[Paper Review] NPC: Neuron Path Coverage via Characterizing Decision Logic of Deep Neural Networks
This paper proposes NPC (Neuron Path Coverage), an interpretable testing criterion for deep neural networks (DNNs) that models decision logic via a decision graph derived from critical neuron activations. By analyzing control-flow and data-flow paths in this graph, NPC measures test adequacy through two path coverage variants—SNPC (control-flow-based) and ANPC (data-flow-based)—demonstrating strong correlation with defect detection and model fairness.
Deep learning has recently been widely applied to many applications across different domains, e.g., image classification and audio recognition. However, the quality of Deep Neural Networks (DNNs) still raises concerns in the practical operational environment, which calls for systematic testing, especially in safety-critical scenarios. Inspired by software testing, a number of structural coverage criteria are designed and proposed to measure the test adequacy of DNNs. However, due to the blackbox nature of DNN, the existing structural coverage criteria are difficult to interpret, making it hard to understand the underlying principles of these criteria. The relationship between the structural coverage and the decision logic of DNNs is unknown. Moreover, recent studies have further revealed the non-existence of correlation between the structural coverage and DNN defect detection, which further posts concerns on what a suitable DNN testing criterion should be. In this paper, we propose the interpretable coverage criteria through constructing the decision structure of a DNN. Mirroring the control flow graph of the traditional program, we first extract a decision graph from a DNN based on its interpretation, where a path of the decision graph represents a decision logic of the DNN. Based on the control flow and data flow of the decision graph, we propose two variants of path coverage to measure the adequacy of the test cases in exercising the decision logic. The higher the path coverage, the more diverse decision logic the DNN is expected to be explored. Our large-scale evaluation results demonstrate that: the path in the decision graph is effective in characterizing the decision of the DNN, and the proposed coverage criteria are also sensitive with errors including natural errors and adversarial examples, and strongly correlated with the output impartiality.
Motivation & Objective
- Address the lack of interpretability in existing DNN structural coverage criteria, which are often opaque and poorly correlated with actual decision logic.
- Overcome the limitations of neuron activation-based coverage (e.g., Neuron Coverage) by modeling the decision-making process of DNNs through a structured representation.
- Develop a test adequacy criterion grounded in the control-flow and data-flow of DNNs to better capture diverse decision behaviors.
- Improve the sensitivity of testing to natural errors and adversarial examples by aligning coverage with actual decision logic.
- Establish a clear, interpretable link between test coverage and model behavior, enabling more systematic and meaningful DNN testing.
Proposed method
- Construct a decision graph from a DNN by identifying critical neurons based on activation patterns from training data.
- Model the decision logic of the DNN as paths in the decision graph, where each path represents a sequence of neuron activations across layers.
- Define SNPC (Structural Neuron Path Coverage) based on control-flow paths, measuring whether different decision paths are exercised by test inputs.
- Define ANPC (Activation-based Neuron Path Coverage) based on data-flow paths, measuring the diversity of activation values along critical decision paths.
- Use clustering of activation values from important neurons to group and identify representative decision paths.
- Integrate the decision graph and path coverage criteria into automated testing pipelines to guide test case generation for maximizing coverage.
Experimental results
Research questions
- RQ1Can decision paths in a DNN be effectively extracted and represented as a graph structure to model the network's decision logic?
- RQ2How do control-flow and data-flow paths in the decision graph relate to the actual behavior and robustness of the DNN?
- RQ3To what extent does the proposed path coverage (SNPC and ANPC) correlate with defect detection, including natural errors and adversarial examples?
- RQ4How does the interpretability of NPC improve understanding of test adequacy compared to traditional neuron activation-based coverage?
- RQ5Can the path coverage criteria guide the generation of more diverse and effective test cases for DNNs?
Key findings
- The decision graph successfully captures the decision logic of DNNs by modeling critical neuron activation paths across layers.
- SNPC and ANPC show strong sensitivity to both natural errors and adversarial examples, indicating their effectiveness in detecting model flaws.
- NPC achieves high correlation with model output impartiality, suggesting its utility in evaluating fairness and robustness.
- The path-based coverage criteria outperform traditional neuron coverage in reflecting actual decision behavior, as they model logical dependencies across layers.
- The evaluation demonstrates that higher path coverage leads to greater exploration of diverse decision logic, enhancing test adequacy.
- NPC is interpretable and provides actionable insights into which decision paths are under-tested, enabling targeted test generation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.