Activation Gradient based Poisoned Sample Detection Against Backdoor Attacks

Danni Yuan, Shaokui Wei, Mingda Zhang, Li Liu, Baoyuan Wu

TL;DR

Researchers have developed AGPD (Activation Gradient based Poisoned sample Detection), a novel defense against backdoor attacks that identifies poisoned training data by analyzing the "circular distribution" of activation gradients. By shifting focus from raw activations to how gradients behave, AGPD achieves near-perfect detection rates even against sophisticated "adaptive" attacks that bypass traditional defenses.

What Problem Does This Paper Address?

Deep Neural Networks (DNNs) are notoriously vulnerable to backdoor attacks. An adversary can "poison" a small portion of the training dataset by adding a specific trigger (like a small patch or a subtle color shift) and changing the label to a target class. The resulting model performs normally on clean data but misbehaves predictably when it sees the trigger.

The primary defense is Poisoned Sample Detection (PSD)—filtering out these malicious samples before training is complete. However, modern "adaptive" attacks are designed to make poisoned samples look identical to clean samples in the model's internal activation space, rendering many current defenses (like Activation Clustering or Spectral Signatures) ineffective. The challenge is finding a metric that remains discriminative even when the attacker is trying to hide.

Methods

The authors introduce a new perspective: the Gradient Circular Distribution (GCD). Instead of looking at where a sample ends up in activation space, they look at the direction of the gradient with respect to those activations.

Figure 2: Illustrations of gradient circular distribution (GCD) and two metrics, and the pipeline of the proposed APGD method which consists of three stages: 1) calculating activation gradient distribution, 2) identifying target class(es), and 3) filtering out poisoned samples within the identified target class(es).

The AGPD method works in three stages:

  1. Calculate GCD: For every sample in a class, they calculate the angle of its activation gradient relative to a known clean reference sample. This creates a circular distribution of angles.
  2. Identify Target Classes: They found that target classes (those containing poisoned samples) have a much higher "dispersion" in their GCD than clean classes. They use a novel metric called CVBT (Cosine similarity Variation towards Basis Transition) and robust Z-scores to flag suspicious classes.
  3. Filter Poisoned Samples: Within the flagged target classes, poisoned and clean samples naturally separate into distinct arcs on the circle. AGPD iteratively filters out samples that are "far" from the clean reference until the distribution stabilizes.

Datasets

The method was rigorously tested across five diverse datasets:

  • CIFAR-10: A standard benchmark for image classification.
  • Tiny ImageNet: A more complex dataset with 200 classes.
  • ImageNet(subset)-200: A subset of the full ImageNet for high-resolution testing.
  • GTSRB: The German Traffic Sign Recognition Benchmark (imbalanced real-world data).
  • DTD: The Describable Textures Dataset (balanced real-world data).

Key Insights and Ideas

  • Gradients as a "Mapping Direction": Backdoored models are forced to map two very different inputs—a clean sample and a poisoned sample—to the same activation area to produce the same target label. Because the starting points in the input space are so different, the "directions" (gradients) needed to reach that activation area must be significantly different.
  • The Dispersion Signature: In a clean class, gradients tend to point in similar directions. In a poisoned target class, the mixture of clean and poisoned samples creates a much more spread-out, dispersed distribution of gradient directions.
Figure 1: Gradient circular distributions (GCDs) across four classes of CIFAR-10, on the clean model (left), Blended attacked model (middle), and SSBA attacked model (right), respectively. The value along with each arc indicates the CVBT value. The GCD of the target class (covering both black and blue arcs). Note that we moved three clean classes’ arcs to different quadrants to avoid visual overlap.

Key Results

AGPD demonstrated state-of-the-art performance across 12 different types of backdoor attacks, including sample-specific and adaptive attacks that foil other detectors.

  • Superior Detection: On CIFAR-10, AGPD achieved an average True Positive Rate (TPR) of 96.66% with a False Positive Rate (FPR) of only 0.17%. On Tiny ImageNet, the TPR reached 99.92%.
  • Robustness to Poisoning Ratio: Unlike many methods that fail when the percentage of poisoned samples is very low (e.g., 0.5%), AGPD remains stable and effective.
Figure 3: Detection performance of AGPD and the compared detectors with poisoing ratios ranging from 0.5% to 10%.
  • Multi-Target Success: The method also excels in complex scenarios where the attacker targets multiple classes simultaneously, maintaining an average F1 score of 98.41%.

Limitations and Future Work

The main drawback identified is computational overhead. The current implementation scans through all layers of a model to find the most discriminative one, which can be expensive for very deep networks or massive datasets.

The authors observed that the best separation usually occurs in the later intermediate convolutional layers. Future work will focus on narrowing the search range to specific layers to improve efficiency without sacrificing detection accuracy.

Summary updated

BibTeX
@inproceedings{yuan2025activation,
  author = {Danni Yuan and Shaokui Wei and Mingda Zhang and Li Liu and Baoyuan Wu},
  title = {{Activation Gradient based Poisoned Sample Detection Against Backdoor Attacks}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=VNMJfBBUd5},
}
Figure