NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

NeuroInspect: Interpretable Neuron-based Debugging Framework through Class-conditional Visualizations

Yeong-Joon Ju, Ji-Hoon Park, Seong-Whan LeearXiv 2023

TL;DR

NeuroInspect is a new debugging framework that helps researchers understand why deep learning models make mistakes by pinpointing the specific neurons responsible for errors. By introducing CLIP-Illusion, a class-conditional visualization technique, the framework translates abstract neural activations into human-understandable images, allowing practitioners to identify and mitigate false correlations without needing extra data or model retraining.

What Problem Does This Paper Address?

Deep learning (DL) models are notoriously "black boxes." When a model misclassifies an image, it’s often unclear whether the failure stems from a lack of features (insufficient information) or the presence of misleading ones (spurious correlations).

Existing debugging tools have significant drawbacks:

  • Attribution methods (like saliency maps) show where a model looks but not what it sees.
  • Concept-based methods require pre-defined "concept banks" which are hard to build for niche domains.
  • Standard Feature Visualization (FV) often produces abstract, psychedelic "blobs" that are impossible for humans to interpret because individual neurons are often polysemantic—they respond to multiple unrelated features (e.g., a single neuron might fire for both "water jets" and "dog faces").

NeuroInspect aims to bridge this gap by providing a global, human-interpretable way to identify and fix specific neural "misunderstandings."

Methods

The NeuroInspect framework operates in three main stages:

  1. Neuron-based Counterfactual Explanations: When a model fails, the framework uses elastic net regularization to find the minimal change needed in the penultimate layer's activations to flip the prediction to the correct class. This identifies "excessive" neurons (causing false positives) and "insufficient" neurons (missing key traits).
  2. CLIP-Illusion: To make these neurons interpretable, the authors developed CLIP-Illusion. It uses a pre-trained CLIP model to guide the image generation process. By conditioning the visualization on a specific class, it "disentangles" a neuron's multiple facets. Instead of one messy image, it generates clear, class-specific visualizations (e.g., "what this neuron looks like in the context of a fireboat").
  3. Decision Layer Editing: Once a problematic neuron-class correlation is identified, the framework introduces a regularization term to the decision layer. This allows practitioners to "edit" the model by shrinking specific weights, effectively telling the model to ignore a spurious feature for a certain class without degrading overall performance.
Fig. 1: Overall process of our debugging framework. Given the mistake samples, we first acquire a set of features with the feature extractor of the model being analyzed. The counterfactual explanation adjusts the features with ω tuned to be predicted to a correct label. We then rank the neurons that make mistakes based on all ω values for the features. Finally, we provide visualizations of the top-ranked neurons, which are the main causes of mistakes across all mistake samples. We calculate rank rates for each neuron by extracting the top-5 neurons contributing to mistakes for each sample. After observing the visualizations, DL practitioners can improve the model performance using our editing method or other methods, such as data augmentation and architecture modifications.

Datasets

The authors evaluated NeuroInspect across several challenging scenarios:

  • ImageNet: Used for general feature visualization and human evaluation.
  • MetaDataset & Waterbird: Benchmarks specifically designed to test a model's reliance on spurious correlations (e.g., a bird always appearing against a water background).
  • Flowers102 & Food101: Real-world fine-grained classification datasets used to demonstrate how the framework improves performance on the "worst-performing" classes.
  • Lego Brick Dataset: Used to test the limits of CLIP-Illusion in out-of-domain scenarios.

Key Insights and Ideas

  • Disentangling Polysemantic Neurons: The core "aha" moment is that neurons don't have to be uninterpretable just because they respond to multiple things. By asking the model to show a neuron's activation conditioned on a class, the "noise" disappears. For example, Neuron 0 in a ResNet-18 might respond to "water jets," "dog faces," and "lattice booms." CLIP-Illusion separates these into distinct, recognizable images.
  • Counterfactuals as Debugging Pointers: Rather than looking at every neuron, counterfactuals act as a filter, highlighting only the small subset of neurons that actually changed the model's decision.
  • Surgical Editing: You don't need to retrain a whole model to fix a bias. By just adjusting the final linear layer's weights for specific neuron-class pairs, you can mitigate false correlations effectively.
Fig. 2: Comparison of FV, CLIP-Illusion, and top-activated images. This figure shows visualizations for neuron 3 of the penultimate layer in ResNet-18. The values at the bottom left of the image represent activation values for neuron 3. The top- activated images show examples with the highest activations for neuron 3 in the validation set of the ImageNet dataset [36]. CLIP-Illusion illustrates representations that activate the neuron in each class, showing how the neuron responds to different class-specific features.

Key Results

  • Human Preference: In a survey, computer vision practitioners preferred CLIP-Illusion visualizations 80% of the time, compared to only 3.75% for standard FV.
  • Mitigating Bias: On the Waterbird dataset, NeuroInspect improved the worst-group accuracy from 66.04% to 72.43% while maintaining high overall accuracy.
  • Real-World Improvement: In fine-grained classification (Flowers102), the framework improved the accuracy of the worst-performing class from 33.33% to 58.33% by identifying and editing out features like watermarks that the model had overfitted to.
Fig. 3: Multiple facets of a given neuron. The FV, real image, and CLIP-Illusion are visualizations for neuron 0 of the penultimate layer in ResNet-18. We chose CLIP-Illusion results corresponding to concepts of top-activated images, where CLIP-Illusion has automatically conditioned on 25 classes most related to neuron 0 based on β; The first row: fireboat, fountain, suspension bridge, and steel arch bridge. The second row: Shih-Tzu, Maltese, orangutan, and three-toed sloth. The third row: manhole cover, mike, saltshaker, and thimble.

Limitations and Future Work

  • Domain Misalignment: Because CLIP-Illusion relies on a pre-trained CLIP model, it can struggle with highly specialized domains (like specific Lego brick types) that CLIP hasn't seen. The authors noted that in these cases, the visualizations can become less interpretable.
  • Human-in-the-Loop: The framework currently requires a human to look at the visualizations and decide which neurons to edit. Automating this "selection" process while maintaining safety is a potential future direction.
  • Prompt Sensitivity: The quality of the generated images is somewhat dependent on the text prompts used to describe the classes to the CLIP model.

Summary updated

BibTeX
@misc{ju2023neuroinspect,
  author = {Yeong-Joon Ju and Ji-Hoon Park and Seong-Whan Lee},
  title = {{NeuroInspect: Interpretable Neuron-based Debugging Framework through Class-conditional Visualizations}},
  year = {2023},
  eprint = {2310.07184},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.07184},
}
Figure