Intermediate level · Module 7: Feature Visualization · Lesson 3 of 3
Finding Shortcuts and Bias with Visualisation
Learners use Grad-CAM to detect shortcut learning (a model relying on backgrounds, watermarks or camera artefacts) and check whether it behaves differently on local images.
In this lesson you will
- Detect shortcut learning with explanations
- Design tests that confirm or rule out a shortcut
Key concepts
shortcut learningspurious correlationbackground reliancecontrolled testsexplanation limits
The lesson
A model can be accurate for the wrong reasons. If all diseased-leaf photos in a dataset have a grey laboratory background and healthy ones are photographed in the field, the model may learn background, not disease. Grad-CAM heatmaps that light up the background are a warning sign.
Confirm a suspected shortcut with a controlled test: swap backgrounds, crop to the object or test on local photos with different backgrounds, and measure the change in accuracy.
Heatmaps are evidence, not proof, and they can be misleading. Use them together with controlled tests and per-group evaluation.
Step by step
- Review Grad-CAM heatmaps for 20 test images and note where the model looks.
- Form a shortcut hypothesis.
- Design and run a controlled test.
- Report whether the shortcut is confirmed.
Practice activity
Write a shortcut investigation for a trained classifier, with heatmaps and a controlled test.
Expected result: A reasoned investigation with a measured result.
Check your understanding
-
What is shortcut learning?
Show answer
A model relying on a spurious cue, such as the background, instead of the real signal.
-
How do you confirm a suspected shortcut?
Show answer
With a controlled test that removes or changes the cue and measures the effect.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.