Program-Structured Survival Models for Flow Cytometry

Flow cytometry measures 10 to 40 proteins on each of hundreds of thousands of cells from one blood or tumor sample. Yet when clinicians use it to predict how long a patient will survive, they usually reduce all of that to one number, such as the ratio of CD4 to CD8 T cells, and put that number into a standard survival regression. We propose a survival model that reads the whole cloud of cells directly. Its predicted risk is built as a sum of contributions from a small number of named functional programs. Each program is a curated group of panel markers, for example an exhaustion program (PD-1, CD39, TIM-3), a regulatory program (CD25, Foxp3, low CD127), or a metabolic program (Glut1). Each program has its own scoring module that sees only lineage markers plus that program's markers. Every term in the risk score is therefore interpretable by construction. We then test each program's contribution statistically, in the way enrichment analysis tests gene sets, instead of reading attention maps after the fact.

The two-sentence version is this. Current deep models for flow cytometry predict labels from unconstrained cell weights, while current prognostic markers collapse cells into crude ratios. We train directly on censored survival times, meaning outcomes where some patients have not yet had the event when follow-up ends, and we force the risk score to decompose over named marker programs that can each be tested. The bet is that this structure costs little or no accuracy on small clinical cohorts. We also bet it fixes a documented failure of attention models: they latch onto one sufficient cell subset and ignore the others.

What exists and what is missing

The closest work is Application and characterization of the multiple instance learning framework in flow cytometry. It treats each sample as a "bag" of cells and learns attention weights over cells, an approach called multiple instance learning (MIL). It reaches AUC 0.9454 on a 22-marker tumor-infiltrating lymphocyte panel and separates high- and low-risk HIV patients on the HIVNH panel (log-rank $p = 0.0009$). That paper motivates our proposal in three ways:

  • It turns survival into a binary risk label instead of modeling censored time.
  • It requires identical panels for every sample.
  • It reports the "incomplete discovery" problem: once the classification loss is satisfied, attention ignores other relevant cell subsets.

Explainable Techniques for Analyzing Flow Cytometry Cell Transformers supplies a usable method. It scales linear attention to 500,000 cells and shows that attention heads specialize on their own into blasts, B cells and erythroblasts. However, it only does diagnosis, and its explanations are gradient directions, not tested functional claims.

On the enrichment side, DeepGSEA supplies the architectural idea we borrow. It uses a shared encoder with one head per gene set, learns prototype cells per set, and runs significance tests on per-set similarity. It works only on single-cell RNA and has no survival objective. GSPA expands gene sets using protein-network embeddings. We considered this route but set it aside. With 10 to 30 measured proteins, network-based expansion has almost nothing to expand into, and GSPA itself degrades where network curation is thin.

On the prognostic side, the CD4/CD8 study in ANRS CO8 shows a ratio below 0.5 confers HR 2.13 for non-AIDS cancers. But about 70% of patients never normalize their ratio, so the ratio cannot say which of them is at risk. The HCC study in Selective Recruitment of Regulatory T Cell through CCR6-CCL20 found HR 2.408 from manually gated Treg frequency. PD-1 Involvement in Peripheral Blood CD8+ T Lymphocyte Dysfunction showed that cells inside the same CD8 gate differ sharply in Glut1 and glycolytic capacity. These three motivate per-program scoring inside gates.

The nearest single-cell survival model, Cox-nnet in Deep-learning and transfer learning identify new breast cancer survival subtypes, reaches test C-index 0.80 versus 0.63 for molecular subtyping. It works on hand-engineered spatial interaction scores from imaging mass cytometry, not on suspension cytometry point clouds.

Core Claim

A Cox-trained MIL model whose risk score is forced to be a sum of program-restricted terms has three expected properties, each of which we will test. First, it should match an unconstrained Cox-trained MIL model in concordance on small flow cytometry survival cohorts. Second, it should recover more of the true risk-driving subpopulations in controlled simulations. Third, it should yield program-level significance statements that hold up under permutation. The new element is not the survival loss alone, which is an easy extension. It is the program decomposition together with the testing procedure attached to it.

For a patient $i$ with cell set $X_i$, let $M_k$ be the marker indices of program $k$ plus shared lineage markers. Let $g_k$ be an attention-pooling module that sees only those columns. The risk is

$$r_i = \sum_{k=1}^{K} w_k \, g_k\big(X_i[:, M_k]\big),$$

and training minimizes the negative Cox partial log-likelihood

$$\mathcal{L} = -\sum_{i:\,\delta_i=1}\Big(r_i - \log \sum_{j:\,t_j \ge t_i} e^{r_j}\Big),$$

where $t_i$ is follow-up time, $\delta_i$ is 1 if the event was observed, and the inner sum runs over patients still at risk at $t_i$. A head whose markers are absent from a sample is set to zero and the remaining heads are renormalized. This partially relaxes the panel-rigidity limitation without imputing anything.

Research Program

