Ranking Through the Serological Window

When a machine learning model is trained to answer "is this single measurement positive or negative?", it optimizes something different from what the person using the model actually needs. In hardware security, this gap is well documented: a neural network trained on side-channel traces — physical leakage, such as power consumption, emitted by a cryptographic chip — with categorical cross-entropy can score well on per-trace classification yet fail completely as an attack tool, because an attacker only needs the true key to rank first after scores from many traces are summed. The fix, developed over several years, was to change both the loss (differentiable ranking losses) and the evaluation metric (Guessing Entropy, the average rank of the true key). Clinical serology has the same disease and no such cure. During the window period — the days after infection when antibodies are still rising and standard serology returns false negatives — a triage system does not need a calibrated probability for each patient; it needs the genuinely infected patients to rank above the uninfected so that scarce confirmatory nucleic-acid tests are spent on the right people. Today's serological machine learning models are trained and validated with exactly the pointwise objectives that the side-channel literature has already proven misaligned.

This proposal imports the metric-alignment machinery from deep-learning side-channel analysis into window-period serology. Concretely: we define triage-ranking evaluation metrics for serology (the analog of Guessing Entropy and Success Rate), train a multi-assay fusion model with a differentiable pairwise ranking loss adapted from Ranking Loss, and test the specific hypothesis that the notorious weakness of IgM-based early-window detection is partly a training-objective artifact rather than a purely biological limit. No published work combines these frameworks — the closest study, a Bayesian mixture model of continuous serology readouts, is static, parametric, and never optimizes a ranking objective — so the transfer is untested and the payoff is measurable: fewer confirmatory tests burned per true case found during the most diagnostically dangerous phase of infection.

Core Claim

The claim has three parts. First, evaluation: window-period serology should be scored by how many confirmatory tests are needed to surface the infected individuals in a population, not by per-sample sensitivity at a fixed cutoff. Second, optimization: a model trained with a pairwise ranking loss over patients — "should this patient rank above that one?" — using serial IgM/IgG readings, time since symptom onset, and cheap biomarkers, will surface infected patients with fewer confirmatory tests than the same architecture trained with cross-entropy, the same architecture with a tuned threshold, and a recalibrated Bayesian posterior score. Third, diagnosis: the poor early-window performance of IgM channels in image-based multiplexed serology is partly a metric misalignment problem, and retraining with a patient-level ranking objective should improve it without changing the assay itself.

The structural mapping is worth stating plainly, because it is the reason the transfer should work. In a side-channel attack, a model $f_\theta$ assigns a score to each of 256 key candidates for each trace; scores are summed across traces, and the attack succeeds if the true candidate's cumulative sum ranks first. During the window period, a patient presents a small set of weak, temporally decoupled readings — IgM rising to a peak around day 10 post-symptom-onset, IgG around day 20, with viral load and C-reactive protein moving on their own schedules. A triage model should assign each patient a cumulative score aggregated over their readings and time index, and the operational goal is that infected patients' scores rank above uninfected patients' scores. Formally, with patient score $S_i = \sum_{j} f_\theta(t_{ij}, m_{ij})$ summing the model output over that patient's readings $m$ at times $t$, the training loss pairs each infected patient $i^+$ against an uninfected patient $i^-$ in the batch:

$$\mathcal{L}(\theta) = -\log \sigma\!\left(\alpha\,(S_{i^+} - S_{i^-})\right),$$

where $\sigma$ is the sigmoid function and $\alpha$ controls its steepness — the same smooth-rank trick used in Ranking Loss, but with pairs drawn across patients in a mini-batch rather than across key hypotheses. This immediately removes the main scalability complaint about pairwise ranking in side channels (comparing all 256 candidates per trace quadratically inflated per-epoch runtime by roughly 4x, per Ranking Loss: Maximizing the Success Rate in Deep Learning Side-Channel Analysis): patient-batch pairing is cheap.

