Adversarial sample detection for deep neural network through model mutation testing

Jingyi Wang, Guoliang Dong, Jun Sun, Xinyu Wang, Peixin Zhang

TL;DR

Deep Neural Networks (DNNs) are notoriously easy to fool with "adversarial samples"—inputs with tiny, invisible tweaks that cause misclassification. This paper proposes a clever runtime defense: by slightly "mutating" the DNN (e.g., flipping a few neurons), researchers found that adversarial samples change their predicted labels much more frequently than normal samples. By measuring this "Label Change Rate" (LCR) using statistical hypothesis testing, they can accurately flag suspicious inputs in real-time without the need for expensive model retraining.

What Problem Does This Paper Address?

While DNNs excel at tasks like image recognition, they are fragile. An attacker can add a layer of "noise" to a picture of a cat that is imperceptible to humans but causes a DNN to see a dog.

Existing defenses generally fall into two camps: proactive hardening (like adversarial training, which is computationally expensive and often fails against new types of attacks) and formal verification (which provides mathematical guarantees but doesn't scale well to large networks). The authors identify a gap for a runtime detection mechanism that is lightweight, accurate, and agnostic to the specific type of attack used.

Methods

The core of the approach is Model Mutation Testing. Instead of changing the input, the authors change the model.

  1. Mutation Operators: They define four ways to "tweak" a trained DNN without destroying its overall accuracy:
  2. Gaussian Fuzzing (GF): Adding random noise to weights.
  3. Weight Shuffling (WS): Shuffling weights within a neuron.
  4. Neuron Switch (NS): Swapping two neurons in a layer.
  5. Neuron Activation Inverse (NAI): Flipping the activation status of a neuron.
  6. Label Change Rate (LCR): For a given input, they generate a set of these slightly mutated models. The LCR is the percentage of these mutants that give a different prediction than the original model.
  7. Statistical Detection (SPRT): To make detection fast, they use the Sequential Probability Ratio Test (SPRT). Instead of testing a fixed number of mutants, the algorithm tests them one by one and stops as soon as it has enough statistical confidence to label the input as "normal" or "adversarial."

Datasets

The researchers evaluated their method using two standard computer vision benchmarks:

  • MNIST: A dataset of handwritten digits (0-9).
  • CIFAR10: A dataset of 60,000 tiny color images in 10 classes (airplane, bird, cat, etc.).

They tested against a wide battery of state-of-the-art attacks, including FGSM, JSMA, DeepFool, C&W, and Black-Box attacks.

Key Insights and Ideas

  • The "Sensitivity" Hypothesis: The "aha moment" is the observation that adversarial samples are fundamentally more "sensitive" to model perturbations. Because adversarial samples are mathematically engineered to sit just across a decision boundary, even a tiny shift in that boundary (caused by mutation) is likely to "kick" the sample back to a different class.
  • Distinguishable LCR: Normal samples are robust; they sit deep within the "territory" of their class, so small mutations rarely change their label. The paper empirically proves that the LCR for adversarial samples is significantly higher than for normal ones.
  • Efficiency via SPRT: By treating detection as a statistical sampling problem, the authors avoid the need to run hundreds of mutants for every single input, making the system viable for real-world deployment.

Key Results

  • High Accuracy: Using the NAI mutation operator, the system detected 96.4% of adversarial samples for MNIST and 90.6% for CIFAR10.
  • Superior Performance: In head-to-head comparisons (using AUROC scores), this mutation-based approach outperformed existing baselines (like density estimation and uncertainty metrics) in over half of the tested scenarios.
  • Speed: The detection is lightweight. With pre-cached mutated models, an input can be verified in under 0.1 seconds on a single machine.
  • Robustness to "Wrongly Labeled" Data: Interestingly, the method also flagged samples that were naturally misclassified by the original model, suggesting these samples also sit near decision boundaries.

Limitations and Future Work

  • Threshold Sensitivity: The system relies on a threshold ($\varsigma_h$) to distinguish between normal and adversarial LCR. Setting this threshold requires some prior knowledge or a "tuning" phase.
  • The Arms Race: The authors acknowledge that a sophisticated attacker who knows about this defense might try to craft "robust" adversarial samples that are less sensitive to mutations (though this would likely make the attacks much harder to generate).
  • Model Specificity: While it works well on LeNet and GooglLeNet, future work is needed to see how this scales to massive architectures like ResNet or Transformers used in production environments.
  • False Positives: There is an inherent trade-off between catching every attack and accidentally flagging "hard" but legitimate images as adversarial.

Summary updated

BibTeX
@inproceedings{wang2019adversarial,
  author = {Jingyi Wang and Guoliang Dong and Jun Sun and Xinyu Wang and Peixin Zhang},
  title = {{Adversarial sample detection for deep neural network through model mutation testing}},
  booktitle = {ICSE},
  year = {2019},
  url = {https://openreview.net/forum?id=RBoI3nDoTg},
}

Loading related content...

Figure