Robust Learning via Conditional Prevalence Adjustment

Minh Nguyen, Alan Q. Wang, Heejong Kim, Mert R. Sabuncu

Abstract

Healthcare data often come from multiple sites in which the correlations between confounding variables can vary widely. If deep learning models exploit these unstable correlations, they might fail catastrophically in unseen sites. Although many methods have been proposed to tackle unstable correlations, each has its limitations. For example, adversarial training forces models to completely ignore unstable correlations, but doing so may lead to poor predictive performance. Other methods (e.g. Invariant Risk Minimization) try to learn domain-invariant representations that rely only on stable associations by assuming a causal data-generating process (input X causes class label Y). Thus, they may be ineffective for anti-causal tasks (Y causes X), which are common in computer vision. We propose a method called CoPA (Conditional Prevalence-Adjustment) for anti-causal tasks. CoPA assumes that (1) generation mechanism is stable, i.e. label Y and confounding variable(s) Z generate X, and (2) the unstable conditional prevalence in each site E fully accounts for the unstable correlations between X and Y. Our crucial observation is that confounding variables are routinely recorded in healthcare settings and the prevalence can be readily estimated, for example, from a set of (Y,Z) samples (no need for corresponding samples of X). CoPA can work even if there is a single training site, a scenario which is often overlooked by existing methods. Our experiments on synthetic and real data show CoPA beating competitive baselines.

Introduction

In clinical machine learning, models are frequently trained on data from one set of hospitals and deployed in others. A significant challenge in this pipeline is the presence of "unstable correlations." For instance, a model trained to detect pneumonia at Hospital A might inadvertently learn to rely on the specific type of X-ray scanner ($Z$) used for sick patients ($Y$). If Hospital B uses that same scanner for healthy patients, the model's performance will collapse.

Most existing Out-of-Domain (OOD) generalization methods assume a causal relationship where the input $X$ (e.g., pixels) causes the label $Y$. However, medical imaging is fundamentally anti-causal: the underlying disease ($Y$) and patient-specific factors ($Z$) cause the observed image ($X$). Standard methods like Invariant Risk Minimization (IRM) often fail to account for this structure, particularly when the prevalence of a disease or its correlation with metadata varies across sites.

Methodology: Conditional Prevalence-Adjustment (CoPA)

CoPA is designed specifically for anti-causal tasks where the relationship between the disease and the image ($P(X|Y, Z)$) remains stable across environments, but the conditional prevalence—the frequency of a disease given patient metadata ($P(Y|Z, E)$)—is site-dependent.

Causal graphs representing different environments (E1-E6) where correlations between disease (Y), confounders (Z), and images (X) vary.

The authors demonstrate that the ratio $R(X, Z) = \frac{P(Y|X, Z, E)}{P(Y|Z, E)}$ is invariant across different sites ($E$). CoPA leverages this by training a neural network $f_\theta(X, Z)$ to estimate this stable ratio. During training, the network's output is adjusted by the local site's conditional prevalence. At test time, the model is re-adjusted using the prevalence statistics of the new site. This approach allows the model to "absorb" site-specific noise and focus purely on the stable generative process of the image.

Crucially, CoPA utilizes confounding variables ($Z$) such as age, sex, or equipment type, which are standard components of clinical records. Unlike many domain generalization methods that require multiple training environments to identify invariant features, CoPA can learn effectively from a single training site, provided the metadata is available.

Experimental Evaluation

The authors evaluated CoPA against several baselines, including Empirical Risk Minimization (ERM), IRM, DANN, and Deep CORAL, across three primary datasets:

  • Synthetic Data (2-dim & CMNIST): Controlled environments where correlations between confounders (like color) and labels (digits) were manipulated to test robustness.
  • ISIC (Skin Cancer): A dataset of ~70,000 dermoscopic images with confounders including age, anatomical site, and sex.
  • Chest X-Ray (CXR): A large-scale combination of CXR8, CheXpert, and PadChest datasets, using age, projection angle, and sex as confounders.

Key Results

CoPA consistently outperformed all baselines. In scenarios involving significant label shift (e.g., disease prevalence dropping from 40% in training to 7% in testing), CoPA maintained high F1-scores while other models experienced sharp performance declines. On the real-world ISIC dataset, CoPA demonstrated superior generalization across international sites, proving its utility in handling complex, multi-variable confounders.

Discussion and Limitations

While CoPA offers a robust solution for anti-causal tasks, it relies on the assumption that confounding variables ($Z$) are observed and recorded. If hidden factors drive correlation shifts, the method cannot account for them. Furthermore, the mathematical framework is specifically tailored to the $Y \to X$ direction; its efficacy in purely causal tasks ($X \to Y$) remains outside the scope of this work.

Finally, CoPA requires an estimate of the prevalence ($P(Y|Z)$) at the test site. Although the authors show that a small sample of label-metadata pairs (without images) is sufficient for this estimation, it does necessitate a minimal amount of data from the target location prior to deployment.

Summary updated

BibTeX
@inproceedings{nguyen2024robust,
  author = {Minh Nguyen and Alan Q. Wang and Heejong Kim and Mert R. Sabuncu},
  title = {{Robust Learning via Conditional Prevalence Adjustment}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=Dr8b1AAoF4},
}
Figure