NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Self-Supervised Visual Representations Learning by Contrastive Mask Prediction

Yucheng Zhao, Guangting Wang, Chong Luo, Wenjun Zeng, Zheng-Jun Zha

Introduction: Beyond the "One Image, One Object" Bias

Self-supervised learning (SSL) has revolutionized visual representation learning by enabling models to learn from vast amounts of unlabeled data. Most state-of-the-art frameworks, such as MoCo and SimCLR, rely on Instance Discrimination (ID). This paradigm treats each image as a unique class and trains the model to recognize different augmented views (crops) of the same image as the "same," while views from different images are treated as "different."

While highly effective on object-centric datasets like ImageNet, this approach relies on an implicit Semantic Consistency (SC) assumption: that any two random crops from the same image contain the same primary object or category. However, in "the wild"—using unconstrained datasets like COCO or Conceptual Captions—this assumption frequently fails. A single image of a complex scene might contain a cat on a sofa near a window; forcing the model to treat a crop of the cat and a crop of the window as semantically identical introduces significant noise into the learning signal.

The Problem: Semantic Inconsistency in Complex Scenes

To quantify this issue, researchers from USTC and Microsoft Research Asia introduced the concept of "ResNet distance" to measure semantic consistency across datasets. Their analysis revealed that while ImageNet is highly consistent, complex scene datasets like COCO exhibit significantly lower consistency.

Figure 2: In complex scenes, different crops (red and blue boxes) often contain entirely different semantic concepts, violating the assumptions of standard instance discrimination.

As shown in the figure above, a crop of a chair and a crop of a window in the same room are treated as the same instance in standard SSL, despite having no shared semantic features. This "semantic noise" hinders the model's ability to learn robust, transferable representations when training on non-object-centric data.

Methodology: MaskCo and Contrastive Mask Prediction

To address this, the authors proposed Contrastive Mask Prediction (CMP), implemented through the MaskCo (Mask Contrast) framework. Instead of whole-image discrimination, MaskCo shifts the focus to region-level consistency.

1. Region-Level Contrast

MaskCo identifies a specific overlapping region (a "box") between two different views of an image. This ensures that the model is always comparing the exact same spatial area, regardless of what objects are present.

2. The Masking Mechanism

In the "query" view, this overlapping region is masked out (set to zero). In the "key" view, the region remains visible. This forces the model to understand the relationship between a region and its surrounding context.

3. Mask Prediction Head (MPH)

The query view is processed by a backbone network and a specialized Mask Prediction Head (MPH). The MPH's task is to predict the features of the missing (masked) region based solely on the context provided by the rest of the image.

Figure 6: A comparison between standard Instance Discrimination (top), which compares whole instances, and Contrastive Mask Prediction (bottom), which predicts a masked region's features from its context.

4. Contrastive Loss

The predicted feature from the masked query is pulled toward the actual feature of the same region from the unmasked key view (the positive sample). Simultaneously, it is pushed away from features of other regions or other images (negative samples). By predicting the exact same region, the model bypasses the need for the Semantic Consistency assumption.

Experimental Results

The researchers evaluated MaskCo across several benchmarks, focusing on how it handles unconstrained data compared to traditional methods like MoCo v2.

  • Superiority on COCO: When pre-trained on the complex COCO dataset, MaskCo outperformed MoCo v2 by 0.6 AP on Pascal VOC object detection and 1.1% on ImageNet linear classification. This demonstrates that MaskCo learns more effectively from complex scenes.
  • Scaling with Unconstrained Data: On the large-scale Conceptual Captions (CC) dataset (3.3M images), MoCo v2's performance tended to saturate. In contrast, MaskCo showed continuous gains as training iterations increased, proving its robustness for "in the wild" web-scraped data.
  • Competitive on ImageNet: Even on object-centric data where the SC assumption holds, MaskCo remains highly competitive, matching or slightly exceeding MoCo v2 in detection and segmentation tasks.

Conclusion and Future Work

MaskCo represents a significant step toward self-supervised learning that is truly data-agnostic. By replacing instance-level discrimination with region-level mask prediction, it eliminates the noise inherent in training on complex, multi-object scenes.

Future research directions include optimizing hyperparameters specifically for unconstrained datasets—as most current settings are tuned for ImageNet—and exploring more advanced strategies for incorporating intra-image negative samples to further refine the model's localization capabilities.

Summary updated

BibTeX
@inproceedings{zhao2021self,
  author = {Yucheng Zhao and Guangting Wang and Chong Luo and Wenjun Zeng and Zheng-Jun Zha},
  title = {{Self-Supervised Visual Representations Learning by Contrastive Mask Prediction}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.01000},
}
Figure