Visual Representation Learning from Unlabeled Video using Contrastive Masked Autoencoders

Jefferson Hernandez, Ruben Villegas, Vicente Ordonez · OpenReview

TL;DR

This paper introduces ViC-MAE, a novel self-supervised learning framework that unifies Masked Autoencoders (MAE) and contrastive learning for visual representation learning. By pooling local features learned via MAE and applying a contrastive objective, ViC-MAE achieves state-of-the-art performance in video-to-image transfer learning and strong results on video and image classification benchmarks.

What Problem Does This Paper Address?

The field of self-supervised visual representation learning has seen significant progress, primarily driven by two dominant approaches: joint-embedding methods (like contrastive learning) and masked image modeling (MIM). While both have been successful individually for images and videos, effectively combining them, especially for video-to-image transfer, has been challenging. Previous attempts often involved replicating images to simulate videos or treating videos as mere sequences of images, which can be computationally inefficient or fail to capture the full richness of video data. This paper aims to bridge this gap by proposing a unified framework that leverages the strengths of both MAE and contrastive learning to learn robust representations that generalize well across both image and video tasks, addressing the imbalance in transfer learning performance between these modalities.

Methods

ViC-MAE combines two core self-supervised learning paradigms:

  • Masked Image Modeling (MIM): Similar to standard MAE, ViC-MAE masks out portions of input frames (or images) and uses a Vision Transformer (ViT) encoder to learn representations. A decoder then attempts to reconstruct the masked patches, optimizing a reconstruction loss. This process helps learn rich local features.
  • Contrastive Learning: The key novelty lies in how ViC-MAE integrates contrastive learning. Instead of directly using the [CLS] token or other global representations from the ViT encoder, ViC-MAE first applies a global pooling operator (e.g., mean pooling) to the local features learned by the MAE encoder. This pooled global representation is then used within a contrastive learning framework. For videos, frames sampled with a temporal gap are treated as positive pairs, while frames from different videos or distant time points serve as negative pairs. For images, standard data augmentations create positive pairs. This approach aims to align representations across different views (temporal for videos, augmented for images) while pushing apart dissimilar ones.

The overall loss is a combination of the MAE reconstruction loss and the contrastive loss.

Datasets

The paper utilizes a variety of datasets for pre-training and evaluation:

  • Pre-training:
    • ImageNet-1K (images)
    • Kinetics-400 (video)
    • Moments in Time (MiT) (video)
    • Kinetics-600 (video)
    • Kinetics-700 (video)
    • A combined dataset labeled K710 (Kinetics-400, Kinetics-600, Kinetics-700, Moments in Time, and ImageNet-1k)
  • Evaluation:
    • ImageNet-1K (for image classification)
    • Kinetics-400 (for video classification)
    • Places-365 (out-of-domain image classification)
    • Something-something-v2 (out-of-domain video classification)
    • COCO (for object detection and segmentation)

Key Insights and Ideas

  • Unified Framework: Combining MAE and contrastive learning within a single framework is effective for learning representations that generalize across modalities.
  • Pooling Local Features: Using a global pooling operator on MAE-derived local features for contrastive learning is more effective than relying solely on the [CLS] token, especially for video tasks. This approach helps avoid representational collapse.
  • Video as Temporal Augmentation: Treating short video segments as augmented views of a single instance, rather than just sequences, provides an efficient way to leverage temporal information.
  • Balanced Transfer Learning: ViC-MAE demonstrates a balanced performance in transferring learned representations to both image and video downstream tasks, addressing a known imbalance in previous methods.
  • Efficiency: ViC-MAE is more computationally efficient than some other video-focused MAE methods by processing fewer tokens per video.

Key Results

  • Video-to-Image Transfer: ViC-MAE achieves state-of-the-art transfer learning performance on ImageNet-1K when pre-trained on video data (Moments in Time), reaching 86% top-1 accuracy (87.1% with extra data), outperforming OmniMAE.
  • Video Classification: On the challenging Something-something-v2 benchmark, ViC-MAE achieves 75.9% top-1 accuracy, outperforming most other methods.
  • Image Classification: ViC-MAE achieves 86% top-1 accuracy on ImageNet-1k when using the ViT-L architecture, competitive with supervised methods.
  • Object Detection/Segmentation: On the COCO dataset, ViC-MAE with a ViT-B backbone achieves state-of-the-art results, outperforming C-MAE and MAE.
  • Ablations: Increasing frame separation in videos improves performance. Mean pooling is found to be most effective for aggregating features. Strong spatial augmentations are crucial for image tasks, while temporal variations in videos can compensate for weaker spatial augmentations.

Limitations and Future Work

  • Limitations:
    • While ViC-MAE performs well, it still lags behind some state-of-the-art supervised models, particularly on ImageNet-pretrained benchmarks.
  • The gap in performance for models pre-trained purely on video compared to those using additional image data still exists.
  • The paper notes that combining MAE with negative-free contrastive methods (like VicReg and SimSiam) using the [CLS] token did not yield optimal results, suggesting that the integration needs careful design.
  • Future Work:
    • Leveraging additional weak supervision from other modalities like text, audio, or 3D geometry.
  • Exploring improvements in contrastive learning for images that can be directly adapted to the ViC-MAE framework.
  • Replacing pixel reconstruction with features more relevant to video representation, such as object correspondences or optical flow.
  • Investigating the integration of ViC-MAE with other architectures or more complex temporal modeling techniques.

Summary updated

BibTeX
@inproceedings{hernandez2024visual,
  author = {Jefferson Hernandez and Ruben Villegas and Vicente Ordonez},
  title = {{Visual Representation Learning from Unlabeled Video using Contrastive Masked Autoencoders}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=z3AjrBo0Aj},
}
Figure