On the Effectiveness of Out-of-Distribution Data in Self-Supervised Long-Tail Learning.

Jianhong Bai, Zuozhu Liu, Hualiang Wang, Jin Hao, Yang Feng, Huanpeng Chu, Haoji Hu

Self-supervised learning (SSL) is the engine behind many modern AI breakthroughs, allowing models to learn rich representations from massive, unlabeled datasets. However, standard SSL makes a critical assumption: that the training data is relatively balanced. In the real world, data is typically "long-tailed." A few categories (the "head") contain thousands of examples, while the vast majority of categories (the "tail") have almost none.

When trained on long-tailed data, standard SSL models are dominated by the majority classes, leading to poor representation and performance on rare but critical tail classes. A paper from ICLR 2023, "On the Effectiveness of Out-of-Distribution Data in Self-Supervised Long-Tail Learning," introduces a clever and counter-intuitive fix: using completely unrelated "Out-of-Distribution" (OOD) data to balance the scales.

TL;DR

The authors propose COLT (Contrastive with Out-of-distribution data for Long-Tail learning), a framework that leverages easily accessible, unlabeled OOD data (like random web images) to rebalance the feature space of long-tailed datasets. By identifying "tail" samples and strategically padding their neighborhoods with OOD data, COLT significantly boosts performance on minority classes without requiring expensive in-distribution labels.

The Problem: Feature Space Dominance

Standard SSL methods, such as SimCLR or MoCo, excel at learning representations by comparing different augmented views of the same image. However, when trained on imbalanced data, the majority classes dominate the feature space. The "tail" classes end up with sparse, poorly defined neighborhoods, making them difficult to distinguish during downstream tasks like classification.

Previous solutions attempted to fix this by collecting more "in-distribution" (ID) data for the tail classes. But if you are building a model to diagnose a rare disease, finding more ID images is exactly the bottleneck. The authors ask a provocative question: Can we use OOD data—data that has nothing to do with our specific task—to help the model learn better representations for our rare classes?

Methods: The COLT Framework

The authors introduce COLT, which plugs into existing SSL frameworks via three main steps:

The COLT Framework Pipeline
  1. Localizing the Tail (Tailness Score): Since labels are absent during SSL, the model must infer which images belong to the tail. COLT uses a "tailness score" based on neighborhood density. In the projected feature space, majority class samples are surrounded by many similar neighbors, while tail samples are isolated outliers. COLT identifies these lonely samples automatically.
  2. Online OOD Sampling: Once the tail is identified, the model dynamically selects OOD samples from a large external pool (e.g., random internet images) that map closely to these tail regions in the feature space. This effectively re-balances the density of the feature space.
  3. Distribution-Aware Contrastive Loss: Simply mixing OOD data with ID data can degrade the model's core representations. To prevent this "toxicity," COLT uses a novel loss function that makes the model aware of the distribution difference. It forces the model to distinguish between ID and OOD samples while still using the OOD samples to provide structural support for the tail classes.

Key Insights

  • OOD Data as a "Bridge": The most surprising finding is that OOD data helps even if it doesn't share classes with the ID data. It acts as a structural filler, improving "intra-class consistency" for tail samples by bridging the gaps in their sparse neighborhoods.
  • Tailness is Observable: You don't need labels to find the tail. The geometry of the feature space itself reveals which samples are from minority classes through their lack of neighbors.
  • Dynamic Re-sampling is Key: The OOD samples are re-selected every few epochs. This prevents the model from over-fitting to specific OOD images and ensures the tail classes are constantly exposed to new negative examples that sharpen their boundaries.

Key Results and Limitations

COLT delivers impressive gains across standard long-tailed benchmarks (like CIFAR-10-LT, CIFAR-100-LT, ImageNet-100-LT, and Places-LT). On CIFAR-100-LT, COLT improved the baseline SimCLR accuracy from 47.65% to 57.46%—a nearly 10% jump using just 10k OOD images. Furthermore, the performance gap between "Many-shot" (head) and "Few-shot" (tail) classes narrowed significantly, indicating a much more balanced model.

Accuracy across different OOD datasets and imbalance ratios

While COLT is highly effective, the authors note that not all OOD data is created equal. As shown in the chart above, while datasets like 300K Random Images or ImageNet-100 provide massive boosts over the baseline, adding pure Gaussian noise provides almost no benefit (and sometimes hurts performance). Choosing the "right" kind of OOD data for a specific ID task remains an open research question.

Ultimately, COLT proves that we don't always need perfectly curated data to fix dataset imbalances. Sometimes, a strategic injection of "random" internet noise is exactly what the underdogs need to thrive.

Paper Citation: Jianhong Bai, et al. "On the Effectiveness of Out-of-Distribution Data in Self-Supervised Long-Tail Learning." ICLR 2023. Link to Code

Summary updated

BibTeX
@inproceedings{bai2023effectiveness,
  author = {Jianhong Bai and Zuozhu Liu and Hualiang Wang and Jin Hao and YANG FENG and Huanpeng Chu and Haoji Hu},
  title = {{On the Effectiveness of Out-of-Distribution Data in Self-Supervised Long-Tail Learning.}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=v8JIQdiN9Sh},
}
Figure