Coding Exercise on Saliency Maps
Explore the VarGrad saliency map algorithm to interpret image classifier decisions. Learn to implement this variance-based technique that sharpens saliency maps by computing the variance of gradients over noisy image samples, improving the understanding of pixel importance in predictions.
We'll cover the following...
Problem statement: VarGrad saliency
Like SmoothGrad saliency, Variance-based Gradient Regularization (VarGrad) saliency maps reduce visual noise and produce sharper saliency maps. While the main idea of SmoothGrad is to use smoothened gradients across multiple noisy versions of the input image, VarGrad uses the variance of these gradients for generating saliency maps.
The intuition behind the thought is that if an input pixel is important for prediction, its gradients with respect to prediction will fluctuate (i.e., have high variance) when injected with noise, while pixels that have no contribution in the prediction should have stable gradients.
Mathematically, given an image