Adversarial purification is a defense that cleans an input before an unmodified classifier sees it. It adds noise to the image and then uses a generative model trained only on clean data to reconstruct a clean-looking version. The approach is attractive because it avoids adversarial training, which is the expensive practice of retraining the classifier on attacked examples. It has two costs, though. Every input gets washed at the same strength, so benign images lose fine detail and clean accuracy drops. And the washing is usually slow. This proposal makes purification strength a per-input decision, set by a cheap signal that adversarial perturbations themselves supply: they are fragile. An imperceptible perturbation depends on exact high-frequency pixel patterns. A mild lossy operation such as light JPEG compression or a band-limited low-pass filter tends to erase it, so the classifier's prediction changes sharply. A clean image survives the same operation almost unchanged. We measure that prediction change and use it to set how much noise a single-step consistency model removes. A consistency model is a generator distilled so that it maps a noisy image at any noise level back to a clean one in one network evaluation. Clean images therefore get a light touch and suspicious images get a deep wash, and the cost stays at one purifier call regardless of depth.
The central empirical bet is an attacker's dilemma. An adaptive attacker who wants to avoid the deep wash must make the perturbation survive the mild probe. The protective-perturbation literature shows this requires moving energy into lower frequencies or raising magnitude (MetaCloak had to build blur and crop robustness into its optimization and paid in visibility). Whether such probe-robust perturbations can still fool the classifier after a shallow one-step purification, within a fixed ℓ∞ budget, is the question this work settles. If they can, the idea fails, and we say so.
Core Claim
At matched clean accuracy, a purifier whose noise level is set per input from a prediction-fragility score reaches higher robust accuracy than the best fixed noise level. This gain must hold under fully adaptive, deterministic white-box attacks that target the score and the purifier jointly. The classifier needs no training. The only fitted component is a two-parameter map from score to noise level, calibrated once on held-out data. The adaptive-versus-best-fixed comparison on the clean/robust frontier is the claim. Everything else supports it.
Relation to Prior Work
Four groups of papers shape this proposal, and each plays a different role.
Three papers supply the method.
- DiffPure established the recipe of noising to a time $t^*$ and then reversing. It showed that too large a $t^*$ destroys class semantics, and that multi-step reversal is slow. We keep its recipe but make $t^*$ input-dependent.
- Consistency Purification and OSCP made purification one-step, at CIFAR/64-pixel scale and at ImageNet scale respectively. Both use a single fixed noise level. We use their purifiers as the engine. The one-step property is what makes variable depth free: with multi-step diffusion, a deeper wash means more solver steps, but with a consistency model it only means a different starting noise level.
Two papers motivate the proposal.
- IntensPure showed that estimating attack intensity and purifying accordingly preserves benign accuracy (88.36% versus 74.73% for DiffPure on Market1501). Its estimator relies on re-identification-specific retrieval stability and attribute checks, which do not exist in classification. Our fragility score is domain-agnostic and uses only the classifier's own outputs.
- ADP observed that score norms are larger on adversarial inputs but did not turn this into a depth controller. We compare against a score-norm gate directly.
Two papers constrain the design.
- ADDT showed that diffusion purifiers often survive only because of randomness. When the attacker knows the seeds, robust accuracy falls from about 47% to about 16%. A one-step deterministic purifier with a deterministic gate removes that crutch, so every result here is reported under its deterministic white-box protocol.
- ZeroPur purifies inside the classifier's own feature space. The file flags this reliance on classifier gradients as a potential weakness against adaptive attacks such as BPDA. Our gate also reads the classifier's outputs, so it inherits the same concern and must be attacked directly.
One paper is the closest competitor on the same question. MANI-Pure attacks clean-accuracy loss from the frequency side by shaping noise across spectral bands, bringing the CIFAR-10 clean gap to 0.59%. It still uses multi-step reversal and the same shaping for every input. Our gate is orthogonal to its spectral shaping, so we test both alone and combined.
Research Program
The fragility score compares the classifier's predictive distribution on the input with its distribution after a mild probe transform $T$:
$$s(x) = \mathrm{KL}\big(p_f(\cdot \mid x)\,\|\,p_f(\cdot \mid T(x))\big)$$
Here $p_f$ is the frozen classifier's softmax output and $T$ is a differentiable band-limiting filter. We use the differentiable filter rather than JPEG so that the attacker receives exact gradients and we are not hiding behind non-differentiability. The purification noise level is
$$\sigma(x) = \sigma_{\min} + (\sigma_{\max}-\sigma_{\min})\,\mathrm{sigmoid}\big(a\,(\log s(x) - b)\big)$$
where $\sigma_{\min} > 0$ guarantees that every input is purified at least lightly, and $a, b$ are fit on a held-out split of clean and standard-PGD examples. The consistency model then maps the image, noised to $\sigma(x)$, back to a clean image in one step, and the frozen classifier predicts. The total cost is two classifier passes and one purifier pass.
The program has three stages.
The first stage is characterization. For clean images, standard attacks (PGD and AutoAttack), and score-suppressing adaptive attacks, we measure the distribution of $s(x)$ and the radial frequency spectrum of the perturbations. The purpose is to test whether suppressing $s$ forces spectral mass downward, as MetaCloak's tension suggests.
The second stage is the defense and its frontier. We sweep $\sigma_{\min}$ and $\sigma_{\max}$ and trace clean accuracy against robust accuracy. We compare that frontier with the fixed-$\sigma$ frontier obtained with the same purifier.
The third stage is adversarial stress. We attack the full pipeline end to end. The attacker's loss is cross-entropy after purification plus $\lambda\, s(x+\delta)$, swept over $\lambda$. It uses exact gradients through the filter, the gate, and the one-step purifier, with known seeds and no randomness. This is the configuration that decides whether the dilemma is real.
Baselines
The naive reference points are the undefended standard classifier and the same classifier behind a fixed-level single-step purifier. For each dataset we report the fixed-level purifier at every $\sigma$ on our sweep grid, not just one tuned value. Beating this curve is the proposal's only real claim.
The key ablation is the best fixed $\sigma$ chosen with oracle knowledge of the test attack. Our method must lie strictly above that curve at some clean accuracy within one point of undefended. We add a second ablation that replaces the fragility score with the ADP-style score-norm signal, which isolates whether prediction fragility specifically carries the information.
The strongest existing methods, all rerun under identical threat models, are the following.
- MANI-Pure is the strongest method on clean accuracy. It reports a 0.59% clean gap on CIFAR-10 and a 2.15% AutoAttack gain with a CLIP ViT-L/14 classifier.
- CARSO is the strongest on robust accuracy. It reports 76.13% AutoAttack accuracy on CIFAR-10, with roughly a 5.6% clean penalty, using an adversarially trained backbone and eight reconstructions.
- OSCP is the ImageNet speed-and-robustness reference, reporting 74.19% AutoAttack accuracy at about 0.1 seconds per sample.
- ZeroPur is the generator-free reference, reporting 69.62% AutoAttack accuracy on CIFAR-10.
These reported numbers come from each paper's own evaluation and are not directly comparable. We therefore rerun MANI-Pure and ZeroPur on the same WideResNet classifier, the same 1,000-image test subsets, and the same attack budget (AutoAttack plus EOT, and the deterministic white-box protocol at ℓ∞ 8/255 for CIFAR and 4/255 for ImageNet). Each method gets an equal hyperparameter-tuning budget on a shared validation split. CARSO is compared on its reported configuration, clearly marked, because it requires its own adversarially trained backbone.
Beating the field means one of two things under the deterministic adaptive attack: matching MANI-Pure's clean gap with higher robust accuracy, or matching fixed-depth robust accuracy with at least three points more clean accuracy. In both cases, latency must stay within a factor of two of OSCP.
As the reference for avoiding training cost, we compare against Robustness Tokens. That method recovers DINOv2-G white-box ImageNet accuracy from 0.3% to 63.1% at 85.2% clean, with only 200 steps of token training. We report both its numbers with secret tokens and its numbers when the attacker knows the tokens.
Why not just…?
Why not just use the probe transform itself (JPEG or blur) as the defense? Cheap preprocessing works against fragile, non-adaptive perturbations, as the poisoning results in APBench show. It fails once the attacker optimizes through the transform: MetaCloak's EOT perturbations survived Gaussian filtering, and in IMPRESS JPEG and resizing did not remove the perturbations that the optimization-guided method removed. Blurring also costs detail on every image. We include "probe as defense" as a row in every table. The proposal uses the probe only as a sensor, not as the cleaner.
Why not just tune one fixed shallow noise level? This is the most serious threat. If the fragility score adds nothing beyond a well-chosen constant, the frontiers will coincide. That is why the oracle-best fixed $\sigma$ is the main ablation, and why we will report a null result if the adaptive curve does not clear it under score-suppressing attacks.
Why not just shape the noise spectrally as MANI-Pure does? Spectral shaping and per-input depth address different sources of clean-accuracy loss: which frequencies get noised versus how much. If shaping alone already closes the gap to 0.59%, the gate's value must come from robustness at that clean level. We test shaping alone, gating alone, and both combined on a one-step purifier.
Why not just adversarially train, or tune robustness tokens? Full adversarial training drops CIFAR-10 clean accuracy to about 82% (TART reports 81.76%). Its inner loop multiplies training cost, which is prohibitive for foundation backbones. Robustness tokens avoid most of that cost, but their security depends on keeping the tokens secret. Our pipeline has no secret parameters and no min-max training. Its total one-time cost (calibrating $a$ and $b$) and its per-query cost are reported alongside the adversarial-training and token baselines.
Decisive Checks
The work stands or falls on three measurements.
The first, and the main claim, is the frontier comparison. On CIFAR-10 with a standard WideResNet, the adaptive frontier must lie above the oracle fixed-$\sigma$ frontier under the deterministic white-box attack with score suppression, at every $\lambda$ we sweep. We replicate this on CIFAR-100 and on ImageNet using an OSCP-style one-step purifier.
The second is the dilemma itself. We plot, for adaptive attacks, final robust accuracy against the low-frequency fraction of perturbation energy. The dilemma predicts that attacks which achieve low $s(x)$ concentrate their energy in low frequencies and still fail after shallow purification.
The third is clean-image cost. Benign accuracy after gating should approach undefended accuracy, with the IntensPure-style gap as the target. Wall-clock latency per image is reported against OSCP and DiffPure.
A negative result on the first measurement would still be informative. It would show that input-dependent depth offers no advantage against adaptive attackers, which bears on IntensPure-style designs in any domain.
References
- MetaCloak: Preventing Unauthorized Subject-Driven Text-to-Image Diffusion-Based Synthesis via Meta-Learning
- Diffusion Models for Adversarial Purification
- Consistency Purification: Effective and Efficient Diffusion Purification towards Certified Robustness
- Instant Adversarial Purification with Adversarial Consistency Distillation
- IntensPure: Attack Intensity-aware Secondary Domain Adaptive Diffusion for Adversarial Purification
- Adversarial Purification with Score-based Generative Models
- Towards Understanding the Robustness of Diffusion-Based Purification: A Stochastic Perspective
- ZeroPur: Succinct Training-Free Adversarial Purification
- MANI-Pure: Magnitude-Adaptive Noise Injection for Adversarial Purification
- Robustness Tokens: Towards Adversarial Robustness of Transformers
- APBench: A Unified Availability Poisoning Attack and Defenses Benchmark
- IMPRESS: Evaluating the Resilience of Imperceptible Perturbations Against Unauthorized Data Usage in Diffusion-Based Generative AI
- TART: Boosting Clean Accuracy Through Tangent Direction Guided Adversarial Training