Learning Imbalanced Datasets with Maximum Margin Loss

Haeyong Kang, Thang Vu, Chang D. Yoo

Introduction

Training deep neural networks on highly imbalanced datasets remains a significant challenge, as models naturally tend to overfit to majority classes. In real-world scenarios, data often follows a long-tailed distribution where a few classes dominate the sample count. Standard empirical risk minimization (ERM) leads to biased predictions and poor performance on minority classes.

While techniques like class re-weighting and Label-Distribution-Aware Margin (LDAM) loss have been proposed, they often struggle to balance majority and minority class accuracy effectively. This paper introduces a Maximum Margin (MM) loss function that dynamically adjusts decision boundaries by penalizing "hard negative" (misclassified) samples more heavily than "hard positive" ones, particularly when combined with deferred re-balancing schedules.

Methods: Asymmetric Maximum Margin Loss

The core innovation is the Maximum Margin (MM) Loss, inspired by Support Vector Machines (SVMs) but tailored for deep learning. Unlike static margins, the MM loss defines two dynamic margins based on logit outputs:

  1. Hard Positive Margins ($\Delta^+$): Derived from correctly classified samples.
  2. Hard Negative Margins ($\Delta^-$): Derived from misclassified samples.
Conceptual diagram of asymmetric boundary shifting using hard positive and hard negative margins.

The approach employs asymmetric boundary shifting. The loss function is designed so that hard negative margins shift the decision boundary more aggressively than hard positive margins. This forces the model to carve out a wider margin for minority classes that are easily encroached upon by majority classes. To ensure stable optimization, the authors utilize a smooth cross-entropy relaxation rather than a standard hinge loss.

Deferred Re-balancing Optimization Schedule (DRW)

The MM loss is integrated with a Deferred Re-balancing Optimization Schedule (DRW). The model is initially trained normally to establish robust general representations. Later in the training process, the learning rate is decayed, and the re-weighted MM loss is applied. This two-stage approach allows the margin loss to act as a precise fine-tuning mechanism without disrupting early feature learning.

Experimental Results

The authors evaluated the MM loss on artificially imbalanced versions of CIFAR-10 and CIFAR-100, using both long-tailed and step imbalance distributions with ratios up to 100:1.

Performance comparison of MM-based methods against standard baselines on imbalanced CIFAR datasets.

The proposed MM-LDAM-DRW method consistently outperformed state-of-the-art baselines:

  • Step Imbalance: On CIFAR-10 (ratio 100), the method achieved a 21.82% top-1 validation error, significantly lower than ERM (36.70%) and LDAM (33.42%).
  • Long-tailed Imbalance: On CIFAR-100 (ratio 100), the error rate was reduced to 53.70%, compared to 61.68% for standard training.
  • Class-Specific Gains: Per-class analysis indicated that while standard re-weighting (CB-RW) often leads to minority class under-fitting, the MM-DRW approach rescues performance on rare classes without sacrificing majority class accuracy.

Limitations and Conclusion

The MM loss demonstrates strong regularization properties for imbalanced learning. However, it introduces hyperparameter sensitivity, specifically regarding the scaling factor $\beta$ which controls the ratio between positive and negative margin shifts. Optimal values for $\beta$ vary depending on the dataset and imbalance type. Future work should focus on validating this approach on large-scale, naturally imbalanced datasets such as ImageNet-LT or iNaturalist to further confirm its scalability and robustness in real-world applications.

Summary updated

BibTeX
@inproceedings{kang2021learning,
  author = {Haeyong Kang and Thang Vu and Chang D. Yoo},
  title = {{Learning Imbalanced Datasets with Maximum Margin Loss}},
  booktitle = {ICIP},
  year = {2021},
}
Figure