Introduction
In real-world scenarios, data rarely follows a balanced distribution. Most datasets are "long-tailed," where a few "head" classes possess thousands of samples while hundreds of "tail" classes have only a handful. Standard Supervised Contrastive Learning (SupCon) excels at learning robust representations by clustering similar samples, but it suffers from a critical flaw: a mathematical bias toward high-frequency classes. In imbalanced settings, the gradient norm for majority classes is significantly steeper, causing the model to prioritize the "head" at the expense of the "tail."
The PaCo Framework
To address this, the authors propose Parametric Contrastive Learning (PaCo). The core innovation shifts from a purely non-parametric approach (sample-to-sample comparison) to a hybrid framework incorporating parametric class-wise learnable centers.
In PaCo, every class maintains a "center" vector in the feature space. During training, samples are compared not only to other samples in the batch or queue but also to these learnable centers. This approach is complemented by several key components:
- Rebalancing via Optimization: PaCo introduces a hyperparameter to make the optimal probability of identifying positive pairs more uniform across all classes, regardless of their frequency.
- Balanced Softmax Integration: This technique adjusts predicted probabilities based on class distribution, preventing the learnable centers from being overwhelmed by majority samples.
- Strong Augmentation: Unlike some previous contrastive methods, PaCo thrives on aggressive data augmentation, utilizing combinations like RandAugment and SimAugment to improve representation learning.
Bridging the Gradient Gap
A key insight of this work is the visualization of gradient norms across class frequencies. In standard SupCon, the gradient for the top 200 classes is disproportionately large compared to the rest of the distribution. PaCo effectively "flattens" this gradient curve, ensuring the optimizer remains sensitive to rare classes.
This rebalancing suggests that PaCo acts as a more sophisticated supervision method for contrastive learning. Under balanced settings, it mathematically reduces to a weighted sum of supervised cross-entropy and supervised contrastive loss, making it a versatile tool beyond just long-tailed data.
Experimental Results
PaCo consistently achieves state-of-the-art (SOTA) performance across various benchmarks, outperforming methods like RIDE, Decouple, and Balanced Softmax:
- ImageNet-LT: Achieved 57.0% top-1 accuracy with a ResNet-50, a massive jump from the 41.6% baseline. With a larger ResNeXt-101 backbone, it reached 60.0%.
- iNaturalist 2018: Reached 73.2% accuracy, leading previous methods by a substantial margin.
- Balanced ImageNet: Surprisingly, PaCo also improves results on standard balanced datasets. A ResNet-200 trained with PaCo achieved 81.8% top-1 accuracy, surpassing standard SupCon.
- Efficiency: Despite the addition of learnable centers, PaCo maintains competitive inference times, ensuring its practical utility in real-world deployments.
Conclusion
PaCo provides a robust solution for long-tailed recognition by rebalancing the contrastive loss from an optimization perspective. While the integration of Balanced Softmax is currently a practical remedy, future work may explore more rigorous theoretical foundations for center-based rebalancing to further refine the framework.
Summary updated