$D^3$: Detoxing Deep Learning Dataset

Lu Yan, Siyuan Cheng, Guangyu Shen, Guanhong Tao, Xuan Chen, Kaiyuan Zhang, Yunshu Mao, Xiangyu ZhangBUGS @ NeurIPS 2023

TL;DR

This paper introduces $D^3$, a novel post-mortem technique for detoxifying deep learning datasets poisoned with backdoor attacks. By analyzing a few compromised test samples, $D^3$ extracts the malicious "trigger" and uses it to retrain a classifier, effectively identifying and removing poisoned data. This approach significantly outperforms existing methods, achieving over 95% precision and recall on a diverse set of poisoned datasets.

What Problem Does This Paper Address?

Deep learning models are vulnerable to data poisoning attacks, where malicious actors inject specially crafted "poisoned" samples into the training data. A common type of this attack is the "backdoor attack," where a subtle, often imperceptible, trigger is embedded in the input data. When this trigger is present during inference, the model misclassifies the input to a target class chosen by the attacker, while behaving normally on clean data. Existing defenses against these attacks are often outpaced by increasingly sophisticated poisoning methods, especially those that are "stealthy" (e.g., clean-label attacks where labels aren't changed, or input-aware attacks where the trigger depends on the input). This paper addresses the challenge of detecting and removing these sophisticated backdoor attacks after a model has been trained, a scenario where many existing defenses fail.

Methods

$D^3$ employs a four-step post-mortem approach:

  1. Poison Extraction via Differential Analysis: Given a few poisoned test samples and a set of clean validation samples (from the victim class), $D^3$ formulates poison extraction as a constrained optimization problem. It uses iterative gradient descent to find a "clean" version of the test sample and the "poison" (trigger). This process is guided by several rules: the extracted poison should resemble the original trigger, it should be effective in causing misclassification, and it should be small and stealthy. $D^3$ handles two types of poisons: "patch-like" (a localized pattern) and "pervasive" (subtle, widespread perturbations).
  2. Poison Data Augmentation: The extracted poison is then applied to clean validation samples to create synthetic poisoned samples. This step is crucial because the initial set of poisoned test samples is often too small to train a robust classifier.
  3. Training a Classifier: A classifier is trained to distinguish between clean target class samples and the synthetically generated poisoned samples. This classifier learns to identify the features associated with the extracted poison.
  4. Dataset Detoxification: The trained classifier is then used to scan the original training dataset, identifying and separating clean from poisoned samples.

Datasets

The paper evaluates $D^3$ on a comprehensive set of datasets:

  • TrojAI: 39 poisoned datasets from the TrojAI program, which provides poisoned models and synthetic datasets with various architectures and attack types.
  • CIFAR10: A popular image classification dataset.
  • VGGFace: A dataset for face recognition.
  • ImageNet: A large-scale image dataset.

These datasets were poisoned using 18 different types of poisons, including clean-label, dynamic, and input-aware backdoor attacks.

Key Insights and Ideas

  • Post-mortem analysis is crucial: In scenarios where defenses fail, a retrospective approach to identify and remove poisons is essential.
  • Differential analysis for trigger extraction: By comparing poisoned test samples with clean validation samples and using optimization, $D^3$ can effectively isolate the malicious trigger, even for stealthy attacks.
  • Data augmentation bridges the gap: Creating synthetic poisoned data from extracted triggers is vital for training a robust classifier when only a few real poisoned samples are available.
  • Logits are key: The classifier in $D^3$ operates on the "logits" (raw output scores before the final activation) of the trojaned model, which capture more nuanced information about the model's internal state than just the final predictions. This allows $D^3$ to be effective even when the extracted trigger differs slightly from the original.
  • Architecture Agnostic: $D^3$ demonstrates effectiveness across a variety of neural network architectures, suggesting its broad applicability.

Key Results

  • $D^3$ achieves over 95% precision and 95% recall on average across 42 poisoned datasets and 18 poison types.
  • It substantially outperforms state-of-the-art methods like TRACEBACK, Activation Clustering (AC), Spectral Signature (SS), and STRIP. For instance, TRACEBACK's average precision and recall are significantly lower, and in some cases, it fails entirely.
  • $D^3$ also shows superior performance compared to black-box reverse engineering tools like ABS and FeatureRE, highlighting the importance of having poisoned test samples for effective trigger extraction.
  • The method is robust to variations in poisoning rate, validation set size, and the number of known poisoned samples.

Limitations and Future Work

  • Scope of Application: Currently, $D^3$ is primarily designed for Computer Vision (CV) datasets and image detoxification. The reliance on a pre-trained StyleGAN for generating clean samples from noise limits its direct applicability to other domains.
  • Attack Type Specificity: $D^3$ is most effective when the captured poisoned test samples correspond to attack types it has been trained to handle. While it can generalize to variations, it might struggle with entirely novel or unseen attack mechanisms.
  • Optimization Formula Separation: The paper uses separate optimization formulas for patch and pervasive triggers. While this aligns with common practice in the field, it could be seen as a limitation if a more unified approach were possible.

The authors suggest that future work could explore extending $D^3$ to other domains beyond CV and potentially developing a more unified optimization strategy for different trigger types.

Summary updated

BibTeX
@inproceedings{yan2023d,
  author = {Lu Yan and Siyuan Cheng and Guangyu Shen and Guanhong Tao and Xuan Chen and Kaiyuan Zhang and Yunshu Mao and Xiangyu Zhang},
  title = {{$D^3$: Detoxing Deep Learning Dataset}},
  booktitle = {BUGS @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=RYU6qiidVL},
}
Figure