ViC-MAE: Self-Supervised Representation Learning from Images and Video with Contrastive Masked Autoencoders

Jefferson Hernandez, Ruben Villegas, Vicente Ordonez

TL;DR

ViC-MAE is a novel self-supervised framework that combines the local feature learning of Masked Autoencoders (MAE) with the global consistency of contrastive learning. By treating video frames as natural "temporal augmentations," it achieves state-of-the-art video-to-image transfer performance, proving that what a model learns from motion can significantly boost its understanding of static images.

What Problem Does This Paper Address?

In the world of computer vision, self-supervised learning (SSL) has split into two main camps: Joint-embedding methods (like contrastive learning), which teach models to recognize that two different views of the same object are related, and Masked Image Modeling (MIM), which forces models to reconstruct missing parts of an image to learn fine-grained local details.

While both work well, they have different strengths. Furthermore, there is a strange imbalance in the field: models trained on images adapt easily to video, but the reverse—video-to-image transfer learning—has been notoriously difficult. The authors argue that videos contain rich, natural variations in pose and viewpoint that synthetic image augmentations (like cropping or color jittering) simply cannot replicate. The challenge lies in creating a unified architecture that can ingest both modalities and learn representations that are robust enough for both static and dynamic tasks.

Methods

The authors propose ViC-MAE (Visual Contrastive Masked AutoEncoder). The architecture uses a Siamese backbone (shared weights) and operates on two inputs: either two distant frames from a video or two augmented views of a single image.

ViC-MAE Architecture

The model is trained with a dual-objective loss:

  1. Masked Image Modeling (Local): A portion of the input is masked. A Vision Transformer (ViT) encoder processes the visible patches, and a lightweight decoder attempts to reconstruct the original pixels. This teaches the model about local textures and object parts.
  2. Contrastive Learning (Global): Instead of just using a standard [CLS] token, ViC-MAE pools the local features learned by the encoder into a global representation. It then uses an InfoNCE loss to "attract" representations of frames from the same video (or views of the same image) and "repel" those from different samples.

A key technical contribution is the use of a global pooling layer before the contrastive head. The authors found that this prevents the "representation collapse" often seen when trying to combine contrastive objectives with MAEs, effectively bridging the gap between local patch reconstruction and global scene understanding.

Datasets

The model was pre-trained on a massive mix of data:

  • Video: Kinetics-400, 600, and 700 (combined into a ~665K sample dataset called K710) and Moments in Time (MiT) (~1M videos).
  • Images: ImageNet-1k (IN1K) (~1.2M images).

For evaluation, the authors tested on:

  • Classification: ImageNet-1k, Kinetics-400, Places-365, and Something-something-v2 (SSv2).
  • Downstream Tasks: COCO (Object Detection/Segmentation) and eight other natural image datasets (e.g., CIFAR, Birdsnap, SUN397).

Key Insights and Ideas

  • Video as Augmentation: Rather than treating images as "still videos" (a common approach), ViC-MAE treats video frames as a powerful form of temporal data augmentation. This perspective allows the model to learn from real-world physics and motion.
  • Distant Sampling Matters: The authors found that sampling frames with a large time gap (approx. 1 second) provides a "stronger" augmentation that forces the model to learn more robust, invariant features compared to sampling adjacent, nearly identical frames.
  • Pooling vs. [CLS] Token: A surprising finding was that using a pooling operation over all transformer features worked significantly better for contrastive learning than using the standard [CLS] token, which often led to suboptimal performance in hybrid MAE models.
  • Efficiency: By processing frames sparsely, ViC-MAE is more computationally efficient than "heavy" video models like OmniMAE, while achieving better results.

Key Results

ViC-MAE sets a new bar for self-supervised transfer learning.

Table 1: Transfer learning results from video and image pre-training to various datasets using the ViT/L-16 backbone. The pre-training data is a video dataset (MiT, K600, K700, or K400) and/or image dataset (IN1K). All self-supervised methods are evaluated end-to-end with supervised finetuning on IN1K, Kinetics-400, Places365, and SSv2. Best results are in bold. Results of MAE, ST-MAE, and VideoMAE for out-of-domain data were taken from Girdhar et al. [33].
  • ImageNet-1k: Achieved 87.1% top-1 accuracy using a ViT-L backbone, outperforming the previous state-of-the-art OmniMAE (84.7%) and even surpassing some supervised methods.
  • Video Benchmarks: On the challenging Something-something-v2 dataset, it reached 75.9%, showing it doesn't sacrifice temporal understanding for image performance.
  • Object Detection: On COCO, it achieved a box AP of 53.2, the highest reported score for this type of architecture, proving the features generalize well to localization tasks.

Limitations and Future Work

Despite its success, ViC-MAE still lags behind DINOv2 in some image-centric benchmarks. The authors also note that while they have successfully unified image and video, the model does not yet incorporate other modalities like text or audio, which are increasingly important in foundation models.

Future directions include integrating pixel reconstruction with features that capture optical flow or object correspondences, and exploring how to leverage automatically generated data or weak supervision from text to further close the gap with the best-supervised models.

Summary updated

BibTeX
@inproceedings{hernandez2024vic,
  author = {Jefferson Hernandez and Ruben Villegas and Vicente Ordonez},
  title = {{ViC-MAE: Self-Supervised Representation Learning from Images and Video with Contrastive Masked Autoencoders}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=z3AjrBo0Aj},
}
Figure