MEDFAIR: Benchmarking Fairness for Medical Imaging

Yongshuo Zong, Yongxin Yang, Timothy Hospedales

Machine learning models for medical diagnosis frequently exhibit systematic biases, performing worse for certain demographic subgroups based on race, gender, or age. While many "bias mitigation" algorithms have been proposed to address this, the field is currently a "Wild West." Researchers use different datasets, inconsistent metrics, and varying "model selection" strategies (the rules for picking which version of a model is the final one).

This lack of standardization makes it nearly impossible to tell which algorithms actually work. Furthermore, most fairness research focuses on natural images or tabular data, which fail to capture the unique complexities of medical imaging—such as high-resolution 3D scans, significant label noise, and the ethical imperative of beneficence.

To address this, researchers have introduced MEDFAIR, a comprehensive new benchmark for evaluating fairness in medical imaging. The study reveals a surprising truth: specialized "fairness" algorithms often fail to beat standard training methods, and the way we select our "best" model during training matters more for fairness than the specific debiasing algorithm used.

The MEDFAIR Framework

MEDFAIR is a standardized framework designed to bring rigor to the evaluation of fairness in medical AI.

Overview of the MEDFAIR benchmarking framework.

The authors re-implemented and evaluated 11 algorithms across five distinct categories:

  • Subgroup Rebalancing: Simple resampling techniques to balance groups.
  • Domain-independence: Training separate classifiers for different subgroups.
  • Adversarial Training: Attempting to "hide" sensitive attributes from the model's internal representations.
  • Disentanglement: Separating "diagnostic" features from "bias" features.
  • Domain Generalization (DG): Techniques like SWAD (Stochastic Weight Averaging Densely) and SAM (Sharpness-Aware Minimization) that aim for robust, "flat" optima in the loss landscape.

Crucially, the framework tests three distinct Model Selection Criteria:

  1. Overall Performance: Picking the model with the best average score.
  2. Minimax Pareto Selection: Picking the model that performs best for the worst-performing group.
  3. DTO (Distance to Optimal): Picking the model closest to a theoretical "perfect" score for all groups.

Diverse Datasets and Evaluation

The benchmark includes 10 publicly available datasets covering various modalities (2D and 3D) and sensitive attributes (Age, Sex, Race, Skin Type):

  • Chest X-rays: CheXpert, MIMIC-CXR.
  • Skin Dermatology: HAM10000, Fitzpatrick17k.
  • 3D Scans: ADNI (Brain MRI), COVID-CT-MD (Lung CT), OL3I (Heart CT).
  • Others: PAPILA (Fundus), OCT (Retina).

To see if fairness holds up in the real world, the authors also evaluated Out-of-Distribution (OOD) performance, training on one hospital's data (e.g., CheXpert) and testing on another (e.g., MIMIC-CXR).

Key Insights and Results

The authors trained over 7,000 models using 6,800 GPU hours, leading to several critical insights that challenge current assumptions in the field.

Model Selection is the "Secret Sauce"

The most striking finding is that how you choose your model is often more important than which algorithm you use.

Comparison of different model selection strategies on subgroup performance.

Simply switching from an "Overall Performance" selection to a "Minimax Pareto" strategy significantly improved fairness for the worst-case groups, even for standard models. Using a Pareto-optimal model selection strategy improved the average rank of the worst-case group performance from 2.53 to 1.49.

The ERM Baseline is Stubborn

Standard Empirical Risk Minimization (ERM)—essentially "normal" training—is surprisingly hard to beat. When tested across all 10 datasets with statistical rigor, most specialized fairness algorithms did not significantly outperform ERM. Despite the hype around adversarial and disentanglement methods, none were found to be significantly better than the ERM baseline across the entire benchmark suite.

General Robustness Equals Fairness

Algorithms from the Domain Generalization (DG) field, specifically SWAD, consistently ranked as top performers. SWAD achieved the highest average rank for both worst-case and overall AUC in both in-distribution and out-of-distribution settings. Even though SWAD wasn't explicitly designed for fairness, its ability to find robust, generalizable features naturally helps reduce the performance gap between subgroups.

Bias is Multi-Faceted

The study highlights that bias in medical AI isn't just about group size. It stems from a complex mix of label noise, differences in disease prevalence, and inherent task difficulty (e.g., certain skin lesions are objectively harder to see on darker skin tones).

Limitations and Future Work

While MEDFAIR is a massive step forward, the authors acknowledge that it currently focuses on binary classification. Real-world medical tasks often involve multi-label classification, segmentation, or detection, which are not yet covered. Additionally, newer paradigms like self-supervised learning might offer different fairness properties not captured here. Moving forward, the authors plan to keep the codebase alive by incorporating more datasets and tasks, providing a reproducible entry point for the future of fair medical AI.

Summary updated

BibTeX
@inproceedings{zong2023medfair,
  author = {Yongshuo Zong and Yongxin Yang and Timothy Hospedales},
  title = {{MEDFAIR: Benchmarking Fairness for Medical Imaging}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=6ve2CkeQe5S},
}
Figure