Searching for Backdoor Triggers by the Shape They Leave Behind

A backdoored image classifier behaves normally on ordinary inputs but switches to an attacker-chosen output whenever a hidden pattern, the trigger, is present. The strongest repair methods first reconstruct something that behaves like the trigger and then retrain the model to ignore it. They search for that trigger inside a small pixel-distance budget. Triggers that spread out instead, such as smooth image warps, escape the budget and therefore escape the repair.

This note proposes a different search criterion: look for the model's internal fingerprint of a trigger rather than for a small pixel change. Recent work found that adversarial and backdoor inputs make a large language model's internal activations "topologically compress." Clean activations form a rich, many-scale structure with many small loops. Triggered activations collapse into a few large, well-separated blobs. We propose to treat that collapse as the target of a trigger search over a constrained family of transformations (patches, blends, smooth warps) with no pixel-norm bound. We would then unlearn the recovered transformation with a loss that restores the clean activation shape. Tools from persistence diagram transformation do the heavy lifting in two places. Persistent homology, a method that records at what scale clusters merge and loops appear and vanish as one connects nearby points, provides the fingerprint. A critical-set optimizer turns gradients on that fingerprint into coordinated moves of whole clusters of points.

Core Claim

The claim is that topological compression is a property of the backdoor mechanism, not only a symptom to classify. Because it is scale-invariant, it identifies triggers that norm-bounded searches cannot reach, while ignoring the trivial "shrink everything" solutions that variance or entropy criteria also reward.

Concretely, let $h(x)$ be a chosen intermediate layer's activation for input $x$, and let $T_\theta$ be a parameterized input transformation applied to a batch of clean images $x_1,\dots,x_n$. Compute the persistence diagram of the point cloud $\{h(T_\theta(x_i))\}$. Let $\ell_1 \ge \ell_2 \ge \dots$ be its bar lengths in dimensions 0 and 1, meaning how long each cluster or loop survives as the connection scale grows. Define the concentration

$$\kappa(\theta) = \frac{\sum_{j \le k} \ell_j}{\sum_j \ell_j},$$

the share of total persistence carried by the $k$ longest bars. Shrinking the whole cloud uniformly leaves $\kappa$ unchanged, so the statistic rewards exactly what Fay et al. describe: "few large features, few small cycles." It does not reward mere contraction. The trigger search maximizes $\kappa(\theta)$ subject to a perceptual-fidelity constraint on $T_\theta$ and no label information.

Purification then fine-tunes the weights $w$ on clean data. It adds a term matching the diagram of the transformed batch to that of the clean batch,

$$\mathcal{L}(w) = \mathrm{CE}_w(x, y) + \mathrm{CE}_w(T_\theta(x), y) + \lambda\, W\big(\mathrm{Dgm}(h_w(T_\theta(x))),\ \mathrm{Dgm}(h_w(x))\big),$$

where CE is cross-entropy against the true label $y$, $W$ is the standard matching (Wasserstein) distance between diagrams, and $\lambda$ weights the topological term.

The closest existing work is The Shape of Adversarial Influence. It builds 41-dimensional persistence summaries of LLM activations and trains a logistic regression that separates clean from poisoned activations, reporting 1.00 accuracy and AUC-ROC. That paper motivates this one: it supplies the phenomenon. Our proposal differs in three ways. Its detector needs labelled poisoned activations, and we assume the trigger is unknown. It is purely diagnostic, and the authors note it does not modify the model. It is shown only for LLMs, so whether compression holds in convolutional image classifiers is itself a first open question we test.

Research Program

The work has three pieces, each testable on its own.

The first is a transfer study. Using models trained with BackdoorBench, we measure $\kappa$ on clean and triggered batches at every block of PreAct-ResNet18, VGG-19 and EfficientNet-B3. The attacks are BadNets, Blended, WaNet, sample-specific invisible triggers (ISSBA) and a clean-label attack. If compression does not appear in vision, or appears only for patch triggers, the program stops here and reports that negative result.

The second is the topological trigger search. The transformation family is small and interpretable: a mask-and-pattern patch, a blend coefficient and pattern, and a low-frequency warp field of the kind WaNet uses. Each is regularized for fidelity, not pixel norm. Persistence in dimension 0 for a point cloud equals the edge lengths of its minimum spanning tree. The equivalences between discrete Morse gradients and minimum spanning forests in Discrete Morse Functions and Watersheds, and between contrast dynamics and persistence in An Equivalence Relation Between Morphological Dynamics and Persistent Homology in n-D, let the inner loop use a near-linear spanning-forest computation instead of a full complex. This matters because Fay et al. flag computational cost as their main barrier. Dimension-1 features are computed less often, every few steps.

The third piece is the optimizer. Ordinary persistence gradients push only the two points defining each bar. That is a poor fit for our objective, which should move whole blobs apart or together. Topological Optimization with Big Steps extracts, from the matrix decompositions computed during persistence, the full "critical set" responsible for each birth and death and updates it jointly. The paper reports 10x to 25x fewer steps at a 3x to 4x per-step cost. We use it the way that paper uses it on grids. A big step on the diagram proposes target positions for every point in a merging component. The network, through $\theta$ during search or $w$ during unlearning, is then trained with a squared-distance loss to reach those targets. Whether this works on activation point clouds, which are not the lower-star grid filtrations that paper studied, is an engineering risk we measure directly.

