TL;DR
Adversarial training typically breaks down when applied to real-world, long-tailed (highly imbalanced) datasets because models generate uneven adversarial examples and suffer from compressed feature spaces for tail classes. This paper introduces Re-balancing Adversarial Training (REAT), a framework that uses an adaptive class-weighting loss and feature margin regularization to significantly boost both clean accuracy and adversarial robustness on imbalanced data without relying on easily bypassed gradient obfuscation tricks.
What Problem Does This Paper Address?
Deep learning models are notoriously vulnerable to adversarial attacks—small, imperceptible perturbations designed to fool them. While adversarial training (generating adversarial examples on-the-fly and adding them to the training set) is the gold standard for defense, it assumes the training data is perfectly balanced.
Real-world data, however, is usually "long-tailed," meaning a few "head" classes have tons of samples, while many "tail" classes have very few. When you run standard adversarial training on long-tailed data, two major dilemmas emerge:
- Uneven Adversarial Examples (AEs): The generated AEs are overwhelmingly misclassified into the dominant head classes, meaning the model rarely practices defending tail classes during training.
- Unbalanced Feature Space: Head classes crowd out the feature embedding space, leaving very little room for tail classes, which severely degrades both their clean accuracy and robust accuracy.
Prior work (like RoBal) tried to fix this but relied on a scale-invariant layer that caused gradient vanishing, making it highly vulnerable to simple adaptive attacks. It also ignored "body" classes (the middle ground between head and tail), hurting overall model utility.
Methods
The authors propose REAT, a framework that tackles both the data generation and feature space dilemmas through two novel components:
- Re-Balanced Loss (RBL) for AE Generation: Inspired by the concept of "effective number" in long-tailed recognition, RBL dynamically adjusts class weights during the adversarial attack phase. If too many AEs are being classified into a specific class (like a head class) in the previous epoch, RBL penalizes that class in the current epoch. This forces the generator to produce more diverse, informative AEs distributed across tail classes.
- Tail-sample-mining-based feature margin regularization (TAIL): To fix the feature space imbalance, TAIL treats tail samples as "hard samples." It maps features into a probabilistic embedding space and uses a regularization term based on Kullback-Leibler Divergence (KLD). It maximizes the distance between tail classes and other classes while minimizing the distance between samples of the same tail class, effectively expanding the territory of tail classes in the feature space.
Datasets
The authors evaluated REAT using standard long-tailed benchmarks:
- CIFAR-10-LT and CIFAR-100-LT: Long-tailed variants of standard CIFAR datasets, created by artificially downsampling classes using an imbalance ratio (UR) ranging from 10 to 100.
- Tiny-Imagenet: A downsampled real-world dataset used to evaluate the framework's scalability to more complex, realistic scenarios.
Key Insights and Ideas
- The Illusion of Robustness via Gradient Obfuscation: The authors discovered that the leading baseline, RoBal, didn't actually create a robust model; its defense relied heavily on gradient vanishing in its classification layer. By simply multiplying the output logits by a constant factor (an adaptive attack), RoBal's defense collapsed. REAT avoids this trap by ensuring true adversarial robustness without obfuscating gradients.
- Don't Forget the Body: Previous methods focused exclusively on the extremes (head vs. tail), which inadvertently tanked the performance on intermediate "body" classes. REAT treats the distribution more holistically, yielding much better overall accuracy.
- Data Unbalance vs. Data Hunger: Through ablation studies, the authors showed that the unbalance of data harms adversarial robustness far more than the sheer scarcity (hunger) of data alone.
Key Results
- Superior Robustness: On CIFAR-10-LT (with an imbalance ratio of 50) using a ResNet-18 architecture, REAT achieved 67.33% clean accuracy and 32.08% robust accuracy under AutoAttack, outperforming RoBal (which drops significantly under adaptive attacks).
- Strong Generalization: REAT consistently beats standard PGD-AT across various long-tailed loss functions (Focal Loss, LDAM, Balanced Softmax Loss), demonstrating excellent compatibility with existing long-tailed recognition techniques.
- Better Feature Separation: Visualizations (via t-SNE) confirm that REAT successfully prevents tail class features from being crowded out by head classes, creating a well-separated, balanced feature space.
Limitations and Future Work
Despite the improvements, a noticeable robustness gap still remains between models trained on perfectly balanced datasets and those trained on long-tailed datasets. Tail classes inherently suffer from a lack of data, making high robustness exceptionally difficult to achieve. The authors note that exploring novel network architectures specifically tailored for long-tailed adversarial defense is a vital direction for future work.
Summary updated