Generative models improve fairness of medical classifiers under distribution shifts

Ira Ktena, Olivia Wiles, Isabela Albuquerque, Sylvestre-Alvise Rebuffi, Ryutaro Tanno, Abhijit Guha Roy, Shekoofeh Azizi, Danielle Belgrave, Pushmeet Kohli, Alan Karthikesalingam, A. Taylan Cemgil, Sven Gowal · DOI

Abstract

Medical image classifiers often suffer from performance degradation when deployed across different clinical sites (distribution shift) and can exhibit biases against underrepresented patient groups. This paper investigates the use of conditional diffusion models to generate realistic, fair synthetic data for training. By sampling uniformly across sensitive attributes while maintaining disease prevalence, the proposed method significantly improves both robustness to distribution shifts and algorithmic fairness. Evaluation across histopathology, radiology, and dermatology demonstrates substantial gains in accuracy and a marked reduction in fairness gaps, particularly in out-of-distribution settings.

Introduction

Machine learning models in healthcare face two major hurdles: domain generalization and algorithmic bias. A model trained at one hospital often performs poorly when deployed at another due to differences in imaging equipment, staining protocols, or patient demographics—a phenomenon known as distribution shift. Furthermore, medical datasets often underrepresent certain groups (e.g., specific skin tones or age groups), leading models to develop "shortcuts" or biases that result in lower diagnostic accuracy for those populations. While traditional heuristic augmentations (e.g., rotations) provide some robustness, they fail to capture the complex variations of real medical conditions. This study explores whether generative AI can "fill in the gaps" of medical datasets to improve fairness and robustness.

Overview of medical imaging modalities used in the study: Histopathology, Radiology, and Dermatology.

Methods

The researchers propose a three-step pipeline leveraging Diffusion Probabilistic Models:

  1. Generative Model Training: A conditional diffusion model is trained on both labeled and unlabeled data, conditioned on diagnostic labels and sensitive attributes (e.g., skin tone, hospital ID).
  2. Fair Sampling Strategy: Instead of mimicking the biased training distribution, the model samples uniformly across sensitive attributes while preserving natural disease prevalence, creating a balanced synthetic dataset.
  3. Downstream Classification: A standard classifier (e.g., ResNet) is trained on a combination of real and synthetic images. For high-resolution tasks like Radiology and Dermatology, a cascaded approach is used, employing a low-resolution base model followed by a super-resolution diffusion model to recover fine clinical details.

Datasets

The approach was evaluated across three distinct medical contexts:

  • Histopathology: The CAMELYON17 dataset, focusing on breast cancer metastases in lymph node sections across five different hospitals.
  • Chest Radiology: Training on CheXpert and evaluating on ChestX-ray14 (NIH) for out-of-distribution performance across five thoracic conditions.
  • Dermatology: A large-scale dataset of 27 skin conditions, artificially skewed to simulate bias across sex, age, and skin tone (Fitzpatrick scale).

Results

The study yielded several key insights:

  • Canonical Examples: Generative models often produce "canonical" versions of diseases that represent pathology without the "noise" or "shortcuts" found in real-world clinical images.
  • Spurious Correlation Reduction: Principal Component Analysis (PCA) showed that models trained on synthetic data require fewer features, suggesting they ignore irrelevant hospital-specific features (e.g., lighting).
  • Label Efficiency: In histopathology, a model trained on just 10 real samples plus synthetic data matched the performance of a baseline trained on 1,000 real samples.
  • Distribution Alignment: Maximum Mean Discrepancy (MMD) analysis confirmed that learned augmentations align feature distributions across hospitals better than manual methods.

Quantitative improvements were significant, especially in out-of-distribution (OOD) settings:

  • Histopathology: 7.7% absolute improvement in accuracy on test hospitals.
  • Radiology: 5.2% average AUC improvement OOD and a 44.6% reduction in the sex-based fairness gap.
  • Dermatology: 63.5% improvement in sensitivity for high-risk conditions and a 7.5x reduction in the fairness gap in skewed settings.

Discussion and Limitations

While generative models offer a powerful tool for fairness, several challenges remain. There is a risk of overconfidence if synthetic images are not rigorously evaluated against real-world data. The "garbage in, garbage out" principle applies: poor-quality or biased generative models could exacerbate existing issues. Furthermore, fairness is limited by observable attributes; unmeasured factors (e.g., socioeconomic status) cannot be explicitly corrected. The authors emphasize the need for transparency, suggesting that synthetic data be clearly tagged in clinical databases. Future research will focus on integrating Differential Privacy to ensure patient data security during the training of these generative systems.

Summary updated

BibTeX
@inproceedings{ktena2024generative,
  author = {Ira Ktena and Olivia Wiles and Isabela Albuquerque and Sylvestre-Alvise Rebuffi and Ryutaro Tanno and Abhijit Guha Roy and Shekoofeh Azizi and Danielle Belgrave and Pushmeet Kohli and Alan Karthikesalingam and A. Taylan Cemgil and Sven Gowal},
  title = {{Generative models improve fairness of medical classifiers under distribution shifts}},
  booktitle = {Nature Medicine},
  year = {2024},
  doi = {10.1038/s41591-024-02838-6},
}
Figure