Abstract
We consider robustness to distribution shifts in the context of diagnostic models in healthcare, where the prediction target $Y$, e.g., the presence of a disease, is causally upstream of the observations $X$, e.g., a biomarker. Distribution shifts may occur, for instance, when the training data is collected in a domain with patients having particular demographic characteristics while the model is deployed on patients from a different demographic group. In the domain of applied ML for health, it is common to predict $Y$ from $X$ without considering further information about the patient. However, beyond the direct influence of the disease $Y$ on biomarker $X$, a predictive model may learn to exploit confounding dependencies (or shortcuts) between $X$ and $Y$ that are unstable under certain distribution shifts. In this work, we highlight a data generating mechanism common to healthcare settings and discuss how recent theoretical results from the causality literature can be applied to build robust predictive models. We theoretically show why ignoring covariates as well as common invariant learning approaches will in general not yield robust predictors in the studied setting, while including certain covariates into the prediction model will. In an extensive simulation study, we showcase the robustness (or lack thereof) of different predictors under various data generating processes. Lastly, we analyze the performance of the different approaches using the PTB-XL dataset, a public dataset of annotated ECG recordings.
Introduction
Machine learning models for medical diagnosis are typically "anti-causal": they predict a disease ($Y$) from a biomarker ($X$), even though the disease is what actually causes the biomarker (e.g., heart disease causes specific patterns in an ECG). A major challenge arises when these models are deployed on a new population where the distribution of auxiliary covariates ($V$), such as age or BMI, differs from the training data. If a model learns to rely on "shortcuts"—statistical correlations between these covariates and the disease that are unstable—its performance will degrade during a distribution shift. This research investigates whether we should include these covariates in our models, ignore them, or use "invariant learning" techniques to force the model to be independent of them.
Causal Framework and Methods
The authors use causal modeling to analyze two distinct data-generating processes that characterize the relationship between a covariate $V$ and a disease $Y$:
- Spurious Relation ($V \leftrightarrow Y$): The covariate and the disease are related only through a hidden common cause (a confounder $C$).
- Causal Relation ($V \to Y$): The covariate directly influences the probability of having the disease (e.g., old age causes a higher prevalence of heart conditions).
Through Proposition 1, the authors theoretically demonstrate that in the "Causal Relation" setting, the conditional probability $P(Y|X, V)$ remains invariant even when the distribution of $V$ shifts. This suggests that including $V$ as a predictor is the optimal strategy for robustness in this scenario.
To validate this, the study employs:
- Synthetic Simulations: Controlled environments where the "knobs" of the data distribution can be precisely shifted.
- Invariant Learning Baselines: Comparisons against state-of-the-art methods designed to remove spurious correlations.
- Deep Learning on Real Data: Using a ResNet-based architecture (xresnet1d101) to test hypotheses on the PTB-XL dataset, which contains 21,837 clinical 12-lead ECG recordings.
Results and Discussion
The synthetic experiments were categorized into three scenarios of varying difficulty and causal structure, visualizing how the biomarker distribution $P(X|Y, V)$ shifts across groups.
Synthetic Performance
In Scenario 1, where the relationship between the biomarker and disease was highly dependent on the covariate, the model that included $V$ maintained a steady AUC (~0.95) across all shifts. In contrast, the model that ignored $V$ saw its AUC drop from ~0.88 to below 0.80 as the distribution shifted. Notably, invariant learning methods—which attempt to strip out the influence of $V$—performed significantly worse than simply including $V$ as an input, often matching the poor performance of the $V$-agnostic model.
Real-World Validation
Analysis of the PTB-XL dataset revealed that age shifts followed the "Causal Relation" pattern. By including age as an input (using FiLM layers), the model maintained or slightly improved its performance as the test population became significantly older than the training population.
Key Insights
- The "Invariance" Trap: While making models "invariant" to demographics is often a goal for fairness, if a demographic variable like age actually causes a higher disease rate, forcing the model to ignore it makes the model less robust to population shifts.
- Causal Knowledge is Essential: Building a robust model requires understanding the underlying causal graph. If $V$ causes $Y$, it should be included. If the relationship is spurious, invariant learning is more appropriate.
- Anti-Causal Diagnostics: Because healthcare is often anti-causal ($Y \to X$), the relationship between the biomarker and the disease is inherently tied to the prevalence of the disease. Including the "cause" ($V$) allows the model to adjust its baseline expectations for different groups.
Conclusion
The study highlights that the common practice of ignoring demographic covariates in diagnostic models can be detrimental to robustness. When covariates causally influence the disease, including them as model inputs provides the most stable performance under distribution shifts. Future work should address the challenges of causal discovery in complex medical settings and the impact of estimation errors in finite sample sizes.
Summary updated