Probabilistic Contrastive Learning for Long-Tailed Visual Recognition

Chaoqun Du, Yulin Wang, Shiji Song, Gao Huang

TL;DR

ProCo (Probabilistic Contrastive Learning) overcomes the "batch size bottleneck" in supervised contrastive learning for imbalanced data. By modeling class features as von Mises-Fisher distributions, the authors derive a closed-form loss that simulates an infinite number of contrastive pairs, significantly boosting performance on rare "tail" categories without the need for massive hardware resources.

What Problem Does This Paper Address?

In the real world, data is rarely balanced; it usually follows a "long-tailed" distribution where a few "head" classes have thousands of samples, while many "tail" classes have only a handful. Standard deep learning models tend to ignore these rare classes, leading to poor generalization.

Supervised Contrastive Learning (SCL) has emerged as a powerful way to learn robust features by pulling samples of the same class together and pushing different classes apart. However, SCL has a major flaw: it requires very large batches to ensure that every class is represented in every training step. For tail classes, the probability of appearing in a random batch is tiny. This means the model rarely receives a meaningful "push" or "pull" signal for rare categories, causing it to collapse toward the dominant head classes.

Methods

The authors propose ProCo, which shifts the paradigm from sampling discrete images to sampling from estimated probability distributions.

  1. The vMF Assumption: Since contrastive learning typically uses normalized features (projected onto a unit hypersphere), the authors assume features follow a von Mises-Fisher (vMF) distribution. This is essentially the hyperspherical version of a Gaussian distribution.
  2. Online Parameter Estimation: Instead of needing a massive batch, ProCo estimates the mean direction ($\mu$) and concentration ($\kappa$) for every class using a running average (first sample moment) across all training batches. This allows the model to "remember" the feature distribution of tail classes even when they aren't in the current batch.
  3. The "Infinite" Loss: The core mathematical contribution is deriving a closed-form expected contrastive loss. By integrating over the estimated vMF distributions, the authors calculate what the loss would be if they sampled an infinite number of contrastive pairs. This eliminates the need for large batches and explicit pair construction.
  4. Dual-Branch Architecture: The model uses a shared backbone with two heads: a standard classification head (using Logit Adjustment) and a representation head (using the ProCo loss).

Datasets

The researchers evaluated ProCo on several rigorous benchmarks:

  • CIFAR-10/100-LT: Long-tailed versions of standard datasets with varying imbalance factors.
  • ImageNet-LT: A large-scale long-tailed version of ImageNet.
  • iNaturalist 2018: A massive, naturally imbalanced dataset of plant and animal species.
  • LVIS v1: Used for long-tailed object detection and instance segmentation.
  • CUB-200-2011: Used to test performance on fine-grained balanced data.

Key Insights and Ideas

  • Distributions over Samples: The "aha moment" is realizing that a batch is just a noisy estimate of a distribution. If you can estimate the distribution directly, you don't need the batch to be large; you just need it to be sufficient to update your distribution parameters.
  • Geometry Matters: Using vMF distributions instead of standard Gaussians is crucial. Because features are normalized to a sphere, Gaussian math doesn't hold up. vMF fits the geometry of the feature space perfectly, leading to more stable and theoretically sound optimization.
  • Implicit Margin: The derived ProCo loss naturally enforces a margin between classes. This is vital for long-tailed recognition because it prevents head classes from "crowding out" the feature space reserved for tail classes.
  • Versatility: While designed for long-tail problems, ProCo also improves performance on balanced datasets and can be easily adapted for semi-supervised learning by using the distribution to generate more reliable pseudo-labels for unlabeled data.

Key Results

ProCo consistently outperformed state-of-the-art methods across all benchmarks:

  • ImageNet-LT: Achieved 57.3% top-1 accuracy (ResNet-50), surpassing the previous best (BCL) by 1.3%.
  • iNaturalist 2018: Reached 75.8% accuracy, showing strong scalability to very large, real-world imbalanced datasets.
  • Tail Performance: On CIFAR-100-LT, ProCo improved accuracy on "Few-shot" (tail) classes by 2.0% compared to BCL, while maintaining or improving "Many-shot" (head) performance.
  • Object Detection: On the LVIS dataset, ProCo improved the Mask R-CNN baseline by 3.5% in mask AP, particularly helping with rare object categories.

Limitations and Future Work

The authors note that ProCo relies on the assumption that features follow a vMF distribution. While this works well for current deep features, more complex data distributions might require a "mixture of vMFs" which would be harder to solve in closed form.

Future directions include applying ProCo to multi-modal foundation models (like CLIP) and exploring its utility in other domains like self-supervised video representation or medical imaging where data imbalance is a persistent hurdle.

Summary updated

BibTeX
@article{du2024probabilistic,
  author = {Chaoqun Du and Yulin Wang and Shiji Song and Gao Huang},
  title = {{Probabilistic Contrastive Learning for Long-Tailed Visual Recognition}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2024},
  url = {https://openreview.net/forum?id=GNyzJ36d9c},
}
Figure