Abstract
A key challenge in self-supervised video representation learning is how to effectively capture motion information besides context bias. While most existing works implicitly achieve this with video-specific pretext tasks (e.g., predicting clip orders, time arrows, and paces), we develop a method that explicitly decouples motion supervision from context bias through a carefully designed pretext task. Specifically, we take the key frames and motion vectors in compressed videos (e.g., in H.264 format) as the supervision sources for context and motion, respectively, which can be efficiently extracted at over 500 fps on CPU. Then we design two pretext tasks that are jointly optimized: a context matching task where a pairwise contrastive loss is cast between video clip and key frame features; and a motion prediction task where clip features, passed through an encoder-decoder network, are used to estimate motion features in a near future. These two tasks use a shared video backbone and separate MLP heads. Experiments show that our approach improves the quality of the learned video representation over previous works, where we obtain absolute gains of 16.0% and 11.1% in video retrieval recall on UCF101 and HMDB51, respectively. Moreover, we find the motion prediction to be a strong regularization for video networks, where using it as an auxiliary task improves the accuracy of action recognition with a margin of 7.4%–13.8%.
Introduction: The Challenge of Context Bias
A major hurdle in video representation learning is context bias. If a model observes a person in a swimming pool, it might classify the action as "swimming" based solely on the static background (context) without actually understanding the movement of the limbs (motion). Most self-supervised methods attempt to learn motion implicitly through tasks like predicting clip order or playback speed, but these often fail to truly separate the "where" (environment) from the "what" (action).
Furthermore, capturing motion traditionally requires calculating optical flow, which is computationally expensive and slow. This research aims to find a way to learn high-quality, motion-aware video representations efficiently and without manual labels by leveraging the internal structure of compressed video formats.
Methodology: Decoupling via Compressed Streams
The core innovation of this framework lies in using the compressed video stream itself as a supervision source. In formats like H.264, videos are not just a series of images; they consist of structured data that can be extracted at over 500 fps on a standard CPU.
As shown in the figure above, the stream provides two primary signals:
- I-frames (Key frames): Full images that provide rich, static context.
- Motion Vectors: Data describing how blocks of pixels move between frames, providing a direct proxy for motion.
Dual Pretext Tasks
The authors propose two parallel pretext tasks to train a shared video backbone:
- Context Matching: The model uses a contrastive loss (InfoNCE) to match a video clip with its corresponding I-frame. This forces the network to recognize the environment and global scene layout.
- Motion Prediction: The model takes a current video clip and attempts to predict the motion features of future frames. Instead of predicting raw pixel offsets, which can be noisy, the model uses an encoder-decoder (Transformer-based) to predict motion features in a pointwise contrastive way. This forces the network to understand the dynamics and trajectories of the action.
Key Results and Insights
The "Decoupling" approach yielded significant improvements over previous self-supervised methods across standard benchmarks like UCF101 and HMDB51.
- Video Retrieval: On the UCF101 dataset, the model achieved a 41.7% R@1 score, representing a 16.0% absolute gain over the previous state-of-the-art.
- Action Recognition: Pretraining with this method improved top-1 accuracy by 14.7% to 18.6% compared to training from scratch.
- Motion as Regularization: Interestingly, the motion prediction task acts as a powerful regularizer. Even in fully supervised settings, adding the motion prediction task as an auxiliary requirement significantly boosts final accuracy (by 7.4% to 13.8%).
Conclusion
By splitting context and motion into separate, explicit tasks, the model is prevented from taking "shortcuts" (e.g., ignoring motion because the background is a strong enough signal). The paper demonstrates that the metadata inside video codecs—specifically motion vectors—is a highly effective and nearly free alternative to expensive optical flow. Future work may explore the use of "residuals" (the difference between predicted motion and actual pixels) to provide even finer-grained details about vanishing or emerging objects in a scene.
Summary updated