Generalizing Supervised Contrastive learning: A Projection Perspective

Minoh Jeong, Alfred Hero

Researchers at the University of Michigan have introduced a significant theoretical and practical advancement to Supervised Contrastive (SupCon) learning. By proposing a new loss function called ProjNCE, they bridge the gap between heuristic contrastive methods and information theory, offering a more flexible and robust framework for representing categories in latent space.

The Theoretical Gap in Supervised Contrastive Learning

In self-supervised learning, the InfoNCE loss is widely regarded as the gold standard because it is mathematically proven to maximize a lower bound on the Mutual Information (MI) between different views of data. However, when transitioning to the supervised setting with SupCon, this theoretical link becomes less clear. While SupCon treats all samples of the same class as "positives," it lacks a formal mechanism to ensure it is maximizing the information between learned features and class labels.

Furthermore, SupCon relies heavily on class "centroids"—the average embedding of all samples in a category. This approach is fragile; in datasets with outliers or noisy labels, the mean may be a poor representative of the class, leading to suboptimal feature clusters and reduced performance.

The ProjNCE Framework

ProjNCE generalizes the InfoNCE loss by incorporating two key innovations:

  1. Projection Functions ($g_+$ and $g_-$): Instead of forcing a class to be represented by a simple centroid, ProjNCE allows for arbitrary functions to project class labels into the embedding space. This flexibility enables the model to capture more complex class structures.
  2. The Adjustment Term ($R$): This term ensures that ProjNCE remains a valid lower bound for the mutual information $I(X; C)$. It accounts for the similarity ratio between negative pairs, preventing the model from becoming overconfident or collapsing clusters too tightly.

The authors explored several projection strategies, including Orthogonal Projection (ProjNCE-perp) using kernel estimators, Median-based Projection (ProjNCE-med) for robustness against feature noise, and MLP-based Projection (ProjNCE-MLP), which uses a learnable neural network to optimize class representations automatically.

Visualizing the "Spread" Effect

A key insight from the research is the structural difference in the learned embedding space. Standard SupCon often leads to "class collapse," where embeddings for a single category are packed too tightly. ProjNCE, through its adjustment term and flexible projections, encourages a more uniform spread within clusters.

t-SNE visualizations comparing (a) SupCon with (b) ProjNCE and its variants (c, d). ProjNCE variants demonstrate a more uniform spread within clusters, preventing class collapse.

As shown in the t-SNE visualizations, the ProjNCE adjustment term forces embedding clusters to spread out more than standard SupCon. This prevents collapse and helps the model better distinguish between similar but distinct categories, which is critical for downstream classification tasks.

Experimental Results and Robustness

The researchers evaluated ProjNCE across a wide array of benchmarks, including ImageNet, CIFAR, and various audio datasets. Key findings include:

  • ImageNet Performance: ProjNCE-MLP achieved 57.66% top-1 accuracy, a substantial improvement over standard SupCon's 42.89%.
  • Label Noise Robustness: On the STL-10 dataset with 30% label noise, ProjNCE-MLP maintained ~67.7% accuracy, while SupCon dropped to ~63.4%.
  • Feature Noise Resilience: In experiments with Gaussian pixel noise, the Median-based projection (ProjNCE-med) proved most resilient, outperforming other contrastive variants.
  • Mutual Information: Using the Mixed KSG estimator, the authors confirmed that ProjNCE consistently yields higher estimated mutual information between embeddings and labels compared to SimCLR or SupCon.

Conclusion

ProjNCE represents a major step forward in supervised representation learning. By grounding contrastive loss in information theory and moving beyond simple class centroids, it provides a more robust and high-performing alternative to standard SupCon. While the method introduces some computational overhead during training due to the adjustment term, the significant gains in accuracy and robustness to noise make it a powerful tool for real-world applications where data is often imperfect.

Summary updated

BibTeX
@misc{jeong2025generalizing,
  author = {Minoh Jeong and Alfred Hero},
  title = {{Generalizing Supervised Contrastive learning: A Projection Perspective}},
  year = {2025},
  eprint = {2506.09810},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.09810},
}
Figure