Comparing Patients Only Within Their Own Cohort: Survival Models That Survive Platform Changes

When researchers pool gene-expression datasets from several hospitals to predict how long cancer patients will survive, the pooled model often learns which lab or platform produced a sample rather than how the patient's biology affects survival. The standard fixes either remove batch differences before modeling or train the model so its internal features cannot reveal the source cohort. Both have the same flaw. Cohorts differ in technology, and they also differ in their patients. A referral center sees more advanced disease. Erasing everything that distinguishes cohorts therefore erases real prognosis too.

This note proposes a different route that relies on the structure of the survival model rather than on preprocessing. A Cox model is the standard survival regression that ranks patients by relative risk. It can be fit so that each patient is compared only with other patients from the same cohort who were still at risk at the time of an event. Under that restriction, any offset shared by a whole cohort cancels out of the objective. It does not matter whether the offset comes from the platform or from the case mix. Two things stratification alone cannot remove are added on top. The first is platform-specific compression or stretching of expression values, which is corrected using genes that carry no prognostic signal. The second is cohort-specific baseline risk, which is re-estimated from a small number of events in each new cohort. The claim is that this combination generalizes to unseen platforms without the over-correction that adversarial or empirical-Bayes harmonization causes. A further claim is that the comparison can be settled cleanly by varying how unbalanced the case mix is across cohorts.

Core Claim

A semi-parametric Cox model separates risk into a time-varying baseline hazard and a patient-specific risk score. In the stratified version, each cohort $k$ gets its own baseline hazard, and the likelihood uses only within-cohort risk sets. We fit

$$\ell(\theta) = \sum_{k}\sum_{i \in k:\,\delta_i=1}\Big[f_\theta(g_k(x_i)) - \log \sum_{j \in R_k(t_i)} \exp f_\theta(g_k(x_j))\Big].$$

In this objective, $x_i$ is patient $i$'s expression profile, $\delta_i$ indicates an observed event at time $t_i$, and $R_k(t_i)$ is the set of patients in cohort $k$ still at risk at $t_i$. The function $f_\theta$ is the risk model, which can be linear or a small network. The map $g_k$ is a per-cohort monotone intensity transform. It is fit, without using outcomes, on a set of anchor genes chosen because they show no within-cohort survival association in the training cohorts.

The mechanism splits the problem into two parts. Additive per-gene shifts shared by a cohort cancel exactly when $f_\theta$ is linear, and largely so after within-cohort centering when $f_\theta$ is nonlinear. These shifts include both platform offsets and case-mix differences in means, and none of them is rewarded by the objective. Platform-dependent dynamic range is a separate problem. Microarrays compress the high end of expression, whereas RNA sequencing does not. That distortion is corrected by $g_k$.

The anchor genes matter for one specific reason. Rescaling each cohort by its own standard deviation (z-scoring) is confounded with case mix, because a cohort enriched for a high-risk subtype has wider variance in subtype genes. A transform fit on non-prognostic anchors is not confounded in that way.

Absolute survival probabilities are a separate step. The ranking model is frozen, and only the new cohort's baseline hazard is re-estimated by the Breslow estimator, using its first $m$ observed events. We report how calibration improves as $m$ grows. We do not claim calibration is possible with zero events.

Relation to Prior Work

Konstantinopoulos et al. ran ComBat across four ovarian microarray cohorts before Supervised PCA and a multivariable Cox model, in Integrated Analysis of Multiple Microarray Datasets Identifies a Reproducible Survival Predictor in Ovarian Cancer. ComBat adjusts each batch's per-gene mean and variance using an empirical Bayes model. This work motivates ours: the pipeline validated, but it never asked whether the harmonization removed prognostic case-mix signal. We drop the upstream harmonization and let stratification do that work.

Batch Effect Removal via Batch-Free Encoding learns batch-invariant codes with an adversarial Wasserstein penalty and batch-specific decoders. It supplies the obvious competitor, namely the same adversary attached to a Cox loss, which the research file flags as unbuilt. It also constrains our design. Full invariance to cohort identity is exactly the wrong target when cohort and prognosis are dependent.

CoxNMF joins matrix factorization with the Cox partial likelihood. It shows that unsupervised-then-supervised pipelines pick up variance unrelated to outcome, which supports coupling harmonization to the survival objective. CoxNMF was tested only within single TCGA cohorts. It has no batch mechanism, and it serves here as a baseline.

Deep Cox Mixtures gives latent patient groups their own baseline hazards. It shows that concordance can stay high while calibration collapses: the Expected Calibration Error (ECE) was 0.0992 for Cox versus 0.0200 for the mixture on FLCHAIN. That finding is why we evaluate calibration separately. Our strata are known cohorts rather than learned clinical phenotypes.

ATRCN pre-trains a deep Cox network on selected TCGA cancers and checks risk stratification on three GEO liver microarray cohorts. It does not harmonize features or baseline hazards. Addressing Data Heterogeneity in Federated Learning of Cox Proportional Hazards Models treats heterogeneity as differences in which features each site records, not as numeric platform shifts, so it addresses a different problem. DeepSurv supplies the nonlinear Cox network we use as $f_\theta$. Biased Data, Biased AI shows that deep features predict TCGA acquisition site with 70% accuracy even from ImageNet-only weights. It motivates our site-leakage diagnostic.

Research Program

