TL;DR
LiVT (Learning imbalanced data with Vision Transformers) is a novel two-stage framework that finally allows Vision Transformers (ViTs) to be trained from scratch on highly imbalanced, "long-tailed" datasets. By combining label-agnostic Masked Generative Pretraining with a theoretically grounded Balanced Binary Cross-Entropy loss, LiVT sets new state-of-the-art benchmarks without relying on massive external balanced datasets.
What Problem Does This Paper Address?
In the real world, data is rarely balanced. Most datasets follow a "long-tail" distribution where a few "head" classes have thousands of examples, while hundreds of "tail" classes have only a handful. Deep learning models, especially data-hungry Vision Transformers (ViTs), struggle in these scenarios. They tend to overfit on the rare tail classes or develop a massive bias toward the dominant head classes.
While Convolutional Neural Networks (CNNs) have well-established techniques for Long-Tailed Recognition (LTR), ViTs have lagged behind. Most existing ViT-based LTR methods "cheat" by using weights pretrained on massive, balanced datasets like ImageNet-21K. This paper tackles the harder, more honest challenge: Can we train a ViT to handle imbalanced data using only the imbalanced data itself?
Methods
The authors propose a two-stage pipeline called LiVT:
- Masked Generative Pretraining (MGP): Instead of starting with supervised learning (which is "poisoned" by the imbalanced labels), the researchers use a self-supervised approach. They mask out 75% of an image and task the ViT with reconstructing the missing pixels. Because this process doesn't care about labels, it learns robust, generalized features based on the visual structure of the data rather than class frequencies.
- Balanced Fine-Tuning (BFT): Once the model has learned "what things look like," it is fine-tuned for classification. The authors introduce a new loss function, Balanced Binary Cross-Entropy (Bal-BCE). While standard Binary Cross-Entropy is often preferred for ViTs, it fails in long-tailed scenarios. Bal-BCE adds a mathematically derived "logit bias" that compensates for class imbalance, effectively widening the margins for tail classes to ensure they aren't ignored.
Datasets
The researchers evaluated LiVT across several standard and challenging benchmarks:
- CIFAR-10/100-LT: Artificially imbalanced versions of the classic CIFAR datasets.
- ImageNet-LT: A long-tailed subset of ImageNet-1K.
- ImageNet-BAL: A balanced subset created by the authors with the same total image count as ImageNet-LT, used to prove that MGP is robust to label distribution.
- iNaturalist 2018 (iNat18): A massive, naturally long-tailed dataset of species classification.
- Places-LT: A long-tailed version of the Places scene recognition dataset.
Key Insights and Ideas
- Self-Supervision is an LTR Superpower: The "aha moment" is that Masked Generative Pretraining is remarkably robust to data imbalance. As shown in the paper, MGP trained on imbalanced data performs nearly as well as if it were trained on perfectly balanced data. It bypasses the "toxic" influence of skewed labels during the critical feature-learning phase.
- ViTs Scale Better than CNNs for LTR: While a standard ViT-Base performs worse than a ResNet50 when trained supervised on imbalanced data, the LiVT framework allows ViTs to scale their performance with model size much more effectively than CNNs.
- BCE Needs Balancing Too: Most LTR research focuses on standard Cross-Entropy. The authors prove that for ViTs, balancing the Binary version of this loss is superior, providing better numerical stability and faster convergence.
Key Results
LiVT consistently outperforms previous state-of-the-art (SOTA) methods, many of which use complex ensembles or multi-expert architectures:
- ImageNet-LT: LiVT (ViT-B) achieved 60.9% Top-1 accuracy, beating the best ResNet50-based methods (like PaCo at 58.2%) and other ViT recipes (like MAE at 54.5%).
- iNaturalist 2018: LiVT reached a staggering 81.0% accuracy (at 384 resolution), significantly surpassing previous leaders like NCL.
- Convergence Speed: As seen in Figure 2, the proposed Bal-BCE loss leads to much faster and more stable training compared to standard supervised losses.
Limitations and Future Work
The primary limitation acknowledged is that LiVT is a two-stage process. While effective, it cannot yet be deployed in a single, end-to-end training run. The authors note that simultaneous learning of the reconstruction task (MGP) and the classification task (BFT) is difficult because the heavy masking required for good feature learning interferes with the model's ability to classify the image correctly.
Future work may involve finding ways to bridge these two stages into a unified, more efficient architecture, or applying these "imbalance-robust" pretraining insights to other domains like object detection or video analysis.
Summary updated