{# REVIEW: the wording of this section was written by the builder, not by the author. Every number comes from the result files. #}

Abstract

Background A pathology classifier can score well while leaning on something other than the tissue, such as a mark on the slide or the stain color of the hospital that prepared it. If the test set shares that cue, the score hides it. This project measures how large the effect is in a small network that can be inspected completely, and whether the usual explanation maps catch it.

Methods One small convolutional network, written by hand in PyTorch, was used in two experiments. In the first, on PathMNIST patches of colorectal tissue, a {{ stamp_size|count }} by {{ stamp_size|count }} pixel ring was planted on {{ p_target|pct(0) }} of the training images of one class (colorectal adenocarcinoma epithelium) and on {{ p_other|pct(0) }} of the others, and the result was compared with an identical network trained without the ring. The outcomes were how often the ring turns a non-tumor image into a tumor call and how much Grad-CAM attends to it.{% if p2 %} In the second, on {{ "Camelyon17-WILDS" }} lymph node patches ({{ p2.hier.n_patches|count }} patches from {{ p2.hier.n_slides|count }} slides, {{ p2.hier.n_patients|count }} patients and {{ p2.hier.n_hospitals|count }} hospitals), data were held out at {{ p2.levels.levels|length|count }} levels (patch, slide, patient, hospital) with {{ p2.n_folds|count }} folds each, a simple classifier was tested on naming the hospital from a patch's color, and the hospital-level models were retrained with random stain augmentation.{% endif %} Intervals are {{ ci_level|pct(0) }} bootstrap intervals{% if p2 %}, resampling images in the first experiment and slides in the second{% endif %}.

Results On unmarked test images the poisoned network reached {{ ev.clean.poisoned.value|pct(1) }} accuracy, against {{ ev.clean.clean.value|pct(1) }} for the clean one. With the ring at the image edge it called {{ ev.edge.poisoned.value|pct(1) }} of non-tumor test images tumor (clean network: {{ ev.edge.clean.value|pct(1) }}), and with the ring at the center, where it never appeared in training, {{ ev.centre.poisoned.value|pct(1) }} (clean network: {{ ev.centre.clean.value|pct(1) }}). Grad-CAM put {{ ev.cam.poisoned.value|pct(2) }} of its mass inside the ring's box, {{ 'below' if ev.cam.poisoned.value < even_share else 'against' }} the {{ even_share|pct(2) }} an evenly spread map would put there.{% if p2 %} On {{ "Camelyon17" }} the pooled AUROC was {{ p2.hl.patch|num(3) }} when random patches were held out and {{ p2.hl.hospital|num(3) }} {{ p2.hl.hospital_ci|ci(3) }} when whole hospitals were. The color histogram of a patch alone named its hospital {{ p2.pb.hist.accuracy_mean|pct(0) }} of the time, with chance at {{ p2.pb.chance|pct(0) }}. Stain augmentation raised the hospital-level AUROC to {{ p2.hl.gap.s0.aug|num(3) }} and {{ p2.hl.gap.s1.aug|num(3) }} for the two training seeds, closing {{ p2.hl.gap.s0.share|pct(0) }} and {{ p2.hl.gap.s1.share|pct(0) }} of the gap to the patch-level score.{% endif %}

Conclusions A planted shortcut shifted the network's decisions while its accuracy barely moved{% if ev.cam.poisoned.value < even_share %}, and Grad-CAM on average did not point to it{% endif %}.{% if p2 %} How the data are split changed the headline score a great deal, and the hospital's stain carries enough signal to be learned. Stain augmentation repaired most of the gap.{% endif %} These are single training runs{% if p2 %} (two seeds for the hospital-level models){% endif %} of a deliberately small network, so they show that the effects exist and which way they point. How large they would be in bigger models is an open question. Everything on the page is computed live by the server or from the result files listed at the end.

Keywords shortcut learning, Clever Hans effect, data poisoning, domain shift, stain augmentation, Grad‑CAM, integrated gradients{% if p2 %}, {{ "Camelyon17" }}{% endif %}