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

CoMatch: Semi-supervised Learning with Contrastive Graph Regularization

Junnan Li, Caiming Xiong, Steven C. H. HoiICCV 2020

Abstract: Semi-supervised learning has been an effective paradigm for leveraging unlabeled data to reduce the reliance on labeled data. We propose CoMatch, a new semi-supervised learning method that unifies dominant approaches and addresses their limitations. CoMatch jointly learns two representations of the training data, their class probabilities and low-dimensional embeddings. The two representations interact with each other to jointly evolve. The embeddings impose a smoothness constraint on the class probabilities to improve the pseudo-labels, whereas the pseudo-labels regularize the structure of the embeddings through graph-based contrastive learning. CoMatch achieves state-of-the-art performance on multiple datasets. It achieves substantial accuracy improvements on the label-scarce CIFAR-10 and STL-10. On ImageNet with 1% labels, CoMatch achieves a top-1 accuracy of 66.0%, outperforming FixMatch [32] by 12.6%. Furthermore, CoMatch achieves better representation learning performance on downstream tasks, outperforming both supervised learning and self-supervised learning. Code and pre-trained models are available at https://github.com/salesforce/CoMatch/.

Introduction

Semi-supervised learning (SSL) aims to train high-performing models using a small amount of labeled data and a large volume of unlabeled data. Historically, the field has been divided into two primary paradigms: Pseudo-labeling (self-training), where the model treats its own predictions as ground truth, and Self-supervised Contrastive Learning, where the model learns task-agnostic representations by grouping similar images.

While effective, both have drawbacks. Pseudo-labeling is prone to confirmation bias, where incorrect predictions reinforce errors. Contrastive learning, while robust, may learn features that are suboptimal for specific classification tasks. CoMatch bridges these worlds by introducing a third component: graph-based SSL, which assumes that similar samples in a feature space should share labels.

Comparison of CoMatch with existing SSL paradigms: (a) self-training with pseudo-labels, (b) self-supervised learning, and (c) the proposed CoMatch framework.

The CoMatch Framework

CoMatch jointly learns two representations for every image: a class probability (via a classification head) and a low-dimensional embedding (via a projection head). These representations interact through a co-training loop designed to improve both classification accuracy and representation quality.

Memory-Smoothed Pseudo-labeling

Instead of relying on a single raw prediction, CoMatch refines pseudo-labels by consulting a "memory bank" of nearby samples in the embedding space. If an image's neighbors in the embedding space belong to a specific class, the model increases its confidence in that label. This "smoothness" constraint significantly mitigates confirmation bias by grounding predictions in the local structure of the feature space.

Graph-based Contrastive Learning

Standard contrastive learning focuses on making different augmentations of the same image similar. CoMatch extends this by building a pseudo-label graph. In this graph, images with similar predicted labels are encouraged to have similar embeddings. This ensures that the embedding space is not just task-agnostic but is actively organized by the semantic categories the model is learning.

Detailed overview of the CoMatch framework for unlabeled data, showing the interaction between the classification head (h ◦ f) and projection head (g ◦ f) through memory-smoothed pseudo-labeling and graph-based losses.

Experimental Results

CoMatch was evaluated across several standard benchmarks, demonstrating state-of-the-art performance, particularly in label-scarce scenarios:

  • ImageNet (1% labels): CoMatch achieved 66.0% top-1 accuracy, a 12.6% improvement over the previous state-of-the-art, FixMatch. With self-supervised pre-training, this reached 67.1%.
  • CIFAR-10 (4 labels/class): The model reached 93.09% accuracy, outperforming FixMatch by over 6%.
  • STL-10: CoMatch outperformed FixMatch by 13.27%, showing high robustness even when the unlabeled data contains out-of-distribution (OOD) samples.
  • Transfer Learning: When pre-trained on ImageNet with only 10% labels, CoMatch outperformed fully supervised models (100% labels) on downstream object detection tasks (MS-COCO), suggesting it learns more generalizable features.

Key Insights and Discussion

The success of CoMatch stems from the synergy between its two heads. The embeddings provide a smoothness constraint that cleans up noisy pseudo-labels, while the pseudo-labels provide a semantic structure that organizes the embedding space. This creates a natural curriculum: as the model improves, the graph becomes more connected and confident, increasing the specificity of the contrastive task.

While highly effective, CoMatch introduces additional hyperparameters, such as the smoothing weight and graph threshold. Future work may explore automated tuning for these parameters or the inclusion of "sharpening" techniques to further refine pseudo-labels. Despite the implementation complexity of maintaining a memory bank and momentum queue, the efficiency gains in terms of training epochs and final accuracy make CoMatch a powerful new tool for semi-supervised learning.

Summary updated

BibTeX
@misc{li2020comatch,
  author = {Junnan Li and Caiming Xiong and Steven C. H. Hoi},
  title = {{CoMatch: Semi-supervised Learning with Contrastive Graph Regularization}},
  year = {2020},
  eprint = {2011.11183},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.11183},
}
Figure