Adversarial training makes an image classifier robust to small, deliberately crafted input perturbations. It does this by attacking every training image with several steps of gradient ascent before each weight update, which makes it roughly an order of magnitude more expensive than ordinary training. That expense buys more than robustness. While generating its attacks, the training loop also measures how hard each training example is to push across the decision boundary. Prior work shows this measurement exposes poisoned examples. Backdoor attacks plant a hidden trigger so that any input carrying it is classified as an attacker-chosen class. The poisoned training images are unusually hard to perturb away from their target label, and once pushed across the boundary they fall back to their true class (Adversarial-Inspired Backdoor Defense via Bridging Backdoor and Adversarial Attacks). That defense, however, pays for a separate attack pass over the entire dataset and assumes classes of equal size.
We propose to read the same signal for free from the attack steps that adversarial training already runs, and to make it work on long-tailed data. In long-tailed data a few "head" classes hold most of the examples and many "tail" classes are rare. This setting breaks naive poison detection: clean tail examples are naturally fragile and easy to flip, and a backdoor whose target is a tail class can contribute more training examples to that class than the clean data does. The core idea fits in two sentences. Record, during long-tailed adversarial training, the attack step at which each example first changes its prediction, and compare it to what a clean example of a class that size should need. Examples that are persistently too hard to flip are flagged as likely poisons and relabeled to the class the attack pushes them to, all within one training run and at essentially no extra compute.
Core Claim
Robust training on long-tailed data and backdoor screening can be done in a single adversarial training run with no additional gradient computation, provided the per-example hardness signal is calibrated against class frequency rather than against the example's own class. Within-class calibration fails exactly when it matters. When the backdoor targets a tail class, poisons can outnumber that class's clean examples, so any within-class median is dominated by poisons. On CIFAR-10-LT with an imbalance ratio of 50, for example, the rarest class has about 100 clean images, while a 1% poisoning rate injects over 100 poisons. Instead we fit, across classes, how hard a clean example of a class of size $n_c$ is expected to be. Each class's expectation is estimated while leaving that class out, so a poisoned class cannot pull its own reference toward the poisons.
Concretely, in epoch $t$ let $k_i^t$ be the first inner-loop attack step at which example $i$ is no longer predicted as its label $y_i$. Examples that never flip within the $K$ steps get $K+1$, with a tie-break on their final robust loss. Let $\hat g_t(\log n_c)$ be a smooth regression of median flip step on log class count, fitted across all classes except $c$, and let $\hat\sigma_t$ be its residual spread. The poison score accumulates over epochs, in the spirit of cumulative-entropy tracking:
$$s_i = \sum_{t \le T} \frac{k_i^t - \hat g_t(\log n_{y_i})}{\hat\sigma_t}.$$
Examples whose $s_i$ exceeds a threshold set by the score distribution on the largest head classes are relabeled to their most frequent adversarial label across epochs. They are dropped if that label is unstable. Training then continues with the Balanced Softmax loss. The per-step logits are already computed by the attack, so the only overhead is storing a few scalars per example.
Positioning Against Prior Work
Three papers motivate the signal and the setting. Adversarial-Inspired Backdoor Defense (AIBD) finds that poisoned samples resist gradient attacks and that, once forced across the boundary, their adversarial label realigns to the true class. It supplies our detection cue and our relabeling rule. We differ in two ways: we obtain the cue as a byproduct of training rather than through a dedicated full-dataset attack pass, and we correct for class imbalance, which AIBD never faces.
The long-tailed literature explains why that correction is necessary. Adversarial training shrinks the classifier's weights in a way that disproportionately collapses minority-class boundaries (Understanding the Impact of Adversarial Robustness on Accuracy Disparity). It also under-explores the neighborhoods of tail examples (Adversarial Training Over Long-Tailed Distribution). Clean tail examples should therefore flip early, while head examples flip late. An uncalibrated "hard to flip" rule would mostly flag clean head data.
Long-Tailed Backdoor Attack Using Dynamic Data Augmentation Operations (D²AO) supplies the threat. Its sample-specific triggers survive the heavy augmentation that long-tailed training relies on, reaching 97.01% average attack success at around 76% clean accuracy on CIFAR10-LT with an imbalance ratio of 50. That work covers only the attack, under ordinary training, so it says nothing about adversarial training.
Three defenses constrain the design by failing in the long tail for reasons we must avoid. Anti-Backdoor Coreset Selection via Cumulative Entropy (ABCS) keeps high-entropy examples and retrains on a coreset of about 55% of the data. On long-tailed data, slow-learning tail classes stay high-entropy and quickly learned head classes do not, so the class-frequency confound is built into the criterion. Not All Poisons are Created Equal (EPIC) prunes examples that sit isolated in last-layer gradient space, and rare classes naturally form such isolated clusters. LT-Defense treats the backdoor target as an artificial head class, and its authors state that naturally long-tailed tasks produce false positives.
Our use of a regression across classes, fitted while leaving each class out, is a direct answer to the common failure of all three. Each of them asks "is this example unusual for its class?", and in the long tail that question has no reliable answer.
The training recipe itself is borrowed. Revisiting Adversarial Training Under Long-Tailed Distributions (AT-BSL) shows that plain adversarial training with Balanced Softmax and diverse augmentation matches or beats more elaborate pipelines while using about 45% less memory than RoBal. It is our host algorithm. Posterior Mismatch Matters (PAT) obtains better worst-class robustness at the price of a surrogate model plus weight perturbation. We do not compete on that axis, but PAT is a reference point for robust fairness. Breadcrumbs also reuses training history to avoid extra computation, but it caches feature vectors for clean accuracy. We cache only scalars, and we use them for security.
Research Program
The work has three parts.
The first is a measurement study, run before any defense is built. It asks whether the flip-step signal survives adversarial training at all. Adversarial training makes clean examples harder to flip, which could erase the gap AIBD observed in ordinarily trained models. It also asks how the signal's distribution depends on class frequency on clean long-tailed data, and how it shifts when poisons target a head class versus a tail class. If, after frequency calibration, the poison/clean gap closes under adversarial training, the project stops here and reports that negative result.
The second part builds the defense described above. It includes ablations on the calibration reference: none, within-class, and across-class with each class left out. It also tests the warm-up length before scores are trusted and the choice between relabeling and dropping.
The third part studies an adaptive attacker who knows the defense and designs triggers to be easy to flip, for example weaker or lower-magnitude triggers. We measure the trade-off this forces between staying hidden from our score and keeping a high attack success rate under adversarial training.
Baselines
The naive reference is AT-BSL (Revisiting Adversarial Training Under Long-Tailed Distributions) trained on poisoned data with no screening. It answers whether adversarial training already suppresses backdoors. On robustness, the AT-BSL paper reports a +6.66% gain under AutoAttack over RoBal on CIFAR-10-LT, and RoBal reports 74.51% natural and 32.04% AutoAttack accuracy at an imbalance ratio of 50. We found no reported result on Lacuna for AT-BSL's attack success rate under backdoor poisoning, so we measure it.
The strongest existing competitor for screening is AIBD followed by AT-BSL retraining. It uses the same cue we do, so it isolates exactly our two claims: that the cue is free, and that calibration matters. A second strong competitor is ABCS with per-class entropy thresholds, followed by AT-BSL on the coreset. It is the most compute-efficient published screener. We also run EPIC and LT-Defense-style head-feature detection, adapted to vision, as further competitors.
All methods share the same architecture, data, augmentation, adversarial training schedule and attack budget, and receive the same tuning budget for their thresholds. Wall-clock time and GPU memory are reported end to end, including any separate detection or retraining runs.
PAT is included as the strongest robust-fairness reference. It reports worst-class AutoAttack accuracy of 26.23% on CIFAR10-LT at an imbalance ratio of 50, against about 15.59% for AT-BSL and about 22.79% for AT-SD. We stack our screening onto PAT as well, to show the screening is independent of the host algorithm.
The key ablation is our method with within-class calibration instead of calibration across classes. It isolates the ingredient we claim is necessary.
We count the method as beating these baselines if it meets three conditions. Attack success must fall to the level of AIBD followed by retraining, or lower. Clean-tail false positive rate must be lower. Worst-class AutoAttack accuracy on unpoisoned data must stay within noise of unscreened AT-BSL. Total cost must be within a few percent of a single AT-BSL run.
Why not just…?
Why not just rely on adversarial training to wash out the backdoor? It may partly do so, and the AT-BSL baseline measures this directly. But D²AO triggers are built to survive strong augmentation, and AIBD's finding that poisons are especially hard to perturb suggests the trigger shortcut is a large-margin feature that an $\ell_\infty$ inner loop does not remove. If AT-BSL alone brings attack success near chance for every trigger type, we will report that and narrow the contribution to the adaptive-attack analysis.
Why not just run AIBD or ABCS with per-class thresholds and then adversarially train? This is the real threat on detection quality, and we include it as a baseline rather than dismiss it. It has two weaknesses. Per-class thresholds rely on the class's own distribution, which breaks when poisons outnumber clean examples in a tail target class; the within-class ablation tests exactly this. It also costs at least one extra full pass: a dedicated attack over the dataset for AIBD, or warm-up plus retraining for ABCS. If calibrated two-stage screening matches our detection, our contribution reduces to removing that cost, and the compute accounting will show how large that saving is.
Why not just use a frequency-aware gradient or feature outlier detector such as EPIC? Natural tail classes are themselves sparse outliers in gradient and feature space, and EPIC's isolated-cluster rule cannot distinguish rarity from poisoning. Our clean-data control, which reports false positives by class size, makes this failure measurable rather than assumed.
Proposed Experiments
Experiments run on CIFAR-10-LT at imbalance ratios 50 and 100, and on CIFAR-100-LT at ratio 10, matching the D²AO setting. TinyImageNet-LT, following PAT, provides scale. Backbones are ResNet-18 and WideResNet-34-10. Attacks are BadNets, SIG, WaNet and D²AO at several poisoning rates, with the target class placed in the head, the middle and the extreme tail. Robustness is reported under AutoAttack only, since PGD-only evaluation of long-tailed models can show illusory gains (Adversarial Robustness Under Long-Tailed Distribution). Metrics are clean accuracy, AutoAttack accuracy, worst-class AutoAttack accuracy, attack success rate, detection true and false positive rates broken down by class size, wall-clock time and memory.
Three checks decide the project. First, on clean long-tailed data, does the across-class calibrated score keep false positives on tail examples near the head-class rate, while the uncalibrated and within-class variants do not? Second, with a tail target class and poisons outnumbering clean examples, does detection hold where within-class calibration collapses? Third, does the whole procedure leave worst-class AutoAttack accuracy unchanged when no poison is present? This matters because silently discarding scarce tail data would undo exactly what long-tailed adversarial training is meant to protect.
References
- Adversarial-Inspired Backdoor Defense via Bridging Backdoor and Adversarial Attacks
- Understanding the Impact of Adversarial Robustness on Accuracy Disparity
- Alleviating the Effect of Data Imbalance on Adversarial Training
- Long-Tailed Backdoor Attack Using Dynamic Data Augmentation Operations
- Anti-Backdoor Coreset Selection via Cumulative Entropy
- Not All Poisons are Created Equal: Robust Training against Data Poisoning
- LT-Defense: Searching-free Backdoor Defense via Exploiting the Long-tailed Effect
- Revisiting Adversarial Training under Long-Tailed Distributions
- Adversarial Robustness Under Long-Tailed Distribution
- Posterior Mismatch Matters: Adversarial Training for Long-Tailed Robustness
- Breadcrumbs: Adversarial Class-Balanced Sampling for Long-Tailed Recognition