We will build the model with linear attention inside each head, following ReluFormer, so that whole samples fit without subsampling. We will define programs a priori from the marker panel and literature, and freeze them before any outcome data are seen.

Enrichment enters at two levels:

  • Patient level. Each program's importance is the drop in held-out C-index when its head is removed. Its significance is assessed against a null built by retraining on permuted survival times.
  • Cell level. We take the top 5% of cells by a head's attention in high-risk patients. We then run a hypergeometric overrepresentation test, the same statistic as ORA, asking whether those cells fall in the canonical gate for that program more often than background cells do. This checks whether the head found the biology it was named for, or something else.

To address incomplete discovery, heads are trained jointly but with a dropout over whole heads. This forces each program to carry predictive signal on its own when it has any.

Baselines

The naive reference point is a Cox model on a single gated scalar: CD4/CD8 ratio on HIVNH, as in ANRS CO8, and Treg frequency where a Treg panel exists, as in the HCC study. A stronger classical baseline is an elastic-net Cox model on all manually or automatically gated subset frequencies plus median marker intensities. This is a reviewer's best non-deep answer, and it gets the same programs' markers.

The strongest existing method is the attention MIL of Application and characterization of the multiple instance learning framework in flow cytometry, run two ways. One version uses the paper's binarized risk label. The other uses our Cox loss, so the comparison isolates structure rather than the loss. The only number reported for it on our primary cohort is log-rank $p = 0.0009$ for HIVNH risk stratification. We found no reported C-index on Lacuna for HIVNH. We will therefore reproduce it and report both log-rank separation and C-index.

The decisive ablations are two. The first is our model with a single head over all markers, which is the unconstrained version. The second is our model with randomly drawn marker programs of matched sizes, which tests whether curated programs matter or any partition does.

All methods share nested cross-validation splits, the same preprocessing with flowVS variance stabilization, and equal hyperparameter search budgets. We report bootstrap confidence intervals. "Beating" means the following. On concordance, the program model must be non-inferior to Cox-MIL, with the lower bootstrap bound of the difference above −0.02. On simulated discovery recall, it must be strictly better. On permutation-calibrated program tests, curated programs must clear the null at rates random programs do not.

Why not just…?

Why not just add a Cox loss to existing attention MIL? This is the real threat. On a small cohort, an unconstrained Cox-MIL may predict just as well. If it also recovers multiple risk subpopulations in simulation, our structure buys only labeling. The single-head ablation settles this directly. If the single-head model matches on both concordance and discovery recall, we would reframe the contribution as a testing procedure applied after the fact to Cox-MIL, and drop the architectural claim.

Why not just gate the cells and fit a penalized Cox model on frequencies? For a 10-marker T-cell panel this may come close. Gating sees only the subsets someone thought to draw. The ACLF study shows that metabolic and exhaustion differences live inside standard gates (PD-1 Involvement), and MIL already beat manual analysis on discovery in the TIL cohort. The elastic-net baseline is included precisely so a narrow win can be reported as narrow.

Why not explain an unconstrained model afterward with attention maps or gradients? ReluFormer's gradients show marker directions but give no significance, and attention concentrates on one sufficient subset. That means post-hoc maps under-report secondary programs by design. The spiked-in simulation measures whether post-hoc attribution on the single-head model recovers secondary subsets as often as our dedicated heads do.

Why not run standard GSEA on marker loadings? With tens of proteins, gene sets from GO or KEGG overlap the panel in only a handful of markers. The enrichment statistics become degenerate, and GSPA-style expansion has no measured neighbors to draw on. Panel-defined programs with outcome-permutation tests are the honest version of enrichment at this scale.

Proposed Experiments

The first experiment is a controlled simulation. We spike two or three synthetic risk-carrying subpopulations, defined in different programs' marker subspaces at frequencies down to the 0.06% regime the MIL paper showed is detectable, into real healthy-like HIVNH or TIL backgrounds. We generate survival times from a known hazard. We measure C-index and the fraction of planted subpopulations recovered by the top-5% attended cells, sweeping frequency, effect size and number of planted programs.

The second experiment is real survival on HIVNH, the only raw flow-cytometry survival cohort in the file. We compare all baselines by C-index and log-rank stratification. We report which programs pass the permutation test and whether their cell-level overrepresentation matches their names.

The third experiment is a panel-robustness check. We mask one program's channels in a random fraction of HIVNH samples and compare how our model degrades against the alternative of excluding those samples.

The fourth experiment is a transfer check. We apply the same program heads with a classification loss to the TIL cohort and check whether the exhaustion program recovers the CD39⁺CD127⁻ phenotype that the original MIL paper reported.

We will treat two outcomes as decisive. The proposal succeeds if, in simulation, discovery recall is higher than the single-head and post-hoc models, and on HIVNH, concordance is non-inferior. It fails if random programs perform as well as curated ones. If that happens, we will report it as a negative result about functional grounding in protein panels.