One biological constraint must be built in from the start, not discovered later. Between 5% and 24% of infected individuals never mount detectable antibody titers — estimated at 14.5% of infected adults in Estimating SARS-CoV-2 infection probabilities with serological data and a Bayesian mixture model. These non-responders are unrankable by serology alone, which sets a hard ceiling on any triage Success Rate; our evaluation therefore reports the ceiling explicitly and treats non-responders as an irreducible residual rather than a model failure.

Research Program

The program has four components. First, we formalize two triage metrics in direct analogy to side-channel evaluation, following the systematic definitions in SoK: Deep Learning-based Physical Side-channel Analysis: Triage Entropy, the mean rank of true infected individuals in the score-sorted population, and Triage Success Rate at budget b (SR@b), the fraction of infected individuals found within the top b ranked when only b confirmatory tests are available. We also define confirmatory-tests-to-detection — the budget needed to reach 90% of serologically detectable cases — the exact analog of traces-to-key-recovery that side-channel papers report. Second, we build the ranking-trained fusion model: a small network over (IgM titer, IgG titer, days since onset, biomarkers such as C-reactive protein), with per-patient score aggregation across serial readings as above, trained with the pairwise loss. Third, we build a fast surrogate for model selection, adapting the idea of Fast Guessing Entropy from The Need for Speed: A Fast Guessing Entropy Calculation for Deep Learning-based SCA: a subsampled Triage Entropy over a restricted validation pool that can be computed every epoch, replacing cell-level or sample-level accuracy as the early-stopping signal for serological pipelines. Fourth, we run the misalignment diagnosis on the image-based assay: retraining its cell classifier with a patient-level ranking objective to test whether IgM's weak early-window performance is an objective artifact.

The prior work plays three distinct roles here. Motivating evidence comes from The Curse of Class Imbalance and Conflicting Metrics with Machine Learning for Side-channel Evaluations, which proved that ranking-based success and classification accuracy can move in opposite directions — deep networks trained pointwise collapse onto majority classes and lose the discriminative signal in rare, informative classes, which is precisely the early-seroconverter situation — and from Perceived Information Revisited New Metrics to Evaluate Success Rate of Side-Channel Attacks, which showed cross-entropy is only a loose lower bound on the information that actually determines attack success in low signal-to-noise regimes, exactly the regime of a day-6 antibody reading. Method supply comes from Ranking Loss (the differentiable pairwise formulation) and The Need for Speed (the fast surrogate for model selection). Constraints come from Bias-variance Decomposition in Machine Learning-based Side-channel Analysis: even ranking-aligned objectives like mean squared error do not protect against the complexity trap, where added model capacity inflates variance on noisy sub-signals — a direct warning for the noisy IgM channel, and the reason we keep the fusion model deliberately small and report its variance behavior. What none of these papers do is touch clinical data; the boundary work in section 2 of our review — the Bayesian mixture model, the GPRt outbreak tracker, the optimal multi-test allocation theory — never optimizes a ranking objective at the individual level.

Proposed Experiments

