Decoupled Contrastive Learning for Long-Tailed Recognition

Shiyu Xuan, Shiliang Zhang

Abstract

Standard Supervised Contrastive Learning (SCL) often fails on long-tailed datasets due to a gradient imbalance that biases models toward head classes. This paper proposes Decoupled Contrastive Learning (DCL), which separates the learning signals from self-augmentations and same-class neighbors. Additionally, a Patch-based Self Distillation (PBSD) module is introduced to transfer knowledge of shared visual patterns from head to tail classes. The combined approach achieves state-of-the-art performance on major benchmarks including ImageNet-LT and iNaturaList 2018.

Introduction: The Challenge of Long-Tailed Data

In real-world scenarios, data distributions are rarely balanced. Instead, they follow a "long tail" where a few classes have abundant samples while many others are extremely rare. While Supervised Contrastive Learning (SCL) is effective for balanced data, it struggles with this imbalance. SCL pulls positive pairs (same class) together and pushes negative pairs (different classes) apart. In long-tailed settings, head classes have many neighbors to pull from, but tail classes lack sufficient same-class examples.

Standard SCL often relies on low-level shortcuts like background color for rare classes.

This disparity leads to a gradient imbalance. Tail classes, lacking semantic neighbors, often default to learning low-level "shortcuts" such as background color or texture rather than robust semantic features. For example, a model might incorrectly group a rare insect with a specific flower color rather than identifying the insect itself.

Proposed Methodology

The authors address these issues through two primary innovations:

1. Decoupled Supervised Contrastive Loss (DSCL)

The authors identify that in standard SCL, the gradient for tail classes is dominated by the single self-augmentation, while head classes are dominated by same-class neighbors. DSCL re-weights these components to ensure the "pull" from same-class neighbors does not overwhelm the "pull" from self-augmentation. This decoupling ensures a more balanced optimization across the entire class distribution.

2. Patch-based Self Distillation (PBSD)

To mitigate under-representation in tail classes, PBSD leverages shared visual patterns (e.g., "wheels" shared between a rare "tractor" and a common "truck"). By extracting features from random patches using ROI pooling and applying self-distillation, the model learns to recognize these local patterns across different instances. This effectively transfers knowledge from data-rich head classes to data-poor tail classes.

Tail classes benefit from learning shared semantic features across diverse backgrounds.

Experimental Results

The method was evaluated on three major long-tailed benchmarks:

  • ImageNet-LT: Achieved 57.7% top-1 accuracy, significantly outperforming previous contrastive methods like TSC (52.4%) and PaCo (53.6%).
  • iNaturaList 2018: Reached 72.0% accuracy with a single model, demonstrating robustness on large-scale real-world data.
  • Places-LT: Showed consistent improvements in scene recognition.

Ablation studies confirmed that both DSCL and PBSD contribute independently to these gains, validating the importance of both loss re-weighting and feature-sharing.

Conclusion

Decoupled Contrastive Learning provides a theoretically grounded and practically effective solution for long-tailed recognition. By addressing the gradient imbalance in SCL and enabling knowledge transfer through local patches, the method bridges the gap between head and tail class performance. Future work may explore extending these principles to more complex tasks like long-tailed object detection.

Summary updated

BibTeX
@inproceedings{xuan2024decoupled,
  author = {Shiyu Xuan and Shiliang Zhang},
  title = {{Decoupled Contrastive Learning for Long-Tailed Recognition}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i6.28459},
}
Figure