Search

Search papers and lessons

Revisiting Feature Prediction for Learning Visual Representations from Video

Adrien Bardes, Quentin Garrido, Jean Ponce et al. · 2024

V-JEPA learns video features by predicting the feature vectors of hidden regions, with no labels or pixel reconstruction, and its frozen features serve both motion and appearance tasks.

On this page

  • Colour = topic mix
  • Linear algebra
  • Representation learning
  • Discrete math
  • Calculus
  • Neural network basics
  • Architectures
  • ReadReady to readNot yet

TL;DR

V-JEPA is a method for learning visual features from unlabeled video. It hides large regions of a clip and trains an encoder and a predictor so that the predictor can produce the feature vectors of the hidden regions from the visible ones. It uses no labels, no text, no pretrained image encoder and no pixel reconstruction. The largest model, a ViT-H/16 trained only on video, reports 81.9 percent on Kinetics-400, 72.2 percent on Something-Something-v2 and 77.9 percent on ImageNet-1K, using frozen features.

Builds on: Joint-Embedding Predictive Architecture, Masked Autoencoder, Vision Transformer (ViT), Stop-Gradient, Exponential Moving Average · Leads to: I-JEPA, the image version of the same idea, and later video models that predict in feature space

Why it mattered

The paper showed that predicting features, rather than pixels, is a practical stand-alone objective for video. Before it, the strongest self-supervised video models mostly reconstructed masked pixels, as in masked autoencoders extended to video, and the strongest image features came from models trained on still pictures. V-JEPA gave one frozen encoder that does well on motion-heavy tasks such as Something-Something-v2, where the answer depends on how things move, and on appearance-heavy tasks such as Kinetics-400, where a single frame often carries the answer. Its training is also cheaper: the authors report roughly a 2 times speedup in pretraining wallclock time against the large pixel-prediction models they compare with.

The problem

Two questions were open. The first was whether feature prediction works as the only training signal. Joint-embedding predictive architectures had worked for images and audio, but the video version had been tried mostly with small convolutional networks, frozen pretrained encoders or extra losses such as contrastive ones. The second was what should be predicted. Pixel reconstruction keeps a lot of detail that does not matter for meaning, such as fine texture and lighting, and that detail takes capacity to model. Predicting features asks the encoder to keep only the information that helps prediction.

A third problem is collapse. If an encoder is trained to make one part of a video predictable from another, the easiest solution is to output the same vector for every input. Any method that predicts features must prevent this, and the paper's solution is inherited from image work: a target encoder that is an average of the main encoder over time, with gradients stopped on the target side.

How it works

Follow one clip through the training step. The model uses ViT-L/16 or ViT-H/16 backbones and a 16-frame clip at 224 pixels, with a frame skip of 4, so the clip covers roughly 2 to 3 seconds of video.

  1. Cut the clip into tokens. The clip is split into small spatio-temporal patches, each a 16 by 16 pixel block spanning 2 consecutive frames. The paper calls each of these a token. For a 224 by 224 clip with 16 frames, that is 14×14×8=156814 \times 14 \times 8 = 1568 tokens. Check: 14 by 14 gives 196 spatial positions, and 8 two-frame slices give 196×8=1568196 \times 8 = 1568.
  2. Choose the target region. Several blocks are sampled, with aspect ratios between 0.75 and 1.5, and each block is extended through all frames. The target region yy is the union of these blocks, and the context xx is the rest. Two mask types are used. Short-range masks take the union of 8 blocks covering 15 percent of each frame, and long-range masks take 2 blocks covering 70 percent. The paper reports an average masking ratio of about 90 percent. Check: about 10 percent of 1568 is about 157 visible tokens, so the predictor has very little context.
  3. Encode the visible tokens. The context encoder EθE_\theta receives only the visible tokens. The dropped tokens are not processed at all.
  4. Predict the hidden tokens. The predictor PϕP_\phi is a narrower Transformer, with 12 blocks and an embedding width of 384. Its input is the context encoder's output, plus one mask token for each hidden position. Each mask token is a learnable vector shared by all positions, plus a positional embedding that encodes that position's place in space and time. Check: the predictor is told where each hidden token sits, but not what it contains.
  5. Build the targets. A target encoder E‾θ\overline{E}_\theta, an exponential moving average of the context encoder, processes the full, unmasked clip. The features at the target positions are selected at its output. These selected features are the targets, and they do not receive gradients.
  6. Measure the error. The loss is the average absolute difference, the L1 distance, between each predicted vector and its target. Only the context encoder and the predictor are updated by gradient steps. The target encoder follows by averaging.
  7. Evaluate with the encoder frozen. After pretraining, the encoder weights stay fixed. A small attentive probe is trained on top to predict labels, which tests how much the features already contain.
