Poison as a Cure: Detecting & Neutralizing Variable-Sized Backdoor Attacks in Deep Neural Networks

Alvin Chan, Yew-Soon OngarXiv 2019

Abstract

Deep learning models have recently shown to be vulnerable to backdoor poisoning, an insidious attack where the victim model predicts clean images correctly but classifies the same images as the target class when a trigger poison pattern is added. This poison pattern can be embedded in the training dataset by the adversary. Existing defenses are effective under certain conditions such as a small size of the poison pattern, knowledge about the ratio of poisoned training samples or when a validated clean dataset is available. Since a defender may not have such prior knowledge or resources, we propose a defense against backdoor poisoning that is effective even when those prerequisites are not met. It is made up of several parts: one to extract a backdoor poison signal, detect poison target and base classes, and filter out poisoned from clean samples with proven guarantees. The final part of our defense involves retraining the poisoned model on a dataset augmented with the extracted poison signal and corrective relabeling of poisoned samples to neutralize the backdoor. Our approach has shown to be effective in defending against backdoor attacks that use both small and large-sized poison patterns on nine different target-base class pairs from the CIFAR10 dataset.

Introduction

Deep learning models, despite achieving human-level accuracy on standard benchmarks, remain surprisingly fragile. They are particularly susceptible to Backdoor Poisoning (BP), a "Trojan Horse" style attack where an adversary inserts a specific trigger—such as a small dot or a transparent overlay—into a fraction of the training data. The resulting model behaves normally on clean images but misclassifies them into a specific "target class" whenever the trigger is present.

Most existing defenses require a verified clean dataset, knowledge of the poison ratio, or only work against small, pixel-sized triggers. Researchers from Nanyang Technological University have proposed a more robust, self-contained defense that uses the model’s own internal sensitivity to find and fix the backdoor.

The Challenge of Blind Detection

Backdoor attacks are insidious because they do not degrade overall performance; a poisoned model appears healthy until the trigger is activated. The core challenge is blind detection: identifying poisoned samples without knowing the trigger's appearance, the attack's scale, or even which classes are affected.

Methodology: Turning the Poison into a Cure

The proposed defense framework consists of four modular steps designed to detect and neutralize attacks without prior knowledge.

1. Poison Extraction

The authors hypothesize that "poison neurons"—those activated specifically by the trigger—possess significantly larger weights than normal neurons. By calculating the input gradient (the sensitivity of the loss with respect to each pixel), the poison signal can be distilled from the background noise. Using Singular Value Decomposition (SVD) on these gradients allows the system to extract a candidate poison signal.

Visualization of input gradients used for poison signal extraction.

2. Poison Filtering and Class Detection

Once a candidate signal is extracted, a Gaussian Mixture Model (GMM) clusters the images. Poisoned images exhibit gradients highly similar to the extracted signal, while clean images appear as random noise. To identify the "target" and "base" classes, the system measures the Wasserstein distance between gradient clusters. A poisoned class displays a distinct, two-peak distribution (clean vs. poisoned), whereas a safe class shows a single, unified cluster.

Distribution of clean vs. poisoned samples based on gradient similarity.

3. Neutralization

The final stage involves retraining the model using two strategies:

  • Counter-Poisoning: The extracted poison signal is added to images of all classes during retraining, teaching the model to ignore the trigger.
  • Corrective Relabeling: Filtered poisoned samples are relabeled back to their original "base" class, restoring the model's integrity.

Experimental Results

The defense was evaluated on the CIFAR-10 dataset using ResNet18 and VGG19 architectures across nine different target-base class pairs. Key findings include:

  • Attack Neutralization: In a "Dog-to-Cat" attack scenario, the model's accuracy on poisoned images improved from 2.5% to 95.3% post-defense.
  • Clean Accuracy Preservation: The "cure" maintained the model's performance on clean data, with accuracy drops typically limited to 1% or less.
  • Robustness: The method consistently outperformed baseline defenses like Activation Clustering (AC) and Spectral Signatures, particularly in difficult "overlay" attack scenarios where triggers are large and transparent.

Conclusion

By leveraging input gradients, this framework effectively "snitches" on the backdoor signal. Its independence from prior knowledge of the poison ratio or a clean validation set makes it a practical solution for real-world security. While future work may need to address adaptive attacks that attempt to hide signals within gradients, this modular approach provides a strong foundation for neutralizing both small and large-scale backdoor threats.

Summary updated

BibTeX
@misc{chan2019poison,
  author = {Alvin Chan and Yew-Soon Ong},
  title = {{Poison as a Cure: Detecting \& Neutralizing Variable-Sized Backdoor Attacks in Deep Neural Networks}},
  year = {2019},
  eprint = {1911.08040},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.08040},
}
Figure