Introduction
Deep Learning (DL) systems are increasingly integrated into critical infrastructure, yet their "black-box" nature makes traditional software testing difficult. Unlike standard code where logic is explicit, DL models encode decision-making in millions of weights and neurons. Traditional adversarial testing methods, such as the Fast Gradient Sign Method (FGSM), often produce model-specific perturbations that lack generalizability and can result in semantically nonsensical inputs.
CAGFuzz addresses these challenges by introducing a coverage-guided fuzzing framework. It leverages generative adversarial networks (CycleGAN) to create natural-looking adversarial examples that adhere to deep semantic constraints while using neuron coverage as a feedback loop to explore hidden model logic.
Methodology
The CAGFuzz framework operates through a three-step iterative process: data collection and training, adversarial example generation, and DNN feedback.
Adversarial Case Generator (AEG)
At the core of CAGFuzz is the Adversarial Case Generator, which utilizes a CycleGAN. Unlike gradient-based methods that target specific model vulnerabilities, the AEG learns the underlying data distribution. By transforming an image into a different style and then reconstructing it, the system generates "invisible" perturbations. This approach ensures that the mutations are natural-looking and more likely to transfer across different model architectures.
Deep Semantic Constraints
To maintain the semantic integrity of test cases, CAGFuzz employs a pre-trained VGG-19 network as a "semantic judge." It extracts high-level features from both the original and mutated images, calculating their Cosine Similarity. If the similarity score falls below a threshold (e.g., 0.9), the example is discarded. This ensures that a mutated image of a car still perceptually represents a car to a human observer, preventing the generation of "garbage" adversarial inputs.
Coverage-Guided Feedback Loop
Inspired by modern security fuzzers like AFL, CAGFuzz uses Neuron Coverage (NC) as its primary feedback metric. NC measures the percentage of neurons activated by a given test set. When a generated adversarial example activates previously dormant neurons, it is prioritized for further mutation. This allows the fuzzer to systematically explore the "hidden logic" of the target neural network.
Experimental Evaluation
The authors evaluated CAGFuzz using three benchmark datasets: MNIST (handwritten digits), CIFAR-10 (object classes), and ImageNet (large-scale visual recognition). The framework was tested against various architectures, including LeNet, VGG, and ResNet.
Key Results
- Error Detection: CAGFuzz identified 1,898 potential errors, outperforming baseline tools like DeepHunter (1,319) and DeepXplore (72).
- Coverage Improvement: The framework significantly boosted neuron coverage. For example, coverage on a VGG-16 model trained on CIFAR-10 increased from 50.99% to 62.32%.
- Robustness Enhancement: Retraining models with CAGFuzz-generated data improved adversarial accuracy. VGG-16 accuracy on adversarial sets rose from 86.72% to 97.25%, a 12.14% gain.
- Generalization: Because the AEG is data-driven rather than model-driven, its test cases proved highly effective at "transferring" between different model architectures.
Conclusion
CAGFuzz demonstrates that combining generative adversarial networks with coverage-guided feedback provides a robust mechanism for stress-testing Deep Learning systems. By enforcing deep semantic constraints, it ensures test cases remain human-interpretable while effectively exposing thousands of hidden errors. Future work will focus on automating data splitting for AEG training and exploring multi-dimensional coverage metrics beyond simple neuron activation.
Summary updated