Low activation Mid activation High activation

Grad-CAM: Where a Medical-Scan AI Is Looking (2D)

This 2D companion to the 3D Grad-CAM simulator runs the exact same kind of real, hand-specified two-layer convolutional network — actual 3×3 convolutions, ReLU, max-pooling, global average pooling and a linear head — over a synthetic scan containing a movable, adjustable-contrast lesion, then computes a genuine Class Activation Map: the gradient-weighted sum of the final convolutional layer's feature maps that reduces, for a global-average-pooled linear head, to the exact formula used in real Grad-CAM interpretability tooling. Along the way it fixes a real calibration bug found by numerically testing the 3D source: that sim's deep "lesion-selective" channel was wired to a blob/Laplacian filter that saturates on the background's high-frequency texture instead of the lesion, so its predicted class barely moved as contrast increased. Here the same channel is wired to a blur/local-brightness filter instead — verified to make the classifier's Normal/Abnormal call genuinely track the lesion — while the CAM math, panel layout and every other control stay faithful to the original two-layer architecture.