Testing Deep Neural Networks

Youcheng Sun, Xiaowei Huang, Daniel KroeningarXiv 2018

Introduction

Deep Neural Networks (DNNs) are increasingly deployed in safety-critical domains, yet their internal logic remains opaque. Traditional software testing relies on code coverage metrics (e.g., statement or branch coverage) to ensure reliability. However, in DNNs, the logic resides in the weights and activations rather than the source code. This paper addresses the need for rigorous, scalable testing criteria by adapting the Modified Condition/Decision Coverage (MC/DC) standard—a gold standard in avionics—to the neural network architecture.

Methodology: Adapting MC/DC for DNNs

The core innovation lies in treating neurons in adjacent layers as conditions and decisions. In traditional MC/DC, a test must demonstrate that a single condition independently affects the outcome. Here, the authors define four coverage criteria based on the causal relationship between a "condition" neuron in layer $i$ and a "decision" neuron in layer $i+1$.

A standard feed-forward neural network architecture used to define condition and decision neurons across layers.

The criteria are categorized by changes in the sign (activation status) or value of the neurons:

  1. Sign-Sign (SS): A sign change in the input neuron causes a sign change in the output neuron.
  2. Value-Sign (VS): A small value change in the input causes a sign change in the output.
  3. Sign-Value (SV): A sign change in the input causes a significant value change in the output.
  4. Value-Value (VV): A value change in the input causes a significant value change in the output.

To generate test cases that satisfy these criteria, the researchers used Linear Programming (LP) for small-to-medium networks and gradient-based heuristic searches for massive architectures like VGG16.

Table illustrating the tracking of sign changes (sc) across different neuron activations for given input pairs to satisfy coverage criteria.

Experimental Evaluation

The approach was validated across three major benchmarks: MNIST (fully connected networks), CIFAR-10 (CNNs), and ImageNet (VGG16). The tools achieved nearly 100% coverage on most MNIST and CIFAR-10 models, demonstrating both efficiency and scalability.

Key Insights and Results

  • Causality as a Metric: Unlike previous metrics that looked at neurons in isolation, these criteria capture the causal relationship between layers, allowing developers to understand why a model reached a certain decision.
  • Adversarial Discovery: The authors found that pushing for higher coverage naturally uncovers adversarial vulnerabilities. These "bugs" are most frequently found when testing the middle layers of a network.
  • Granularity: Testing finer-grained features (individual neurons) helps find more subtle, high-quality adversarial examples than testing coarse-grained features.

Conclusion

By bridging the gap between formal verification and heuristic testing, this framework provides a rigorous method for quantifying DNN robustness. While the choice of thresholds for "significant" changes remains heuristic, the ability to scale MC/DC-like rigor to models as large as VGG16 marks a significant step toward safer autonomous systems.

Summary updated

BibTeX
@misc{sun2018testing,
  author = {Youcheng Sun and Xiaowei Huang and Daniel Kroening},
  title = {{Testing Deep Neural Networks}},
  year = {2018},
  eprint = {1803.04792},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1803.04792},
}
Figure