Four experiments, each anchored to a cohort in the file. E1 (SAPRIS-SERO, 81,797 continuous anti-spike IgG optical density ratios with 319 PCR-confirmed positives). We first reproduce the cutoff-misalignment finding as a ranking failure: at the manufacturer's 1.1 positive cutoff, empirical sensitivity was 75.9% despite claimed >90%, and an optical density ratio of 0.8 — labeled "negative" — carried a 61.8% infection probability for a 40–49-year-old in the Paris region (Estimating SARS-CoV-2 infection probabilities with serological data and a Bayesian mixture model). We then evaluate all models by Triage Entropy and SR@b on held-out participants. This cohort is mostly convalescent rather than acute, so E1 validates the machinery, not the window-period claim itself. E2 (the 571-patient Chinese cohort with 30-patient longitudinal arm). Using the mapped kinetics — IgM peaking at day 10, IgG at day 20, IgM dominant through day 15, over 70% seropositive within 7 days of onset (The seroprevalence and kinetics of IgM and IgG in the progression of COVID-19) — we simulate acute triage: rank patients using day-indexed early readings and measure SR@b and confirmatory-tests-to-detection. This is the primary window-period test. E3 (the Shenzhen 57-patient suspected cohort, 33 of them PCR-negative). This is the diagnostic-rescue setting: combined IgM/IgG testing with 95th-percentile cutoffs (0.88 IgM, 1.02 IgG) found 72.73% of the PCR-negative suspected infections, and PCR-negative patients carried distinctly higher C-reactive protein (1.10 vs 0.51 mg/L) (Clinical Significance of an IgM and IgG Test for Diagnosis of Highly Suspected COVID-19). We test whether the ranking model, given the same titers plus the biomarker panel, surfaces these infections at a smaller confirmatory budget than the fixed-cutoff rule and than a CCE-trained model of identical architecture. E4 (the mini-IFA imaging dataset, 948 specimens, 55,496 expert-labeled cells). The published pipeline trains a cell classifier with standard classification loss and reports sensitivity 0.79–0.89 with specificity 0.95–0.97, and the authors note IgM suffers elevated non-specific background (Image-based & machine learning-guided multiplexed serology test for SARS-CoV-2). We retrain with a specimen-level ranking loss and measure patient-level IgM ranking quality (Spearman correlation against ELISA, reported at 0.81–0.82 for IgG in the original) plus SR@b for early-window specimens. A positive result here — ranking loss closes part of the IgM sensitivity gap at unchanged specificity — is the most striking single finding the proposal could produce, because it would attribute part of a widely observed biological limitation to a fixable training choice.

As an evaluation-methods check, we mirror the FGE result: on the ASCADf side-channel benchmark, models selected by the fast rank-based surrogate recovered the key in 101 traces versus 266 for models selected by the standard metric (The Need for Speed). The serological analog is to select mini-IFA and fusion checkpoints by the fast Triage Entropy surrogate versus by cell-level AUC, and measure the resulting confirmatory-tests-to-detection gap. No reported result found on Lacuna for any ranking-loss-trained model on a serological cohort, so there is no incumbent number to beat on the triage metrics themselves; the comparison is entirely against the baselines below.

Baselines

The naive reference point is the manufacturer cutoff as used in practice: the fixed optical density thresholds (negative below 0.8, indeterminate 0.8–1.1, positive above 1.1) evaluated on the SAPRIS-SERO data, where the 1.1 cutoff yields 75.9% sensitivity, and the 95th-percentile combined IgM/IgG rule on the Shenzhen cohort, which caught 72.73% of PCR-negative suspected infections. This baseline matters because it is what laboratories actually do, and any ranking model must beat it at equal confirmatory budget — that is, we compare SR@b at the budget the cutoff rule would consume to reach its detection rate. The strongest existing competitor is the Bayesian mixture model of Estimating SARS-CoV-2 infection probabilities with serological data and a Bayesian mixture model: it preserves the continuous optical density signal, models non-responders explicitly, and outputs a posterior infection probability that can be used directly as a ranking score, which makes it the most natural strong baseline and the one a skeptical reviewer would name first. We will re-fit it on each cohort's training split with the same covariates given to our model, and beat it only if our ranking-trained model achieves strictly lower Triage Entropy and higher SR@b with non-overlapping bootstrap intervals, at the same data access, the same tuning budget (a matched random-search allocation over hyperparameters, including the mixture model's component structure), and comparable compute. Between these sit two model-level baselines run on our exact architecture and splits: the same network trained with categorical cross-entropy and used with a threshold swept over the full ROC range, and the same network trained with mean squared error on the infection label, which Bias-variance Decomposition in Machine Learning-based Side-channel Analysis showed is already ranking-aligned in the side-channel setting. The key ablation isolates the loss: identical architecture, identical features, identical aggregation, only the training objective varied (cross-entropy, mean squared error, pairwise ranking). Any claimed advantage of the proposal lives or dies in that ablation; if the mean-squared-error variant matches the ranking loss, the honest conclusion is that the win came from score aggregation and continuous readouts, not from pairwise ranking, and we would report it that way.