Baselines

The naive reference is fine-tuning on the defender's 5% clean split with no trigger handling. It shows how much of any gain comes simply from extra clean training.

Fine-Pruning removes neurons dormant on clean data and then fine-tunes. It is the canonical capacity-based defense. Its own traffic-sign result (attack success rate reduced from about 99% only to about 30%) shows the residual vulnerability we expect to beat.

The strongest competitor is Shared Adversarial Unlearning (SAU), which searches for perturbations that fool both the backdoored and the defending model and unlearns them. It reports an average CIFAR-10 attack success rate of 2.51% (versus 15.32% for i-BAU and 37.2% for NAD), with clean accuracy within 1 to 2 points of undefended, using 5% clean data. Per-attack figures for WaNet are not in the file: no reported result found on Lacuna for SAU on WaNet specifically, and BackdoorBench's per-cell numbers are likewise unreported here. We will run SAU ourselves through BackdoorBench's implementation. It gets the same models, the same 5% clean split, the same number of fine-tuning epochs, and a hyperparameter sweep matched in GPU-hours to ours, including enlarged perturbation radii so it is not handicapped by defaults.

For detection, the reference is CatchBackdoor, whose data-free variant reports an average label change rate of 73% and roughly 2x the effectiveness of Neural Cleanse and TABOR on stealthy attacks. STRIP serves as the run-time reference, reporting 0% false acceptance and false rejection in most CIFAR-10 and GTSRB cases.

Three ablations isolate the key ingredient. The first replaces $\kappa$ with activation variance or prediction entropy during search. The second keeps our recovered trigger but drops the topological term in unlearning, which leaves relabel-and-retrain only. The third replaces critical-set steps with ordinary sparse persistence gradients at equal wall-clock time.

Beating SAU means two things. On BadNets and Blended, our attack success rate must stay within one point of SAU at equal clean accuracy. On WaNet and ISSBA, we must cut attack success rate by at least half relative to SAU, with clean accuracy loss of no more than 2 points, across at least two of the three architectures.

Why not just…?

Why not just search with activation variance or output entropy instead of persistence? This is the most serious threat, because input-agnostic collapse should lower variance and entropy too, and both are far cheaper. The argument for topology is scale invariance: a warp that blurs images into near-identical gray also shrinks variance, but it does not concentrate persistence into a few long bars. Fay et al. report that their persistence features beat linear and dimensionality-reduction methods, though that evidence is for LLMs and for detection, not trigger search. The first ablation settles the question on our models. If variance- or entropy-guided search recovers triggers whose unlearning matches ours, we drop the persistence machinery from the search and keep it only where it helps.

Why not just run SAU with a larger perturbation radius? SAU's authors concede it fails on large-norm triggers. Widening an $\ell_p$ ball to cover a warp also admits many non-trigger perturbations, so unlearning starts to damage clean accuracy. Our matched sweep includes enlarged radii, so if this simple fix closes the WaNet gap, the experiment will show it.

Why not just use standard persistence gradients instead of critical sets? They are simpler and well established. Nigmetov and Morozov show they converge slowly because each step moves only the two points defining a bar, which is the wrong motion when an entire triggered blob must move. The third ablation compares the two at equal compute. If sparse gradients match, we report that and use the simpler method.

Why not just apply the Fay et al. detector? It requires examples of poisoned activations to train its classifier. A defender repairing a downloaded model has none, which is exactly the gap the label-free search fills.

Proposed Experiments

The datasets are CIFAR-10, GTSRB and Tiny ImageNet. The attacks are BadNets, Blended, WaNet, ISSBA and a Bullseye-Polytope-style clean-label attack, at poisoning ratios of 10%, 1% and 0.5%, since BackdoorBench identifies low ratios as the hard regime. The architectures are PreAct-ResNet18, VGG-19 and EfficientNet-B3. Metrics are clean accuracy, attack success rate after purification, and the fraction of the original trigger's effect reproduced by the recovered transformation, measured as the attack success rate of $T_\theta$ on the untouched backdoored model. For model-level detection we report AUC of the maximal achieved $\kappa$ over a pool of clean and backdoored models.

The decisive checks are four. First, compression must appear in image classifiers, and in at least one block per architecture triggered batches must carry a $\kappa$ clearly above clean batches. Second, $\kappa$-guided search must recover a transformation with high attack success on WaNet models where SAU's recovered perturbations do not. Third, the variance and entropy ablation must fall measurably short on that same setting. Fourth, purification must hit the SAU-relative targets above. If the first check fails, the result is a clean negative finding about the reach of topological compression. If the third check fails, the honest conclusion is that persistence was a detour. Either outcome is informative.

A secondary, smaller experiment applies the same search to the password-locked WMDP models of Fay et al., using BEEAR as the baseline. BEEAR reports attack success reduced from above 95% to below 1% for its RLHF-implanted backdoors, and it concedes vulnerability to multi-trigger attacks whose distinct drift directions its single linear perturbation cannot cover. This tests whether a shape-based search covers multiple trigger modes where a single drift vector cannot.