Abstract
Deep Neural Networks (DNNs) are often treated as black boxes, making them difficult for software engineers to debug and verify. This paper presents NeuralVis, an interactive, instance-based visualization tool that enables developers to inspect model architectures, compare intermediate activations across different inputs, and perform real-time model mutation. By allowing users to "freeze" specific filters and observe downstream effects, NeuralVis provides concrete intuitions about feature importance and model behavior on specific edge cases.
Introduction
While Deep Neural Networks (DNNs) are increasingly embedded into software systems, they remain notoriously difficult to debug and verify. Unlike traditional code, where a developer can step through logic line-by-line, a DNN’s "logic" is buried in millions of weights and non-linear transformations. Existing visualization tools often focus on the training phase (monitoring loss and accuracy), but they offer little help to a software engineer who needs to understand why a specific input caused a model to fail. NeuralVis addresses this gap by supporting "comparative research"—the ability to look at two different inputs and see exactly where their paths through the neural network diverge.
System Design and Methods
NeuralVis is built on top of TensorSpace, utilizing both 3D and 2D visualizations to represent model architecture. The system is designed around four primary operations: model visualization, output visualization, output comparison, and model mutation.
Its core innovation lies in two specific features:
- Output Comparison: Users can select two different inputs (e.g., a clean image and its adversarial counterpart) and compare their intermediate activation maps side-by-side. This helps engineers see which layers are being "fooled" by perturbations.
- Model Mutation: Inspired by mutation testing in traditional software engineering, NeuralVis allows users to "freeze" specific filters in a convolutional layer by applying a zero vector to their weights. The tool then recalculates the downstream effects in real-time, allowing the user to see how the loss of a specific feature detector (like a "vertical line" detector) changes the final classification.
Interactive Analysis
The tool integrates a sketchpad for manual input generation and built-in adversarial attack algorithms to generate edge cases for testing. The user interface is divided into an Operation Panel for model and input selection, and a Detailed Panel for 3D visualization.
As shown in the interface, the Comparison Panel allows for "aha moments" where users can see exactly which pixels the model uses to distinguish between classes, such as a "7" versus a "1". By manually freezing filters, the tool turns a static model into an interactive experiment. If freezing a certain filter causes the model to misclassify a "car" as a "truck," the engineer gains a concrete intuition about that filter's semantic role.
Evaluation and Results
The authors evaluated NeuralVis using two classic benchmarks: MNIST (handwritten digits) with the LeNet model, and CIFAR-10 (color images) with a VGG-12 model. A user study with ten graduate software engineering students yielded promising qualitative results. All participants successfully identified "critical features" in input images that determined prediction results. Furthermore, participants could perform complex tasks—like describing model relationships or identifying differences between intermediate outputs—within a one-hour window. The mutation feature specifically helped participants distinguish between "important" filters vital for correct classification and "useless" filters with minimal impact.
Conclusion and Future Work
NeuralVis demonstrates the power of instance-based debugging for DNNs. While currently limited to Keras models in .h5 format, future work aims to expand support to PyTorch and TensorFlow's SavedModel formats. Additionally, the authors plan to integrate "test case prioritization" to guide engineers toward the most informative or "surprising" inputs, addressing the challenge of selecting which inputs are most worth analyzing in large datasets.
Summary updated