Balanced-Softmax Classifier Retraining Baseline for Long-Tailed Recognition

Discover how Balanced-Softmax classifier retraining (BS-cRT) boosts few-shot accuracy on long-tailed datasets like CIFAR-100, ImageNet, and Places.

martes, 28 de julio de 2026 • 5 min read • Q2BSTUDIO Team

Mejora de Precisión Few-Shot con Actualización del Clasificador

In the field of machine learning, class imbalance is one of the most persistent obstacles, especially when data follows a long-tailed distribution. In this type of distribution, a few classes (head) concentrate the majority of samples, while numerous classes (tail) have very few examples. This phenomenon is common in real-world applications such as image classification, financial fraud detection, rare disease diagnosis, or object identification in urban environments. Models trained with standard loss functions, like cross-entropy, tend to favor majority classes, creating a bias that harms performance on minority classes. To mitigate this problem, various strategies have emerged, among which Balanced Softmax stands out. It modifies the softmax function by incorporating an empirical prior based on class frequency, allowing the model to pay more attention to under-represented classes during training. However, even with Balanced Softmax, the final classifier may retain some head bias, leaving residual error in the tail. Recent research proposes a complementary approach: retrain only the classifier after training the backbone with Balanced Softmax. This technique, known as BS-cRT (Balanced Softmax classifier retraining), has shown significant improvements in few-shot accuracy on datasets such as CIFAR-100-LT, CIFAR-10-LT, ImageNet-LT, and Places-LT.

The BS-cRT procedure consists of two stages. In the first, a backbone is trained together with a cosine classifier using the Balanced Softmax function, which adjusts the probability of each class according to its frequency in the training set. This yields more balanced latent representations. In the second stage, the backbone is frozen and only the linear classifier is retrained, but now with balanced episodic batches, i.e., batches containing the same number of examples per class. This retraining maintains the Balanced Softmax objective with the same empirical prior, and during inference un-scaled cosine logits are used. Experimental results show that this simple modification yields consistent gains: for example, on CIFAR-100-LT with an imbalance factor of 100, few-shot accuracy increases by +5.15 points; on CIFAR-10-LT the gain is +5.83 points; on ImageNet-LT it achieves +6.92 points; and on Places-LT +9.78 points. However, a slight trade-off between top-1 accuracy and few-shot accuracy is observed on ImageNet-LT, suggesting that the choice of threshold or balancing strategy should be adapted to the use case.

Additionally, Counterfactual Boundary Risk Minimization (CBRM) has been analyzed, an extension that examines regions near decision boundaries using prototype-based features. CBRM identifies two main failure modes. The first is that scaled-logit cosine margins tend to destabilize training, causing the classifier not to converge properly. The second is that corrected hardest-negative probes remain anchored to head classes, indicating that boundary supervision must account for class frequency to be effective. These findings reinforce the utility of BS-cRT as a practical and simple baseline for improving long-tail performance without modifying the entire architecture.

From a business perspective, handling imbalanced data is critical in numerous sectors. In fraud detection, for example, fraudulent transactions are extremely rare compared to legitimate ones. A model that ignores tail classes could miss important frauds. Similarly, in predictive maintenance of industrial machinery, failures are infrequent but costly events. Balanced Softmax and classifier retraining techniques offer a viable solution to improve sensitivity to these cases without sacrificing too much overall accuracy. At Q2BSTUDIO, as a software and technology development company, we apply these concepts in our custom artificial intelligence solutions. For instance, we have developed classification systems for financial sector clients that integrate Balanced Softmax in their training pipeline, combined with classifier retraining to maximize accuracy on suspicious transactions. These systems are deployed on AWS or Azure cloud infrastructure, ensuring scalability and low operational cost.

Furthermore, cybersecurity directly benefits from these advances. Intrusion detection systems, malware analysis, or anomaly pattern identification in networks often face long-tailed distributions. Applying BS-cRT allows models to learn to recognize uncommon threats without generating excessive false positives. Q2BSTUDIO offers cybersecurity services including pentesting and development of robust AI models against imbalanced data, helping companies protect their digital assets. Likewise, in Business Intelligence (BI), tools like Power BI can integrate predictive models that handle long-tailed distributions, providing more accurate insights into atypical behaviors in sales, inventories, or customers. Our process automation developments also benefit from these techniques, allowing AI agents to learn from scarce data without losing efficiency. For example, in recommendation systems where niche products have few interactions, a retrained classifier can significantly improve hit rate.

Research on Balanced Softmax and BS-cRT demonstrates that it is not always necessary to completely redesign a model to address class imbalance. Small interventions in the classification stage, such as retraining with balanced batches, can yield substantial improvements. This is especially relevant for companies that already have pre-trained models and seek to optimize them for specific scenarios without incurring high costs of data collection or full retraining. At Q2BSTUDIO we offer consulting and development services to adapt these methodologies to the specific needs of each organization, whether through custom applications, cloud integration, or artificial intelligence solutions. If your company faces imbalanced data problems, we invite you to explore our capabilities in artificial intelligence and cloud computing.

In conclusion, Balanced Softmax combined with classifier retraining represents a practical and effective advance for long-tail problems in machine learning. Its implementation is relatively simple and results are consistent across multiple datasets. With the support of cloud infrastructure and AI expertise, at Q2BSTUDIO we are ready to help organizations overcome these challenges, improving accuracy on minority classes without compromising overall performance. The key is to understand that sometimes the solution is not to reinvent the wheel, but to intelligently adjust the classifier.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.