Where the Effect Lands: Telling Backdoor Triggers from Tiny Lesions in Attention Maps

Attention-based backdoor defenses rest on one observation. A hidden trigger planted in a vision transformer pulls the model's attention into a sharp, isolated hotspot, so finding and removing that hotspot at test time disarms the attack. A vision transformer is an image model that splits the input into patches and lets every patch weigh every other. The "find the spike, delete the spike" recipe works well on natural images, where the real object is large and its attention is spread out. In medical CT or satellite radar, though, the true target can be a lung nodule covering 0.022% of pixels or a ship that is a single pixel wide. That target is itself a sharp, isolated attention spike against an almost empty background. A defense that deletes the most-attended patch is then as likely to delete the tumor as the trigger, and in screening a deleted tumor is a missed cancer.

We propose a different test for an attention spike. Instead of asking how strongly the model attends to it, we ask where its influence on the output lands. A real lesion drives the prediction at its own location: hide it and the segmentation mask vanishes there and nowhere else. A backdoor trigger in a segmentation or detection model has to act at a distance, because it sits in background tissue while changing the output somewhere else. It might erase a nodule elsewhere, create a phantom lesion, or steer a two-stage pipeline's coarse "scout" toward empty regions. We call this signal attention–effect displacement. Our claim is that in the extremely sparse regime it separates triggers from pathology, whereas attention magnitude cannot. We also claim that existing magnitude-based purifiers remove real micro-lesions at a rate that has never been measured.

Core Claim

Extreme spatial class imbalance reverses the premise of attention-based purification. On ImageNet, A Closer Look at Robustness of Vision Transformers to Backdoor Attacks shows that transformer attention acts as a "snitch". That paper finds the highest-influence patch with gradient-weighted attention rollout and drops it ("Token Drop"), cutting ViT-Base attack success from 61.4% to 8.0%. PurMM does the analogous thing in multimodal language models. It clusters deep-layer attention with K-means and zeroes the visual tokens it flags, reducing attack success on ScienceQA from 99.55% to 0.84%. Both papers motivate this proposal and both supply its baseline mechanism. Both also assume that the legitimate content of the image does not look like a trigger. Under 0.1% foreground, that assumption fails. We expect lesion and trigger attention distributions to overlap heavily, and we expect any threshold on magnitude to trade attack success directly against small-lesion sensitivity.

The displacement score replaces magnitude with locality of causal effect. For a candidate set of tokens $S$ that forms an attention spike, let $\Delta_S$ be the absolute change in the model's per-pixel output probability map when $S$ is replaced by locally inpainted background. Let $N(S)$ be a dilated spatial neighborhood of $S$. The score is

$$D(S) = \frac{\sum_{p \notin N(S)} \Delta_S(p)}{\sum_{p} \Delta_S(p) + \epsilon},$$

the fraction of the spike's output influence that falls outside its own neighborhood, where $p$ indexes output pixels and $\epsilon$ prevents division by zero. Lesions should give $D$ near zero. Background-placed triggers should give $D$ near one. Purification removes only spikes whose $D$ exceeds a threshold calibrated on clean scans. Replacement uses inpainting rather than zeroing because a zeroed patch in normalized CT is itself an out-of-distribution artifact.

Research Program

The first part of the program is a measurement that does not yet exist: how much real pathology existing purifiers destroy. We will train transformer segmenters and scouts on sparse benchmarks, implant backdoors under several threat models, and run Token Drop and PurMM-style clustering unchanged. We will report attack success and also the "lesion excision rate", meaning the fraction of true lesions on clean scans that the purifier removes, stratified by lesion size. NLSTseg shows that small lesions are already fragile: a 2D U-Net there drops from 0.95 IoU on training data to 0.42 on test data, partly by confusing vessels with lesions. Any additional loss from a defense therefore matters clinically.

The second part builds the displacement purifier. Computing $D$ for every token would be expensive. Sparsity makes it cheap, because only a handful of spikes per scan rise above background attention, so the masking counterfactual needs to be evaluated only on those few candidates. For deformable-attention scouts like the Deformable-DETR stage in LNTransformer, which predicts boxes using sparse learned sampling points rather than dense attention, we read candidate spikes from the sampled locations. Displacement is then measured on the scout's output boxes rather than on pixel masks.

The third part covers threat models. We will implant four attacks. The first is a lesion-erasure trigger, a small patch placed in lung parenchyma that suppresses nodules elsewhere. The second is a phantom trigger that causes false lesions at a distant location. The third is a scout-misdirection trigger against a glance-and-focus pipeline, modeled on Glance and Focus Reinforcement for Pan-cancer Screening, which discards about 83% of tissue at the scout stage, so steering the scout silently blinds the segmenter. The fourth is an adaptive, co-located attack in the style of Attention-Imperceptible Backdoor Attacks on Vision Transformers. That attack, AIBA, hides small noise inside the already most-attended patch and defeated patch-dropping defenses on ImageNet with 99.97% success. Its authors explicitly leave segmentation and detection open.

The fourth attack is the honest limit of our method. If the attacker places the trigger on the lesion to erase that same lesion, the effect is local and $D$ will not flag it. We will report this case directly rather than hide it. We will also test whether such an attack can be made to work at all. We hypothesize that perturbing a 0.02%-area target strongly enough to implant a reliable backdoor is hard without damaging clean performance, but this hypothesis could fail. We will also report results on globally blended and warping triggers, which produce no spike, while noting that the method is not designed for them.

