Abstract
Once integrated into clinical care, patient risk stratification models may perform worse compared to their retrospective performance. To date, it is widely accepted that performance will degrade over time due to changes in care processes and patient populations. However, the extent to which this occurs is poorly understood, in part because few researchers report prospective validation performance. In this study, we compare the 2020-2021 prospective performance of a patient risk stratification model for predicting healthcare-associated infections to a 2019-2020 retrospective validation of the same model. We define the difference in retrospective and prospective performance as the performance gap. We estimate how i) “temporal shift” (changes in clinical workflows and patient populations) and ii) “infrastructure shift” (changes in access, extraction, and transformation of data) both contribute to the performance gap. Applied prospectively to 26,864 hospital encounters, the model achieved an AUROC of 0.767, a slight decrease from the retrospective AUROC of 0.778. The resulting performance gap was primarily due to infrastructure shift and not temporal shift.
Introduction: The Challenge of Real-World Deployment
In healthcare, most machine learning (ML) models are developed using "retrospective" data—historical records pulled from research warehouses like MIMIC-III. These datasets are highly curated, cleaned, and transformed long after the patient has left the hospital. However, when a model is deployed "prospectively" (in real-time), it must rely on raw, messy data feeds directly from clinical operations.
The authors address a critical question: When a model performs worse in the real world than it did in the lab, is it because the world changed (temporal shift), or because our data plumbing is different (infrastructure shift)? Understanding this distinction is vital for engineers and clinicians trying to debug and maintain reliable AI in clinical settings.
Methodology: Isolating the Performance Gap
The researchers conducted a case study at the University of Michigan Health, focusing on a model designed to predict hospital-associated Clostridioides difficile infections (CDI). To isolate the causes of the performance gap, they compared three distinct data "snapshots":
- $D_{ret}$ (Retrospective): Data from 2019-2020 pulled from a research warehouse.
- $D_{pro}$ (Prospective): Data from 2020-2021 collected via a real-time pipeline during actual deployment.
- $D'_{ret}$ (The Control): Data from the same 2020-2021 period, but pulled retrospectively from the research warehouse months later.
By comparing these, they could mathematically decompose the performance gap:
- Temporal Shift: Difference between $D_{ret}$ and $D'_{ret}$ (Same pipeline, different times).
- Infrastructure Shift: Difference between $D'_{ret}$ and $D_{pro}$ (Same time, different pipelines).
Key Results: Infrastructure as the Primary Culprit
The model's performance degraded upon prospective deployment, but the breakdown reveals where the trouble started:
- Retrospective AUROC ('19-'20): 0.778
- Prospective AUROC ('20-'21): 0.767
- The Total "Gap": 0.011
When decomposing this gap, the infrastructure shift accounted for a loss of 0.016 in AUROC, while the temporal shift actually provided a slight improvement of 0.005 (likely because certain COVID-related clinical changes made the prediction task slightly easier).
Insights and Recommendations
- Infrastructure hits AUROC, Temporal hits Calibration: While infrastructure shift hurt discriminative performance (ranking patients), temporal shift (likely due to COVID-19 changing patient mixes) was the main driver behind changes in calibration (how well predicted probabilities match actual disease frequency).
- "Static" data isn't static: Features like "County of Residence" or "BMI" showed discrepancies. In retrospective warehouses, these are often updated to the most recent known value, whereas the prospective pipeline sees only what was recorded at that specific moment in the encounter.
- Real-time pipelines are brittle: The prospective pipeline failed on 10 out of 356 days due to upstream data-feed issues. This "silent" failure mode is a major risk for deployed ML.
The authors suggest that future ML developers should build "Time Machine" databases that can show exactly what the EHR looked like at any historical point in time and favor stable features like "medication administration" over "medication orders," as the latter are frequently changed or cancelled in real-time.
Summary updated