DeCoDEx: Confounder Detector Guidance for Improved Diffusion-based Counterfactual Explanations

Nima Fathi, Amar Kumar, Brennan Nichyporuk, Mohammad Havaei, Tal Arbel

Introduction

Deep learning models in medical imaging are prone to "shortcut learning," where they rely on spurious artifacts—such as medical support devices or synthetic markers—rather than actual disease pathology to make predictions. For instance, a model might diagnose pleural effusion by detecting a chest drain rather than fluid in the lungs. This paper introduces DeCoDEx, a framework designed to expose and mitigate these biases using diffusion-based counterfactual explanations guided by artifact detectors.

The Challenge of Shortcut Learning

Counterfactual (CF) image generation is a powerful tool for interpretability, asking: "How would this image change if the patient were healthy instead of sick?" However, standard generative models often take the path of least resistance. If a dataset contains a strong correlation between a disease and an artifact (like a chest drain), a baseline CF model will simply remove the artifact to flip the prediction, failing to provide insight into the actual pathology. Existing methods to fix this often require retraining complex models with specialized labels, which is computationally expensive and inflexible.

The DeCoDEx Framework

DeCoDEx addresses this by generating debiased counterfactuals at inference time using an unconditional Denoising Diffusion Probabilistic Model (DDPM). The framework utilizes a pre-trained, binary artifact detector to guide the reverse diffusion process.

During denoising, the image generation is steered by three primary losses:

  1. Classifier Consistency Loss: Drives the image toward the target class (e.g., "healthy").
  2. Identity Preservation Loss: Maintains the anatomical structure of the original patient.
  3. Detector Loss: A gradient reversal signal from the artifact detector.

If the classifier attempts to flip the label by modifying a known artifact, the detector loss pushes back, forcing the diffusion process to find and alter the true clinical markers of the disease instead.

Figure 2: Comparison of counterfactual generation on the Dot Dataset. The baseline model (b) removes the synthetic dot to flip the class, while DeCoDEx (c) preserves the dot and modifies the lung pathology.

Experimental Evaluation

The authors tested DeCoDEx on the CheXpert dataset, specifically focusing on Pleural Effusion. They created two imbalanced benchmarks to induce bias:

  • Dot Dataset: A synthetic benchmark where a black dot is correlated with the disease.
  • Device Dataset: A real-world benchmark where medical support devices act as confounders.

Key Results

DeCoDEx demonstrated significant improvements in both explanation quality and downstream model robustness:

  • Qualitative Success: While baseline models simply erased artifacts, DeCoDEx successfully ignored them, instead altering costophrenic angles and lung opacity—the actual clinical indicators of effusion.
  • Quantitative Robustness: DeCoDEx achieved a Detector Robustness Rate (DRR) of over 0.97 and significantly reduced the Spurious Correlation Latching Score (SCLS) to ~0.06, compared to 0.73 for baselines.
  • Classifier Debiasing: By using DeCoDEx-generated counterfactuals as augmented training data, the authors improved a standard classifier's accuracy on the most difficult minority group (sick patients without artifacts) from 2.2% to 12.1%, and up to 26.5% with more extensive augmentation.

Conclusion and Future Work

DeCoDEx provides a flexible, inference-time solution for generating high-quality, pathology-focused explanations without the need for retraining generative models. While the method effectively steers away from known artifacts, future work will focus on improving the localization of edits and addressing scenarios with multiple hidden confounders. By recycling these explanations for data augmentation, DeCoDEx offers a path toward building more robust and trustworthy medical AI systems.

Summary updated

BibTeX
@inproceedings{fathi2024decodex,
  author = {Nima Fathi and Amar Kumar and Brennan Nichyporuk and Mohammad Havaei and Tal Arbel},
  title = {{DeCoDEx: Confounder Detector Guidance for Improved Diffusion-based Counterfactual Explanations}},
  booktitle = {MIDL},
  year = {2024},
}
Figure