Generative models improve fairness of medical classifiers under distribution shifts

Sofia Ira Ktena, Olivia Wiles, Isabela Maria Carneiro Albuquerque, Sylvestre-Alvise Rebuffi, Ryutaro Tanno, Abhijit Guha Roy, Shekoofeh Azizi, Danielle Belgrave, Pushmeet Kohli, Ali Taylan Cemgil, Alan Karthikesalingam, Sven Gowal

Abstract

Domain generalization is a ubiquitous challenge for machine learning in healthcare. Model performance in real-world conditions might be lower than expected because of discrepancies between the data encountered during deployment and development. Underrepresentation of some groups or conditions during model development is a common cause of this phenomenon. This challenge is often not readily addressed by targeted data acquisition and 'labeling' by expert clinicians, which can be prohibitively expensive or practically impossible because of the rarity of conditions or the available clinical expertise. We hypothesize that advances in generative artificial intelligence can help mitigate this unmet need in a steerable fashion, enriching our training dataset with synthetic examples that address shortfalls of underrepresented conditions or subgroups. We show that diffusion models can automatically learn realistic augmentations from data in a label-efficient manner. We demonstrate that learned augmentations make models more robust and statistically fair in-distribution and out of distribution. To evaluate the generality of our approach, we studied three distinct medical imaging contexts of varying difficulty: (1) histopathology, (2) chest X-ray and (3) dermatology images. Complementing real samples with synthetic ones improved the robustness of models in all three medical tasks and increased fairness by improving the accuracy of clinical diagnosis within underrepresented groups, especially out of distribution.

Addressing Distribution Shifts in Healthcare AI

Machine learning models in healthcare often suffer from "brittleness." A model trained at one hospital might fail at another due to different equipment, staining procedures, or patient demographics—a phenomenon known as distribution shift.

A major driver of this failure is the underrepresentation of certain groups (e.g., by race, sex, or age) or rare diseases in training sets. While the obvious solution is to collect more data, doing so is often prohibitively expensive, requires rare clinical expertise for labeling, or is impossible due to the rarity of certain conditions. This leads to "fairness gaps," where models perform significantly worse on marginalized populations, potentially exacerbating health inequities.

A Three-Step Generative Framework

Researchers from Google DeepMind and partners have demonstrated that generative AI—specifically diffusion models—can significantly improve the fairness and robustness of medical image classifiers. The proposed framework leverages Conditional Diffusion Probabilistic Models (DDPMs) to create a steerable form of data augmentation.

Overview of the medical imaging domains and the proposed three-step generative training framework.

The methodology follows three distinct stages:

  1. Train a Generative Model: A diffusion model is trained on both labeled and unlabeled data, conditioned on diagnostic labels and sensitive attributes (like hospital ID, sex, or age).
  2. Sample for Balance: Instead of replicating the original skewed data distribution, the model samples from the generative model to create a "fair" synthetic dataset. For example, it can generate an equal number of images for male and female patients with a specific condition, even if the original data was heavily skewed.
  3. Train the Classifier: A downstream diagnostic classifier (typically a ResNet) is trained on a combination of real labeled images and these steerable synthetic augmentations.

Evaluation Across Diverse Medical Modalities

The study evaluated the approach across three distinct medical imaging contexts:

  • Histopathology: Used the CAMELYON17 dataset (lymph node sections) to detect breast cancer metastases.
  • Chest Radiology: Used CheXpert for in-distribution training and ChestX-ray14 for out-of-distribution (OOD) evaluation.
  • Dermatology: Used a large teledermatology dataset for training, with OOD evaluation on datasets from Australia and Colombia, involving 27 skin conditions including melanoma.

Key Insights and Results

The approach yielded substantial improvements across all three modalities:

  • Label Efficiency: In histopathology, synthetic data allowed a model trained on only 1–10 real samples to match the performance of a baseline model trained on 1,000 samples.
  • Canonical Examples: Synthetic images may act as "canonical" versions of a disease, helping the model focus on core diagnostic features rather than spurious correlations like lighting or skin tone.
  • Expert Validation: Board-certified dermatologists rated synthetic images as highly realistic, with diagnostic accuracy on par with real images (~56% top-1 accuracy for synthetic vs. ~54% for real).

Quantitatively, the method achieved a 48.5% relative improvement in histopathology accuracy and reduced the sex-based fairness gap in radiology by 44.6% in OOD settings. In dermatology, it led to a 27.3% improvement in sensitivity for high-risk conditions and a 7.5x reduction in the OOD fairness gap.

Limitations and Future Work

While promising, the authors note risks such as bias propagation, where generative models might exacerbate existing structural inequities if trained on poor-quality data. There are also privacy concerns regarding the potential for models to memorize rare features. Future work will aim to move from patch-level evaluation to whole-slide image analysis and address unobserved social determinants of health that are not explicitly labeled in current datasets.

Summary updated

BibTeX
@inproceedings{ktena2024generative,
  author = {Sofia Ira Ktena and Olivia Wiles and Isabela Maria Carneiro Albuquerque and Sylvestre-Alvise Rebuffi and Ryutaro Tanno and Abhijit Guha Roy and Shekoofeh Azizi and Danielle Belgrave and Pushmeet Kohli and Ali Taylan Cemgil and Alan Karthikesalingam 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