Grad-CAM
The most widely used way to visualize which image regions drive a convolutional network's prediction: gradients weight the last layer's feature maps by their importance for one class, and the weighted sum becomes a heatmap over the image.
Grad-CAM was introduced by Ramprasaath Selvaraju and colleagues in 2016 and published at ICCV 2017. Take the feature maps of the last convolutional layer and the score for class . Averaging the gradient over space gives a weight for each map; , upsampled to the image size, is the heatmap. Nothing in the network has to be changed or retrained, so it works on almost any CNN and has become the most familiar tool of explainability.
In medical-imaging papers it is close to a default figure: a chest-film classifier whose heatmap sits on the lesion earns more trust. But its resolution is limited by the last feature map, typically 1/16 to 1/32 of the input, so boundaries are coarse, and a heatmap in the right place does not prove the model used the right reasoning. It is good at exposing blatant shortcuts and should not be read as a diagnosis in itself.
- Selvaraju RR, Cogswell M, Das A, Vedantam R, Parikh D, Batra D. Grad-CAM: visual explanations from deep networks via gradient-based localization. ICCV 2017. arXiv:1610.02391. arxiv.org/abs/1610.02391