Isolated Patients: A Sample-Size-Calibrated Test for Real Distribution Shift Across Hospitals

When a clinical prediction model trained at some hospitals does poorly at a new one, there are two very different explanations. The new hospital may treat patients the source hospitals never saw. Or it may simply be small, so its performance estimate is noisy. In the eICU critical-care database, many hospitals that a leave-one-hospital-out analysis flags as "severely out-of-distribution" turn out to be small hospitals with unstable metrics, not hospitals with different patients (Looking for Out-of-Distribution Environments in Critical Care). This proposal builds a test that separates the two explanations. It borrows one finding from the theory of random networks: a large random network fails to become fully connected not because its big clusters fail to merge, but because a few peripheral nodes stay isolated.

The idea is to connect each patient at the new hospital to nearby patients in the training pool, using a learned low-dimensional patient representation. We then count the new-hospital patients with no neighbor within a radius $r$. Conditional on the training pool, these "isolated" indicators are independent across the new hospital's patients, so under the hypothesis "this hospital looks like just another training hospital" the count has an exact binomial reference distribution whose spread depends explicitly on the hospital's size. An excess of isolated patients therefore indicates genuine lack of coverage, separated from small-cohort noise. The isolated patients also show where the model should fail. We expect them to carry most of the transfer error, which turns a vague "this site is OOD" verdict into a list of the patients and subgroups the training data does not cover.

Core Claim

The claim has two parts, and both can be tested. First, an isolation count calibrated against held-out training hospitals (not training patients) gives a shift test whose false-positive rate stays at the nominal level as hospital size shrinks. Raw performance-drop rankings do not have this property. Second, the excess isolation mass predicts the replicable part of a hospital's AUROC drop, meaning the part that recurs on an independent half of that hospital's patients, better than kernel two-sample tests or distance-based OOD scores do.

Where the Two Directions Meet

The connectivity literature supplies the mechanism and the regime. Zero-one laws for random key graphs (Zero-One Laws for Connectivity in Random Key Graphs) and for key graphs intersected with unreliable channels (Performance of the Eschenauer-Gligor key distribution scheme under an ON/OFF channel; Modeling the Pairwise Key Predistribution Scheme in the Presence of Unreliable Links) all prove connectivity with first- and second-moment arguments on the number of isolated nodes. They show that the parameter that removes the last isolated node is the same parameter that connects the whole graph. We do not claim that clinical generalization obeys a zero-one law; nothing in the file supports that, and learning curves are typically smooth. We reuse two narrower things. One is the statistic itself: isolated-node counts are the quantity that carries the signal. The other is the observation that near the critical radius these counts are small and close to Poisson, which is where we expect a localized coverage test to be most sensitive.

The high-dimensional result of Sandwiching Random Geometric Graphs and Erdos-Renyi constrains the design rather than motivating it. It shows that when latent dimension $d$ greatly exceeds $np$ ($n$ points, edge density $p$), a proximity graph is nearly indistinguishable from a graph with independent random edges. Geometry stops carrying information. Their setting is uniform points on a sphere, which clinical data is not, but the warning applies in spirit. A neighborhood graph built on high-dimensional raw ICU features, for a hospital of a few dozen patients, may contain no usable geometry. We therefore build the graph in a low-dimensional learned representation and test that choice directly.

The clinical side supplies the problem and the data. Yet Another ICU Benchmark (YAIB) shows that single-center training (MIMIC) transfers poorly while multi-center training (eICU) transfers well. It also shows that data choices matter more than model choice. Spathis and Hyland show that pooled training beats local training for small hospitals, and that size confounds OOD labels. Federated Learning in Multi-Center Critical Care Research shows small hospitals destabilizing training. None of these works offers a size-aware criterion for when a hospital is genuinely uncovered. Patient-similarity work (SparGE; Hypergraph Convolutional Networks for ICU Patient Similarity) builds patient graphs for prediction but does not use them to test coverage across sites.

Research Program

The procedure works as follows. We train a mortality model on the source hospitals with the YAIB pipeline and take a low-dimensional representation from it. That representation is either the penultimate layer or a fixed projection, with dimension chosen to stay well below the $np$ scale for typical hospital sizes. For a target hospital with $n_t$ patients and a source pool $S$, call a target patient isolated if no source patient lies within radius $r$. Given $S$, the isolated count $I_t$ satisfies

$$I_t \mid S \sim \mathrm{Binomial}(n_t, q_t(r)),$$

where $q_t(r)$ is the probability that a patient drawn from the target hospital's population has no neighbor in $S$. The scientific null is not "$q_t$ equals the isolation rate of a random source patient". Hospitals differ even when nothing is wrong, so that null would flag everyone. Instead we estimate the distribution of $q$ across source hospitals by leave-one-source-hospital-out. We fit a beta distribution to those rates and test $I_t$ against the resulting beta-binomial. The beta-binomial captures normal between-hospital heterogeneity, and its binomial part captures size noise.

The radius is chosen by the connectivity heuristic. We set $r$ so that a typical held-out source hospital has an expected isolated count of order one, the analogue of the critical window. We then sweep $r$ to check that this choice is close to the most powerful one. The outputs are a per-hospital p-value, an excess isolation mass $\hat q_t - \bar q$, and the identities of the isolated patients. For interpretation we cross-tabulate the isolated patients by age, sex, admission type and diagnosis group.

