What Are Saliency Maps?
You'll learn how saliency maps reveal which pixels in an input image most influence a neural network's prediction.
The Core Idea
A saliency map is a pixel-level visualization that highlights the spatial regions of an input image that had the greatest impact on a neural network's output. Think of it as a "heat map of importance" overlaid on your original image—bright spots show where the model is "looking" to make its decision.
Unlike feature importance for tabular data or SHAP values that assign importance to discrete features, saliency maps work in the continuous, high-dimensional space of images. They answer: "If I slightly changed this pixel, how much would the prediction change?"
How It Works (Conceptually)
Saliency maps compute the gradient of the output with respect to each input pixel. Large gradient magnitudes indicate that small changes to those pixels would dramatically affect the prediction.
Imagine a classifier deciding "cat vs. dog." A saliency map might show bright values around the ears, eyes, and nose—the discriminative features the network learned to focus on—while background pixels remain dark.
Why They Matter
Saliency maps provide local explanations for individual predictions in image-based models. They help you:
- Debug misclassifications by seeing what the model focused on
- Verify the model isn't relying on spurious correlations (like watermarks)
- Build trust by showing clinically meaningful regions in medical imaging
Key Takeaway: Saliency maps are gradient-based visualizations that highlight which pixels most influence a neural network's prediction, providing pixel-level interpretability for image models.