Hospital early-warning models for infection learn that fever, a raised white blood cell count, and rising inflammatory markers mean trouble. Clinicians have long known that this is not a fact about bacteria. It is a fact about a working immune system. Patients on chemotherapy, radiotherapy, steroids, or other immunosuppressants can carry necrotizing abscesses or bloodstream infections with a normal temperature and a normal white count. In a French multicenter ICU cohort of culture-confirmed listeriosis, 46% of patients had no fever at admission and 71% were immunocompromised (Severe listeriosis in intensive care units).
Hospitals differ sharply in how many such patients they treat, and they differ just as much in how they record that a patient is immunosuppressed. One database has chemotherapy orders, another has only diagnosis codes, a third has only neutrophil counts. We propose that part of the well-documented failure of clinical models across hospitals is this "masking" shift. We also propose that the fix is neither invariance nor more pooling. The fix is a transferable estimate of immune competence, assembled from whatever proxies each hospital happens to record, which then tells the diagnostic model how much to trust its inflammatory features.
Core Claim
Write $Y$ for infection or sepsis, $X$ for the routine vital signs and labs, and $V$ for host immune competence. Standard anti-causal analysis treats disease as causing the observations ($Y \to X$). Considerations for Distribution Shift Robustness of Diagnostic Models in Healthcare shows that when a patient covariate such as age shifts the disease rate, conditioning on it keeps $P(Y \mid X, V)$ stable across populations. It also shows that invariance penalties that strip the covariate out hurt robustness. That paper studies a covariate that changes disease risk.
Diagnostic masking is a different structure: $V$ changes the emission mechanism itself, $P(X \mid Y, V)$, so the same fever-and-white-count evidence means different things in different patients. The same conditioning argument still applies if $V$ is observed consistently. In multi-hospital data it is not. Immune status is a latent variable measured through different, partial proxies at each site.
Our claim is that recovering a site-agnostic estimate of $V$ from these heterogeneous proxies is the missing ingredient for cross-hospital transfer in immunocompromised patients. The approach borrows the idea from cross-company software defect prediction that non-overlapping feature sets can be mapped into a shared space rather than cut down to their intersection (CCA+ with unified metric representation).
Research Program
The work has three parts, and the first can falsify the premise before any method is built.
Measuring the masking shift. Using the five harmonized ICU databases in Yet Another ICU Benchmark (YAIB) (MIMIC-III, MIMIC-IV, eICU, HiRID, AUMCdb), we define a reference immunocompromised flag on the richest source database. The flag combines recent chemotherapy, transplant, high-dose corticosteroids, and severe neutropenia. We then test two things. First, whether the conditional relationship between temperature or white count and sepsis actually differs by stratum, by fitting stratum-specific calibration curves. Second, whether cross-site loss in AUROC (area under the ROC curve) concentrates in the immunocompromised stratum. To separate the two sources of shift, we reweight the source population to match each target's stratum mix. The portion of loss that reweighting removes is attributable to the change in how common immunosuppressed patients are ($P(V)$). The residual includes changes in the emission mechanism and in coding.
Building a transferable immune-competence estimate. We train a small encoder $h$ that predicts the reference flag from the union of candidate proxies: medication classes, diagnosis codes, absolute neutrophil and lymphocyte counts, and prior oncology or transplant encounters. During training we randomly hide whole proxy groups to mimic the availability patterns of each target database. This follows the spirit of the unified metric representation in CCA+, which pads missing metric blocks so that source and target share one space. At a target hospital, the encoder is applied to whatever proxies exist and yields a score $z = h(\text{proxies}) \in [0,1]$.
Conditioning the diagnostic model on that estimate. The diagnostic model lets $z$ modulate the weight given to inflammatory features:
$$\text{logit}\, P(Y=1 \mid X, z) = f(X) + z \cdot g(X_{\text{infl}}),$$
Here $f$ is a standard sequence or tree model over all routine features, $X_{\text{infl}}$ is the subset of classic inflammatory signals (temperature, white count, C-reactive protein where present), and $g$ is a learned correction that is active only to the extent the patient is estimated to be immunocompromised. This is a lightweight form of the feature-wise modulation that the Considerations paper applied with age on ECGs. It also resembles the learned gating used to merge metric and semantic features in CNN-MLP defect prediction. The gate we propose, however, is driven by an estimated biological state, not learned per example from the inputs.
Baselines
The naive reference point is pooled empirical risk minimization, meaning ordinary supervised training on all source data. We will run it with LightGBM and a GRU using YAIB's pipeline and its hyperparameter search budget, trained on each source database and tested on the other four. This is the right floor for two reasons. Guo et al. found that pooled training on MIMIC-IV (2008–2016) was not beaten by domain generalization or adaptation, even though sepsis models decayed by up to 0.090 AUROC over time. Herbold et al. found that pooling all source projects into Naive Bayes beat 17 of 23 specialized cross-project methods. For mortality, YAIB reports AUROCs of 0.84 to 0.87 across datasets. For cross-site sepsis restricted to immunocompromised patients, we found no reported result on Lacuna, so we will establish this number ourselves.
The strongest competitor is pooled LightGBM given the union of all immune proxies as raw features, with missing blocks left missing. Gradient-boosted trees handle missingness natively and learn interactions automatically, so this baseline may capture everything our model does without an explicit latent estimate. It receives the same features, the same tuning trials, and the same training data as our method.
We also include two further baselines, each with an identical tuning budget. The first conditions on the reference flag only where it is computable and imputes it elsewhere, which is the direct translation of the Considerations paper. The second is invariant risk minimization with the site as the environment, included to confirm the prior negative result in this setting.
Two ablations isolate the key ingredient. One feeds $z$ as an ordinary input feature without the modulation term, which tests whether the gating matters. The other trains $h$ without group hiding, which tests whether the availability-matched training is what transfers.
Beating the strongest competitor means improved sensitivity at a fixed alarm rate within the immunocompromised stratum on held-out sites. The improvement must hold across source–target pairs under a paired bootstrap, with overall AUROC not falling by more than 0.005.
Why not just…?
Why not just give a gradient-boosted tree every proxy and let it find the interactions? This is the real threat, and it may win. Trees can learn "ignore temperature when steroids are recorded" if the steroid variable exists and means the same thing at every site. Our bet is that it does not. The same underlying state appears as a medication at one site and a diagnosis code at another, so a tree splits on site-specific columns that are absent or distributed differently at the target. The union-feature LightGBM baseline tests exactly this. If it matches our model on held-out sites, we will report that as the finding. Practitioners would then learn that recording immune proxies matters more than modeling them, which is still a useful and publishable answer.
Why not just enforce invariance across hospitals? Invariance would push the model to discard the very features whose meaning changes, which here includes inflammatory signals that remain informative in immunocompetent patients. Guo et al. found that neither domain generalization nor unsupervised adaptation beat plain training under clinical shift. The Considerations paper found that invariance methods performed about as poorly as ignoring the covariate entirely. We include invariant risk minimization only to confirm this.
Why not just train a separate model for immunocompromised patients? Doing so requires knowing who they are at the target site, which is the unobserved-$V$ problem again. It also splits an already small stratum. A per-stratum model trained with the reference flag at the source is therefore included within the "condition on the flag" baseline. Its performance at targets, where the flag must be imputed, directly measures the value of the learned estimate.
Why not just bootstrap labels at the target from heuristics, as CLAMI+ does for software? CLAMI+ assumes that higher metric values mean more defects. Masking inverts this assumption: the sickest masked patients look normal on exactly the heuristic features. The heuristic would therefore label them healthy. We do not pursue this approach.
Why not just search over transfer pipelines automatically? Bilevel pipeline search such as MBL-CPDP beat many standalone methods in software. However, it searches over existing transfer algorithms, none of which represent a latent host state. It is also costly. We leave it out of scope rather than claim it fails.
Proposed Experiments
Simulation. We first extend the Considerations paper's synthetic setup so that $V$ both shifts across domains and attenuates the emission of $X$ given $Y$. We also make $V$ observed through different proxy subsets per domain. The test is whether conditioning on an estimate of $V$ recovers the oracle performance that the paper reports when $V$ is known, roughly 0.95 AUC. The paper reports the $V$-agnostic model dropping from about 0.88 to below 0.80.
Real-data transfer. On YAIB we train on each database and test on the others, for sepsis onset (built with YAIB's ricu-based cohort tooling) and for mortality. We report overall AUROC, stratum-specific sensitivity at a fixed alert rate, and calibration within strata.
Decisive checks.
- Premise check. If stratified calibration shows no difference in the fever and white-count relationship, or cross-site loss does not concentrate in the immunocompromised stratum, the premise is wrong and we stop there.
- Estimate validity. The immune-competence estimate must agree with the reference flag at any target where that flag can be partially reconstructed.
- Head-to-head test. The comparison against union-feature LightGBM decides whether the method adds anything.
- Label-bias check. Sepsis labels depend on clinicians ordering cultures, and masked patients may be cultured late. We therefore repeat the analysis on the culture-positive subset with label timing anchored to culture draw. This checks that apparent gains are not artifacts of delayed labels in masked patients.
References
- Severe listeriosis in intensive care units: insights from a retrospective multicentric study
- Considerations for Distribution Shift Robustness of Diagnostic Models in Healthcare
- Heterogeneous cross-company defect prediction by unified metric representation and CCA-based transfer learning
- Yet Another ICU Benchmark: A Flexible Multi-Center Framework for Clinical ML
- Semantic and traditional feature fusion for software defect prediction using hybrid deep learning model
- Evaluation of domain generalization and adaptation on improving model robustness to temporal dataset shift in clinical medicine
- Correction of "A Comparative Study to Benchmark Cross-project Defect Prediction Approaches"
- Self-learning Change-prone Class Prediction
- MBL-CPDP: A Multi-Objective Bilevel Method for Cross-Project Defect Prediction