Computer Vision · Intermediate level

Intermediate level · Module 7 of 8 · 11 guided hours

Feature Visualization

Seeing what a CNN has learned: first-layer filters, activation maps with forward hooks, saliency and Grad-CAM, and using these tools to find shortcut learning and bias.

Learning objectives

  • Visualise filters and activation maps
  • Produce Grad-CAM explanations for predictions
  • Use visualisations to detect shortcuts and bias

Topics

  • first-layer filters
  • activation maps and forward hooks
  • saliency maps
  • Grad-CAM
  • shortcut learning
  • limits of visual explanations

Lessons

  1. Lesson 1 Filters and Activation Maps

    Learners plot first-layer filters and capture intermediate feature maps with forward hooks to see how representations change through the network.

    first-layer weightsregister_forward_hookactivation mapslow-level vs high-level featureschannel selection

  2. Lesson 2 Grad-CAM and Saliency

    Learners implement Grad-CAM with hooks to show which regions influenced a prediction, and compare it with simple gradient saliency.

    saliency (input gradients)Grad-CAMtarget layerheatmap overlayclass-specific explanation

  3. Lesson 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.

    shortcut learningspurious correlationbackground reliancecontrolled testsexplanation limits

Practical activity

Produce a model-inspection report for a trained classifier: filter and activation galleries, Grad-CAM explanations and a shortcut investigation with a controlled test.

Expected outcomes

  • Ability to inspect what vision models learn
  • Habit of testing for shortcuts and bias

Assessment

Inspection report (70%) and oral explanation of one heatmap (30%).

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.