GGT: Graph-guided testing for adversarial sample detection of deep neural network

Zuohui Chen, Renxuan Wang, Jingyang Xiang, Yue Yu, Xin Xia, Shouling Ji, Qi Xuan, Xiaoniu YangComput. Secur 2021 · DOI

Abstract

Deep Neural Networks (DNN) are known to be vulnerable to adversarial samples, the detection of which is crucial for the wide application of these DNN models. Recently, a number of deep testing methods in software engineering were proposed to find the vulnerability of DNN systems, and one of them, i.e., Model Mutation Testing (MMT), was used to successfully detect various adversarial samples generated by different kinds of adversarial attacks. However, the mutated models in MMT are always huge in number (e.g., over 100 models) and lack diversity (e.g., can be easily circumvented by high-confidence adversarial samples), which makes it less efficient in real applications and less effective in detecting high-confidence adversarial samples. In this study, we propose Graph-Guided Testing (GGT) for adversarial sample detection to overcome these aforementioned challenges. GGT generates pruned models with the guide of graph characteristics, each of them has only about 5% parameters of the mutated model in MMT, and graph guided models have higher diversity. The experiments on CIFAR10 and SVHN validate that GGT performs much better than MMT with respect to both effectiveness and efficiency.

Introduction

Deep Neural Networks (DNNs) are famously powerful but notoriously brittle. A tiny, invisible tweak to an image—an "adversarial perturbation"—can trick a world-class model into misidentifying a stop sign as a speed limit sign. Detecting these attacks is a high-stakes game of cat and mouse. One of the best ways to catch an adversarial attack is to use a "jury" of models. If the original model says "cat" but 100 slightly different versions of that model say "dog," something is fishy. This is the core idea behind Model Mutation Testing (MMT).

However, MMT has two major flaws:

  1. Efficiency: It often requires over 100 full-sized models, making it too slow for real-time use or embedded systems.
  2. Diversity: The "mutated" models are often too similar to the original. Smart attackers can create "high-confidence" adversarial samples that trick the whole jury simultaneously.

The authors of GGT set out to create a jury that is both diverse (harder to trick) and lightweight (faster to run).

Methodology

GGT shifts the focus from random mutations to structural pruning guided by Relational Graphs. The core innovation lies in mapping neural network layers to graph structures to guide the pruning process.

Graph Mapping and Pruning

The researchers represent the connections between neurons in a DNN layer as a graph. By abstracting the architecture this way, they can apply graph theory metrics to determine which connections are critical and which can be pruned while maintaining diversity.

Mapping a 3-layer MLP to a relational graph structure.

Instead of randomly deleting connections, they use graph metrics to decide which ones to keep:

  • Average Degree (AD): Controls how sparse the model is. GGT models are incredibly lean, keeping only about 5% of the original parameters.
  • Average Shortest Path Length (ASPL): This measures how "close" nodes are to each other. The authors found that graphs with shorter ASPLs create pruned models that maintain higher accuracy.

The GGT Workflow

When a new image comes in, GGT passes it through the original model and a sequence of these pruned models. They use Sequential Probability Ratio Testing (SPRT) to finalize a verdict. Instead of running a fixed number of models, the system keeps testing pruned models one by one until it has enough statistical evidence to label the input as "Normal" or "Adversarial."

The GGT workflow: from graph generation to statistical detection using SPRT.

Evaluation and Results

The authors evaluated GGT using two standard computer vision benchmarks: CIFAR10 and SVHN (Street View House Numbers). They tested against six different types of attacks, ranging from simple gradient methods (FGSM) to complex optimization-based attacks (Carlini & Wagner).

Key Insights

  • Diversity is Defensive: Because GGT models are pruned based on different graph structures, their decision boundaries shift in diverse ways. This makes it much harder for an attacker to find a "blind spot" that all models share.
  • The ASPL "Sweet Spot": The paper reveals a link between network science and AI: models guided by graphs with shorter path lengths (ASPL 3-5) are better at capturing the subtle differences between clean and adversarial data.
  • Efficiency Gains: GGT significantly outperformed MMT. On CIFAR10, GGT achieved 93.61% detection accuracy, compared to MMT’s 74.74%. Furthermore, GGT needed only about 30 pruned models on average to reach a verdict, whereas MMT required 50 to 77 full-sized models.

Conclusion

GGT demonstrates that structural diversity through graph-guided pruning is a powerful defense against adversarial samples. By using only 5% of the original parameters, GGT creates a more robust and efficient "jury" than traditional mutation methods, particularly against high-confidence attacks where MMT's accuracy typically plummets. Future work will look toward extending this logic to Recurrent Neural Networks (RNNs) and Transformers.

Summary updated

BibTeX
@article{chen2021ggt,
  author = {Zuohui Chen and Renxuan Wang and Jingyang Xiang and Yue Yu and Xin Xia and Shouling Ji and Qi Xuan and Xiaoniu Yang},
  title = {{GGT: Graph-guided testing for adversarial sample detection of deep neural network}},
  journal = {Comput. Secur.},
  year = {2021},
  doi = {10.1016/j.cose.2024.103710},
}
Figure