Attack Effort as a Free Poison Detector in Adversarial Training

A backdoor attack hides a secret rule inside a model by planting a few training images that carry a small "trigger", such as a patch, a blended pattern, or a slight warp, and are labeled with a class the attacker chooses. A model trained on this data behaves normally until it sees the trigger, and then it outputs the attacker's class. Adversarial training is a separate tool. It repeatedly asks a small internal attacker to nudge each training image until the model misclassifies it, then trains the model on the nudged image. This note proposes using the internal attacker as a measuring instrument rather than as the defense itself. Prior work found that images carrying a trigger are much harder to push across a decision boundary than clean images, and that when they are pushed, the model's prediction snaps back to their true class (AIBD). If the adversarial training loop records how many attack steps each sample needs before its label flips, it produces a per-sample poison score at essentially no extra cost.

The practical aim is one training run on possibly poisoned data. That run should yield a model with a low backdoor success rate, clean accuracy close to standard training, and modest robustness to small perturbations. Its compute cost should be close to cheap, early-stopped adversarial training, with no separate clean dataset, no second detection pass, and no retraining. The robustness-accuracy trade-off is handled in two ways. The attack budget stays small, because the defense does not depend on adversarial training to wash out the trigger. And the corrective signal is applied only to the small set of samples the effort score flags.

Core Claim

Define the attack effort of sample $i$ at training step $t$ as

$$e_i(t) = \min\{k \le K : \arg\max f_{W_t}(x_i + \delta_i^{(k)}) \ne y_i\},$$

where $f_{W_t}$ is the model with its current weights $W_t$, $y_i$ is the sample's (possibly poisoned) label, $\delta_i^{(k)}$ is the perturbation after $k$ steps of a fixed-step-size projected gradient attack inside a small $L_\infty$ ball, $K$ is a step cap, and $e_i(t)=K+1$ if the label never flips. We keep a running average $s_i$ of $e_i(t)$ across epochs. We also record the flipped-to label $r_i$.

The claim has three parts. First, $s_i$ separates poisoned from clean samples within the first few epochs, because the model learns triggers faster than semantic features (ABL). Second, this separation holds for natural-looking triggers such as SIG and Blend, where per-sample training loss fails. Third, relabeling flagged samples to $r_i$ and continuing training removes the backdoor in the same run. Because clean samples flip in a few steps and the attack stops at the flip, the average cost per batch should sit well below the cap $K$.

A second free signal comes from the clean samples. In a backdoored model, untargeted adversarial examples made from clean images collapse onto the attacker's target class (PBE). The histogram of flip destinations among low-effort samples should therefore spike at the target class, which identifies it without any clean reference data.

Relation to Prior Work

The proposal reuses its central observation from AIBD, which runs multi-step attacks on every sample of an already backdoored model, ranks samples by iteration count, relabels them with their adversarial predictions, and retrains. AIBD's limitations are what motivate this work. It needs a fully trained poisoned model, a full-dataset attack pass, and a retraining stage, and it measures effort once against fixed weights. We measure effort continuously against the moving weights $W_t$, intervene before the backdoor is consolidated, and finish in a single run.

PBE appears to contradict AIBD: in PBE, adversarial examples flow toward the target class, while in AIBD they flow back to the true class. We read the two as consistent, since PBE perturbs clean images and AIBD perturbs triggered ones. The proposal relies on both at once.

ABL is the closest training-time method. It isolates the lowest-loss 1% of samples early in training, then applies gradient ascent to them. The file notes that ABL struggles on SIG and Blend because the loss gap blurs. Our score replaces loss with distance-to-boundary, measured by attack steps, and replaces ABL's fixed threshold with an online one.

Two papers constrain the design. CAT shows that $L_\infty$ adversarial training stops patch triggers only at large budgets that collapse clean accuracy, and that covering all trigger types requires stacking spatial and norm-bounded attacks, which multiplies cost. SAU shows that indiscriminate adversarial training can raise backdoor vulnerability. Both results are reasons not to make adversarial training the defense, and our method does not.

The post-hoc unlearning family assumes a backdoored model already exists and usually needs verified clean data. That family includes I-BAU, which solves a minimax game over a universal trigger with implicit gradients; SAU; and ANP, which perturbs neurons and prunes them. We assume neither.

The online-attacker literature, especially A2, adapts attack steps per sample and includes an early-stopping identity operation. We deliberately keep the measuring attacker's step size fixed, because an adaptive attacker would confound the effort count. An A2-style attacker appears only as a variant to test.

Research Program

The first stage is diagnostic. On BackdoorBench (code, paper), we train with early-stopped attacks at $\epsilon \in \{2/255, 4/255\}$ and $K \in \{5, 10\}$ and log $e_i(t)$ for every sample. We plot the separation between poisoned and clean samples against the epoch, for each attack. We compare this separation, measured as the area under the detection curve, against three cheaper per-sample signals at the same epochs: training loss as in ABL, input-gradient norm, and logit margin. This stage tells us whether the attack is necessary at all.

