[Paper Review] CheXplaining in Style: Counterfactual Explanations for Chest X-rays using StyleGAN
This paper proposes StyleEx, a method using StyleGAN-based latent space manipulation to generate clinically relevant counterfactual explanations for chest X-ray diagnoses. By introducing EigenFind—a PCA-based latent space factorization technique—it reduces counterfactual search time from hours to minutes while maintaining high clinical relevance, as validated by radiologists who confirmed that generated feature changes align with real pathological signs.
Deep learning models used in medical image analysis are prone to raising reliability concerns due to their black-box nature. To shed light on these black-box models, previous works predominantly focus on identifying the contribution of input features to the diagnosis, i.e., feature attribution. In this work, we explore counterfactual explanations to identify what patterns the models rely on for diagnosis. Specifically, we investigate the effect of changing features within chest X-rays on the classifier's output to understand its decision mechanism. We leverage a StyleGAN-based approach (StyleEx) to create counterfactual explanations for chest X-rays by manipulating specific latent directions in their latent space. In addition, we propose EigenFind to significantly reduce the computation time of generated explanations. We clinically evaluate the relevancy of our counterfactual explanations with the help of radiologists. Our code is publicly available.
Motivation & Objective
- To address the black-box nature of deep learning models in medical imaging by generating counterfactual explanations that reveal what image changes would alter model predictions.
- To improve computational efficiency in finding classifier-specific latent directions for counterfactual generation in chest X-rays.
- To validate the clinical relevance of generated counterfactuals through expert radiologist evaluation.
- To demonstrate that latent space manipulation via StyleGAN can uncover meaningful, diagnostically relevant image features.
Proposed method
- The method uses a conditional StyleGAN2 generator trained on the CheXpert dataset, conditioned on classifier predictions to generate images with specific diagnostic labels.
- A frozen DenseNet classifier is used to predict pathology labels, and an encoder maps real X-ray images into the StyleGAN latent space.
- The latent space is factorized using PCA to identify the most influential directions (Eigenvectors), enabling efficient counterfactual search via EigenFind.
- Counterfactuals are generated by perturbing the latent code along the top Eigenvectors corresponding to target diagnoses, producing images that are semantically altered yet visually plausible.
- The classifier-specific latent directions are discovered using a modified search algorithm that prioritizes clinically meaningful feature changes.
- The entire pipeline is trained end-to-end with path length and R1 regularization to stabilize training and improve generation quality.
Experimental results
Research questions
- RQ1Can counterfactual explanations generated via latent space manipulation in StyleGAN reveal diagnostically meaningful image changes for chest X-ray classification?
- RQ2How can the computational cost of searching for classifier-specific latent directions be reduced without sacrificing explanation quality?
- RQ3Are the feature changes in generated counterfactuals clinically relevant and recognizable to expert radiologists?
- RQ4Can the model learn to associate specific anatomical indicators (e.g., pacemakers, age-related features) with corresponding pathologies through counterfactual generation?
Key findings
- EigenFind achieved comparable counterfactual generation performance to AttFind (94–96% success rate on three pathologies) but reduced search time from 12 hours to just 5 minutes on a Tesla P100 GPU.
- Radiologists confirmed that the most significant Eigenvectors generated by EigenFind successfully highlighted key pathological features such as increased cardiothoracic ratio, pleural recessus obstruction, and mediastinal shift.
- The generated counterfactuals accurately reflected known clinical signs: e.g., heart enlargement, pleural effusion, and mediastinal shift were visually and clinically plausible.
- The model learned to associate indirect indicators like pacemakers and age with cardiomegaly, demonstrating robustness in capturing clinically relevant patterns.
- The method successfully generated counterfactuals for 91–96% of test images across three pathologies, indicating high reliability and generalization.
- The use of PCA-based factorization in the latent space enabled efficient and interpretable identification of the most influential features driving model predictions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.