Maintaining fairness across distribution shift: do we have viable solutions for real-world applications?

Jessica Schrouff, Natalie Harris, Oluwasanmi Koyejo, Ibrahim Alabdulmohsin, Eva Schnider, Krista Opsahl-Ong, Alex Brown, Subhrajit Roy, Diana Mincu, Christina Chen, Awa Dieng, Yuan Liu, Vivek Natarajan, Alan Karthikesalingam, Katherine A. Heller, Silvia Chiappa, Alexander D'Amour · OpenReview

Abstract

Fairness and robustness are often considered as orthogonal dimensions when evaluating machine learning models. However, recent work has revealed interactions between fairness and robustness, showing that fairness properties are not necessarily maintained under distribution shift. In healthcare settings, this can result in e.g. a model that performs fairly according to a selected metric in "hospital A" showing unfairness when deployed in "hospital B". While a nascent field has emerged to develop provable fair and robust models, it typically relies on strong assumptions about the shift, limiting its impact for real-world applications. In this work, we explore the settings in which recently proposed mitigation strategies are applicable by referring to a causal framing. Using examples of predictive models in dermatology and electronic health records, we show that real-world applications are complex and often invalidate the assumptions of such methods. Our work hence highlights technical, practical, and engineering gaps that prevent the development of robustly fair machine learning models for real-world applications. Finally, we discuss potential remedies at each step of the machine learning pipeline.

Introduction

As machine learning (ML) models are increasingly deployed in high-stakes domains like healthcare, ensuring their fairness across demographic groups is paramount. However, a significant challenge arises: a model that satisfies fairness criteria on its training data (e.g., Hospital A) often fails to maintain those same properties when deployed in a new environment (e.g., Hospital B). This phenomenon is driven by distribution shift—changes in patient populations, clinical practices, or data collection methods between the source and target domains.

While the impact of distribution shift on model performance is well-documented, its specific effect on fairness is more nuanced. The success of any fairness mitigation strategy depends heavily on the underlying structure of the shift. Currently, practitioners lack the empirical tools to diagnose these shifts, often leading to the application of mismatched mitigation strategies that may even exacerbate biases.

Methodology: A Causal Framework for Diagnosis

To address this, we frame distribution shift using Joint Causal Inference (JCI). We represent the data-generating process using a causal graph that includes features ($X$), sensitive attributes ($A$), labels ($Y$), and an environment variable ($S$) representing the source or target distribution.

Causal graph representing distribution shift with environment variable S.

We propose a testing procedure based on conditional independence tests to diagnose the nature of the shift:

  1. Isolate the effect: We determine if the environment ($S$) directly affects a variable by controlling for its causal parents.
  2. Reweighting: Inverse Probability Weighting (IPW) is used to balance the distributions of causal parents across source and target datasets.
  3. Statistical Testing: We perform tests on the reweighted data. If differences persist, $S$ has a direct causal effect on that variable.
  4. Handling High Dimensions: For complex inputs like images, we use model outputs as lower-dimensional summaries to facilitate these tests.

Experimental Setup

We evaluated our framework on two real-world medical datasets:

  • Dermatology: Predicting 26+1 skin conditions from images and metadata. The source data came from a US teledermatology service, while targets included services in Colombia and clinics in Australia/New Zealand.
  • Electronic Health Records (EHR): Predicting prolonged ICU stays (>3 days) using time-series data from the MIMIC-III database. The source consisted of generalist ICUs, while the target focused on specialized Cardiac and Coronary ICUs.

Results and Discussion

Our analysis reveals that real-world shifts are typically "compound shifts", where the environment simultaneously alters demographics, features, and labels. This complexity invalidates many current "robustly fair" algorithms that assume simpler, isolated shifts.

Subgroup performance for Dermatology (a) and EHR (b) tasks across source and target distributions.

Key findings include:

  • Fairness Erosion: In the dermatology task, a model with a 1.05% accuracy gap between age groups on source data saw that gap explode to 12.86% on target data.
  • Mitigation Backfire: In the EHR task, applying a state-of-the-art post-processing technique reduced the source accuracy gap from 7% to 0.8%, but worsened the target gap to 11.4%.
  • Diagnostic Success: Our statistical tests successfully identified the causal drivers of these failures, such as the environment's direct effect on patient age and condition prevalence.

Conclusion

The prevalence of compound shifts in medical data presents a significant hurdle for algorithmic fairness. Blindly applying fairness constraints in the source domain can be counterproductive. We argue for a shift in focus toward holistic pipeline interventions, including better data collection from target environments and manual feature engineering to enforce safe inductive biases. Future work should investigate unobserved variables and alternative model architectures to better handle the hostile nature of real-world distribution shifts.

Summary updated

BibTeX
@inproceedings{schrouff2022maintaining,
  author = {Jessica Schrouff and Natalie Harris and Oluwasanmi Koyejo and Ibrahim Alabdulmohsin and Eva Schnider and Krista Opsahl-Ong and Alex Brown and Subhrajit Roy and Diana Mincu and Christina Chen and Awa Dieng and Yuan Liu and Vivek Natarajan and Alan Karthikesalingam and Katherine A. Heller and Silvia Chiappa and Alexander D'Amour},
  title = {{Maintaining fairness across distribution shift: do we have viable solutions for real-world applications?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=ecWa1aCROvl},
}
Figure