Learning how to explain neural networks: PatternNet and PatternAttribution

Pieter-Jan Kindermans, Kristof T. Schütt, Maximilian Alber, Klaus-Robert Müller, Dumitru Erhan, Been Kim, Sven Dähne

TL;DR

Most popular methods for explaining neural networks (like DeConvNet or Guided BackProp) fail a basic "sanity check": they do not produce theoretically correct explanations for simple linear models. This paper introduces PatternNet and PatternAttribution, two new techniques that learn to separate the actual signal from distracting noise. The result? Visualizations that are both theoretically sound and significantly clearer for deep networks.

The Problem with Existing Explanations

Deep neural networks are often criticized as "black boxes." To peek inside, researchers use explanation methods to visualize which pixels in an image led to a specific classification (e.g., "Why did the model classify this as an elephant?").

The authors point out a fundamental flaw in existing methods like DeConvNet, Guided BackProp, and Layer-wise Relevance Propagation (LRP): they rely heavily on the network's weights ($w$). However, in a linear model, the weight vector acts as a filter, not a pattern. Its primary job is to cancel out "distractors" (noise or irrelevant data) to extract the true signal. Because the weights are optimized to suppress noise, they often do not point in the direction of the actual signal in the data space.

The authors argue a crucial point: if an explanation method doesn't work for the simplest possible case—a linear model—we shouldn't trust it for complex, multi-layer networks.

Methods: Moving from Filters to Patterns

The paper proposes moving away from using raw weights for visualization. Instead, we should learn the "patterns" in the data that the neurons are actually responding to.

Signal vs. Distractor: The weight vector (w) acts as a filter orthogonal to the distractor, while the pattern (a_s) represents the actual signal direction.
  1. The Pattern vs. Filter Distinction: The authors define the filter ($w$) as the mechanism used to extract the output, and the pattern ($a$) as the direction in the data along which the signal actually varies.
  2. PatternNet: This method replaces the weights during the backward pass with learned "informative directions" ($a$). It visualizes the signal that the network detected, rather than the noise-canceling strategy.
  3. PatternAttribution: An evolution of LRP, this method uses the learned patterns to assign "credit" to input pixels. It shows how much each pixel contributed to the final score while ignoring the distractors that the network filtered out.
  4. Two-Component Estimator: To handle the non-linear nature of ReLUs (which act differently when "on" versus "off"), the authors developed an estimator that learns different patterns for the positive and negative regimes of each neuron.

Key Insights

  • The "Limit of Simplicity": A core philosophical contribution is that Explainable AI (XAI) methods must be "backwards compatible" with linear theory. If a method fails on a single-layer linear network, its results on a deep network are likely misleading.
  • Weights are for Filtering: In high-dimensional data, the optimal weight vector is often orthogonal to the noise, not parallel to the signal. Therefore, visualizing weights (or gradients) essentially visualizes the network's "noise-canceling" strategy rather than the object itself.
  • Learning to Explain: Unlike previous methods that are purely algorithmic (applying math to existing weights), PatternNet and PatternAttribution require a "training" phase. They observe the data distribution to learn what constitutes a "signal" versus a "distractor" for each neuron.

Key Results

The authors evaluated their methods using a toy linear dataset, ImageNet, and the VGG-16 architecture.

  • Quantitative Quality: The authors used a correlation measure to see how much information about the output was left in the "residuals" after the signal was removed. PatternNet removed significantly more signal-related information than gradient-based methods, proving it isolates the signal more accurately.
  • Image Degradation: In an experiment where the most "important" pixels were removed, PatternAttribution caused the classifier's confidence to drop much faster than other methods, suggesting it correctly identifies the most influential pixels.
  • Qualitative Clarity: The visualizations produced by PatternNet are remarkably clean.
Comparison of explanation methods. PatternNet and PatternAttribution yield significantly clearer, more object-focused visualizations compared to Gradient, DeconvNet, and Guided Backprop.

While Guided BackProp often looks like a noisy edge-detector, PatternNet produces images that look like the original object, showing exactly what the network "sees" without the clutter of filtered noise.

Limitations and Future Work

  • Computational Overhead: Unlike "plug-and-play" methods, these techniques require an extra step to compute the patterns from a dataset. While optimized to take about 24 hours on a single GPU for a large model like VGG-16, it is still an additional requirement.
  • Linearity Assumption: The method assumes that neurons can be approximated linearly within their active regimes. While this works well for ReLUs, it might need adjustment for more exotic activation functions.
  • Future Directions: The authors suggest applying these sound theoretical foundations to domains like healthcare and the sciences, where "intuitive" visualizations aren't enough—explanations must be factually correct to be useful.

Summary updated

BibTeX
@inproceedings{kindermans2018learning,
  author = {Pieter-Jan Kindermans and Kristof T. Schütt and Maximilian Alber and Klaus-Robert Müller and Dumitru Erhan and Been Kim and Sven Dähne},
  title = {{Learning how to explain neural networks: PatternNet and PatternAttribution}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=Hkn7CBaTW},
}
Figure