Abstract

Medical segmentation foundation models can fail when pathology obscures anatomical boundaries, but output masks alone do not explain which coarse encoder sites and spatial regions support the failure or its correction. We propose counterfactual activation patching, an interventional framework that pairs each diseased image with a patient-matched pseudo-healthy counterfactual and replaces selected MedSAM image-encoder activations between the two forward passes. We study lung segmentation in 200 pleural-effusion radiographs from 59 NIH ChestX-ray14 subjects using automatically generated CheXmask reference masks (silver labels). Counterfactual images improve MedSAM segmentation substantially: CF-Seg increases Dice from 0.726 to 0.850 and reduces HD95 from 123.5 to 80.0 pixels, with a second diffusion generator showing smaller but consistent gains. Activation-patching controls show that patient-matched patches reproduce counterfactual behavior, whereas non-matched donors perform substantially worse. Whole-map neck patching is treated as a pipeline sanity check; full-context patches give the strongest regional signal, but equal-area controls show that this is not a size-controlled context-pixel localization claim. These results position patient-matched counterfactuals as a controlled probe for analyzing and internally monitoring boundary failures in promptable medical segmentation, while expert annotations and external cohorts remain necessary before clinical-deployment claims. Our code and aggregate results are publicly available.

Links to Paper and Supplementary Materials

Main Paper (Open Access Version): https://papers.miccai.org/miccai-2026-sat/paper/MI4MedFM_019.pdf

SharedIt Link: Not yet available

SpringerLink (DOI): Not yet available

Supplementary Material: Not Submitted

Link to Open Review

Open Review Page: https://openreview.net/forum?id=EkF1oyA1Y4

BibTex

@InProceedings{DuiInd_Counterfactual_MICCAISAT2026,
        author = { Duisembayeva, Indira AND Zhang, Ziyue AND Bilal, Muhammad AND Xie, Yutong},
        title = { { Counterfactual Activation Patching of Pleural-Effusion Boundary Failures in MedSAM } },
        booktitle = {Medical Image Computing and Computer Assisted Intervention -- MICCAI 2026 Workshops and Challenges},
        year = {2026},
        publisher = {Springer Nature Switzerland},
        volume = {LNCS 17261},
        month = {pending},
        page = {pending}
}


back to top