Abstract
Deep learning models in medical imaging often lack transparency, providing high accuracy without explaining the underlying rationale. We present PrognosisEx, an intrinsically explainable framework that utilizes diffusion-based autoencoders to generate counterfactual medical images. By manipulating latent features associated with specific clinical outcomes, the model provides visually grounded explanations for its prognostic decisions. Validated on COVID-19 CT scans, PrognosisEx matches the performance of state-of-the-art black-box models while offering superior interpretability.
Introduction
In medical imaging, deep learning models often act as "black boxes." While they can predict disease progression or mortality with high accuracy, they rarely explain why. Traditional Explainable AI (XAI) methods, such as Grad-CAM, produce "attribution maps" (heatmaps) that show where a model is looking. However, in complex medical cases, these heatmaps are often insufficient. Discriminative features—like subtle changes in lung texture—can be tiny or overlap significantly between different diagnostic classes. Clinicians need to know exactly which features (e.g., a specific type of lesion or vessel enlargement) are driving a decision. This work introduces PrognosisEx to bridge this gap by moving beyond heatmaps toward "counterfactual explanations"—generating synthetic images that demonstrate how changing specific features would change the model's prediction.
Methodology
The PrognosisEx framework consists of three main components designed for both high performance and intrinsic explainability.
- Diffusion-based Autoencoder (DDIM): The model first compresses a high-dimensional CT slice into a semantically meaningful, low-dimensional latent representation ($z$). Because it uses a diffusion-based decoder, it can reconstruct the original image with high fidelity or generate realistic variations of it.
- Two-Layer Prognostic Model: Instead of a deep, opaque CNN, the framework uses a simpler two-layer linear model operating on latent representations. The first layer extracts features per slice, and the second aggregates them for a final score. This simplicity makes the relationship between input features and the final decision mathematically traceable.
- Counterfactual Generation: To explain a decision, the model identifies the most influential features in the latent space. It then "nudges" these features—either amplifying or diminishing them—and passes the modified latent vector back through the diffusion decoder. This produces a "counterfactual" image highlighting clinical changes (like increased opacity or vessel density) that would lead to a different prognosis.
The model was validated using an in-house dataset from the University Hospital of Parma, comprising 45,302 CT slices from 566 COVID-19 inpatients. The task was to predict 10-day mortality.
Results and Knowledge Discovery
PrognosisEx achieved an AUC of 0.79 and an accuracy of 0.71, matching the performance of popular black-box models like DenseNet-121 and exceeding ResNet50 and EfficientNet (both AUC 0.71).
Qualitative validation through counterfactual images clearly showed that the model associated increased mortality with specific patterns: increased vascularization, more ground-glass opacities (GGO), and reduced lung area in the upper-middle lung. Conversely, survival was associated with fewer vessel textures and clearer lung fields in the lower regions. By comparing original slices to counterfactuals, the authors found the model was picking up on medically recognized biomarkers without explicit supervision, suggesting its utility for "knowledge discovery" in diseases that are not yet fully understood.
Discussion and Limitations
PrognosisEx demonstrates that intrinsic explainability does not require a trade-off in predictive performance. By operating in a defined "reasoning space," the model can isolate class-specific features and provide clinicians with visual evidence for its predictions.
However, limitations remain. The current model randomly selects four slices from different lung regions to manage computational costs, which might miss localized features. Future work will focus on validating the method across different imaging modalities (MRI, X-ray) and disease types, as well as optimizing the computational power required for diffusion-based image generation.
Summary updated