Distilling Virtual Examples for Long-tailed Recognition

Yin-Yin He, Jianxin Wu, Xiu-Shen Wei

TL;DR

DiVE (Distilling Virtual Examples) is a novel knowledge distillation framework designed to tackle the challenge of long-tailed visual recognition. By treating a teacher model's soft probabilities as fractional "virtual examples," DiVE enables cross-category interaction and explicitly flattens the training distribution to significantly boost the performance of under-represented tail classes without sacrificing head-class accuracy.

What Problem Does This Paper Address?

In the real world, visual data naturally follows a long-tailed distribution: a few "head" categories contain the vast majority of images, while most "tail" categories have only a handful of samples. Standard deep learning models trained on such data become heavily biased toward head classes, leading to dismal accuracy on the tail.

Existing solutions typically rely on data resampling (oversampling the tail or undersampling the head) or loss reweighting. However, these methods operate strictly within individual categories. They lack a mechanism to let categories interact, missing out on the chance to transfer rich visual features learned from head classes to help recognize visually similar tail classes.

Methods

The authors introduce DiVE (Distilling Virtual Examples), which leverages knowledge distillation (KD) to introduce cross-category interactions.

The core idea relies on a re-interpretation of the teacher model's soft predictions. If a teacher network predicts a dog image as (0.7 dog, 0.2 cat, 0.1 rabbit), DiVE interprets this single image as three fractional virtual examples: 0.7 of a dog, 0.2 of a cat, and 0.1 of a rabbit.

Figure 2. Illustration of virtual examples. An input dog example received prediction in the first row from the teacher model, and in effect creates virtual examples in all 5 categories: 0.7 dog exam- ple, 0.02 car example, 0.07 rabbit example, 0.01 ship example and 0.2 cat example.

Mathematically, the authors prove that when the distillation temperature $\tau = 1$, standard knowledge distillation is equivalent to Deep Label Distribution Learning (DLDL).

To fix the long-tail bias, the distribution of these virtual examples must be made much flatter than the original input distribution. DiVE achieves this through two distinct tuning knobs:

  1. Temperature Scaling ($\tau$): Increasing the distillation temperature smoothly softens the teacher's prediction vector, pushing it toward a uniform distribution.
  2. Power Normalization: The authors apply a classic power transform ($x^p$, setting $p=0.5$) to the teacher's soft logits, which effectively doubles the temperature for the teacher's signal while keeping the student's temperature stable.

The final student model is trained using a combined loss function: a Balanced Softmax Cross Entropy (BSCE) loss for the hard ground-truth labels, and a Kullback-Leibler (KL) divergence loss against the tuned, flattened teacher distribution.

Datasets

The method was evaluated on three widely accepted long-tailed recognition benchmarks:

  • CIFAR-100-LT: Created by artificially downsampling the standard CIFAR-100 dataset using an exponential decay, evaluated at imbalance factors ($\beta$) of 10, 50, and 100.
  • ImageNet-LT: A long-tailed version of ImageNet containing 115.8K images across 1,000 categories.
  • iNaturalist2018: A large-scale, naturally long-tailed dataset featuring 437.5K images across 8,412 species.

Key Insights and Ideas

  • Cross-Category Knowledge Transfer: Even if a tail category (e.g., "cat") has very few real images, it can accumulate substantial training signals via fractional virtual examples generated by visually similar head-category images (e.g., "dog").
  • The Necessity of Flatness: The authors demonstrate that a standard cross-entropy teacher produces a virtual example distribution that merely mirrors the heavily skewed input data. For distillation to successfully assist tail classes, the virtual example distribution must be explicitly flattened.
  • Rule-of-Thumb Tuning: Instead of blindly increasing temperature until the distribution becomes uniform (and loses discriminative information), the authors propose a rule-of-thumb: select a temperature where the average number of virtual examples in the tail part becomes slightly higher than in the head part.
Figure 5. The virtual example distribution becomes flatter when the temperature τ increases, illustrated on CIFAR-100-LT with imbalance factor 100. The model was trained with BSCE [23]. Based on our rule-of-thumb, τ = 6 is a proper temperature.

Key Results

DiVE consistently outperformed existing state-of-the-art (SOTA) methods across all benchmarks:

  • CIFAR-100-LT: At the highest imbalance factor ($\beta=100$), DiVE achieved a top-1 accuracy of 45.35%, outperforming the baseline BSCE (42.39%) and the previous SOTA, De-confund-TDE (44.10%).
  • ImageNet-LT: DiVE achieved 53.10% overall accuracy, notably maintaining a high head-class ("Many") accuracy of 64.06% while boosting tail ("Few") accuracy to 31.46%.
  • iNaturalist2018: When trained for 90 epochs, DiVE reached 69.13% top-1 accuracy, outperforming all compared methods by at least 1 percentage point. Extended to 200 epochs, it reached 71.71%.
  • Plug-and-Play Compatibility: DiVE can enhance other multi-expert architectures. By applying DiVE to the RIDE framework (RIDE-DiVE), the authors established new state-of-the-art results across the board (e.g., reaching 73.44% on iNaturalist2018).

Limitations and Future Work

The authors note that while DiVE provides a clean, elegant pipeline for image classification, its application is currently restricted to recognition tasks. They state that a promising future direction is extending the virtual example distillation framework to handle more complex long-tailed tasks, such as object detection and instance segmentation.

Summary updated

BibTeX
@misc{he2021distilling,
  author = {Yin-Yin He and Jianxin Wu and Xiu-Shen Wei},
  title = {{Distilling Virtual Examples for Long-tailed Recognition}},
  year = {2021},
  eprint = {2103.15042},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.15042},
}
Figure