flowchart LR
  A[Video clip of 16 frames] --> B[Split into tokens]
  B --> C[Hide about 90 percent of tokens]
  C --> D[Context encoder on visible tokens]
  D --> E[Predictor with mask tokens]
  B --> F[Target encoder on full clip]
  F --> G[Keep features at hidden positions]
  E --> H[L1 loss between prediction and target]
  G --> H

The math

Step 1 in symbols: the tokens

A clip has TT frames of size H×WH \times W. With 16 frames, 224 by 224 pixels and tubelets of 2 frames by 16 by 16 pixels, the number of tokens is

L=T2⋅H16⋅W16=8⋅14⋅14=1568.L = \frac{T}{2} \cdot \frac{H}{16} \cdot \frac{W}{16} = 8 \cdot 14 \cdot 14 = 1568.

Step 2 in symbols: the masks

Let B1,…,Bk\mathcal{B}_1, \dots, \mathcal{B}_k be the sampled target blocks, each spanning all frames. The target set is y=⋃iBiy = \bigcup_i \mathcal{B}_i, and the context is its complement xx. The paper's two mask types are 8 blocks covering 15 percent of each frame and 2 blocks covering 70 percent. Averaged, the target set covers about 90 percent of the tokens.

Step 3 and 4 in symbols: encode and predict

Write EθE_\theta for the context encoder, PϕP_\phi for the predictor, and Δy\Delta_y for the positions of the target tokens. The prediction for the target tokens is z^y=Pϕ(Eθ(x),Δy)\hat{z}_y = P_\phi(E_\theta(x), \Delta_y).

Step 5 in symbols: the target

Write E‾θ\overline{E}_\theta for the target encoder, updated by the moving average above. The target is zy=E‾θ(y)z_y = \overline{E}_\theta(y), computed from the full clip and then restricted to the target positions. The stop-gradient operator sg(⋅)\mathrm{sg}(\cdot) means no gradient flows into zyz_y.

Step 6 in symbols: the loss

The training objective is

min⁡θ,ϕ  ∥Pϕ(Eθ(x),Δy)−sg(E‾θ(y))∥1.\min_{\theta, \phi} \; \left\lVert P_\phi\big(E_\theta(x), \Delta_y\big) - \mathrm{sg}\big(\overline{E}_\theta(y)\big) \right\rVert_1.

The paper uses the L1 norm, the absolute difference averaged over the hidden tokens, in place of the loss of the image method it builds on, I-JEPA. The authors report that L1 was more stable in their experiments.

Why the target encoder prevents collapse

The paper gives a short argument, adapted from the analysis of BYOL. Suppose the predictor is optimal. For a fixed input, the best L1 predictor is the conditional median of the target YY. Substituting it into the loss, the gradient with respect to the encoder equals the gradient of the median absolute deviation of YY given the encoder's output, which measures the typical distance between YY and its conditional median. So the encoder must keep as much information about the video as possible to keep that deviation small. A constant encoder gives no such information. The moving average is there to keep the predictor close to optimal, because the target changes more slowly than the predictor does.

The attentive probe

After pretraining, a learnable query token qq attends over the frozen encoder's output tokens ZZ through cross-attention. The result is added back to qq with a residual connection, passed through a two-layer MLP with one GeLU activation, then a LayerNorm and a linear classifier. This pooling is trained while the encoder stays frozen.

Results

The paper's own numbers, all frozen-backbone unless noted:

  • Pixels versus features. With ViT-L/16 trained on the same data for the same 90 thousand iterations, predicting features gives 73.7 percent on Kinetics-400 against 68.6 for pixels, 66.2 against 66.0 on Something-Something-v2, and 74.8 against 73.3 on ImageNet-1K. Fine-tuning on Kinetics-400 gives 85.6 against 85.4. The gains are consistent but small on Something-Something-v2.
  • Pooling. Replacing average pooling with the attentive probe raises the ViT-L/16 result from 56.7 to 73.7 on Kinetics-400 and from 50.1 to 66.2 on Something-Something-v2. Check: 73.7−56.7=17.073.7 - 56.7 = 17.0 points, and 66.2−50.1=16.166.2 - 50.1 = 16.1 points.
  • Masking. Multi-block masking gives 72.9 on Kinetics-400, 67.4 on Something-Something-v2 and 72.8 on ImageNet-1K. Random tube masking at 90 percent gives 51.5, 46.4 and 55.6. Restricting the context to the first frames gives 61.3 to 71.9 on Kinetics-400, depending on the setting.
  • Headline. The ViT-H/16 model reports 81.9 on Kinetics-400, 72.2 on Something-Something-v2 and 77.9 on ImageNet-1K. The ImageNet figure uses a two-layer probe; the one-layer probe gives 77.4.
  • Against video baselines. The authors report that the H/16 model beats the largest public VideoMAE, VideoMAEv2, OmniMAE, MVD and Hiera models by at least 5 points on Something-Something-v2, 2 points on Kinetics-400, and 5 points on AVA action detection.
  • Against image baselines. On Something-Something-v2 the video models beat DINOv2, OpenCLIP and I-JEPA by more than 21 points. On Kinetics-400 the image models do well, and the paper says so directly.
  • Label efficiency. With 5 percent of the labels, the largest ViT-H/16 at 384 pixels reaches 68.2 on Kinetics-400 and 54.0 on Something-Something-v2. With 50 percent, it reaches 80.6 and 67.9. VideoMAEv2 falls from 67.8 at 50 percent to 37.0 at 5 percent on Kinetics-400, a larger drop.

