Neuron Sensitivity Guided Test Case Selection for Deep Learning Testing

Dong Huang, Qingwen Bu, Yichao Fu, Yuhao Qing, Bocheng Xiao, Heming Cui

Introduction

Deep Neural Networks (DNNs) have become integral to safety-critical domains such as autonomous driving and medical diagnostics. However, ensuring their reliability requires extensive testing against massive datasets. A significant bottleneck in this process is the cost of human labeling. Test case selection aims to identify the most informative unlabeled data points to maximize model improvement while minimizing labeling effort. Traditional methods, such as neuron coverage or confidence-based "black-box" approaches, often fail to correlate with actual fault detection. This paper introduces NSS (Neuron Sensitivity guided test case Selection), a white-box approach that leverages internal neural dynamics to prioritize test cases.

The Concept of Neuron Sensitivity

The core innovation of NSS is the use of Neuron Sensitivity ($S$) as a proxy for model uncertainty. For a given neuron, sensitivity is defined by the change in its activation value when an input $x$ is subjected to a benign mutation $x'$ (e.g., slight rotation, blur, or brightness adjustment).

Overview of neuron sensitivity calculation and identification of top-k sensitive neurons.

To make this computationally feasible for large-scale models like VGG-16, which contain millions of neurons, NSS employs a Sensitive Neuron Identifier. This component identifies the top-$k$% most reactive neurons using a small data sample. The TNSScore (Test case Neuron Sensitivity Score) for an input is then calculated as the sum of sensitivities across these prioritized neurons. A high TNSScore indicates that the model's internal logic is unstable for that specific input, suggesting a higher likelihood of misclassification.

Selection Workflow

The NSS workflow operates in a cycle designed for continuous model improvement:

  1. Identification: Determine the most sensitive neurons for the current model state.
  2. Mutation & Scoring: Apply benign mutations to unlabeled candidate cases and calculate their TNSScores.
  3. Selection: Rank inputs by their scores and select the top candidates for human labeling.
  4. Retraining: Use the newly labeled "valuable" cases to repair the model, effectively reducing its sensitivity to problematic inputs.

Empirical Evaluation

The authors evaluated NSS across four standard benchmarks—MNIST, Fashion-MNIST, SVHN, and CIFAR-10—using architectures ranging from LeNet to ResNet-20 and VGG-16.

Neuron sensitivity across different datasets and architectures as mutation strength increases.

As shown in the experimental results, neuron sensitivity consistently increases with mutation strength. Crucially, models that have been "repaired" or are inherently more robust exhibit lower sensitivity compared to their unoptimized counterparts. This confirms that sensitivity serves as an effective "white-box" indicator of a model's lack of understanding of specific data regions. Furthermore, the researchers found that neurons in the deeper layers (the last encoder or convolutional layers) provide the most semantic-rich information for selection, as they capture high-level features rather than basic edges.

Key Results and Advantages

NSS demonstrates significant improvements over state-of-the-art baselines like DeepGini and ATS:

  • Superior Fault Detection: In MNIST/LeNet-1 trials, selecting just 5% of unlabeled data achieved an 81.8% Fault Detection Rate (FDR), outperforming baselines by approximately 20%.
  • Enhanced Model Accuracy: Retraining models with NSS-selected cases led to higher accuracy gains compared to random selection or coverage-based methods.
  • Diverse Error Identification: NSS achieved the highest Fault Type Coverage Rate (FTCR), indicating its ability to find a wide variety of edge cases rather than redundant errors.
  • Operational Efficiency: While traditional coverage-guided methods can take hours to process large models, NSS completes selection in seconds (e.g., ~10 seconds for VGG-16), making it highly scalable for real-world applications.

Conclusion and Future Work

NSS offers a robust, efficient, and semantically grounded method for deep learning test case selection. By focusing on internal neuron sensitivity, it bridges the gap between model testing and model improvement. Future research will explore the impact of natural, real-world noise versus simulated mutations and further automate the hyperparameter tuning for sensitive neuron selection.

Summary updated

BibTeX
@article{huang2024neuron,
  author = {Dong Huang and Qingwen Bu and Yichao Fu and Yuhao Qing and Bocheng Xiao and Heming Cui},
  title = {{Neuron Sensitivity Guided Test Case Selection for Deep Learning Testing}},
  journal = {ACM Trans. Softw. Eng. Methodol.},
  year = {2024},
  doi = {10.1145/3672454},
}
Figure