# Explainable Artificial Intelligence: Understanding, Visualizing and Interpreting Deep Learning Models

Layer-wise relevance propagation explains image predictions better than sensitivity analysis

Wojciech Samek, Thomas Wiegand, Klaus-Robert Müller · arXiv · 2017-8-28

- **Problem** Accurate deep networks do not show which inputs drove a given prediction. Their nested non-linear structure works as a black box, which is costly in medical diagnosis.
- **Method** Layer-wise relevance propagation (LRP) pushes the prediction backwards until each input gets a relevance score. Unlike sensitivity analysis, the scores sum to the prediction.
- **Results** On image perturbation tests with GoogleNet, LRP heatmaps made the score fall faster than sensitivity analysis heatmaps.

## Why accurate models still get stuck

Deep networks reach high accuracy, but their nested non-linear structure hides what drives a given prediction. That gap matters most where a wrong answer is costly, such as medical diagnosis or self-driving cars. In the pneumonia case, a model learned that asthma patients with heart problems had a lower risk, a pattern that came from biased data rather than from medical fact.

A black box output would hide this kind of error, because nothing in the prediction shows which signal the model relied on. The same concern appears in law, where a right to explanation asks for the reasons behind an algorithmic decision.

Research on opening black boxes has grown along two lines, one showing what a model has learned and one explaining individual predictions. This paper focuses on the second line, explaining one prediction in terms of its input variables.

## A relevance score for every input

The key idea is to attach a relevance score to every input variable, so the scores explain the prediction instead of only naming the class. The authors compare two ways to compute those scores. Sensitivity analysis (SA) uses the local gradient, while layer-wise relevance propagation (LRP) pushes the prediction backwards through the network.

Both produce a heatmap in which each pixel or word receives a score.

The running example is a rooster image that a trained network labels correctly, and the heatmap points to the rooster's red comb and wattle. The question left open is how far the two heatmaps can be trusted, which the later experiments test.

## What sensitivity analysis measures

Sensitivity analysis takes the magnitude of the partial derivative of the output with respect to each input variable, so the relevance of input i is that magnitude. \\\[ R\_i = \\left\| \\frac{\\partial}{\\partial x\_i} f(x) \\right\| \\\] This assumes the most relevant inputs are the ones the output is most sensitive to. The gradient therefore describes how the score would change under a small edit, not how much each input already contributed to it.

The drawback shows up in the rooster example, where the yellow flowers that occlude the bird would be flagged. Reconstructing the hidden parts of the rooster would raise the score, but the flowers are not evidence for a rooster.

## How relevance flows backwards

LRP starts from the output f(x) and redistributes it backwards with local rules until every input variable holds a relevance score R\_i. The rule that holds throughout is relevance conservation, written as follows. \\\[ \\sum\_i R\_i = \\cdots = \\sum\_j R\_j = \\sum\_k R\_k = \\cdots = f(x) \\\] No relevance is added or removed at any layer, so the input scores sum to the prediction.

The simple LRP rule moves relevance from layer l + 1 to layer l, with x\_j the activations at layer l, R\_k the relevance at layer l + 1, and w\_jk the weight from neuron j to neuron k. \\\[ R\_j = \\sum\_k \\frac{x\_j w\_{jk}}{\\sum\_j x\_j w\_{jk} + \\epsilon} R\_k \\\] Each lower neuron gets a share that grows with its activation and with the strength of its connection, and the small term epsilon keeps the division safe.

Conservation holds exactly only when epsilon is 0.

## The alpha-beta rule and the toolbox

The alpha-beta rule splits each neuron's contributions into positive and negative parts and weights them with alpha and beta. Conservation is kept by the constraint that alpha minus beta equals 1. For alpha equal to 1, the cited work shows that this rule coincides with a deep Taylor decomposition of a ReLU network.

The LRP toolbox provides Python and Matlab code and connects to Caffe and TensorFlow, so other models can be explained without rebuilding them.

## Scoring explanations by perturbation

The authors rank input variables by their relevance and perturb the top ones first. A method that finds the truly relevant inputs should see the prediction score fall more steeply as those inputs are removed. The average decline of the score, or of accuracy, serves as the quality measure. The perturbations are model-independent, such as uniform random values, so that the comparison isn't biased toward one method.

## GoogleNet image results