Why not just…?

Why not just lower the classification threshold? Because a threshold moves the operating point on a fixed score, and the problem is the score itself. The Bayesian mixture study gives the cleanest evidence: in the indeterminate optical density band, true infection probability ranges from 10.8% to 96.6%, so a single threshold applied across demographics produces either massive false positives or missed infections depending on local prevalence, and 14.5% non-responders sit below every threshold. The side-channel literature shows the deeper issue: models trained with pointwise cross-entropy converge to representations that prioritize spurious correlations rather than the true signal (Ranking Loss), and under severe class imbalance — exactly the early-seroconverter situation — they collapse onto the majority class in a way post-hoc threshold adjustment cannot recover (The Curse of Class Imbalance and Conflicting Metrics with Machine Learning for Side-channel Evaluations). Our ROC-swept cross-entropy baseline makes this comparison empirical rather than rhetorical: if threshold tuning matches the ranking loss at equal budget, the proposal is wrong about the mechanism.

Why not just rebalance the training data with SMOTE or class weights? Rebalancing changes the class distribution but not the objective. In the side-channel experiments, SMOTE gave a Random Forest an 8.4x efficiency gain (13,500 traces down to 1,600 on the AES_RD benchmark), yet the same authors showed deep networks remained vulnerable to majority-class collapse unless the loss itself was changed; synthetic interpolation in continuous biological spaces also risks creating antigen-binding profiles that no real immune response produces. We include a class-weighted cross-entropy run as part of the cross-entropy baseline family, so the experiment settles this directly on each cohort.

Why not just use mean squared error, since it is already ranking-aligned? This is the most serious alternative, and we do not argue around it. Van der Valk and Picek proved that mean squared error minimization is mathematically aligned with Guessing Entropy optimization, unlike 0-1 loss, and Zaid et al. found ranking loss only modestly better in data efficiency (20,000 versus 24,870 profiling traces on AES_HD) with faster convergence. It is entirely possible that mean squared error matches our pairwise loss on triage metrics. The ablation is designed to detect exactly this, and a partial prior is that the pairwise formulation should matter most where margins are thin and noisy — the IgM early window — because it penalizes rank inversions rather than absolute calibration error; E4 is where that prior gets tested. If mean squared error wins, the proposal still contributes the triage metrics, the score-aggregation formulation, and the negative result on pairwise losses, which would itself be the first evidence of its kind in this domain.

Why not just use the Bayesian mixture model's posterior as the triage score? For static, single-time-point, convalescent-period data, that may genuinely suffice — which is why it is our strongest baseline, not a dismissed one. It falls short in three ways our experiments target: it is static and cannot represent the within-window kinetics that E2 exploits; it is parametric with fixed component shapes, which the mixture paper itself flags as an assumption about responder and non-responder distributions; and it requires demographic covariates (age, region) to produce absolute probabilities, whereas a ranking model needs only relative order. The head-to-head in E1–E3 at matched tuning budget is the decisive test, and we will report it whichever way it goes.

Decisive Checks

The proposal succeeds if, on at least two of the three clinical cohorts, the ranking-trained model beats both the cutoff rules and the recalibrated Bayesian posterior on SR@b and Triage Entropy at matched budget, with the loss ablation attributing the gain to the ranking objective rather than to architecture or aggregation. It succeeds strikingly if E4 shows that a ranking objective materially improves early-window IgM performance in the imaging assay at unchanged specificity. It fails informatively if mean squared error matches the pairwise loss everywhere — in which case the deliverable becomes the triage metric suite, the demonstration that continuous multi-reading aggregation beats cutoffs, and a documented null result on pairwise ranking under non-responder contamination, none of which currently exists anywhere in the serological literature. A secondary check throughout is variance behavior, following the complexity-trap warning: we track Triage Entropy across checkpoints and confirm the deliberately small fusion model does not trade training loss for ranking variance on the noisy IgM channel.