Abstract
Long-tailed visual recognition tasks pose great challenges for neural networks on how to handle the imbalanced predictions between head (common) and tail (rare) classes, i.e., models tend to classify tail classes as head classes. While existing research focused on data resampling and loss function engineering, in this paper, we take a different perspective: the classification margins. We study the relationship between the margins and logits and empirically observe that the uncalibrated margins and logits are positively correlated. We propose a simple yet effective MARgin Calibration approach (MARC) to calibrate the margins to obtain better logits. We validate MARC through extensive experiments on common long-tailed benchmarks including CIFAR-LT, ImageNet-LT, Places-LT, and iNaturalist-LT. Experimental results demonstrate that our MARC achieves favorable results on these benchmarks. In addition, MARC is extremely easy to implement with just three lines of code. We hope this simple approach will motivate people to rethink the uncalibrated margins and logits in long-tailed visual recognition.
Introduction
In real-world scenarios, visual data is rarely distributed uniformly. While standard benchmarks like ImageNet are curated for balance, real-world datasets typically exhibit a "long-tailed" distribution: a few "head" classes (like common pets) possess thousands of examples, while numerous "tail" classes (like rare species) have only a handful. Standard neural networks trained on such data tend to become biased, frequently misclassifying rare tail instances as common head classes.
Existing strategies for long-tailed learning generally involve data resampling (over-sampling rare classes or under-sampling common ones) or loss function engineering (re-weighting losses to favor rare classes). However, these methods can lead to overfitting on the tail or distortion of feature representations. In this work, we explore a different perspective: the classification margin.
The Logit-Margin Bias
A key observation in long-tailed learning is that models develop biased decision boundaries. Because head classes are seen more frequently during training, the model pushes decision boundaries further away from them to minimize training error, resulting in larger "territories" in the feature space for common categories.
Empirically, we observe that uncalibrated margins and logits are positively correlated with class frequency. As shown in the figure below, head classes (lower indices) exhibit significantly higher logits and margins compared to tail classes (higher indices). This imbalance leads to overconfidence in common categories and poor performance on rare ones.
MARgin Calibration (MARC)
To address this bias, we propose MARgin Calibration (MARC), a simple two-stage approach that decouples feature learning from classifier boundary adjustment.
- Stage 1: Standard Training: The model is trained normally using standard cross-entropy loss and instance-balanced sampling. This ensures the learning of high-quality, undistorted feature representations.
- Stage 2: Calibration: The model's backbone and classifier weights are frozen. We then learn a simple linear transformation for the margins using only two learnable parameters per class ($\omega_j$ and $\beta_j$): $$\hat{d}_j = \omega_j \cdot d_j + \beta_j$$ The calibrated logit is then derived from this adjusted margin. This stage is extremely lightweight; for a 1,000-class dataset, only 2,000 additional parameters are learned, and the implementation requires just three lines of code.
Experimental Results
We validated MARC across several major benchmarks, including CIFAR-LT, ImageNet-LT, Places-LT, and iNaturalist 2018. MARC consistently achieves state-of-the-art performance by significantly boosting accuracy on tail classes while maintaining competitive overall performance.
On ImageNet-LT, MARC reached an overall accuracy of 52.3%, notably increasing "few-shot" (tail) class accuracy to 36.6%—a massive improvement over the 6.6% achieved by standard Softmax. Similar gains were observed on iNaturalist 2018, where MARC achieved 70.4% Top-1 accuracy, surpassing other calibration-based methods like DisAlign.
Conclusion and Limitations
MARC offers a simple yet powerful solution for long-tailed visual recognition. By focusing on margin calibration rather than complex resampling or loss weighting, it achieves superior results with minimal computational overhead.
However, a common trade-off in long-tailed learning persists: improving tail performance often comes at a slight cost to head class accuracy. Future work may explore joint optimization of feature representations and margin calibration to mitigate this drop. Nonetheless, MARC's efficiency and ease of implementation make it a highly practical tool for real-world imbalanced datasets.
Summary updated