Skip to content

Video understanding, tracking, generation, and world models · Video self-supervision · VID020 · Training method

SpeedNet

Learns video features by predicting playback speed. Sampling a recording at different temporal strides creates supervision for recognizing motion patterns without human action labels, while learned speed-sensitive…

Explained here Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

Documented in the Academy only. There's no Set up button.

Availability
Explained here
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Learns video features by predicting playback speed. Sampling a recording at different temporal strides creates supervision for recognizing motion patterns without human action labels, while learned speed-sensitive features can be transferred to other tasks.

Question / objective

Learn transferable video representations from automatically constructed targets or weak cross-modal supervision. This is a learning or inference objective, not a test of a statistical null hypothesis.

Method type and supervision

training-method · Video self-supervision. Self-supervised pretraining; cross-modal variants also use weak paired language supervision.

Architecture / computational structure

Video encoder and playback-speed classification head using resampled training clips.

Assumptions

Inputs must satisfy the temporal, modality and annotation protocol described below. Original videos differ in frame rate and natural motion speed; a model may exploit interpolation artifacts or appearance correlated with speed. Speed classification is not physical velocity estimation.

Formula / computational definition

L=−∑ryrlog⁡pθ(r∣xt:t+ks:k)L=-\sum_r y_r\log p_\theta(r\mid x_{t:t+ks:k}), where rr is a speed class and temporal stride kk changes apparent playback rate. The exact sampling construction must follow the intended speed task.

Parameters and notation

Learned/estimated quantities: Encoder and predictor/projection weights are learned; target-network EMA values are state updates, and masks/negative policies are design choices. Symbols specific to the objective are defined with the equation. Hyperparameters and design choices: Speed ratios, clip duration, spatial augmentation, frame-rate normalization and class balance are important.

Fitting, fine-tuning, and adaptation

Transfer the encoder and replace the speed head. Preserve actual timestamps; normalizing source frame rates before pretraining can reduce dataset shortcuts. Use a separate adaptation validation split, monitor the target metric and retention of previously useful behavior, and save the exact preprocessing and training configuration.

How to use and calibrate

Fix the input protocol and target before fitting; choose design settings on held-out source videos, then freeze the evaluation procedure. Report transfer and speed prediction on unseen source videos, with controls for frame rate, appearance and compression.

Example application

Learn movement-sensitive features from unlabeled exercise recordings.

Interpretation / pitfalls

Watch out

An optimized training objective or a favorable example does not establish generalization. Report transfer and speed prediction on unseen source videos, with controls for frame rate, appearance and compression. The example below isolates one mechanism and cannot substantiate a full-model benchmark claim.

Python and R code examples

Component: Create two playback-speed sampling schedules. Dependencies: NumPy in Python; base R in R; run the shared setup above. Python component: executed successfully. R component: unexecuted. No complete model training or pretrained inference was executed.

Full implementation route — Python: Create resampled clips and a video classifier, retaining original timestamps and speed labels. R: Prototype temporal index generation and speed-class loss in R; use reticulate for a pretrained or trainable video encoder.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — Create two playback-speed sampling schedules.

Shared setup for this chapter
import numpy as np

def softmax(x):
    z = np.asarray(x, dtype=float)
    e = np.exp(z - z.max())
    return e / e.sum()
source_timestamps = np.arange(16)/8  # seconds at 8 fps
normal = source_timestamps[np.arange(4)]
fast = source_timestamps[2*np.arange(4)]
print("normal",normal,"double-stride",fast)
print("speed-class loss",-np.log(softmax(np.array([0.,1.]))[1]))
R

Component demo, not a trained model — Create two playback-speed sampling schedules.

Shared setup for this chapter
softmax <- function(x) {
  e <- exp(x - max(x))
  e / sum(e)
}
source_timestamps <- (0:15)/8
normal <- source_timestamps[1:4]
fast <- source_timestamps[1+2*(0:3)]
print(list(normal=normal,double_stride=fast))
print(-log(softmax(c(0,1))[2]))

Sources

From the CodeSplash reference, entry VID020.