Shift-Screened Sources: Identifiable Latents Make Linear Clinical Models Auditable Under Site Shift

In small clinical datasets, simple linear models often transfer to new hospitals better than deep networks. A linear Cox score built on six lab values held up on an external Canadian cohort where a deep survival network collapsed (Predicting Long-Term Allograft Survival in Liver Transplant Recipients). Linear discriminants on handcrafted spectral features beat EEG foundation models on small diagnostic cohorts (EEG-Bench). The price is that the linear model only works when someone has already hand-built good features. Nonlinear independent component analysis (nonlinear ICA) is the one family of representation learners with a guarantee about what its features mean. It learns a network that undoes an unknown nonlinear mixing of independent hidden "sources," and it recovers each true source up to a harmless per-coordinate distortion.

This note proposes to use that guarantee for a specific robustness operation that entangled features cannot support. When a new hospital differs from the training hospitals, the difference usually lives in a few underlying factors, such as electrode impedance, amplifier filtering, or line noise. In an identified coordinate system those factors occupy a few coordinates, so we can find them with per-coordinate two-sample tests across training sites and remove them before fitting a linear classifier. In an entangled representation, such as an autoencoder, masked-reconstruction foundation model, or PCA, the same few factors spread across every coordinate. Per-coordinate screening then either removes everything or removes nothing. The claim is that identifiability is what turns "detect and drop the shifted factors" into a well-posed step. The pipeline is: learn sources from within-recording temporal variation, screen them for cross-site instability, and fit a linear model on the stable ones.

Core Claim

Suppose observations are $x = f(s)$ with independent sources $s = (s_1,\dots,s_d)$, and a new site changes the distribution of only a subset $S$ of sources. An identified encoder returns $\hat s_i = h_i(s_{\pi(i)})$, where $h_i$ is an invertible per-coordinate function and $\pi$ a permutation. Then exactly $|S|$ coordinates of $\hat s$ change their marginal distribution across sites, and the rest are unchanged. An encoder that is identified only up to an invertible mixing $M$, with $z = M \hat s$, has no such sparsity, because every coordinate of $z$ with a nonzero loading on $S$ shifts.

Screening coordinates for cross-site stability is therefore a meaningful operation only on identified representations. A linear classifier restricted to the stable coordinates inherits the transfer behaviour that makes parsimonious linear models attractive, without handcrafted features. We do not claim the stable sources carry all the diagnostic signal. We claim that the accuracy lost by dropping them is measurable, and it is the honest price of transfer.

The design choice that separates this from the obvious combination is where the auxiliary variable comes from. The obvious move is to condition an identifiable variational autoencoder (iVAE) on site ID. The iVAE of Variational Autoencoders and Nonlinear ICA gets identifiability from a prior that varies with an observed auxiliary variable. With site as that variable, the model is pushed to organize its latent space around exactly the factors that differ between hospitals, and sources that do not vary across sites fall outside the guarantee. This is the tension raised in the file's Gap 4, and it matches the "ruler trap" of models learning site workflow artifacts (COVID-19 Prognostic Models: A Pro-con Debate). We instead obtain identifiability from temporal non-stationarity inside each recording, using Time-Contrastive Learning (TCL). TCL trains a network to predict which time segment a sample came from, and its hidden layer provably recovers sources up to a linear mixing that ordinary linear ICA then resolves (Unsupervised Feature Extraction by Time-Contrastive Learning and Nonlinear ICA). Site labels are then used only for diagnosis, never for learning.

Research Program

The first component is a small theory result, modest by design. For the idealized model above, we show three things. First, the set of coordinates flagged by per-coordinate two-sample tests converges to $S$ as the number of training sites and samples grows. Second, a linear model on the complement has zero covariate shift in its inputs. Third, for any rotation-mixed representation the screening step's expected false-keep rate is bounded away from zero.

We then add finite-sample error. On Finite-Sample Identifiability of Contrastive Learning-Based Nonlinear ICA bounds TCL-style source recovery error as a function of sample size and network capacity, and finds an inverted U in recovery against network width. We propagate that bound into leakage: an imperfectly identified coordinate carries a small admixture of shifted sources, so screening is only approximately clean. This predicts that the width which best recovers sources is also the width at which screening transfers best. That prediction is testable, and it gives a site-free criterion for choosing width. Robustness of Nonlinear Representation Learning shows that recovery degrades only as $O(\eta^2)$ when the mixing is close to linear, $x = As + \eta h(s)$. That result motivates a second variant, a shallow near-isometric unmixer. It trades expressiveness for graceful degradation and is plausibly the better choice at clinical sample sizes.

The second component is the pipeline itself. It has four stages. A TCL encoder is trained, without labels, on unlabelled EEG pooled from all training sites, with segments defined by fixed time windows. Linear ICA is applied to the hidden layer. Each resulting coordinate gets a cross-site stability score, computed as the maximum over training-site pairs of a kernel two-sample statistic, with a threshold set by permutation. Finally, an L2-regularized logistic regression is fit on the retained coordinates. We run the same pipeline with Permutation-Contrastive Learning (Nonlinear ICA of Temporally Dependent Stationary Sources), which suits recordings without clear non-stationarity.