The limits are clear in the paper. Kinetics-400 is largely solved by appearance, so image models with much more data can match or beat V-JEPA there. The training data is 2 million public videos, which is far smaller than the image corpora behind the image models. The authors say that more diverse public video data is a likely next step.

Reading guide

  • Section 1, Introduction. Read for the question and for the claim that feature prediction is the stand-alone objective being tested. It needs the JEPA idea and the Masked Autoencoder line of work.
  • Section 2, Related Works. Skim it. It places the paper among slow-feature methods, predictive-feature methods and self-supervised image learning. You need Self-Supervised Learning and the idea behind Representation Collapse.
  • Section 3, Methodology. The core of the paper. Read 3.1 with Stop-Gradient and Exponential Moving Average in hand, then 3.2 for masking, then 3.3 for the Vision Transformer (ViT) and predictor design. Its median argument needs the definition of a median.
  • Section 3.4, Pretraining data and evaluation. The dataset is VideoMix2M, built from HowTo100M, Kinetics and Something-Something-v2, with validation overlap removed. The evaluation tasks are Kinetics-400, Something-Something-v2 and AVA.
  • Section 4, What Matters. Four ablations: pixels versus features, data mix, attentive probing and masking. Read them in that order. The masking ablation needs the mask definitions from 3.2.
  • Section 5, Comparisons. Tables 5 to 7 compare against pixel-prediction, state-of-the-art and low-label settings. Read the tables with the claims in the text beside them.
  • Section 6, Predictor. The frozen predictor's outputs for the hidden regions are fed to a separately trained diffusion decoder, which shows what the predicted features contain. The decoder never sees the visible pixels.
  • Appendices. The hyper-parameters are in Appendix C: AdamW, a 90 thousand iteration schedule, and an EMA momentum that starts at 0.998 and rises to 1.0.

Check yourself

QuestionWhy does V-JEPA use an exponential moving average target encoder instead of letting the target share the context encoder's weights directly?Show answer
If the target and the context encoder were the same network, with gradients flowing through both sides, the easiest way to make the loss small would be to output a constant vector for every input. The moving average gives a target that changes slowly, and the stop-gradient keeps the target from being pulled toward the prediction. Together these keep the predictor close to optimal, so the encoder must retain information about the video.
QuestionA clip has 16 frames of 224 by 224 pixels, with tubelets of 2 frames by 16 by 16 pixels. How many tokens are there, and how many are visible if about 90 percent are hidden?Show answer
There are (16/2)×(224/16)×(224/16)=8×14×14=1568(16/2) \times (224/16) \times (224/16) = 8 \times 14 \times 14 = 1568 tokens. If about 90 percent are hidden, about 10 percent are visible, which is 0.10×1568=156.80.10 \times 1568 = 156.8, so about 157 tokens are visible to the context encoder.
QuestionWhy does the paper use an L1 loss rather than squared error, and what does that choice change in the analysis?Show answer
The L1 loss is the absolute difference. Under an L1 loss the optimal predictor is the conditional median rather than the conditional mean. The paper's analysis then ties the encoder's gradient to a median absolute deviation, and the authors report that L1 was more stable in their experiments.
QuestionPretraining on pixels gives 68.6 on Kinetics-400 and feature prediction gives 73.7 with the same model and schedule. Which result would a reader use to decide whether features beat pixels for motion, and why?Show answer
The Kinetics-400 result mostly measures appearance, so it is not the right test for motion. The motion test is Something-Something-v2, where the two methods give 66.0 and 66.2. The gain there is only 0.2 points, so the evidence that feature prediction helps motion understanding in this comparison is weak, while the gain on appearance is large.

Sources

Read the full paper

Adrien Bardes, Quentin Garrido, Jean Ponce et al., 2024. arXiv:2404.08471