Skip to main content
QUICK REVIEW

[Paper Review] Targeted Supervised Contrastive Learning for Long-Tailed Recognition

Tianhong Li, Peng Cao|arXiv (Cornell University)|Nov 27, 2021
Domain Adaptation and Few-Shot LearningComputer Science40 references15 citations
TL;DR

This paper proposes Targeted Supervised Contrastive Learning (TSC), a method that improves long-tailed recognition by generating uniformly distributed targets on a hypersphere and aligning class features to these targets during training. TSC enhances feature space uniformity, especially for minority classes, achieving state-of-the-art performance across CIFAR-10-LT, CIFAR-100-LT, ImageNet-LT, and iNaturalist datasets by mitigating bias from imbalanced data distributions.

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.

Motivation & Objective

  • Address the poor uniformity in feature space caused by long-tailed data distributions in supervised contrastive learning.
  • Improve generalization and separability of minority classes in imbalanced datasets without sacrificing head class performance.
  • Develop a method that maintains balanced feature distributions regardless of training data imbalance ratios.
  • Ensure semantic similarity between classes is preserved in the feature space by aligning to spatially appropriate targets.
  • Provide a stable, scalable solution for long-tailed recognition that outperforms existing contrastive learning baselines.

Proposed method

  • Generate optimal, uniformly distributed target points on a hypersphere using stochastic gradient descent to minimize uniformity loss.
  • Assign each class to a target point via an online matching scheme that respects semantic similarity between classes.
  • Train the model using a contrastive loss that encourages features of each class to converge toward their assigned target.
  • Use a balanced positive sampling strategy (as in KCL) to improve alignment within each class, though the benefit is reduced due to inherent balance from target alignment.
  • Apply an online matching algorithm that dynamically assigns targets to classes during training to preserve semantic structure.
  • Ensure stability of target generation by evaluating uniformity loss across multiple random seeds, showing negligible variance.
Figure 1 : Test data feature distribution of (a) k-positive contrastive learning (KCL) and (b) TSC for three classes of CIFAR10 (plane, cat, dog), for different training data imbalance ratios $\rho$ . With high imbalance ratio, class centers learned by KCL exhibit poor uniformity while class centers
Figure 1 : Test data feature distribution of (a) k-positive contrastive learning (KCL) and (b) TSC for three classes of CIFAR10 (plane, cat, dog), for different training data imbalance ratios $\rho$ . With high imbalance ratio, class centers learned by KCL exhibit poor uniformity while class centers

Experimental results

Research questions

  • RQ1Can supervised contrastive learning maintain uniform feature distributions under long-tailed data distributions, or does class imbalance degrade uniformity and generalization?
  • RQ2Does assigning predefined, uniformly distributed targets to classes improve feature space uniformity and performance on minority classes in long-tailed recognition?
  • RQ3How does the online matching of classes to targets affect semantic consistency and model generalization compared to random or fixed target assignments?
  • RQ4To what extent does TSC reduce performance degradation on tail classes without harming head class accuracy?
  • RQ5Is the target generation process stable and robust across different random seeds and class counts?

Key findings

  • TSC achieves state-of-the-art performance on CIFAR-10-LT with an overall accuracy of 63.5%, surpassing KCL (52.4%) and FCL (51.8%).
  • On ImageNet-LT, TSC achieves 63.5% accuracy on many-shot classes, 49.7% on medium, 30.4% on few-shot, and 52.4% overall, outperforming KCL and FCL.
  • The online matching algorithm in TSC reduces the risk score (R) from 7.81 (random assignment) to 7.14, indicating better generalization and more balanced feature learning.
  • TSC maintains high uniformity in feature space even at high imbalance ratios (e.g., 100:1:1), while KCL shows severe collapse of minority class features.
  • The target generation process is stable, with uniformity loss varying by less than 3e-6 across multiple random seeds, confirming robustness.
  • The benefit of balanced positive sampling is smaller in TSC than in KCL, indicating that target-driven alignment naturally balances intra-class alignment.
Figure 2 : Illustration of TSC. It first computes the optimal targets for the class centers on the hypersphere. Then, during training, in each iteration, each target is assigned to the nearest class, and a targeted contrastive learning loss is designed to encourage the samples from each class to mov
Figure 2 : Illustration of TSC. It first computes the optimal targets for the class centers on the hypersphere. Then, during training, in each iteration, each target is assigned to the nearest class, and a targeted contrastive learning loss is designed to encourage the samples from each class to mov

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.