Counterfactual Diffusion Models for Interpretable Morphology-based Explanations of Artificial Intelligence Models in Pathology

bioRxiv [Preprint]. 2025 Jul 22:2024.10.29.620913. doi: 10.1101/2024.10.29.620913.

Abstract

Background: Deep learning (DL) can extract predictive and prognostic biomarkers from histopathology whole slide images, but its interpretability remains elusive.

Methods: We introduce MoPaDi (Morphing histoPathology Diffusion), a framework for generating counterfactual explanations for histopathology that reveal which morphological features drive deep learning classifier predictions. MoPaDi combines self-supervised diffusion autoencoders with task-specific classifiers to manipulate images and flip predictions by altering visual features. To address weakly supervised scenarios common in pathology, it integrates multiple instance learning. We validate MoPaDi across four tasks: tissue type, cancer subtypes, slide origin, and a biomarker (microsatellite instability) classification. Counterfactuals are evaluated through pathologist studies and quantitative analysis.

Results: MoPaDi achieves high image reconstruction quality (MS-SSIM 0.966-0.992) and good classification performance (AUCs 0.76-0.98). In a blinded observer study, two pathologists misclassified between 26.7% and 63.3% of synthetic images as real across all tasks, indicating that MoPaDi-generated images often exhibit high perceptual realism. Furthermore, counterfactual images revealed interpretable, pathology-consistent morphological changes recognizable by experts.

Conclusion: MoPaDi is a practical and extensible framework for counterfactual explanations generation in computational pathology. It enables interpretable, model-specific insight into what morphological changes drive classification outcomes, improving interpretability in clinical deep learning models.

Publication types

  • Preprint