GoogleNet classifies images from ILSVRC2012, and the volcano and coffee cup examples are explained with both methods. The LRP heatmap of the cup highlights its ellipsoidal shape, and the volcano heatmap highlights the mountain's outline. The SA heatmaps are noisier and give large values to pure sky background, so the authors judge LRP's explanations subjectively better.

In the perturbation test, a 9x9 patch is replaced by uniform random values at each step. The score falls much faster when patches follow LRP heatmaps than when they follow SA heatmaps. This averages over the first 5040 images, so the advantage is shown for this GoogleNet setup and patch size.

## Word deletion on 20Newsgroup

A word-embedding based convolutional network classifies 20Newsgroup documents, and this document was labelled sci.med. Both methods mark words such as sickness, body and discomfort as the basis of that decision. LRP also marks words such as ride, astronaut and Shuttle as negative evidence, which shows the classifier sees counter-evidence in the text.

SA doesn't separate positive from negative evidence.

The quantitative test sets the most important words to 0, and the accuracy decrease is averaged over 4154 documents. Deleting the words ranked by LRP lowers accuracy more than deleting those ranked by SA.

## Frames and blocks in action recognition

A Fisher Vector / SVM classifier is trained on block-wise motion vectors, not on individual pixels, to reduce computation. The evaluation uses HMDB51, and a sit-up video is correctly classified. The heatmaps concentrate on blocks around the upper body, where the up and down motion of a sit-up appears. The relevance over four consecutive frames is larger in the frames that show that movement.

So the heatmaps show both the place and the time of the action within a clip.

## Limitations

The quantitative checks use one GoogleNet setup on images and one convolutional network on 20Newsgroup. The image test averages over the first 5040 images with 9x9 patches, and the text test deletes words instead of sampling random values. The video experiment reports relevance over frames and blocks, with no perturbation score. The alpha-beta link to deep Taylor decomposition is stated only for alpha equal to 1 and ReLU networks.

No user study is reported, so the paper doesn't test whether the heatmaps help people validate a model. The authors leave open the theory behind explainability and how post-hoc explanations relate to models built to be interpretable.

## Paper info

