Motion-aware Contrastive Video Representation Learning via Foreground-background Merging

Shuangrui Ding, Maomao Li, Tianyu Yang, Rui Qian, Haohang Xu, Qingyi Chen, Jue Wang, Hongkai Xiong

TL;DR

Self-supervised video models often take a "shortcut" by learning to recognize static backgrounds instead of actual motion patterns. To fix this "background bias," the authors introduce FAME (Foreground-background Merging), a lightweight data augmentation technique that cuts out moving foregrounds and pastes them onto random backgrounds from other videos. This simple swap forces contrastive learning frameworks to focus purely on motion, achieving state-of-the-art results across multiple action recognition and video retrieval benchmarks.

What Problem Does This Paper Address?

Contrastive learning has revolutionized self-supervised representation learning. In the video domain, the standard approach is to take two different clips from the same video and pull their representations closer in an embedding space (forming a positive pair) while pushing clips from other videos away.

However, the authors identify a critical flaw in this setup: background bias. Because backgrounds usually span a large area and remain static across different clips of the same video, a model can easily minimize its loss simply by matching these static backgrounds, completely ignoring the actual action.

Figure 2. Illustration on a diving sequence. The green dashed box represents the scene and the red box means motion area. The two clips have the same background but distinct motions. Drawing such positive pairs closer inclines the model towards static bias.

This "background cheating" severely hurts the model's ability to generalize to downstream tasks like action recognition, where understanding the motion pattern is key.

Methods

To break the background shortcut, the authors propose Foreground-background Merging (FAME). Instead of relying on heavy, computationally expensive off-the-shelf object detectors, FAME extracts moving regions using basic video properties:

  1. Seed Region Extraction: FAME computes the pixel-wise absolute frame difference across adjacent frames. Moving foreground objects naturally produce a high magnitude of change, highlighting their edges.
  2. Seed Propagation via Color Statistics: To expand these edges into a full foreground mask, the method analyzes color distributions. It estimates the probability of a pixel belonging to the foreground versus the background based on the color statistics of the high-motion regions versus the low-motion regions.
  3. Merging: The resulting soft mask is binarized based on a hyperparameter $\beta$ (which controls the foreground ratio). The extracted foreground is then blended with a random background clip sampled from a completely different video within the same mini-batch.
Figure 4. The contrastive learning framework with the proposed FAME. We first randomly sample two clips from a video and use FAME to generate new clips by composing the original foreground onto various backgrounds from other videos. Then, we feed the augmented clips into the existing contrastive learning scheme and perform self-supervised pretraining.

By forcing the model to match the original clip with this newly synthesized, background-distracted clip, the network is forced to align the motion patterns rather than the background context.

Datasets

The authors evaluated FAME across several standard video benchmarks:

  • Kinetics-400: Used for large-scale self-supervised pretraining (~240k video clips across 400 classes).
  • UCF101 & HMDB51: Used for downstream action recognition evaluation (finetuning and linear probing) and video retrieval.
  • Diving48: A challenging fine-grained dataset where different diving categories share very similar backgrounds, making it an excellent testbed for evaluating true motion awareness.
  • Something-Something V2: Used for additional finetuning to test motion-heavy representations.

Key Insights and Ideas

  • Inter-video backgrounds are essential: Merging foregrounds with backgrounds from the same video at different timestamps (intra-video) provides only a minor performance boost. True debiasing requires inter-video background swapping, introducing completely distinct scenes that destroy the background shortcut.
  • Meticulous masks matter for generalization: While rough spatial grids (like a 4x4 grid box) can improve performance when pretraining and testing on the same dataset, a fine-grained segmentation mask (like FAME's color-propagated mask) is crucial for the model to generalize well when transferred to entirely new datasets.
  • FAME alters the underlying network features: Analysis of the temporal kernel weights shows that vanilla contrastive learning leads to highly clustered weights (indicating poor temporal diversity). FAME's weights are scattered and varied, closely mirroring the weight distribution of fully supervised models.

Key Results

  • Action Recognition: FAME combined with an I3D backbone pretrained on Kinetics-400 achieves 88.6% Top-1 accuracy on UCF101 and 61.1% on HMDB51, outperforming competing debiasing methods like Background Erasing (BE).
  • Diving48 Performance: On the motion-critical Diving48 dataset, FAME boosts performance significantly, achieving 72.9% accuracy compared to BE's 62.4%, proving its superior ability to capture fine-grained motion patterns.
  • Video Retrieval: On UCF101 video retrieval, FAME achieves a Top-1 recall (R@1) of 64.6%, a massive improvement over standard self-supervised baselines.
Figure 1. Class-agnostic activation map [3] visualization of impor- tant areas. The heatmap indicates how much the pretrained model attends to the region. Compared to the conventional approach, our method mitigates the background bias significantly.

Limitations and Future Work

  • Sensitivity to Camera Motion and Color Overlap: The foreground extraction relies heavily on frame differences and color statistics. If the camera moves dynamically (causing global frame differences) or if the foreground object shares a very similar color palette with the background, the mask quality degrades.
  • Fixed Foreground Ratio: The portion of the video treated as foreground ($\beta$) is currently a fixed hyperparameter. The authors note that developing an adaptive foreground area ratio would be a valuable direction for future work.

Summary updated

BibTeX
@inproceedings{ding2022motion,
  author = {Shuangrui Ding and Maomao Li and Tianyu Yang and Rui Qian and Haohang Xu and Qingyi Chen and Jue Wang and Hongkai Xiong},
  title = {{Motion-aware Contrastive Video Representation Learning via Foreground-background Merging}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.00949},
}
Figure