Member-only story
Grad-CAM for Explaining Computer Vision Models
Understanding the math, intuition and Python code for Gradient-weighted Class Activation Mapping (Grad-CAM)
An X-ray AI system displays the result — there is a tumour.
Thankfully, it is benign. However, the doctor is hesitant to give this diagnosis directly to the patient. She doesn’t know where in the brain the tumour is and, to be honest, she doesn’t fully trust the AI system.
This is where Grad-CAM comes in [3]. It is an explainable AI (XAI) method that can tell the doctor which part of the X-ray image was used to make the classification. It could potentially point out the exact collection of cells that make up the benign tumour.
In general, Grad-CAM is used to explain convolutional neural networks (CNNs). It does this by highlighting the pixels/regions in an image that are important for a given classification. This is known as a heatmap. Due to its speed, reliability and flexibility, Grad-CAM has become the go-to method for creating these.
So, in this lesson, we will:
- Explain the steps taken by the Grad-CAM algorithm to produce heatmaps
- Give the intuition for the method and other CAM approaches
- Discuss its…
