Backdoor Cleansing with Unlabeled Data

Lu Pang, Tao Sun, Haibin Ling, Chao Chen

Abstract Deep Neural Networks (DNNs) are increasingly susceptible to backdoor attacks, where an adversary injects a hidden trigger into the training set to manipulate model behavior at inference time. Existing defense mechanisms typically rely on a small set of clean, labeled data to "unlearn" these malicious behaviors. However, in many practical scenarios, end-users lack access to the original labels or even in-distribution data. This paper introduces BCU (Backdoor Cleansing with Unlabeled Data), the first defense framework capable of removing backdoors using only unlabeled data, including data from entirely different distributions. By combining knowledge distillation with a novel adaptive layer-wise initialization strategy, BCU effectively purges backdoor triggers while maintaining high classification accuracy on benign inputs.

Introduction

The outsourcing of DNN training and the use of pre-trained models from public repositories have introduced significant security risks, most notably backdoor attacks. In such attacks, a model performs correctly on standard inputs but misclassifies any input containing a specific "trigger" into a target class chosen by the adversary.

Comparison of data regimes for backdoor defense: (a) traditional labeled in-distribution, (b) unlabeled in-distribution, and (c) the proposed unlabeled out-of-distribution setting.

While several defenses exist, they often assume the defender has access to a subset of the original training data with ground-truth labels. BCU relaxes these assumptions, addressing the challenge of cleansing a compromised model using only a collection of random, unlabeled images.

Methodology: The BCU Framework

BCU employs a teacher-student architecture to "wash" the poisoned model. The process consists of two primary components:

  1. Knowledge Distillation (KD) on Unlabeled Data: The potentially compromised model serves as the "teacher." A "student" model is trained to match the teacher's output logits on clean, unlabeled samples. Since these samples do not contain the secret trigger, the teacher only exhibits its learned benign behavior. Consequently, the student learns the correct classification logic while the dormant backdoor behavior fails to transfer.
  2. Adaptive Layer-wise Initialization (ALI): To accelerate convergence and preserve accuracy, the student is not trained from scratch. Instead, it is initialized using a strategic blend of the teacher's weights and random noise. Research indicates that backdoor mappings are often concentrated in deeper layers of the network. BCU applies a higher ratio of random initialization to these deeper layers to break the backdoor path, while retaining more of the teacher's weights in shallower layers to preserve general feature extraction capabilities.
The BCU pipeline: Unlabeled images are passed through a teacher (poisoned) and student model. Knowledge distillation via KL loss transfers benign behavior, while adaptive initialization prevents backdoor transfer.

Experimental Evaluation

The researchers evaluated BCU against six representative backdoor attacks, including Badnets, Blended, and WaNet. Testing was conducted on standard benchmarks like CIFAR-10 and GTSRB. To test the robustness of the method in Out-of-Distribution (OOD) scenarios, Tiny-ImageNet was used as an unlabeled dataset to cleanse models trained on CIFAR-10.

Key Results and Insights

  • Effectiveness without Labels: On CIFAR-10, BCU reduced the Attack Success Rate (ASR) from approximately 97% to just 3.74%, with a negligible drop in clean accuracy (1.15%). This demonstrates that the teacher's predictions on clean data provide sufficient information for effective cleansing.
  • OOD Versatility: BCU successfully cleansed a traffic-sign classifier (GTSRB) using random images of animals and landscapes. This suggests that the distillation process focuses on the underlying logic of the model rather than domain-specific pixel patterns.
  • Layer Sensitivity: The success of ALI confirms that "deep" layers (late in the network) are more likely to harbor backdoor-to-target-class mappings, whereas "shallow" layers primarily hold general visual features.

Conclusion and Limitations

BCU represents a significant advancement in model security by removing the dependency on labeled data for backdoor defense. However, the method faces challenges when poisoning rates are exceptionally high (e.g., 20%), as the teacher may develop a bias toward the target class even on clean images. Future work will explore optimized data selection strategies to further enhance the cleansing effect, particularly against stealthy, "invisible" triggers.

Summary updated

BibTeX
@inproceedings{pang2022backdoor,
  author = {Lu Pang and Tao Sun and Haibin Ling and Chao Chen},
  title = {{Backdoor Cleansing with Unlabeled Data}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
}
Figure