[Paper Review] Gifsplanation via Latent Shift: A Simple Autoencoder Approach to Counterfactual Generation for Chest X-rays
This paper proposes Latent Shift, a simple autoencoder-based method to generate counterfactual chest X-ray images by shifting the latent representation of an input to exaggerate or suppress features influencing a classifier's prediction. The method improves user confidence in true positive predictions (0.15 increase on a 5-point scale, p=0.01) without significantly increasing false positive confidence, outperforming traditional attribution maps in radiologist interpretability.
Motivation: Traditional image attribution methods struggle to satisfactorily explain predictions of neural networks. Prediction explanation is important, especially in medical imaging, for avoiding the unintended consequences of deploying AI systems when false positive predictions can impact patient care. Thus, there is a pressing need to develop improved models for model explainability and introspection. Specific problem: A new approach is to transform input images to increase or decrease features which cause the prediction. However, current approaches are difficult to implement as they are monolithic or rely on GANs. These hurdles prevent wide adoption. Our approach: Given an arbitrary classifier, we propose a simple autoencoder and gradient update (Latent Shift) that can transform the latent representation of a specific input image to exaggerate or curtail the features used for prediction. We use this method to study chest X-ray classifiers and evaluate their performance. We conduct a reader study with two radiologists assessing 240 chest X-ray predictions to identify which ones are false positives (half are) using traditional attribution maps or our proposed method. Results: We found low overlap with ground truth pathology masks for models with reasonably high accuracy. However, the results from our reader study indicate that these models are generally looking at the correct features. We also found that the Latent Shift explanation allows a user to have more confidence in true positive predictions compared to traditional approaches (0.15$\pm$0.95 in a 5 point scale with p=0.01) with only a small increase in false positive predictions (0.04$\pm$1.06 with p=0.57). Accompanying webpage: https://mlmed.org/gifsplanation Source code: https://github.com/mlmed/gifsplanation
Motivation & Objective
- To address the limitations of traditional attribution maps in explaining deep learning predictions for medical imaging.
- To develop a modular, easy-to-implement method that works with existing pretrained classifiers, avoiding complex GAN training.
- To improve model interpretability by generating counterfactual images that exaggerate or diminish features influencing predictions.
- To evaluate whether Latent Shift enhances radiologist confidence and accuracy in identifying correct features used by classifiers.
- To compare Latent Shift against traditional attribution methods in clinical relevance and alignment with ground truth pathology masks.
Proposed method
- The method uses a pretrained autoencoder (encoder E, decoder D) and a separate classifier f, both differentiable and trained independently.
- For an input image x, the latent code z is obtained via z = E(x), and a λ-shifted latent code is computed as z_λ = z + λ·∂f(D(z))/∂z.
- The counterfactual image is reconstructed as x′_λ = D(z_λ), which should produce a higher prediction score f(x′_λ) > f(x).
- Multiple λ values generate a sequence of images that can be stitched into a GIF to visualize feature changes over time.
- The method visualizes changes via optical flow and tracks prediction shifts across the GIF sequence.
- The approach is evaluated using a reader study with two radiologists comparing Latent Shift to traditional attribution maps (e.g., Grad-CAM, Integrated Gradients).
Experimental results
Research questions
- RQ1Does Latent Shift improve radiologist confidence in model predictions compared to traditional attribution methods?
- RQ2Are the features highlighted by Latent Shift more aligned with radiologists' perception of correct pathology locations than traditional methods?
- RQ3How does the performance of Latent Shift compare to traditional attribution maps in identifying false positive predictions?
- RQ4Is there a correlation between the IoU of model-identified features and radiologist assessment of feature correctness?
- RQ5Can Latent Shift effectively reveal whether a model is using spurious correlates (e.g., chest tubes) instead of actual pathology?
Key findings
- Radiologists reported a statistically significant 0.15-point increase in confidence for true positive predictions when using Latent Shift compared to traditional attribution maps (p=0.01).
- There was no significant increase in confidence for false positive predictions (0.04-point increase, p=0.57), suggesting Latent Shift does not induce overconfidence in incorrect cases.
- Despite high AUC scores (e.g., 0.92 for Mass), the IoU between attribution maps and ground truth masks was low, indicating poor spatial alignment with pathology.
- The reader study found that higher IoU values were correlated with radiologists rating features as correct, suggesting that IoU is a meaningful proxy for clinical relevance.
- Radiologists found Latent Shift more intuitive and reported that it better highlighted boundaries of abnormalities, improving their ability to assess model reasoning.
- One radiologist observed that the model used the chest tube to predict pneumothorax, a spurious correlate, which was visually confirmed via Latent Shift, highlighting model brittleness at low resolution.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.