Shortcut Learning · Waterbirds
Project 18 · Advanced Deep Learning

Saliency-based Analysis of Shortcut Learning in CNNs

A ResNet18 trained on the Waterbirds dataset reaches 84% accuracy overall but only 60% on its worst subgroup. We use Grad-CAM and inference-time interventions to show that the gap comes from the model relying on the background rather than the bird.

Grad-CAM for a waterbird on land that the model misclassifies as a landbird.
A waterbird photographed on land. The model predicts landbird — its Grad-CAM attention sits on the land background, not the bird.
Overall test accuracy
83.9%
Balanced test split
Worst-group accuracy
59.5%
Waterbird on land
Overall − worst-group gap
24.4%
Hidden by the headline number
Accuracy after background mask
86.0%
Removing the background helps

Pipeline

Train, evaluate by subgroup, run Grad-CAM, score foreground vs. background attention, intervene at inference time, then compare.

  1. 01
    Load Waterbirds
    grodino/waterbirds · 4 subgroups
  2. 02
    Train ResNet18
    Select best by worst-group acc.
  3. 03
    Subgroup eval
    Accuracy · P · R · F1 · confusion
  4. 04
    Grad-CAM
    Saliency on layer4[-1]
  5. 05
    Bias score
    Background saliency / total
  6. 06
    Interventions
    Blur · mask · shuffle
  7. 07
    Compare
    Δ accuracy · Δ flips · Δ saliency