We first build a semi-synthetic generator in the spirit of the CoxNMF simulations. Real expression from one platform is transformed into a second platform by an anchor-fitted monotone compression plus per-gene offsets. Survival is then planted through known prognostic genes. Two quantities are varied independently. One is the strength of the platform distortion. The other is case-mix imbalance, meaning how strongly a high-risk subtype is over-represented in particular cohorts. This lets us state when each method should fail. Adversarial invariance should degrade as imbalance grows. Per-cohort z-scoring should degrade when imbalance and dynamic-range distortion co-occur. Pooled unstratified models should degrade with distortion alone.

We then fit the stratified objective with both linear (elastic-net) and DeepSurv-style $f_\theta$ on real multi-platform data. All evaluation is leave-one-cohort-out. The held-out cohort's anchor transform is fit without labels. Its baseline hazard is refit from $m \in \{0, 5, 10, 20\}$ events, and $m=0$ falls back to the pooled baseline hazard. Finally, we check whether the risk score leaks site information by training a probe to predict cohort from the risk score after within-cohort centering. Leakage should be at chance level.

Baselines

The do-nothing reference is pooled elastic-net Cox on log-scale expression with no harmonization and a single baseline hazard. It shows how much platform shift actually costs on these data.

The established strongest pipeline is ComBat followed by regularized Cox, as in Konstantinopoulos et al. Their reported result is multivariable hazard ratios of 1.59–2.47 and log-rank p = 0.026 and p = 0.013 on the two validation cohorts. No reported result found on Lacuna for a leave-one-cohort-out C-index of this pipeline, so we rerun it.

The strongest deep competitor is a DeepSurv network with a cohort discriminator trained adversarially, following the Batch-Free Encoding loss. It is the direct realization of the file's "obvious" gap.

The most dangerous simple competitor is per-cohort z-scoring followed by stratified elastic-net Cox. It is classical, cheap, and differs from our method only in using anchor-based rather than variance-based scaling.

We also run CoxNMF, Deep Cox Mixtures, and an ATRCN-style pre-train-then-fine-tune deep Cox model. For the liver task, the reference figure is ATRCN's reported average C-index of 0.628 on HCC. Its per-GEO-cohort C-indices are not reported on Lacuna; only log-rank p < 0.05 is.

Every method gets the same cohorts, gene set, and folds. Every method also gets the same hyperparameter budget: 50 configurations, chosen by inner leave-one-cohort-out validation and never on the held-out cohort.

Two ablations isolate the key ingredients. The first removes stratification while keeping anchor alignment. The second replaces anchor alignment with whole-transcriptome z-scoring while keeping stratification.

Beating the field means a higher held-out-cohort Harrell's C-index than ComBat-Cox and the adversarial model, with confidence intervals bootstrapped over patients, on a majority of held-out cohorts. It also means equal or lower integrated Brier score and ECE at 3 and 5 years for $m \ge 10$. Against z-score-stratified Cox, success is defined more narrowly as a gain that grows with case-mix imbalance in the semi-synthetic sweep and appears on the real cohorts with the most uneven stage distributions.

Why not just…?

Why not just run ComBat and then a penalized Cox model? That pipeline worked in the ovarian study, and it is a serious baseline. ComBat, however, fits per-batch means and variances that absorb case-mix differences unless covariates are supplied. Covariates such as stage are often missing or coded inconsistently across GEO series. The CoxNMF synthetic results also show two-step pipelines locking onto variance unrelated to outcome. The semi-synthetic imbalance sweep tests directly whether ComBat removes planted prognostic genes. If ComBat-Cox matches us on the real cohorts, we will report that.

Why not just z-score each cohort and fit a stratified Cox model? This is the real threat, and it may well suffice whenever cohorts have similar case mix. Our method should beat it only when a cohort's expression variance reflects both its platform and its patients. The anchor-versus-z-score ablation is designed to answer exactly this. If no gap appears even at high imbalance, the honest conclusion is that the classical method is enough, and we would publish the stress test as the contribution.

Why not just train a deep Cox model to be invariant to cohort, adversarially? Full invariance requires the representation's distribution to match across cohorts. When one cohort really has sicker patients, matching distributions means discarding the features that show they are sicker. Stratification removes the incentive to use cohort-level offsets without forcing the model to forget them. The adversarial baseline and the imbalance sweep measure this cost directly.

Why not just use rank or pathway scores, as in EPSA? Within-sample ranks remove scale differences. They are, however, still distorted by microarray compression at the high end, and pathway scores are limited to curated gene sets. We include a rank-transformed stratified Cox model as an additional arm, so this alternative is tested rather than dismissed.

Proposed Experiments and Decisive Checks

The cross-platform test bed is liver cancer. Training uses TCGA LIHC RNA sequencing. Evaluation holds out each of GSE10143, GSE14520 and GSE54236, which are microarray series, so every test is a real change of platform. The second test bed is the four ovarian microarray training cohorts with GSE9899 held out, evaluated both leave-one-cohort-out and on GSE9899 alone. METABRIC serves only as a single-cohort sanity check. There, stratification should neither help nor hurt relative to DeepSurv's reported C-index of 0.867.

The decisive check is the semi-synthetic two-way sweep over platform distortion and case-mix imbalance. The proposal stands if three patterns all appear. The adversarial model must lose recovery of the planted prognostic genes as imbalance rises. Z-score-stratified Cox must lose accuracy only in the cells where imbalance and distortion co-occur. Our model must stay flat across the grid.

Two secondary checks complete the picture. On real data, the site probe on centered risk scores should sit at chance for stratified models and above chance for pooled ones. Calibration in held-out cohorts should approach that of within-cohort fits once roughly ten events are available. If the anchor-scaling advantage fails to appear on real cohorts even though it appears in simulation, we will conclude that real platform distortions are mostly additive, and that stratification alone is the practical recommendation.