Abstract: Real-world data often exhibits long tail distributions with heavy class imbalance, where the majority classes can dominate the training process and alter the decision boundaries of the minority classes. Recently, researchers have investigated the potential of supervised contrastive learning for long-tailed recognition, and demonstrated that it provides a strong performance gain. In this paper, we show that while supervised contrastive learning can help improve performance, past baselines suffer from poor uniformity brought in by imbalanced data distribution. This poor uniformity manifests in samples from the minority class having poor separability in the feature space. To address this problem, we propose targeted supervised contrastive learning (TSC), which improves the uniformity of the feature distribution on the hypersphere. TSC first generates a set of targets uniformly distributed on a hypersphere. It then makes the features of different classes converge to these distinct and uniformly distributed targets during training. This forces all classes, including minority classes, to maintain a uniform distribution in the feature space, improves class boundaries, and provides better generalization even in the presence of long-tail data. Experiments on multiple datasets show that TSC achieves state-of-the-art performance on long-tailed recognition tasks.
The Challenge of Long-Tailed Recognition
In the real world, data is rarely balanced. Most datasets follow a "long-tail" distribution where a few "head" classes have thousands of samples, while many "tail" classes have only a handful. Standard deep learning models—and even recent supervised contrastive learning (SupCon) methods—struggle in these scenarios because the majority classes dominate the training process.
The core issue is uniformity. In an ideal feature space, classes should be spread out evenly on a hypersphere to maximize the "margin" (the distance between decision boundaries). However, when data is imbalanced, the feature space becomes biased: head classes take up most of the room, while tail classes get squeezed together or "collapse" into each other. This lack of separation makes it nearly impossible for a classifier to distinguish between minority classes accurately.
As shown in the figure above, baseline methods like KCL suffer from significant performance degradation as the imbalance ratio increases, with feature clusters for tail classes becoming poorly defined. TSC, by contrast, maintains high accuracy and distinct class boundaries.
The TSC Framework: Imposing Uniformity
To address "tail-class collapse," the authors propose Targeted Supervised Contrastive Learning (TSC). Unlike previous methods that hope for uniformity to emerge naturally, TSC shifts the paradigm by imposing a uniform distribution as a structural requirement.
1. Target Generation
Before training begins, TSC computes a set of "targets"—points on a hypersphere that are as far apart from each other as possible. This is achieved by minimizing an energy potential, a process inspired by the Thomson Problem in physics, which describes how electrons distribute themselves on a sphere to reach a minimum energy state.
2. Semantic-Aware Target Assignment
You cannot simply assign targets to classes randomly; doing so would ignore the inherent semantic relationships between categories (e.g., "cat" and "dog" features should naturally be closer to each other than "cat" and "airplane"). To preserve this structure, TSC uses an Online Matching-Training Scheme. During training, the model uses the Hungarian Algorithm to adaptively match class centers to the pre-computed targets. This ensures that semantically similar classes are mapped to targets that are relatively close to one another on the hypersphere.
3. Targeted Loss Function
TSC introduces a loss function that combines standard contrastive learning (which pushes different classes apart) with a "targeted" component. This targeted term acts like a magnet, pulling the features of a specific class toward its pre-assigned uniform target, ensuring that even minority classes occupy a dedicated, equidistant region of the feature space.
Experimental Results
The authors evaluated TSC on four standard long-tailed recognition benchmarks, consistently outperforming previous state-of-the-art (SOTA) single-model methods:
- CIFAR-10-LT & CIFAR-100-LT: TSC achieved 79.7% accuracy on CIFAR-10-LT (at imbalance ratio 100), a significant jump over the previous KCL baseline of 77.6%.
- ImageNet-LT: The model reached 52.4% overall accuracy, outperforming other contrastive methods like KCL (51.5%) and traditional methods like $\tau$-norm (46.7%).
- iNaturalist 2018: TSC achieved 69.7% accuracy on this large-scale, naturally imbalanced dataset containing over 8,000 species.
- Ensembling: When combined with multi-expert models (like RIDE), TSC pushed performance even further, reaching 56.9% on ImageNet-LT.
Conclusion
TSC demonstrates that treating uniformity as a constraint rather than a byproduct is key to solving long-tailed recognition. By forcing all classes to maintain a uniform distribution, TSC prevents the crowding effect caused by head classes and improves generalization. While the method currently requires a pre-defined class count, its success on major benchmarks suggests that targeted feature distribution is a powerful tool for imbalanced learning. Future work may explore applying these constraints to self-supervised settings where labels are unavailable.
Summary updated