Baselines

The naive reference point is the undefended backdoored model. It sets the ceiling for attack success and the clean Dice and lesion sensitivity any defense must preserve. The clean-trained model on the same split gives the utility target. For lung nodules, the anchor is LNTransformer's reported 91.4% Dice on LUNA16 and 78.3% on the external UHN set LNTransformer. For pan-cancer screening, GF-Screen's FLARE25 pipeline is the reference for a scout-plus-segmenter system Glance and Focus Reinforcement for Pan-cancer Screening.

The strongest existing purifier is Token Drop from A Closer Look at Robustness of Vision Transformers to Backdoor Attacks. It ranks patches by gradient-weighted attention rollout and drops the top-ranked ones at inference, and its reported result is ViT-Base attack success reduced from 61.4% to 8.0% on ImageNet. It is the strongest competitor because it is cheap, needs no clean data, and directly uses the attention-spike property we claim fails here. The second strong baseline is PurMM-style purification PurMM. It applies K-means over posterior-half-layer attention with deep-layer filtering and has reported ScienceQA attack success falling from 99.55% to 0.84% on LLaVA-v1.5-7B. On any sparse medical or radar benchmark, we found no reported result on Lacuna for either method, or for any backdoor defense.

Every method gets the same backdoored checkpoint, the same test scans, and the same budget of masked forward passes per scan. Each method's threshold or number of dropped tokens is tuned on the same clean validation split to a fixed clean-lesion excision rate, for example at most 2%. This removes the trivial trade of "drop more, lose more" from the comparison. Beating the baselines means lower attack success at matched excision rate, or lower excision rate at matched attack success, with the gap concentrated on lesions under about 7 mm.

The key ablation keeps everything except locality. It removes candidate spikes ranked by total output change $\sum_p \Delta_S(p)$ instead of by $D(S)$. This is a plain occlusion-sensitivity purifier. If it performs as well as displacement, then our contribution reduces to "use occlusion instead of attention", and we will say so. A second ablation zeroes the patch instead of inpainting it, which isolates the replacement choice.

Why not just…?

Why not just drop the top-attended tokens, as Token Drop does? This baseline is what our first experiment measures, and we expect it to fail in a specific way. The highest-attention patch in a sparse scan is often the lesion, so dropping it removes the pathology. Token Drop's 61.4%→8.0% result comes from ImageNet, where objects are large. Nothing in the file shows it preserves sub-centimeter lesions. If the measured excision rate turns out to be low, the premise of this proposal weakens, and we will report that result.

Why not restrict purification to tokens outside an anatomical prior, such as a lung mask? A trigger placed in lung parenchyma sits inside the prior. Benign mimics such as vessels and bronchioles, which LNTransformer notes can look like nodules, also lie inside it. We will include an anatomy-gated Token Drop as an extra baseline. It should help against triggers outside the organ and provide no help against triggers inside it.

Why not detect poisoned training samples instead, in the style of TCAP? TCAP fits Gaussian mixtures to how attention is split across fixed input components to flag poisoned fine-tuning samples. It reports F1 of 100% under BadNet on LLaVA-NeXT. That method depends on an invariant component, the system prompt, which a segmentation volume does not have. It also assumes the defender controls training. Many clinical sites deploy third-party checkpoints. We will still run a TCAP-like clustering of per-scan attention statistics on the poisoned training set. If it reliably separates poisoned scans, training-time sanitization is a real competitor in the setting where the defender owns training, and we will report that outcome as such.

Why not use plain occlusion sensitivity? This is the real threat, and the locality ablation above settles it. Displacement is occlusion sensitivity plus a spatial test. The bet is that total effect is large for both lesions and triggers, while location of effect differs between them.

Proposed Experiments

The main experiments use LUNA16 and NLSTseg for lung nodules, where lesion pixels are 0.022% of the image in NLSTseg, and FLARE25 for pan-cancer screening, where lesions are 0.085% of the volume. xView3-SAR, where targets are 0.005% of pixels, serves as an out-of-domain check that the method is not specific to CT anatomy xView3-SAR. The models are a SwinUNETR segmenter, a Deformable-DETR scout followed by mask refinement as in LNTransformer, and a glance-and-focus pipeline. The metrics are attack success, defined per threat model as lesion erased, phantom created, or scout misdirected. We also report clean Dice and normalized surface distance, lesion-level sensitivity stratified by size, the lesion excision rate on clean scans, and added latency per scan.

Three checks are decisive. The first is the overlap test. On clean scans with true lesions and on poisoned scans with triggers, we plot the distributions of attention magnitude and of $D$ for both kinds of spike. The proposal stands only if magnitude overlaps substantially while $D$ separates the two. The second is the matched-excision comparison against Token Drop, PurMM-style clustering, and the occlusion-magnitude ablation, broken down by lesion size. The third is the co-located adaptive attack. We report whether an AIBA-style trigger on the lesion itself can be implanted without clean-Dice loss and how badly displacement fails against it. This defines the boundary of the threat model in which the method should be trusted.