Backdoor Mitigation by Distance-Driven Detoxification

Shaokui Wei, Jiayin Liu, Hongyuan Zha

TL;DR

This paper introduces Distance-Driven Detoxification (D3), a novel post-training method to remove backdoors from machine learning models. D3 reformulates defense as a constrained optimization problem, pushing model weights away from their initial backdoored state while preserving clean data performance, outperforming existing SOTA defenses.

What Problem Does This Paper Address?

Deep neural networks (DNNs), despite their widespread success, are vulnerable to "backdoor attacks." In these attacks, adversaries subtly poison a small portion of the training data. This manipulation causes the model to behave normally on clean, uncorrupted data but to misclassify inputs that contain a specific, often inconspicuous, "trigger." This poses a significant security risk, especially in critical applications like autonomous driving or healthcare. While various defense strategies exist, this paper focuses on post-training defenses, which aim to clean a pre-trained, potentially backdoored model without retraining from scratch. Existing post-training methods, particularly vanilla fine-tuning (re-training on clean data), often fail because they get "trapped" in parameter regions that have low loss for both clean and poisoned data, thus failing to eliminate the backdoor's influence.

Methods

The core of this paper is the Distance-Driven Detoxification (D3) method. D3 tackles the problem by framing backdoor defense as a constrained optimization problem. The key idea is to find new model weights ($\theta$) that are maximally distant from the initial backdoored weights ($\theta_{init}$) while ensuring that the model's performance on clean data (measured by clean loss, $L_{cl}$) remains within an acceptable threshold ($\epsilon$).

This is formalized as: $$ \max_{\theta} d(\theta_S, \theta_{init,S}) \quad \text{s.t.} \quad E_{(x,y) \in D_{cl}}[l(f_{\theta}(x), y)] \leq \epsilon $$ where $d$ is a distance metric, $\theta_S$ represents a subset of model weights (to manage complexity and focus on impactful parameters), and $l$ is the loss function.

To make this practical, D3 reformulates the constraint into a penalty term within the objective function, leading to: $$ \min_{\theta: \theta_S \in S} d(\theta_S, \theta_{init,S}) + \lambda \times \max(0, L_{cl}(\theta) - \epsilon) $$ Here, $\lambda$ is a hyperparameter controlling the trade-off between moving away from the initial weights and maintaining clean accuracy. The optimization is solved using Projected Gradient Descent (PGD). D3 also addresses challenges like over-fitting on limited clean data and ensuring the "distance" metric is meaningful (not just trivial scaling).

Datasets

The paper evaluates D3 on three benchmark datasets:

  • CIFAR-10: A widely used dataset of 32x32 color images in 10 classes.
  • Tiny ImageNet: A smaller version of ImageNet, containing 200 classes.
  • GTSRB: The German Traffic Sign Recognition Benchmark, containing images of traffic signs.

Additionally, the authors explore the use of a generated dataset from CIFAR-5m, which consists of synthetic CIFAR-10-like images created using diffusion models, to test D3's applicability with synthetically generated data.

Key Insights and Ideas

  • Vanilla fine-tuning gets stuck: The paper provides compelling evidence that vanilla fine-tuning often fails because it converges to parameter regions where both clean and backdoor losses are low. This "backdoor region" prevents the model from truly unlearning the backdoor.
  • Distance matters: Moving the model's weights away from their initial backdoored state is a crucial strategy for effective backdoor mitigation. This is more effective than simply trying to minimize clean loss.
  • Selective weight optimization: Focusing the distance maximization on a subset of weights (e.g., linear layers) is a practical approach to manage computational complexity and prevent over-fitting.
  • Meaningful distance: Simply maximizing weight distance can be exploited by trivial scaling. D3 introduces constraints to ensure the distance reflects meaningful changes in the model's decision-making process.
  • Trade-offs are inherent: There's a delicate balance between reducing backdoor success rate (ASR) and maintaining clean accuracy (ACC). D3 aims to find an optimal point in this trade-off space, often achieving a better balance (higher DER) than other methods.

Key Results

  • Superior ASR reduction: D3 consistently achieves significantly lower Attack Success Rates (ASR) across various attacks and datasets, often below 1% for many attacks.
  • Competitive Clean Accuracy: While D3 pushes weights away from the initial state, it maintains clean accuracy (ACC) that is competitive with, and sometimes even surpasses, other SOTA defenses.
  • High Defense Effectiveness Rating (DER): D3 frequently achieves the highest DER, indicating a strong balance between reducing backdoor risk and preserving clean performance.
  • Robustness to poisoning ratio: D3 remains effective even with substantial data poisoning (up to 50%).
  • Effectiveness with limited data: The method performs well even with small reserved clean datasets (as low as 1% of training data).
  • Resilience to adaptive attacks: D3 demonstrates robustness against adaptive attacks designed to bypass fine-tuning defenses, effectively steering the model away from problematic weight regions.

Limitations and Future Work

  • Trade-off between ACC and ASR: The paper acknowledges the inherent trade-off between clean accuracy and backdoor attack success rate. While D3 manages this trade-off well, further improvements could be made.
  • Identifying backdoor-related weights: Future work could focus on more precisely identifying which weights are most critical for the backdoor, allowing for more targeted and efficient distance measurements.
  • Handling more complex attacks: Extending D3 to handle more sophisticated and diverse backdoor attack scenarios is a promising avenue for future research.
  • Computational complexity: While D3 is designed to be practical, further optimizations for computational efficiency, especially for very large models, could be explored.

Summary updated

BibTeX
@inproceedings{wei2025backdoor,
  author = {Shaokui Wei and Jiayin Liu and Hongyuan Zha},
  title = {{Backdoor Mitigation by Distance-Driven Detoxification}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure