Explainable AI (XAI) Advanced 14 minutes

Evaluating Explanations and Sanity Checks

How do we know an explanation really reflects the model? Faithfulness, stability and usefulness to humans.

Your progress in the track0%

Three axes of evaluation

AxisQuestionExample metrics
FaithfulnessDoes the explanation reflect the model?Deletion and insertion, ROAR, randomization tests
StabilityDoes it change with a small change?Max sensitivity, consistency across seeds
Human usefulnessDoes it improve the user's decision?Controlled user studies

Sanity checks (Adebayo et al.)

  1. Model randomization: re-initialize the layer weights progressively from the top; the map should change.
  2. Data randomization: train the model on shuffled labels; the map should differ.

The study found that some methods, such as Guided Backprop in the reported experiments, stay worryingly similar.

Deletion and insertion

import numpy as np
def deletion_curve(model_prob, image, attribution, steps=20, fill=0.0):
    order = np.argsort(attribution.ravel())[::-1]          # most important first
    img = image.copy().ravel(); probs = [model_prob(img.reshape(image.shape))]
    chunk = len(order) // steps
    for k in range(steps):
        img[order[k*chunk:(k+1)*chunk]] = fill
        probs.append(model_prob(img.reshape(image.shape)))
    return np.array(probs)          # area under the curve: smaller is better for deletion

Warning: deleting pixels creates out-of-distribution images, which affects the result; that is why ROAR proposed retraining after deletion.

Human studies

  • Compare a group that sees the explanation with a group that does not.
  • Measure the joint performance of the human and the model, not satisfaction alone.
  • Beware of over-trust: some studies found that explanations may increase users' acceptance of wrong recommendations.

A methodological rule: do not publish an explanation in a paper or a product without at least one quantitative faithfulness test and a comparison with a random baseline.

Lesson terms

Answer faithfulness
The degree to which the generated answer is grounded in the retrieved passages without adding unsupported claims.
Model randomization test
A test that compares the explanations of the trained model with those of a model with random weights; strong similarity indicates that the method does not reflect what the model learned.

Abstract

A visually convincing explanation may not reflect the model. Sanity checks showed that some saliency methods give similar maps even after the model's weights are randomized, meaning they reflect the structure of the image, not the model's decision. An explanation is evaluated along several axes: faithfulness (does removing the important regions change the prediction?), stability (does the explanation change a lot with a small change?), and usefulness to humans (does it actually improve users' decisions?). Human evaluation needs well-designed studies.

Review questions

  1. What does it mean if a saliency map stays almost unchanged after the model's weights are randomized?

    That the method reflects properties of the image itself, such as edges, and not what the model learned, so it is not faithful.

  2. How does the deletion metric work?

    We delete pixels in order of their importance and plot the drop in the model's confidence; a faster drop means a more faithful explanation.

Sources and references

  1. Adebayo et al. (2018) — Sanity Checks for Saliency Maps
  2. Petsiuk, Das & Saenko (2018) — RISE (deletion and insertion metrics)
  3. Hooker et al. (2019) — A Benchmark for Interpretability Methods in Deep Neural Networks (ROAR)
  4. Quantus Toolkit

Complete the lesson