The analysis has three parts. The first is calibration under pure size variation. The second is power under shifts we inject. The third is predictive validity on real hospitals: whether isolation predicts AUROC drop, and whether isolated patients carry a disproportionate share of the model's error and miscalibration.

Baselines

The naive reference point is the procedure Spathis and Hyland use: rank hospitals by the gap between in-domain and out-of-domain AUROC and flag the worst. It is the default practice the proposal aims to replace. It is run on the same model, same splits and same hospitals. We beat it if our flags keep a nominal false-positive rate on size-matched subsamples of in-distribution hospitals while the raw ranking's false positives rise as hospitals shrink.

The size-aware version of that baseline is a bootstrap confidence interval on each hospital's AUROC drop, flagging hospitals whose interval excludes zero. It accounts for sample size. It is the most direct competitor for the calibration question, so it gets the same hospitals and the same number of resamples.

The strongest general-purpose competitor is a two-sample test between target and source representations. We use two versions with permutation nulls: a kernel maximum mean discrepancy test and a domain-classifier test. These are also size-aware and have no graph machinery. We run them in the same learned representation, with bandwidth or classifier capacity tuned on source hospitals only. We give them the same leave-one-source-hospital-out reference distribution, so that the only difference from our method is the statistic.

Two ablations isolate the key ingredients. In the first, we score each target patient by mean distance to its $k$ nearest source neighbors, with no binomial or beta-binomial null. This tests whether the calibrated null, rather than nearest-neighbor geometry itself, carries the benefit. In the second, we run the full method on raw harmonized features instead of the learned low-dimensional representation. This tests the dimensionality constraint suggested by Bangachev and Bresler.

No reported result was found on Lacuna for any shift-detection method on eICU hospitals, so there is no published number to beat on the detection task. The only relevant reported figure is the mortality AUROC range of 0.84 to 0.87 across ICU datasets in Yet Another ICU Benchmark. We use it to check that our underlying predictor is competitive before any shift analysis.

Why not just…?

Why not just put bootstrap confidence intervals on each hospital's AUROC drop? This handles size noise. But for a hospital of a few dozen patients with roughly 10% mortality, the AUROC interval is so wide that almost nothing is flagged, and when something is flagged the result says nothing about which patients are at issue. Our test uses all patients, not only the few deaths, because coverage does not depend on labels. It can therefore detect uncovered subpopulations before the outcome counts become informative. The calibration-and-power experiment settles this directly. If bootstrap intervals match our power at small sizes, the main claim fails.

Why not just use a kernel two-sample test or a domain classifier? This is the real threat. These tests are size-calibrated and well understood. They answer "do the distributions differ?", while we ask "does the target place mass where the source has none?" A hospital can differ in mix, for example older patients drawn from a well-covered range, without being uncovered. We predict such mix shifts hurt AUROC little, given YAIB's finding that multi-center models transfer well. If the two-sample tests predict the replicable AUROC drop as well as isolation does, we will report isolation as an interpretability tool rather than a better detector.

Why not just fit a learning curve and declare small hospitals noisy below some size? A size cutoff discards exactly the small community hospitals where uncovered patients are most likely, and it cannot tell a small hospital that is covered from one that is not. Spathis and Hyland's resampling shows that performance falls with size at every hospital. That is evidence that size noise exists, not that size alone explains the flags. Our injected-shift experiments at fixed small size test whether a size rule misses real shift.

Proposed Experiments

All experiments use eICU through the YAIB and ricu harmonization, with 24-hour mortality from 48-hour windows. The setup follows Spathis and Hyland, with roughly 127 hospitals after cohort filtering. A logistic regression and a small GRU serve as predictors, consistent with their finding that smaller models transfer better.

The first decisive check is calibration. We take the largest hospitals, which are well covered by construction, and subsample them to sizes from 20 to 1000 patients, many times each. The false-flag rate of each method is plotted against size. We expect the raw AUROC-gap ranking to flag subsamples more often as they shrink, and our test to stay near the nominal level.

The second is power at matched size. Within held-out hospitals, we inject coverage shift by removing an entire subpopulation from all source hospitals, such as an admission diagnosis group or an age band. We inject mix shift by reweighting the target toward an existing but covered subgroup. Our test should detect coverage shift at sizes where the bootstrap AUROC interval cannot, and should respond less to mix shift than the two-sample tests.

The third is replication on real hospitals. We split each hospital's patients into two random halves. Flags and excess isolation are computed on half A, and AUROC drop is measured on half B. Noise-driven flags should not replicate. The method whose half-A score best predicts the half-B drop, measured by rank correlation across hospitals, wins. As a secondary analysis, we test whether isolated patients have higher Brier score and calibration error than covered patients at the same hospital.

The fourth is external transfer. We train on MIMIC-IV alone and on eICU, then test on HiRID and AUMCdb. This checks whether isolation explains YAIB's single-center transfer gap: MIMIC-trained models should leave far more external patients isolated than eICU-trained models, and the excess should track the AUROC gap.

The study fails cleanly if a permutation two-sample test matches isolation on all four checks. It succeeds if isolation alone combines nominal calibration at small sizes with replicable prediction of transfer loss.