Occlusion test

Attribution · lens

Hide one part of the input, run the model again and measure how far its score drops: the drop is how much the answer relied on that part.

Also called Region impact, Occlusion sensitivity, Feature ablation

A tiny network with the four stroke filters from the feature map card scores a drawing as straight or slanted. Every patch is hidden in turn and the model runs again. Orange: hiding it lowered the score. Blue: hiding it raised the score. Colours are scaled to the strongest patch. Pick a patch to see that run.

Impact of hiding each patch

Full drawing

Straight strokes93.1%
Slanted strokes6.9%

4 × 4 patches, one run each.

Figure 1. Every number is computed in your browser.

What it shows

An occlusion test asks the model instead of reading its insides. Cover a patch of the image with a plain fill, run the model, and record how much the score of the class you care about changes; repeat for every patch and you get a map of the regions the answer depends on. The same idea works for any input: blank one word, zero one sensor reading, untick one checkbox.

How to read it

Hot cell
Hiding this region lowered the score a lot: the answer leans on it.
Empty cell
Hiding it changed almost nothing.
Cell in the other colour
Hiding it raised the score: that region argued against the class.
Grid size
The patch size: smaller patches give a finer map and cost more runs.

What it does not tell you

The result depends on what you hide with: grey, black and blur each look strange to a model in their own way. Two regions that matter only together (either one is enough) each show a small drop. One run per patch makes maps coarse.

Checking whether a classifier uses the object or a shortcut such as a watermark or the background, comparing models, and explaining a single prediction to a person.

In WeightSpace

Region impact in the Plants workbench runs the real model once per region of the current photo. In Lesson 1, hiding region 2, 6 of a Monstera photo lowers Monstera from 92.3% to 82.1%, while every region in the bottom two rows moves it by less than 2 points. Lesson 2 does the tabular version: untick Urgent and the ticket router’s answer does not change. The demo above runs a tiny hand-set network on a drawing.