The second stage is the defense. After a warm-up of a few epochs, samples whose $s_i$ exceeds an adaptive threshold are flagged. The threshold is the upper mode of the bimodal $s_i$ distribution, refit each epoch. Flagged samples receive their reverted label $r_i$ when $r_i$ is consistent across epochs. Otherwise they receive gradient ascent as in ABL. The flip-destination histogram is used to confirm the target class and to reject flags whose original label is not that class, which reduces false positives on hard clean samples. Training then continues as ordinary small-budget adversarial training.

The third stage covers cost and stress tests. We log GPU time per epoch and the average number of attack steps actually used, and we evaluate an adaptive attacker. That attacker knows the defense and adds a margin-shrinking term so that poisoned samples flip as easily as clean ones. This is the most likely way to break the method, and we will report it whether it works or not.

Baselines

The do-nothing reference is standard training on the poisoned data with the same architecture and schedule. It fixes the clean-accuracy ceiling and the undefended attack success rate. AIBD reports that the undefended success rate is 99.73% on CIFAR-10.

The strongest same-setting competitor is ABL, because it also trains a clean model from poisoned data in one pipeline without clean reference data. ABL reports a 7.69% attack success rate averaged over ten attacks on CIFAR-10, with 84.76% clean accuracy against 88.41% for training on clean data only. We rerun it through BackdoorBench with the same poisoning ratios and architecture and tune its isolation ratio and threshold with the same budget as our threshold. Beating ABL means a lower attack success rate at equal or better clean accuracy, especially on SIG and Blend.

The strongest method on attack success rate is AIBD. It reports 0.33% on CIFAR-10 and 0.08% on GTSRB, with 0.00% on BadNets, SIG and WaNet on GTSRB. We charge AIBD its full pipeline cost: training the poisoned model, the full-dataset attack pass, and retraining. Beating AIBD does not mean a lower attack success rate. It means staying within about one percentage point of its success rate and clean accuracy at substantially lower total GPU time, measured on the same hardware.

CAT is the adversarial-training-as-defense competitor. It reports all tested attacks below 6% success rate on CIFAR-10, and its spatial variant reports about 85% clean accuracy against patch attacks. We run CAT at its published budgets and compare clean accuracy and time per epoch. A2 reports 287 seconds per epoch for 20-step projected gradient training on WideResNet-34-10, which anchors what full-strength adversarial training costs. There is no reported result on Lacuna for the per-epoch cost of early-stopped adversarial training, so we will measure it ourselves.

SAU (2.51% attack success rate on CIFAR-10) and I-BAU are included as post-hoc references. They are given the clean data they require, and the comparison table marks that advantage explicitly.

Two ablations isolate the key ingredient. In the first, the effort score is replaced by loss, gradient norm, or margin, with everything else fixed. In the second, effort is measured once at the end of training, AIBD-style, rather than online. The second ablation tells us whether online measurement matters.

Why not just…?

Why not just run AIBD after normal training? This is the real threat. AIBD already achieves near-zero attack success rates with the same underlying signal. Our case rests on cost, on avoiding a three-stage pipeline, and on the possibility that early intervention prevents the backdoor from ever entangling with clean features. The compute-matched comparison settles the question. If single-run effort tracking does not cut total time substantially at matched attack success rate and clean accuracy, the contribution reduces to an engineering convenience, and we will say so.

Why not just use ABL's loss-based isolation, which needs no attack at all? Loss reflects how well a sample is fit, not how far it sits from the decision boundary. The file documents that ABL weakens on SIG and Blend, where triggered and clean losses overlap. The first-stage separation curves test directly whether effort separates where loss does not. If the cheaper proxies, gradient norm or margin, match effort, we will drop the attack and adopt the proxy.

Why not just adversarially train harder, as CAT does? CAT shows that norm-bounded adversarial training needs large budgets to stop patch triggers, at a clean-accuracy cost, and that covering every trigger family requires running two attack types per step. SAU shows that indiscriminate adversarial training can increase backdoor vulnerability. Our small-budget training is not expected to remove the backdoor by itself. The ablation that runs our training without the relabeling step should confirm this; if it does not, the effort-tracking machinery is unnecessary.

Why not just prune neurons afterwards? Fine-Pruning leaves about 30% attack success rate on traffic signs against a pruning-aware attacker. ANP needs clean data and degrades on MobileNet-V2. Both require a backdoored model as a starting point. We include ANP as a post-hoc reference, not as the main competitor.

Proposed Experiments

The experiments use CIFAR-10, GTSRB and Tiny ImageNet via BackdoorBench, with PreAct-ResNet18 and one compact network such as MobileNet-V2 to probe architecture sensitivity. The attacks are BadNets, Blend, SIG, WaNet, label-consistent attacks and sample-specific invisible triggers, at poisoning ratios from 1% to 10%, plus a 50% stress setting following ABL and an all-to-all variant. The metrics are clean accuracy, attack success rate, robust accuracy under small-budget projected gradient attack and AutoAttack, poison-detection true and false positive rates over epochs, average attack steps per sample, and total GPU-hours.

Three checks decide the outcome. The first is whether effort separates poisoned from clean samples by the warm-up epoch on SIG and Blend, where ABL's loss signal is reported to blur. The second is whether the single-run defense matches AIBD within about a point of attack success rate and clean accuracy at clearly lower total compute. The third is whether the defense survives the margin-shrinking adaptive attacker. The all-to-all setting tests whether the target-class histogram fails gracefully when there is no single target.