Self-Supervised Learning of Compressed Video Representations

Youngjae Yu, Sangho Lee, Gunhee Kim, Yale Song

Training deep learning models on video is notoriously resource-heavy. Researchers usually face a "pick your poison" scenario: either decode videos into massive folders of JPEG frames (consuming terabytes of storage) or decode them on-the-fly during training (bottlenecking the CPU/GPU). This paper proposes a way out: don't decode at all.

TL;DR

The authors introduce a method to learn video representations directly from compressed bitstreams (like MPEG-4) using self-supervised learning. By leveraging the internal structure of compressed video—specifically I-frames, motion vectors, and residuals—their "IMR Network" achieves state-of-the-art performance in compressed video recognition while being significantly faster and more storage-efficient than traditional methods.

What Problem Does This Paper Address?

Standard video models operate on raw RGB frames. However, almost all video is stored in a compressed format (e.g., H.264 or MPEG-4). Compression works by storing one full image (an I-frame) followed by several P-frames that only record the changes (motion vectors and residuals) relative to the I-frame.

The "gap" the authors identify is twofold:

  1. Efficiency: Decoding these streams into RGB frames is a massive computational tax that hinders large-scale training.
  2. Self-Supervision: While some supervised models have used compressed data, no one had yet shown how to effectively use the unique properties of compressed video (like the "Group of Pictures" or GOP structure) for self-supervised learning—learning from unlabeled data.

Methods: The IMR Network

Overview of the IMR Network and self-supervised pretraining tasks

The authors introduce the IMR Network (IMRNet), which consists of three sub-networks designed to process the raw components of a compressed video stream:

  • I-Network: Processes RGB I-frames (appearance).
  • M-Network: Processes Motion Vectors (where things moved).
  • R-Network: Processes Residuals (what the motion vectors missed).

The Innovation: Bidirectional Dynamic Connections

Detailed architecture of the Bidirectional Dynamic Connections

Unlike previous "late fusion" models that process these streams separately and combine them at the very end, IMRNet uses Bidirectional Dynamic Connections. These allow the networks to share information while they are encoding. They use a multimodal gated attention mechanism to decide which information from the motion stream is relevant to the appearance stream (and vice versa) at every layer. This early fusion ensures the model learns a much richer representation than if it just looked at the streams in isolation.

Two New Pretext Tasks

To train the model without labels, they designed two tasks that exploit the "free" information in the compressed stream:

  1. Pyramidal Motion Statistics Prediction (PMSP): The model must predict which region in a spatio-temporal grid has the "highest energy" of motion. This forces the model to locate salient moving objects by relying on the videographer bias (the assumption that the most motion-heavy part of a video is the most important).
  2. Correspondence Type Prediction (CTP): The model is shown pairs of I-frames and P-frames and must guess if they are correctly aligned, randomly paired, shuffled, or temporally shifted. This teaches the model how appearance and motion correlate.

Key Insights and Ideas

  • GOPs as "Atomic Motion": The authors argue that the Group of Pictures (GOP) structure in compression isn't just a technical detail; it's a semantic one. A GOP contains just enough scene change for a codec to work efficiently, providing a natural "chunk" of motion for a model to analyze.
  • Motion Vectors are "Free" Optical Flow: Calculating optical flow (pixel-level motion) is incredibly slow. Motion vectors are already calculated by the video encoder, providing a "good enough" motion signal for free.

Key Results

The authors pretrained their model on Kinetics-400 and evaluated it on standard action recognition benchmarks like UCF-101 and HMDB-51, comparing it against existing compressed video models (like CoViAR and DMC-Net) and standard RGB models.

  • Speed: IMRNet is roughly 3 to 10 times faster than traditional video CNNs. In their runtime analysis, IMRNet took ~4.3ms per frame compared to ~82.5ms for a standard ResNet-152 approach.
  • Accuracy: On UCF-101, their self-supervised model (pretrained with PMSP+CTP) achieved 76.8% accuracy, outperforming other self-supervised methods that use compressed video.
  • Supervised Performance: When trained with labels, IMRNet (using a ResNet-50 backbone) hit 92.6% on UCF-101, setting a new state-of-the-art for models that don't require full decoding.

Limitations and Future Work

  • Videographer Bias: The PMSP task relies on the assumption that the most dynamic region is the most important. While visualizations show this holds true for most action-oriented datasets, the authors admit it is a "weak hypothesis" that might fail in static or multi-subject scenes.
  • Codec Specificity: The current work focuses on MPEG-4 Part 2. While the principles apply to H.264 or HEVC, the specific implementation of how motion vectors and residuals are extracted might need to be adapted for newer, more complex codecs.
  • Future Direction: The authors suggest that this approach could be extended to even more modalities, such as audio, which is also naturally bundled in the compressed container.

Summary updated

BibTeX
@inproceedings{yu2021self,
  author = {Youngjae Yu and Sangho Lee and Gunhee Kim and Yale Song},
  title = {{Self-Supervised Learning of Compressed Video Representations}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure