Class-Balanced Softmax: A Bayes Theory-Based Method for Long-Tailed Recognition
Summary
Class-Balanced Softmax (CBS) is a novel logit adjustment method designed to improve deep learning model performance on imbalanced datasets, particularly in long-tailed recognition tasks. Traditional softmax classifiers and even Balanced Softmax often suffer from a "preference issue," where models exhibit significantly higher training error and larger generalization gaps for tail classes. Rooted in a theoretical Bayesian framework and a power-law assumption, CBS introduces a hyperparameter β ≥ 0 that modifies raw logits z_nc to z_nc+βlog|N_c|, effectively generalizing Balanced Softmax. This computationally inexpensive approach seamlessly integrates into existing pipelines. Extensive experiments on large-scale benchmarks like ImageNet-LT, iNaturalist2018, and an LVIS-based dataset demonstrate CBS's high scalability and superior performance, consistently achieving the highest average testing recall and effectively mitigating the preference issue by balancing gradients during training.
Key takeaway
For Machine Learning Engineers addressing long-tailed recognition, implementing Class-Balanced Softmax (CBS) provides a robust solution to the "preference issue" in imbalanced datasets. You should integrate this computationally inexpensive logit adjustment, z_nc+βlog|N_c|, into your deep learning pipelines. This will significantly improve average testing recall and balance performance across head and tail classes, outperforming existing methods like Balanced Softmax, particularly in large-scale, highly imbalanced scenarios.
Key insights
Class-Balanced Softmax (CBS) mitigates model preference for head classes by dynamically rebalancing gradients via a parameterized logit adjustment.
Principles
- Imbalanced data creates a "preference issue" in models.
- Logit adjustment rebalances class-wise gradient signals.
- Power-law functions model class frequency-prediction probability.
Method
CBS modifies raw logits z_nc to z_nc+βlog|N_c| using a calibrated power-law hyperparameter β ≥ 0 to balance gradients during back-propagation.
In practice
- Integrate CBS as a logit adjustment into existing pipelines.
- Calibrate β via grid search, starting in range [1.0, 1.3].
- Combine CBS with contrastive learning for enhanced performance.
Topics
- Long-tailed Recognition
- Imbalanced Classification
- Class-Balanced Softmax
- Logit Adjustment
- Gradient Balancing
- ImageNet-LT
Code references
Best for: AI Engineer, Research Scientist, AI Scientist, Machine Learning Engineer, Computer Vision Engineer
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by cs.CV updates on arXiv.org.