Abstract: In this paper, we study adversarial training on datasets that obey the long-tailed distribution, which is practical but rarely explored in previous works. Compared with conventional adversarial training on balanced datasets, this process falls into the dilemma of generating uneven adversarial examples (AEs) and an unbalanced feature embedding space, causing the resulting model to exhibit low robustness and accuracy on tail data. To combat that, we propose a new adversarial training framework -- Re-balancing Adversarial Training (REAT). This framework consists of two components: (1) a new training strategy inspired by the term effective number to guide the model to generate more balanced and informative AEs; (2) a carefully constructed penalty function to force a satisfactory feature space. Evaluation results on different datasets and model structures prove that REAT can effectively enhance the model's robustness and preserve the model's clean accuracy. The code can be found in https://github.com/GuanlinLee/REAT.
Introduction
Adversarial training (AT) is considered the gold standard for defending neural networks against malicious perturbations. However, most AT research assumes a balanced distribution of classes. In real-world applications, data is often long-tailed: a few "head" classes possess numerous samples, while many "tail" classes have very few.
When standard AT is applied to long-tailed data, it suffers from two major drawbacks. First, Biased Attacks: the adversarial examples (AEs) generated during training tend to be misclassified into head classes, preventing the model from learning to defend tail classes. Second, Feature Encroachment: the dominant head classes occupy the majority of the internal feature space, squashing the representations of tail classes and making them difficult to distinguish.
The REAT Framework
To address these issues, we propose REAT (Re-balancing Adversarial Training), which incorporates two primary innovations:
- Re-Balanced Loss (RBL): Instead of generating AEs uniformly, RBL leverages the concept of the "effective number" of samples. It dynamically adjusts weights during the attack phase to ensure the model generates AEs that are more evenly distributed across all classes. This forces the model to learn the decision boundaries of rare classes during defensive training.
- Tail-sample-mining-based feature margin regularization (TAIL): To resolve feature encroachment, TAIL introduces a regularization term that maximizes the distance between tail class features and other classes using Kullback–Leibler divergence. This "pushes" head class representations away, providing more "territory" for tail classes in the embedding space.
Experimental Results
We evaluated REAT on CIFAR-10-LT, CIFAR-100-LT, and Tiny-ImageNet with varying Unbalanced Ratios (UR). REAT demonstrated superior performance compared to standard PGD-AT and the previous state-of-the-art, RoBal.
- Robustness: On CIFAR-10-LT (UR=50), REAT achieved 32.08% robust accuracy under the AutoAttack benchmark, outperforming RoBal.
- Clean Accuracy: REAT maintained a clean accuracy of 67.33%, which is 1.25% higher than RoBal.
- Adaptive Security: Unlike some previous methods that rely on gradient obfuscation, REAT remains stable against adaptive attacks, proving its robustness is genuine.
Conclusion
REAT effectively addresses the challenges of adversarial training on long-tailed distributions by re-balancing AE generation and optimizing the feature space. While a gap remains between balanced and unbalanced performance due to the inherent data scarcity in the tail, REAT provides a robust foundation for future work in practical, imbalanced settings.
Summary updated