Balanced Meta-Softmax for Long-Tailed Visual Recognition

Jiawei Ren, Cunjun Yu, Shunan Sheng, Xiao Ma, Haiyu Zhao, Shuai Yi, Hongsheng Li

In deep learning, datasets are rarely perfectly balanced. Real-world data is often "long-tailed": a few "head" categories appear frequently, while thousands of "tail" categories are seen only occasionally. Standard models optimized with the Softmax function naturally gravitate toward these head classes, leading to poor performance on rare objects.

In their NeurIPS 2020 paper, "Balanced Meta-Softmax for Long-Tailed Visual Recognition," Jiawei Ren and colleagues propose a mathematical correction to this bias, paired with a meta-learning strategy to optimize data sampling.

The Problem: Intrinsic Bias in Softmax

Most deep classifiers use Softmax to convert model outputs (logits) into probabilities. However, the authors demonstrate that Softmax is intrinsically biased in long-tailed scenarios. Because head classes appear more often, training gradients are skewed, pushing decision boundaries away from common classes and suppressing the representation of rare ones.

Existing solutions like re-weighting or re-sampling often introduce instability or lead to overfitting on tail classes. The challenge lies in accounting for the distribution shift between imbalanced training data and a balanced test set without compromising the learning process.

Methodology: The BALMS Framework

The authors introduce BALMS (Balanced Meta-Softmax), a two-pronged approach:

1. Balanced Softmax

The authors derive a new loss function from a probabilistic perspective. By explicitly modeling the label distribution shift, they show that standard Softmax should be adjusted by the number of training samples ($n_j$) for each class. This "normalizes" the logits based on class frequency, ensuring unbiased gradient estimation.

Marginal likelihood across class indices for different imbalance factors. Balanced Softmax (red) maintains a more uniform distribution compared to standard Softmax (blue) and EQL (orange).

2. Meta Sampler

While Balanced Softmax fixes the loss, optimization remains difficult when classes are extremely rare. The Meta Sampler is a learnable version of data re-sampling. Instead of hand-crafted rules, it uses meta-learning (bi-level optimization) to find the optimal sampling rate for each class, guided by a small, balanced "meta-set." To make this process differentiable, they employ the Gumbel-Softmax reparameterization trick.

Key Insights and Results

The most significant theoretical contribution is the proof that standard Softmax is a biased estimator under distribution shift. Adding a simple $\log(n_j)$ term to the logits effectively removes this bias. Furthermore, the authors found that naively combining standard re-sampling with Balanced Softmax can lead to "over-balancing," where the model over-prioritizes tail classes. The Meta Sampler avoids this by finding an optimal balance.

Marginal likelihood on CIFAR-10-LT and CIFAR-100-LT. The combination of Balanced Softmax and Meta Sampler (red line) achieves the most balanced performance across all categories.

Performance Benchmarks

BALMS consistently outperformed state-of-the-art (SOTA) methods across major benchmarks:

  • LVIS Dataset: Achieved an Average Precision ($AP$) of 27.0, surpassing the previous SOTA (25.2).
  • Tail Class Mastery: On LVIS "Rare" classes, BALMS reached an $AP_r$ of 19.6, a significant jump from the next best method's 14.6.
  • CIFAR-LT: Showed robust performance across varying imbalance factors (10 to 200).

Conclusion

BALMS provides an elegant, theoretically grounded solution to long-tailed recognition. By combining an unbiased loss function with a learnable sampling strategy, it ensures that rare objects are treated with the same "respect" as common ones. While the meta-learning component adds computational overhead, the gains in tail-class performance set a new standard for robust visual recognition in the real world.

Summary updated

BibTeX
@inproceedings{ren2020balanced,
  author = {Jiawei Ren and Cunjun Yu and Shunan Sheng and Xiao Ma and Haiyu Zhao and Shuai Yi and Hongsheng Li},
  title = {{Balanced Meta-Softmax for Long-Tailed Visual Recognition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=wyL7SSCnM6y},
}
Figure