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

CO2: Consistent Contrast for Unsupervised Visual Representation Learning

Chen Wei, Huiyu Wang, Wei Shen, Alan L. Yuille

TL;DR

CO2 (Consistent Contrast) improves unsupervised visual representation learning by moving beyond simple "same vs. different" labels. By enforcing that two different crops of the same image should have consistent similarity patterns to the rest of the dataset, it effectively handles "class collisions" where semantically similar images are incorrectly treated as purely negative samples.

What Problem Does This Paper Address?

Most modern self-supervised learning (SSL) relies on instance discrimination. In this setup, a model is given a "query" image crop and told that another crop from the same image is a "positive," while crops from all other images are "negatives."

The problem is the one-hot label. Standard contrastive learning treats all negatives as equally different from the query. However, if your query is a picture of a Golden Retriever, the "negative" pool might contain another dog, a cat, and a car. Treating the other dog as "equally negative" as the car is counter-intuitive and forces the model to ignore semantic similarities. This is known as class collision or sampling bias, and it limits the quality of the features the model learns.

Methods

The authors propose Consistent Contrast (CO2), which draws inspiration from consistency regularization in semi-supervised learning.

Comparison of standard contrastive learning and CO2
  1. The Setup: Like standard contrastive learning (e.g., MoCo or SimCLR), CO2 takes two augmented crops of the same image: a query ($q$) and a positive ($p$). It also maintains a large bank of negative samples ($n_k$).
  2. The Consistency Term: Instead of just pushing $q$ toward $p$, CO2 looks at how $q$ relates to all the negatives. It calculates a similarity distribution $Q$ (the probability that $q$ matches each negative). It does the same for $p$, creating distribution $P$.
  3. The Logic: Since $q$ and $p$ come from the same image, they should "see" the rest of the world in the same way. If $q$ is somewhat similar to a specific negative sample, $p$ should be too.
  4. The Loss: The model minimizes a weighted sum of the standard InfoNCE loss and a Symmetric KL Divergence between distributions $P$ and $Q$. This forces the model to maintain a consistent "similarity profile" for different views of the same instance, effectively using the model's own predictions as soft pseudo-labels for the negatives.

Datasets

The authors evaluated CO2 using several standard computer vision benchmarks:

  • ImageNet-1K & ImageNet-100: Used for large-scale pre-training and linear protocol evaluation.
  • PASCAL VOC: Used to test the "transferability" of the learned features across three tasks: image classification, object detection (Faster R-CNN), and semantic segmentation (FCN).

Key Insights and Ideas

  • "Self-Semi-Supervised" Learning: The authors reframe SSL. They view the positive pair as "labeled" data and the relationship between the query and the negatives as "unlabeled" data that requires regularization.
  • Soft Labels > Hard Labels: By using a distribution ($P$ and $Q$) rather than a one-hot vector, the model can acknowledge that some negatives are "less negative" than others. This prevents the model from being forced to learn features that distinguish between two nearly identical objects just because they originated from different files.
  • Dynamic Feedback: Unlike offline clustering methods (which are computationally expensive), CO2 generates these soft pseudo-labels on-the-fly during every training step. As the model gets better, the pseudo-labels become more accurate, creating a positive feedback loop.
  • Label Smoothing is Insufficient: The authors show that standard label smoothing (assigning a small constant value to all negatives) actually hurts performance. This proves that the heterogeneous (varying) similarity captured by CO2 is the secret sauce.

Key Results

CO2 consistently outperformed its baselines (MoCo and MoCo v2) across the board:

  • ImageNet Linear Probe: CO2 improved MoCo v1 by 2.9% (reaching 63.5% top-1 accuracy).
  • Semi-Supervised Learning: When fine-tuning with only 1% of ImageNet labels, CO2 provided a 3.8% top-5 accuracy gain over the baseline.
  • Downstream Tasks: On PASCAL VOC, CO2 showed better generalization, notably improving semantic segmentation by 0.7% mIoU over MoCo v1.
  • Framework Agnostic: While primarily tested on MoCo, the authors showed it also boosts SimCLR (an end-to-end framework) by 3.4% on ImageNet-100.

Limitations and Future Work

  • Hyperparameter Sensitivity: The method introduces two new hyperparameters: the weight of the consistency term ($\alpha$) and a temperature constant ($\tau_{con}$). Finding the optimal balance requires some tuning.
  • Transfer Gap: While CO2 improves transfer learning, the gains in complex tasks like object detection are smaller than the gains seen in linear classification. The authors note that SSL methods in general still struggle to perfectly balance semantic invariance with the localization precision needed for detection.
  • Computational Overhead: Although "low-cost," calculating the KL divergence over a very large memory bank (e.g., 65k samples) adds a small amount of extra computation per step.

Summary updated

BibTeX
@inproceedings{wei2021co,
  author = {Chen Wei and Huiyu Wang and Wei Shen and Alan L. Yuille},
  title = {{CO2: Consistent Contrast for Unsupervised Visual Representation Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=MEC7JSBgsZd},
}
Figure