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

Siamese Prototypical Contrastive Learning

Shentong Mo, Zhun Sun, Chao Li

TL;DR

Siamese Prototypical Contrastive Learning (SPCL) is a new self-supervised framework that fixes a major flaw in traditional contrastive learning: the "false negative" problem, where semantically similar images are mistakenly pushed apart in the embedding space. By combining instance-level contrast with cluster-based "prototypes" and a Siamese-style metric loss, SPCL achieves a landmark result: an unsupervised ResNet-50 that actually outperforms its fully-supervised counterpart on ImageNet-1K.

What Problem Does This Paper Address?

Contrastive Self-supervised Learning (CSL) has become the gold standard for learning visual representations without manual labels. The logic is simple: take an image (the anchor), create two augmented versions (positives), and teach the model to pull them together while pushing away all other images in the batch (negatives).

However, CSL has a "false negative" problem. To learn well, these models usually require massive batch sizes (thousands of images). In such a large crowd, there is a high statistical probability that the "negatives" for a picture of a Golden Retriever will include other pictures of dogs. Standard CSL forces the model to push these similar images apart, which confuses the model’s semantic understanding and degrades performance on downstream tasks like classification.

Methods

The authors introduce SPCL, which moves beyond simple instance-to-instance comparison by incorporating prototypes—clusters of similar features that act as "pseudo-labels."

The training process follows a specific loop:

  1. Clustering: At the start of every epoch, the model uses K-means clustering to group all image features into $K$ prototypes.
  2. Multi-Component Loss: Instead of just one contrastive loss, SPCL optimizes a weighted sum of three distinct objectives:
  3. Standard Contrastive Loss ($L_{contra}$): The classic approach of pulling augmented views of the same image together.
  4. Siamese-style Metric Loss ($L_{metric}$): This is the "secret sauce." It uses a Siamese network structure to ensure that features within the same prototype are pulled closer, while features from different prototypes are pushed further apart. This explicitly tackles the false negative issue by refining the boundaries between clusters.
  5. Prototypical Cross-Entropy Loss ($L_{proto}$): This guides the individual views of an image toward their assigned prototype center, providing a more stable "global" signal than instance-wise comparison alone.

Datasets

The authors evaluated SPCL on three standard computer vision benchmarks:

  • CIFAR-10 & CIFAR-100: Used for ablation studies and initial testing.
  • ImageNet-1K: The primary benchmark for large-scale visual representation learning.

The researchers used a standard ResNet-50 architecture to ensure fair comparison with previous state-of-the-art methods like SimCLR, MoCo, and SwAV.

Key Insights and Ideas

  • Mitigating False Negatives: The most important insight is that we shouldn't treat all "other" images as equally negative. By using prototypes, the model recognizes that some "negatives" are actually semantically related to the anchor and stops aggressively pushing them away.
  • Batch Size Independence: Unlike SimCLR, which requires massive batch sizes to perform well, SPCL is much more robust. The authors found that once the batch size is "sufficient" (around 128 for CIFAR), the prototypical regularization eliminates the need for the extreme batch sizes typically seen in CSL.
  • The Power of Metric Learning: Simply adding a cross-entropy loss on clusters isn't enough (and can sometimes hurt performance). The addition of the Siamese-style metric loss is what allows the model to effectively separate inter-prototype features while maintaining intra-prototype similarity.

Key Results

The results are highly impressive, particularly on the ImageNet-1K linear probe benchmark (where the backbone is frozen and only a final classification layer is trained):

  • Beating Supervised Learning: SPCL achieved 77.68% top-1 accuracy on ImageNet. For context, a standard ResNet-50 trained with full human supervision typically achieves around 77.15%.
  • Outperforming SOTA: SPCL outperformed other leading self-supervised methods, including SwAV (75.30%) and SimCLRv2 (71.70%), despite using a more modest batch size (1024 vs. 4096+ in some competitors).
  • Robustness: In ablation studies on CIFAR-10, SPCL showed significantly better "True Positive" distance (keeping views of the same object together) and lower "False Negative" distance (not pushing similar objects too far apart) compared to SimCLR.

Limitations and Future Work

While SPCL is powerful, the paper notes a few areas for further exploration:

  • Sensitivity to Prototype Count: The accuracy is somewhat sensitive to the number of clusters ($K$) chosen for K-means. If $K$ is vastly different from the actual number of classes in the downstream task, it can introduce noise.
  • Computational Overhead: Although the authors mention that the K-means clustering (using the Faiss library) is relatively fast (taking only a small fraction of total training time), it still adds a layer of complexity to the training pipeline compared to end-to-end instance-wise methods.
  • Future Directions: The authors suggest that stacking multiple prototypical losses with different numbers of clusters (multi-resolution clustering) could further improve the robustness of the representations.

Summary updated

BibTeX
@inproceedings{mo2021siamese,
  author = {Shentong Mo and Zhun Sun and Chao Li},
  title = {{Siamese Prototypical Contrastive Learning}},
  booktitle = {BMVC},
  year = {2021},
}
Figure