REFINE: Inversion-free backdoor defense based on model reprogramming
REFINE: Inversion-Free Backdoor Defense via Model Reprogramming
The authors propose REFINE, a trigger-inversion-free backdoor defense based on model reprogramming, achieving ASR below 3% under 7 attacks on CIFAR-10/ImageNet.
The defender obtains a pretrained model from a third-party platform, and the model may have been implanted with a backdoor by the attacker in any way; the defender does not modify the model parameters, only performs preprocessing before inference, and assumes possession of an unlabeled dataset independent and identically distributed with the training set. The main experiments assume white-box access, and Appendix E explores the black-box setting with only class confidence outputs.
- Third-party pretrained models may be implanted with backdoors. Among preprocessing defenses, transformation-based methods struggle to balance benign accuracy and defense effectiveness, while trigger inversion (BTI)-based methods struggle to accurately recover the trigger.
- REFINE uses a trainable U-Net input transformation module to scramble benign and backdoor patterns, then uses a hard-coded output remapping module to redefine the output domain, trained with cross-entropy and supervised contrastive loss, without changing the original model parameters.
- On CIFAR-10 and a 50-class ImageNet subset, with ResNet-18 and 7 attacks, REFINE's ASR is below 3%, with BA dropping by less than 3% on CIFAR-10; against simulated adaptive attacks, ASR remains below 1.5%.
- The authors point out: the defense relies on a certain amount of unlabeled samples, and with 10% of the data BA drops to about 78%; it requires training a local transformation module, with overhead higher than random-transformation-based defenses; it covers only image classification tasks, with other modalities left for future work.
- Evaluated models
- ResNet-18VGG-16DenseNet-121ViTResNet-50
- Benchmarks
- CIFAR-10ImageNet (50-class subset)CINIC10
- Metrics
- BAASR
The researchers propose REFINE, a deep neural network backdoor defense method based on model reprogramming that requires no trigger inversion. Its input transformation module disrupts benign features and backdoor patterns and generates new benign features, while its output remapping module redefines the model output domain to guide the transformation; combined with a supervised contrastive loss, it enhances defense while preserving model utility. Extensive experiments on multiple benchmark datasets verify its effectiveness, and it can resist potential adaptive attacks.
Paper analysis
What problem does this paper attempt to solve?
How to break the trade-off between utility and defense effectiveness in preprocessing defenses without inverting the trigger or changing model parameters.
Core question: can the trade-off between model utility and defense performance in preprocessing-based backdoor defenses be broken without relying on backdoor trigger inversion (BTI).
- Problem setting: Developers often directly use third-party pretrained DNNs, and the model may have been implanted with a backdoor during training — it behaves normally on benign inputs but outputs the attacker-specified result when it encounters the trigger, which the authors consider a threat to critical applications.
- Shortcomings of existing methods: The authors state that transformation-based defenses, lacking backdoor feature information and able to modify all features indiscriminately, have a trade-off between BA and ASR; BTI-based defenses, lacking prior knowledge, struggle to accurately invert triggers, have limited purification effectiveness, and may even invert "pseudo-triggers."
- Core observation: The authors give Theorem 1, stating that the distance between output features before and after preprocessing is constrained by the Wasserstein-1 distance of the representation distributions; a fixed output domain forces the input transformation to simultaneously accomplish two conflicting goals, "removing the trigger" and "preserving benign features," and changing the output domain can relax this.
- Proposed approach: REFINE, an inversion-free defense based on model reprogramming: a trainable input transformation module + a hard-coded output remapping module, together with cross-entropy and supervised contrastive loss.
- Threat model (Section 3.1):
- Attacker's goal: implant a backdoor in a pretrained model, in any way (poisoning or intervening in training).
- Defender's knowledge: obtains a third-party pretrained model that may be backdoored; the main experiments assume white-box access, and Appendix E explores the black-box setting with only output confidences.
- Defender's capability: does not change the model structure or weights, only preprocesses before inference; possesses an unlabeled dataset independent and identically distributed with the training set.
- Victim system: a downstream deployment using this third-party model for image classification.
What related research exists?
Related work is divided into three groups: backdoor attacks, three paradigms of backdoor defenses, and model reprogramming; this paper belongs to preprocessing defenses.
Backdoor attacks
- BadNets (Gu et al., 2019) — the earliest poisoning-based backdoor attack, using a visible pixel patch as the trigger; Blended (Chen et al., 2017) — implicitly blends the trigger into the sample to evade manual inspection.
- WaNet (Nguyen & Tran, 2021), ISSBA (Li et al., 2021d), LIRA (Doan et al., 2021), BATT (Xu et al., 2023) — invisible or sample-specific triggers; PhysicalBA (Li et al., 2021c), Label-consistent (Turner et al., 2019), Adaptive-Patch (Qi et al., 2023) — physical scenarios, clean labels, and adaptive attacks.
Backdoor defenses (the paper divides them into three paradigms following Li et al., 2024c)
- Preprocessing-based: AutoEncoderDefense (Liu et al., 2017), Februus (Doan et al., 2020), ShrinkPad (Li et al., 2021c), Deepsweep (Qiu et al., 2021), as well as generation-model-based ZIP (Shi et al., 2023, diffusion model) and BDMAE (Sun et al., 2023, masked autoencoder).
- Backdoor removal-based: ABL (Li et al., 2021a), decoupled training of Huang et al. (2022), Neural Polarizer (Zhu et al., 2023), DataElixir (Zhou et al., 2024), etc., which remove backdoors by changing parameters or controlling training.
- Trigger removal/test sample filtering-based: STRIP (Gao et al., 2019), CleaNN (Javaheripi et al., 2020), etc., which filter malicious samples at inference time.
Model reprogramming
- Elsayed et al. (2019) proposed adversarial reprogramming, repurposing an ImageNet classifier for other uses; BAR (Tsai et al., 2020) extended it to the black-box setting; Voice2Series (Yang et al., 2021) reprogrammed acoustic models. The authors state that reprogramming does not change the original model's parameters and is more efficient and flexible than transfer learning.
Baselines and benchmarks: The transformation-based baselines are ShrinkPad, BDMAE, and ZIP; the BTI-based baselines are Neural Cleanse, UNICORN, and BTI-DBF(P); the benchmarks are CIFAR-10 and a 50-class ImageNet subset.
Authors' positioning: This paper belongs to preprocessing defenses, but differs from transformation-based methods (which break the trade-off by remapping the output domain) and BTI-based methods (which do no trigger inversion at all); the authors also state that traditional reprogramming only adds a universal perturbation around the input and the trigger remains, whereas REFINE transforms the input as a whole with an autoencoder.
How does the paper address this problem?
REFINE uses a trainable input transformation module plus hard-coded output remapping to reprogram the backdoored model into a new output domain.
Overall idea: treat the backdoored model as a fixed feature extractor, prepend a trainable input transformation module to disrupt trigger patterns, and append a hard-coded output remapping module to change the output domain, so that the input transformation is no longer constrained by "preserving the original benign features." The method is named REFINE (REprogramming-based Inversion-Free backdoor defeNse mEthod).
Theoretical motivation
- Theorem 1: Ex∼ D,x̃∼ D̃ |F(x)−F(x̃)|2 ≤ 2α√K · W1(μ, μ̃), i.e., the upper bound on the distance between model predictions before and after transformation is determined by the Wasserstein-1 distance between the feature representation distributions (proof in Appendix A).
- The authors' interpretation: to preserve utility, existing defenses tend to preserve the output representation, thereby limiting the damage to the backdoor; allowing the output domain to change can amplify the magnitude of the input transformation.
Input transformation module
- A trainable autoencoder (U-Net) is used as the transformation module T, X̃ = T(X, θ), keeping the sample dimension unchanged before and after transformation.
- The authors state that, compared with traditional reprogramming, which only adds a universal adversarial perturbation around the input, an autoencoder manipulates samples more flexibly; the transformation disrupts both benign and backdoor patterns, generating new benign features that cluster by class.
Output mapping module
- A hard-coded one-to-one label remapping function fL: l̃ ↦ l (l̃ ≠ l) rearranges the original model's confidence for each class into new scores Y = M(Ỹ).
- A remapping function is randomly specified before each defense; Appendix I gives a concrete example of the class permutation used on CIFAR-10.
Optimization objective
- Total loss Lrefine = Lce + λ Lsup: cross-entropy maintains utility under the new output domain, and supervised contrastive loss (Khosla et al., 2020) brings transformed samples of the same class closer and those of different classes farther apart.
- Since the defender's data are unlabeled, the original model is first used to predict the batch samples to obtain pseudo-labels Ȳ = arg max(F(X)), and then the two losses are computed; the temperature parameter τ = 0.1.
- Training setup (Appendix C): SGD (momentum 0.9, weight decay 5×10⁻⁴), initial learning rate 0.01, CIFAR-10/ImageNet batch size 256/64, trained for 150 epochs, with the learning rate multiplied by 0.8 at epochs 100 and 130.
Inference and success criteria
- Inference pipeline y = M(F(T(x, θ))), all parameters fixed, and the original model is not modified.
- Defense effectiveness is measured by BA (benign accuracy, higher is better) and ASR (attack success rate, lower is better); the paper marks a BA drop or ASR > 10% as a failure case.
What experiments did the paper conduct?
Compared 6 baselines on 2 datasets, 4 architectures, and 7 attacks, and also tested adaptive attacks and the black-box setting.
Experimental setup
- Evaluated models: ResNet-18 (main experiments, CIFAR-10 and ImageNet); VGG16, DenseNet121, ViT (Appendix D, CIFAR-10); black-box experiments use ResNet-50 as the black-box model and ResNet-18 as the surrogate model.
- Datasets: CIFAR-10 (50,000 training / 10,000 test, 10 classes); ImageNet subset (50 classes, 500 training / 100 test per class).
- Attacks: BadNets, Blended, WaNet, PhysicalBA, BATT, LabelConsistent (LC), Adaptive-Patch, 7 in total; poisoning rates are mostly 0.1 (LC is 0.25/1.0 on CIFAR-10/ImageNet, Adaptive is 0.01/0.03), all implemented with BackdoorBox.
- Baselines: transformation-based ShrinkPad, BDMAE, ZIP; BTI-based NC, UNICORN, BTI-DBF(P).
- Metrics: BA and ASR; a BA drop or ASR > 10% is recorded as a failure case.
- Implementation: U-Net as the input transformation module; the paper does not report the number of repeated experiments.
Main results
According to Table 1 and Table 2 (ResNet-18, %):
Swipe horizontally to read the table
Dataset Attack No defense BA/ASR REFINE BA/ASR Best baseline ASR (method) CIFAR-10 BadNets 91.24/100 90.43/0.78 3.18 (BDMAE) CIFAR-10 Blended 91.04/100 89.85/1.73 3.72 (ZIP) CIFAR-10 WaNet 91.15/99.97 90.33/0.97 4.37 (BTI-DBF(P)) CIFAR-10 BATT 92.48/100 90.54/1.21 4.80 (BTI-DBF(P)) CIFAR-10 Adaptive 91.34/97.17 90.30/0.81 9.34 (ShrinkPad) ImageNet BadNets 65.42/99.55 66.27/1.81 2.65 (ShrinkPad) ImageNet LC 67.44/80.96 66.43/0 0.86 (ShrinkPad) ImageNet BATT 67.76/100 66.19/2.71 6.94 (BTI-DBF(P)) (ImageNet rows for Physical, WaNet, Blended, Adaptive are omitted; REFINE's ASR is 1.11–1.97.)
- The authors state that REFINE's ASR is below 3% in all cases (mostly below 2%), BA drops by less than 3% on CIFAR-10, and BA actually increases on ImageNet, which the authors attribute to the input transformation module increasing model depth.
- By contrast, baselines have failure cases: e.g., BDMAE has ASR 84.80 on CIFAR-10 Blended and 99.92 on WaNet; NC has 96.90 on ImageNet Blended; BTI-DBF(P) has 88.92 on CIFAR-10 LC (Table 1–2).
- Exception: On ImageNet Physical, REFINE's BA is 67.11, lower than the no-defense 71.64, and also lower than ShrinkPad's 71.80 and BTI-DBF(P)'s 73.60 (Table 1–2).
Ablation experiments (Table 3, CIFAR-10, ResNet-18)
- Removing hard-coded remapping (w/o HRF): BA is largely maintained (89.77–92.86), but ASR rises sharply, e.g., WaNet 99.53, Blended 75.30; the authors state that the output domain is unchanged in this case, falling back to the same trade-off as other transformation-based defenses.
- Removing supervised contrastive loss (w/o SCL): ASR remains low (0.10–5.87), but BA drops to 88.06–90.38; the authors state that SCL helps restore the original model's benign accuracy.
Adaptive attack (Table 4)
- Setting: The attacker fully knows the REFINE pipeline, fine-tunes the backdoored model with randomly initialized remapping and transformation modules, optimizing Lb + γLrefine.
- Results: On CIFAR-10, REFINE BA 83.05, ASR 0.98; on ImageNet, BA 60.53, ASR 1.09; BA drops are both less than 1.5 percentage points.
- Authors' interpretation: The defender can arbitrarily specify the output mapping, which differs from the attacker's simulated module; adaptive training itself also lowers the model's BA from 91.74 to 84.53 (CIFAR-10).
Black-box scenario (Appendix E, Table 11)
- Setting: Only confidence outputs are available; first distill the black-box ResNet-50 to a surrogate ResNet-18 with MSE loss, train the REFINE modules on the surrogate, then apply them back to the black-box model.
- Results: On the black-box model, ASR for 7 attacks is 0.04–3.72, BA 87.44–89.84; on the surrogate model itself (target is the surrogate), ASR 0.32–3.37.
Other ablations and analyses
- Other architectures (Table 5): REFINE's ASR on VGG16/DenseNet121/ViT is all below 3.5%, and BA on ViT rises from 66–68 to 72.75–80.36.
- Amount of unlabeled data (Table 6, BadNets): from 100%→20% data, BA drops from 91.20 to 83.93, ASR rises from 0.86 to 2.21.
- Temperature parameter λ (Table 7): ASR 0.51–1.27 between 1.0 and 0.2, which the authors state has little effect.
- U-Net channel count (Table 8): ASR 0.64–1.43 at 32/48/64/80 channels.
- Out-of-distribution defense data (Table 9): training the module with CINIC10, under BadNets BA 88.39, ASR 1.40.
- Traditional reprogramming comparison (Table 10): T-MR's BA drops by more than 15 percentage points, ASR 25.76 under WaNet, versus REFINE's 1.93.
- Combination with fine-tuning defense (Table 13): FT alone ASR 91.67, FT+REFINE drops to 0.87.
- Overhead (Table 12): REFINE 36.70 minutes, BDMAE 39.67, BTI-DBF(P) 15.49; inference on 10,000 CIFAR-10 images takes 6.31 seconds.
What are some points that can be further explored?
The authors list three limitations: data volume, training overhead, and modality; the experiments cover image classification and multiple architectures.
Limitations and future directions noted by the authors
- Reliance on unlabeled samples (Appendix L): The defense assumes the defender has a certain amount of unlabeled data; with 10% data, REFINE still reduces ASR but BA drops to 77.89–79.87 (Table 14); when samples are insufficient, the input transformation module cannot be trained. The authors plan to explore maintaining effectiveness in few-shot scenarios.
- Training overhead (Appendix L): A local input transformation module must be trained, with overhead higher than random-transformation preprocessing defenses; the authors state it is lower than generative-model-based and BTI-based methods, and acceptable relative to retraining from scratch.
- Image classification only (Appendix L): The method mainly targets image classification models; the authors plan to explore other modalities and tasks such as text and audio in the future.
- Lack of theoretical guarantees (Appendix K): The authors did not find an effective adaptive attack that bypasses REFINE, but state that its effectiveness lacks theoretical guarantees, and attackers may design more advanced adaptive attacks.
Experimental coverage
- The evaluated models are ResNet-18, VGG16, DenseNet121, ViT, and ResNet-50 (black-box), 5 in total, all image classification architectures (Section 5.1, Appendices D, E).
- Attacks cover 7 poisoning-based backdoor attacks, with datasets CIFAR-10 and a 50-class ImageNet subset; the out-of-distribution defense data experiment uses CINIC10 (Section 5.1, Appendix D.5).
- Adaptive attack evaluation covers one setting where the attacker fully knows the defense pipeline and fine-tunes the model with Lb + γLrefine (Section 5.4).
- Black-box experiments cover only one combination: ResNet-50→ResNet-18 distillation surrogate (Appendix E).
- The paper does not report the number of repetitions and variance for each experiment, nor statistical tests beyond the sensitivity analysis of hyperparameters other than λ.
Summarize the main content of the paper
REFINE performs inversion-free backdoor defense via model reprogramming, with ASR below 3% under 7 attacks and resistance to adaptive attacks.
An ICLR 2025 image backdoor defense paper that proposes REFINE: without changing the parameters of the backdoored model, it adds one module before and one after inference to perform model reprogramming.
- Problem: Among preprocessing defenses, transformation-based methods trade off between BA and ASR, and BTI-based methods struggle to accurately invert triggers; the authors use Theorem 1 to attribute the cause to the constraint that a fixed output domain imposes on feature distance.
- Method: A U-Net input transformation module disrupts benign and backdoor patterns, a hard-coded output remapping module permutes the classes, and pseudo-labels produced by the original model are used to compute cross-entropy and supervised contrastive loss to train the transformation module.
- Main results: On CIFAR-10 and 50-class ImageNet, ResNet-18, and 7 attacks, REFINE's ASR is all below 3% (mostly below 2%), BA on CIFAR-10 drops by less than 3 percentage points, and BA on ImageNet rises slightly (Table 1–2); all 6 baselines have failure cases with ASR > 10%.
- Ablation: Removing the output remapping causes ASR to rise again (WaNet 99.53), and removing the supervised contrastive loss causes BA to drop (Table 3).
- Robustness and extension: Under adaptive attacks where the attacker fully knows the pipeline, ASR remains below 1.5% (Table 4); in the black-box setting after proxy distillation, ASR is 0.04–3.72 (Table 11); on VGG16/DenseNet121/ViT, ASR is below 3.5% (Table 5).
- Authors' conclusion: The authors state that REFINE is effective and can resist potential adaptive attacks, and hope it offers a new angle for defense design from the reprogramming perspective; they also acknowledge that it relies on unlabeled data, requires training overhead, covers only image classification, and lacks theoretical guarantees for its effectiveness.
Related papers
- Poisoning and Backdooring Contrastive LearningAttacksarXiv