Abstract
In real-world machine learning applications, datasets often exhibit a long-tailed distribution where a small number of "head" classes contain the majority of samples, while numerous "tail" classes are represented by only a few examples. Standard training objectives like Cross-Entropy typically result in models biased toward head classes. This paper introduces Gradient-Aware Logit Adjustment (GALA) loss, a novel approach that addresses this bias by focusing on the dynamics of gradients during optimization. By dynamically adjusting logits based on accumulated gradients and applying a post-hoc prediction re-balancing strategy, GALA achieves state-of-the-art performance across major long-tailed recognition benchmarks.
Introduction
Deep learning models excel when trained on balanced datasets, but their performance degrades significantly in long-tailed scenarios. The prevailing challenge is that models become over-confident in head classes and fail to generalize to tail classes. While existing methods often focus on re-sampling data or re-weighting loss functions based on label frequency, this research argues that the fundamental issue lies in the imbalance of gradients during the training process.
The Root Cause: Imbalanced Gradients
The authors identify two specific distortions in the gradient space that hinder the learning of tail classes:
- The Gradient Ratio Problem: For tail classes, the "push" from negative gradients (generated by samples of other classes) is disproportionately stronger than the "pull" from positive gradients (generated by samples of the class itself). This imbalance makes it difficult for the model to learn robust representations for sparse classes.
- The "Undiscovered Devil": Negative gradients are not uniformly distributed. Negative gradients originating from head classes are significantly stronger than those from other tail classes. This creates a scenario where the model struggles to distinguish between different tail classes because the "push" between them is too weak, leading to frequent inter-tail misclassifications.
Methodology
The proposed solution, GALA, consists of a two-stage approach: a modified loss function for training and a normalization strategy for inference.
1. GALA Loss (Gradient-Aware Logit Adjustment)
Instead of relying on static class frequencies, GALA modifies the linear classifier's logits by incorporating two margin terms derived from accumulated gradients:
- Positive Gradient Accumulation ($\theta_j$): This term balances the ratio between positive and negative gradients for each class, ensuring tail classes receive sufficient "pull" during optimization.
- Negative Gradient Accumulation ($\phi_k$): This term suppresses excessive negative gradients from head classes, preventing them from overwhelming the feature space of tail classes.
By integrating these terms into the loss function, the optimization process naturally balances the influence of head and tail classes without the need for complex sampling heuristics.
2. Post-hoc Prediction Re-balancing
Despite improvements in the loss function, the underlying feature extractor (e.g., a CNN backbone) often retains some degree of bias. To mitigate this, the authors introduce a test-time strategy that normalizes the prediction probability matrix. By scaling probabilities using an $L_1$ norm and a temperature hyperparameter ($\tau$), the model flattens the prediction gap across classes, leading to more equitable classification.
Experimental Results
The GALA framework was evaluated on four major long-tailed recognition benchmarks: CIFAR100-LT, ImageNet-LT, Places-LT, and iNaturalist 2018. The method consistently outperformed previous state-of-the-art (SOTA) approaches, such as GCL.
- CIFAR100-LT (Imbalance Factor 100): GALA achieved 48.5% top-1 accuracy, a significant 3.62% improvement over GCL.
- iNaturalist 2018: On this naturally long-tailed, large-scale dataset, GALA reached 73.3% accuracy, outperforming the previous SOTA by 1.2%.
- Places-LT: GALA achieved 41.4% accuracy, marking a 0.76% improvement over GCL.
The results indicate that GALA is particularly robust in scenarios with extreme imbalance (e.g., IF=200), where it maintains a wider performance margin over competing methods.
Discussion and Insights
The success of GALA highlights that the dynamics of gradients are a more precise indicator of model bias than simple label counts. A key insight of the paper is the identification of the "Inter-Tail Conflict," where tail classes are misclassified as one another due to insufficient negative gradient pressure between them. Furthermore, the effectiveness of the post-hoc re-balancing step suggests that refining the classifier's final decision boundary is as critical as the optimization of the feature space itself.
Limitations and Future Work
While GALA sets a new benchmark for long-tailed recognition, certain areas warrant further study. The post-hoc strategy's reliance on the temperature parameter $\tau$ suggests a need for more automated hyperparameter tuning. Additionally, while the computational cost of accumulating gradients is manageable, it does introduce additional bookkeeping. Future research could explore integrating gradient-awareness directly into the backbone layers of the network to address feature extractor bias more fundamentally.
Summary updated