Evaluating Explanations and Sanity Checks
How do we know an explanation really reflects the model? Faithfulness, stability and usefulness to humans.
Three axes of evaluation
| Axis | Question | Example metrics |
|---|---|---|
| Faithfulness | Does the explanation reflect the model? | Deletion and insertion, ROAR, randomization tests |
| Stability | Does it change with a small change? | Max sensitivity, consistency across seeds |
| Human usefulness | Does it improve the user's decision? | Controlled user studies |
Sanity checks (Adebayo et al.)
- Model randomization: re-initialize the layer weights progressively from the top; the map should change.
- 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 deletionWarning: 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
-
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.
-
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
Complete the lesson
You have completed all the lessons in the track! You can now request the track completion certificate.
Request the certificate