Long- Tailed Recognition via Weight Balancing

Shaden Alshammari, Yu-Xiong Wang, Deva Ramanan, Shu Kong · DOI

Abstract

Most machine learning models struggle with "long-tailed" data distributions, where a few dominant classes provide the bulk of training examples while rare classes are underrepresented. This paper demonstrates that standard models develop disproportionately large weight norms for common classes, leading to a systematic bias during inference. By revisiting and properly tuning classic regularizers—specifically Weight Decay and MaxNorm constraints—the authors propose a Weight Balancing approach that achieves state-of-the-art accuracy on long-tailed benchmarks without the need for complex architectural modifications or expensive self-supervised pre-training.

Introduction

In real-world applications, data is rarely distributed uniformly. Whether in autonomous driving, medical imaging, or species classification, datasets typically follow a long-tailed distribution: a "head" of frequent categories and a "tail" of rare ones. Standard deep learning models are inherently "greedy," optimizing for overall accuracy. This objective naturally favors the head classes, often resulting in a model that fails to recognize rare but critical tail categories.

Previous research into Long-Tailed Recognition (LTR) has largely focused on complex interventions, such as specialized loss functions, data oversampling, or multi-expert architectures. This paper takes a different path, identifying a fundamental structural imbalance in the classifier itself: the magnitude of the parameters (weight norms) for common classes grows significantly larger than those for rare classes. This disparity causes the model to over-predict the "popular" categories simply because their corresponding weights exert a stronger pull on the final prediction.

The Weight Norm Disparity

The authors observe a direct correlation between class frequency in the training set and the $L_2$ norm of the corresponding weights in the final classification layer. In a naive model, the weights for head classes act like a magnet, dominating the logit space. To counter this, the paper advocates for Weight Balancing, focusing on three fundamental regularization techniques:

  1. Weight Decay (WD): While standard in most training pipelines, the authors found that the default values (e.g., 2e-4) are often suboptimal for long-tailed data. Increasing and carefully tuning this hyperparameter can significantly mitigate the growth of head-class weights.
  2. MaxNorm Constraint: This technique enforces a hard cap on the $L_2$ norm of weights within a specific radius. Unlike hard normalization (which forces all weights to a specific value), MaxNorm allows the weights of rare classes to grow and differentiate themselves while preventing the weights of common classes from exploding.
  3. L2-Normalization: This forces all weight vectors to have a magnitude of 1. While this theoretically eliminates the norm disparity, the authors found it often proves too restrictive, potentially hampering the model's ability to learn nuanced features.

Proposed Methodology: Two-Stage Training

The researchers propose a streamlined two-stage pipeline to implement these insights effectively:

  • Stage 1: Feature Learning. The backbone network is trained using standard cross-entropy loss. The key intervention here is the aggressive tuning of Weight Decay to ensure a more balanced feature space from the outset.
  • Stage 2: Classifier Learning. The backbone is frozen to preserve the learned features. The final classification layer is then retrained using a class-balanced loss function combined with both Weight Decay and the MaxNorm constraint. This stage specifically targets the alignment of the classifier weights without disturbing the underlying feature representations.

Experimental Results

The approach was evaluated on several rigorous LTR benchmarks, including CIFAR100-LT, ImageNet-LT, and the naturally long-tailed iNaturalist 2018 dataset.

The results on CIFAR100-LT (with an imbalance factor of 100) highlight the efficacy of the method:

  • Baseline Model: 38.38% accuracy.
  • Tuned Weight Decay (Stage 1 only): 46.08% accuracy.
  • Full Weight Balancing (WD + MaxNorm + Stage 2): 53.35% accuracy.

Remarkably, this simple regularization-based approach outperformed significantly more complex state-of-the-art methods. For instance, it surpassed RIDE (49.1%), ACE (49.6%), and PaCo (52.0%), many of which rely on ensembles or computationally expensive self-supervised pre-training phases.

Key Insights

  • Weight Norm as a Proxy: The magnitude of a class's weight vector serves as a proxy for its frequency. Controlling this norm is a direct way to control prediction bias.
  • The "Freespace" Advantage: MaxNorm is superior to standard L2-normalization because it provides "freespace" inside the norm ball. This flexibility allows the model to maintain the necessary discriminative power for rare classes while still imposing a ceiling on dominant ones.
  • Marginal Likelihood: The authors demonstrate that Weight Balancing moves the model toward a uniform marginal likelihood, meaning the model becomes equally likely to predict any class when presented with a balanced test set—the ideal state for an LTR system.

Conclusion and Future Work

This research serves as a reminder that fundamental regularization techniques, when properly understood and applied, can be as effective as—or more effective than—complex new architectures. By focusing on the weight norms of the classifier, the authors provide a simple, orthogonal solution that can be integrated into existing LTR pipelines.

Future work may explore how these weight-balancing constraints interact with advanced data augmentation strategies or multi-expert models. Additionally, the authors note that while these techniques improve class fairness, they must be applied ethically to ensure that balancing does not inadvertently introduce other forms of bias if training data is partitioned maliciously.

Summary updated

BibTeX
@misc{alshammari2022long,
  author = {Shaden Alshammari and Yu-Xiong Wang and Deva Ramanan and Shu Kong},
  title = {{Long- Tailed Recognition via Weight Balancing}},
  year = {2022},
  eprint = {2203.14197},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.14197},
}
Figure