- **Authors**: Wojciech Samek, Thomas Wiegand, Klaus-Robert Müller
- **Venue**: arXiv · Preprint
- **First published**: 2017-8-28
- **Added**: 2026-11-12
- **Updated**: 2017-8-28
- **Version**: v1
- **arXiv**: 1708.08296
- **Category**: cs.AI · cs.CY · cs.NE · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1708.08296v1) · [PDF ↗](https://arxiv.org/pdf/1708.08296v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Wojciech Samek, Thomas Wiegand, Klaus-Robert Müller (2017). Explainable Artificial Intelligence: Understanding, Visualizing and Interpreting Deep Learning Models. arXiv:1708.08296v1. https://arxiv.org/abs/1708.08296v1

**BibTeX**

```
@misc{samek2017explainable,
  title = {{Explainable Artificial Intelligence: Understanding, Visualizing and Interpreting Deep Learning Models}},
  author = {Wojciech Samek and Thomas Wiegand and Klaus-Robert Müller},
  year = {2017},
  eprint = {1708.08296},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1708.08296v1}
}
```

## Related papers

- [Methods for Interpreting and Understanding Deep Neural Networks](https://refivu.com/en/papers/beae0f88-5d82-43a5-a727-e94025cff266-methods-for-interpreting-and-understanding-deep-neural.md)
- [A Survey Of Methods For Explaining Black Box Models](https://refivu.com/en/papers/e8fafeb3-dfaa-4e9a-b461-dc36765f1ed6-a-survey-of-methods-for-explaining-black-box.md)
- [European Union regulations on algorithmic decision-making and a "right to explanation"](https://refivu.com/en/papers/8d7d2fe1-f155-44ca-8f0a-551e154b6b3a-european-union-regulations-on-algorithmic-decision-making.md)
- [Explainable Artificial Intelligence (XAI): Concepts, Taxonomies, Opportunities and Challenges toward Responsible AI](https://refivu.com/en/papers/3f686a20-03db-4642-80bb-f85fafc1d04f-explainable-artificial-intelligence-xai-concepts-taxonomies.md)
- [A Review on Deep Learning Techniques Applied to Semantic Segmentation](https://refivu.com/en/papers/8ae0e955-3ed5-48a2-b638-f9e5d7aa334e-a-review-on-deep-learning-techniques-applied-to.md)
- [A Survey on Deep Learning in Medical Image Analysis](https://refivu.com/en/papers/4d173b56-9ea6-4644-98f2-af1794e63965-a-survey-on-deep-learning-in-medical-image.md)

## Other paper commentary

- [SCA-CNN: Spatial and Channel-wise Attention in Convolutional Networks for Image Captioning](https://refivu.com/en/papers/51e17bf0-d47d-4aca-8ce3-e07e4204a821-sca-cnn-spatial-and-channel-wise-attention-in.md)
- [Attention Gated Networks: Learning to Leverage Salient Regions in Medical Images](https://refivu.com/en/papers/63b212b7-3fc0-42f4-b6d8-1724e918c784-attention-gated-networks-learning-to-leverage-salient.md)
- [Deeper Depth Prediction with Fully Convolutional Residual Networks](https://refivu.com/en/papers/4ef3d92a-82ea-4f76-8b77-ec72d726dd77-deeper-depth-prediction-with-fully-convolutional-residual.md)
- [ResNeSt: Split-Attention Networks](https://refivu.com/en/papers/7bce75cd-ce67-4d10-8c3b-89c0b6a895bd-resnest-split-attention-networks.md)
- [A Time Series is Worth 64 Words: Long-term Forecasting with Transformers](https://refivu.com/en/papers/15822929-13f1-40c7-8503-ce263dcf1639-a-time-series-is-worth-64-words-long.md)
- [Learning Bayesian Networks with the bnlearn R Package](https://refivu.com/en/papers/bdeeb8df-cd3a-419f-af61-f58819af852d-learning-bayesian-networks-with-the-bnlearn-r-package.md)
- [Learning Hand-Eye Coordination for Robotic Grasping with Deep Learning and Large-Scale Data Collection](https://refivu.com/en/papers/7027eeb7-fc1d-48f5-a7af-9efbaa9ad813-learning-hand-eye-coordination-for-robotic-grasping-with.md)
- [Conditional Prompt Learning for Vision-Language Models](https://refivu.com/en/papers/aafdc9ad-313a-44a6-bed9-42556a8097ea-conditional-prompt-learning-for-vision-language-models.md)
- [Imagen Video: High Definition Video Generation with Diffusion Models](https://refivu.com/en/papers/79ba3745-980d-44fe-a5b0-70a6fbd0bc66-imagen-video-high-definition-video-generation-with-diffusion.md)
- [Unsupervised Data Augmentation for Consistency Training](https://refivu.com/en/papers/7940975d-f8e6-4178-9d29-c4dc7f994398-unsupervised-data-augmentation-for-consistency-training.md)
- [Universal Sentence Encoder](https://refivu.com/en/papers/832f78a9-5914-4e69-88eb-9c85196eb17b-universal-sentence-encoder.md)
- [Federated Learning for Mobile Keyboard Prediction](https://refivu.com/en/papers/e56197ce-a521-4965-9369-f978e10dc5fe-federated-learning-for-mobile-keyboard-prediction.md)

## Terms in this paper

- [GoogLeNet](https://refivu.com/en/terms/50b933468e4c-googlenet)
- [heatmap](https://refivu.com/en/terms/db912df5b4bc-heatmap)
- [HMDB51](https://refivu.com/en/terms/87e589274cbe-hmdb51)
- [layer-wise relevance propagation](https://refivu.com/en/terms/8f88b1c3f79a-layer-wise-relevance-propagation)
- [right to explanation](https://refivu.com/en/terms/c7da1114207a-right-to-explanation)
- [sensitivity analysis](https://refivu.com/en/terms/f97589901505-sensitivity-analysis)
- [black box model](https://refivu.com/en/terms/038e0deb3064-black-box-model)
- [deep Taylor decomposition](https://refivu.com/en/terms/cf23867e2db3-deep-taylor-decomposition)
- [human action recognition](https://refivu.com/en/terms/5d3bddaac890-human-action-recognition)
- [prediction accuracy](https://refivu.com/en/terms/bc66df146189-prediction-accuracy)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/6bd22a78-4fb3-465f-b297-2113b18ee3f2-explainable-artificial-intelligence-understanding)