Baselines

The naive reference point is a linear model on raw band-power features with no representation learning and no screening. It shows whether anything learned adds value.

The strongest classical competitor is the EEG-Bench handcrafted pipeline: spectral features with LDA or a linear SVM. The file reports LDA at 0.813 accuracy on mTBI detection and a linear SVM at 0.722 balanced accuracy on TUAB (EEG-Bench). It is the strongest competitor because it already has the linear-transfer property we want. We rerun it ourselves under our shift splits, using the same training subjects and the same classifier tuning grid, so that the comparison is not against numbers from a different protocol.

The strongest learned competitor is LaBraM, which EEG-Bench reports at 0.838 balanced accuracy on TUAB. We evaluate it both with a frozen linear probe and with full fine-tuning. A frozen linear probe is the fair counterpart to our linear head. EEG-FM-Bench documents that frozen probes of masked-reconstruction models lose substantial accuracy, so we also include fine-tuning to avoid comparing against a straw man.

The key ablations isolate identifiability. We apply the identical screening-plus-logistic-regression head to latents of equal dimension from three sources: a standard autoencoder trained on the same data with matched parameter count and epochs, PCA on band power, and linear ICA on band power. We also run an iVAE conditioned on site ID, which tests the anchoring hypothesis directly. Finally, we run our pipeline with screening switched off, which separates the value of identified features from the value of dropping coordinates.

Beating the strongest baseline means two things. On held-out-cohort evaluation, the pipeline's balanced accuracy must exceed both the rerun handcrafted LDA/SVM and the LaBraM probe. The autoencoder-plus-screening ablation must not match it. All hyperparameters are tuned only on training sites. Every method gets the same budget of tuning configurations and the same compute cap for representation learning, apart from the foundation models' own pretraining.

Why not just…?

Why not just use handcrafted spectral features with Lasso or LDA? This is the real threat. On small cohorts such pipelines beat foundation models (EEG-Bench), and in radiomics a LASSO-plus-logistic model reached 0.957 validation AUC while outperforming XGBoost (Xie et al.). Band powers are fixed linear-quadratic summaries, however, and a single band mixes biological rhythm with site artifacts such as line noise and filter roll-off. Screening those features would discard the whole band. The file also shows handcrafted features falling well short on TUAB (0.722 versus 0.838). If our pipeline fails to beat rerun handcrafted LDA under cohort shift, we will report that identifiability adds nothing beyond expert features in this regime.

Why not just screen PCA or autoencoder features for stability? This is exactly the ablation the claim rests on. The theory predicts that shift spreads across all coordinates of a mixed representation. The synthetic experiment measures this directly as recovery of the true shifted set $S$. If screened autoencoder features transfer as well as screened TCL features, the core claim is false.

Why not just fine-tune a large EEG foundation model? The file reports BENDR and Neuro-GPT collapsing near chance on unseen channel configurations (EEG-Bench). It also reports compact models with domain-informed design matching far larger ones (EEG-FM-Bench). Fine-tuning is nonetheless strong in distribution, so we include it. We expect it to win on in-distribution TUAB and to lose its margin under held-out-cohort shift. That pattern mirrors DeepHit's drop from 0.828 in distribution to 0.749 on the external cohort, against 0.847 for the linear MAS score (Gao et al.).

Why not just standardize features per site? Per-site normalization removes shifts in mean and scale but not shifts in distribution shape. It also requires unlabelled target-site data. We include it as a baseline applied to every representation, and as an optional preprocessing step for ours, so that any gain we report is beyond what it provides.

Proposed Experiments

The decisive synthetic check comes first. We generate sources with segment-wise non-stationary variances and mix them through random invertible multilayer networks, following the TCL and iVAE simulations. We then create "sites" by changing the distributions of a chosen subset $S$ of sources, and set the label to depend on sources both inside and outside $S$. We sweep the degree of nonlinearity, the sample size, and encoder width.

We measure mean correlation coefficient to the true sources, precision and recall of the screened set against $S$, and target-site accuracy relative to an oracle linear model on the true stable sources. The core prediction is that screening recall on TCL latents is high wherever the mean correlation coefficient is high, and near zero for autoencoder and PCA latents. A second prediction is that target accuracy peaks at the same width where recovery peaks, which would extend the Lyu–Fu inverted U to transfer.

On real data, we reproduce the capacity sweep on EEG Eye State, the dataset used by Lyu and Fu, with segment or session as the site. We then move to the EEG-Bench clinical suite. Where multiple cohorts share a diagnostic label, we use leave-one-cohort-out splits. Where they do not, we use cross-subject splits that group recordings by session or montage. TUAB serves as the in-distribution anchor, and mTBI and schizophrenia serve as low-data cases. We report balanced accuracy, calibration error, and the in-distribution-to-shifted drop for every method. We also report how many sources were screened out and how much accuracy that cost.

The idea fails if any of three things happens: screened TCL latents do not beat screened autoencoder latents under shift, the synthetic screening recall is no better than for mixed representations, or rerun handcrafted LDA dominates across held-out cohorts. The idea holds if the gap between identified and entangled representations appears specifically under shift and grows with the strength of site effects.