TL;DR
This paper introduces ProjNCE, a generalized contrastive loss that provides a mathematically rigorous link between supervised contrastive learning and mutual information. By replacing rigid class centroids with flexible projection functions and adding a novel adjustment term for negative pairs, ProjNCE consistently outperforms standard Supervised Contrastive (SupCon) learning and cross-entropy across diverse image and audio benchmarks.
What Problem Does This Paper Address?
Contrastive learning has become a cornerstone of modern AI, particularly in self-supervised settings (like SimCLR) where models learn by comparing different views of the same data. The InfoNCE loss used in these settings is well-understood as a lower bound on Mutual Information (MI)—essentially, it ensures the model retains as much information about the input as possible.
However, when we move to the supervised setting (SupCon), where we use labels to group similar items, the information-theoretic grounding becomes shaky. The standard SupCon loss doesn't necessarily preserve a valid MI bound. Furthermore, SupCon relies on a "centroid" approach, forcing all samples of a class to align with their average embedding. The authors ask two key questions:
- How does SupCon actually relate to the mutual information between features and labels?
- Is the simple class centroid really the best way to represent a category in embedding space?
Methods
The authors propose ProjNCE, a framework that views contrastive learning through a "projection perspective."
Key Innovations:
- The Adjustment Term ($R$): The authors prove that standard SupCon lacks a specific term required to be a valid MI lower bound. They introduce an adjustment term for negative pairs that "fixes" this mathematical gap, ensuring that minimizing the loss directly maximizes the mutual information between learned representations and class labels.
- Flexible Projections ($g_+$ and $g_-$): Instead of a fixed class centroid, ProjNCE allows for different projection functions for positive and negative samples. They explore three main types:
- Orthogonal Projection: The theoretically optimal projection for minimizing error, approximated using the Nadaraya-Watson (NW) estimator to handle cases where soft labels aren't available.
- Median-based Projection: A robust alternative that is less sensitive to outliers than the standard mean (centroid).
- MLP-based Projection: A learnable projection using a Multi-Layer Perceptron, which removes the need for manual hyperparameter tuning.
Datasets
The researchers evaluated ProjNCE across a wide array of modalities:
- Vision: CIFAR-10, CIFAR-100, STL10, Tiny-ImageNet, Caltech256, Food101, and the massive ImageNet dataset.
- Audio: CREMA-D (emotion recognition) and SpeechCommands (keyword spotting).
- Noise Benchmarks: They specifically tested performance under label noise (incorrect labels) and feature noise (corrupted images) to evaluate robustness.
Key Insights and Ideas
- SupCon is "Almost" MI-Bound: The authors show that SupCon can be viewed as a special case of ProjNCE, but it lacks the adjustment term needed to be a strict lower bound on mutual information. Adding this term forces embedding clusters to spread out more effectively, preventing "class collapse."
- Centroids Aren't Universal: While class centroids work well for clean data, they struggle with noisy labels. The flexibility to use medians or learnable MLPs allows the model to ignore outliers and learn more robust category representations.
- Information Retention: Using the Mixed KSG estimator, the authors empirically confirmed that ProjNCE retains significantly more class-relevant information in its embeddings compared to both SupCon and self-supervised SimCLR.
Key Results
- ImageNet Breakthrough: On the challenging ImageNet dataset, ProjNCE-MLP achieved 57.66% top-1 accuracy, a massive jump over SupCon's 42.89%.
- Consistent Gains: Across seven different benchmarks, ProjNCE variants (Perp, Med, or MLP) outperformed the SupCon baseline in every single case.
- Robustness to Noise: In experiments with 30% label noise on STL10, ProjNCE-MLP maintained a high accuracy (67.73%) while standard Cross-Entropy and SupCon performance dropped significantly (61.00% and 63.39% respectively).
- Audio Performance: While Cross-Entropy remained the leader for SpeechCommands, ProjNCE significantly closed the gap compared to standard SupCon, showing its versatility across modalities.
Limitations and Future Work
- Batch Size Sensitivity: Like most contrastive methods, ProjNCE performs better with larger batch sizes. The adjustment term $R$ is particularly difficult to estimate accurately with very small batches (e.g., $B=128$ on Tiny-ImageNet).
- Kernel Tuning: The "Orthogonal" version (ProjNCE-perp) requires tuning the bandwidth ($h$) of the kernel estimator, though the authors found it to be relatively stable across a range of values.
- Future Directions: The authors suggest extending ProjNCE to incorporate auxiliary information, such as class taxonomies or semantic label embeddings (e.g., Word2Vec), which could further refine how categories are projected into the embedding space.
Summary updated