Concolic testing for deep neural networks

Youcheng Sun, Min Wu, Wenjie Ruan, Xiaowei Huang, Marta Kwiatkowska, Daniel Kroening

Introduction

As Deep Neural Networks (DNNs) are increasingly deployed in safety-critical applications like autonomous driving and medical diagnostics, the "black box" nature of these models becomes a major liability. Traditional software testing relies on "coverage"—ensuring every line of code or logic path is exercised. However, DNNs do not have traditional code paths; their logic is distributed across millions of weights and activation functions. Existing testing methods for DNNs were either too shallow, relying on random or concrete testing that fails in high-dimensional spaces, or struggled to scale due to the "path explosion" problem inherent in pure symbolic execution.

This paper introduces DeepConcolic, the first concolic testing framework for DNNs. By combining concrete execution with symbolic analysis, DeepConcolic systematically explores a model's behavior, identifying subtle vulnerabilities that simpler search methods often miss.

Methodology: The Concolic Loop

The authors adapt concolic testing—a portmanteau of concrete and symbolic—to the specific architecture of DNNs. The process operates in an iterative loop:

  1. Concrete Execution: The DNN is run on a specific input (e.g., an image of a handwritten digit) to record which neurons are activated.
  2. Requirement Ranking: A heuristic identifies which "coverage requirements" (such as an unactivated neuron) are closest to being satisfied based on the current run.
  3. Symbolic Analysis: The framework formulates a mathematical constraint using Linear Programming or Global Optimization to find a new input. This input is designed to be similar to the original but triggers a specific change in the network's internal state, such as flipping a ReLU activation from 'off' to 'on'.
  4. Iteration: This new input is added to the test suite, and the process repeats until the desired coverage level is reached.

The researchers formalized these requirements using Quantified Linear Arithmetic over Rationals (QLAR), allowing them to define both structural metrics (like Neuron Coverage) and semantic metrics (like Lipschitz continuity) within a single mathematical framework.

Comparative Analysis

DeepConcolic represents a significant advancement over previous state-of-the-art tools. Unlike earlier frameworks that often focused on a single metric or a specific search strategy, DeepConcolic is designed as a general-purpose framework capable of handling multiple coverage criteria and distance metrics.

Comparison of DeepConcolic with state-of-the-art DNN testing tools.

As shown in the table above, DeepConcolic supports a wider array of coverage criteria, including Neuron Coverage (NC), Sign-Sign Coverage (SSC), and Neuron Boundary Coverage (NBC). While tools like DeepXplore and DeepTest utilize gradient-based or greedy search methods, DeepConcolic’s use of concolic testing allows for a more rigorous exploration of the input space.

Key Insights and Results

  • ReLU as a Logic Gate: The paper treats the Rectified Linear Unit (ReLU) function as a "path divergence" point, effectively treating a DNN as a traditional program with conditional branches.
  • Superior Coverage: In evaluations on the MNIST dataset, DeepConcolic achieved 97.6% neuron coverage, significantly outperforming DeepXplore, which reached approximately 82%.
  • Adversarial Discovery: The tool successfully identified adversarial examples with perturbations as small as 1/255, the smallest possible change in a standard image pixel. This demonstrates its ability to find vulnerabilities that are invisible to the human eye.
  • Metric Sensitivity: The authors noted that the discovery of adversarial examples varies based on the distance metric used ($L_\infty$ vs $L_0$), highlighting that DNN safety cannot be validated using a single metric alone.

Limitations and Future Work

While highly effective, DeepConcolic faces challenges regarding computational cost. The reliance on Linear Programming (LP) solvers and global optimization makes scaling to "ImageNet-scale" models with hundreds of layers difficult. Furthermore, the performance of the concolic loop is highly dependent on search heuristics. Future research will focus on the automated generation of better heuristics and addressing the "oracle problem"—the difficulty of determining the ground truth for automatically generated, perturbed inputs in complex real-world scenarios.

Summary updated

BibTeX
@inproceedings{sun2018concolic,
  author = {Youcheng Sun and Min Wu and Wenjie Ruan and Xiaowei Huang and Marta Kwiatkowska and Daniel Kroening},
  title = {{Concolic testing for deep neural networks}},
  booktitle = {ASE},
  year = {2018},
  doi = {10.1145/3238147.3238172},
}
Figure