Calibrated Deferral for Faint-Band Nucleic Acid Test Readouts

Reading a rapid nucleic acid test is easy when the pathogen is abundant, and it is hardest exactly where sensitive assays are supposed to help: at the limit of detection, where the test line on a lateral flow strip is barely visible, or where a real-time amplification curve barely separates from background noise. Modern diagnostic pipelines increasingly push the readout onto automated systems — smartphone cameras, convolutional classifiers, vision-language models — and the evidence is that these systems fail precisely in this faint regime: on real COVID lateral flow images, GPT-4V read tests correctly only 64% to 74% of the time, an open-source vision model could localize the inner result window with only 4.69% accuracy, and another hallucinated COVID tests as pregnancy tests in 99% of cases Interpreting COVID Lateral Flow Tests' Results with Foundation Models. What these systems never produce is an honest statement of "I cannot tell." A faint band gets the same confident verdict as a clear one.

The mechanism for fixing this already exists in an unrelated literature. Temperature scaling is a cheap post-hoc trick: divide a classifier's raw output scores by a single learned number $T$ before converting them to probabilities, so that a "99% confident" prediction actually proves right 99% of the time. A recent refinement, SMART, replaces the single global temperature with a small network that maps each sample's logit margin — the gap between the top two scores — to a sample-specific temperature, correcting easy samples and ambiguous samples differently Sample Margin-Aware Recalibration of Temperature Scaling. Meanwhile, calibrated confidence has been shown to power deferral cascades: a cheap model handles routine inputs and passes only the uncertain ones to an expensive model, cutting cost by 55% while matching the expensive model's accuracy on text-safety benchmarks Calibrated Deferral Routing for Cost-Efficient Guardrails. Nobody has brought margin-aware calibration and deferral to automated nucleic acid test reading. That is this proposal.

Core Claim

The claim is that a margin-aware temperature-scaling layer, placed on top of any automated reader of nucleic acid test outputs, converts raw reader scores into calibrated probabilities of true positivity, and that a threshold on those calibrated probabilities defines a deferral policy that routes indeterminate faint-band reads to expert review — yielding better sensitivity-at-the-limit-of-detection per unit of expert labor than either a fixed-threshold reader or an uncalibrated machine reader. The diagnostic setting is not a mere application domain here; it supplies a physically meaningful margin. On a lateral flow dipstick, the natural analog of the top-two logit gap is the contrast between the test-line intensity and the control-line intensity, exactly the quantity a human reader eyeballs when judging a faint band. For real-time fluorescence curves, the margin is the separation between a candidate cycle-threshold bin and its neighbor. SMART's central insight — that the margin itself predicts how much softening a sample needs — translates directly onto these signals.

Research Program

The program builds three things. First, a reader layer: lightweight convolutional and regression models that take smartphone-captured lateral flow images (cropped to the result window) and real-time fluorescence traces from isothermal reactions, and output raw positivity scores. Second, a calibration layer: global temperature scaling, isotonic regression, and a SMART-style margin-aware temperature network, all fitted on small held-out calibration sets. The calibrated probability of a positive is $\hat{p} = e^{z/T(m)} / (e^{z_1/T(m)} + e^{z_2/T(m)})$, where $z_1, z_2$ are the raw evidence scores for positive and negative and $m = z_1 - z_2$ is the margin; on dipstick images $m$ is computed from measured line intensities. Third, a deferral policy: report positive if $\hat{p} > \tau_+$, negative if $\hat{p} < \tau_-$, and defer to an expert reader or laboratory RT-PCR otherwise, with $\tau_\pm$ chosen on the calibration split to optimize a coverage–risk trade-off.

The biological assays define the regime. The point-of-care formats we target are the sensitive isothermal platforms already benchmarked in the literature: recombinase-aided amplification with lateral flow dipsticks for paucibacillary tuberculosis Duplex recombinase aided amplification-lateral flow dipstick assay for rapid distinction of Mycobacterium tuberculosis and Mycobacterium avium complex, Cas12a-coupled isothermal assays that resolve targets at 12 copies per microliter and 0.01% abundance in bulk DNA Mengyu Wang et al. (2022), and LAMP formats with roughly tenfold better sensitivity than PCR Xiaomei Xie et al. (2022). We will run dilution series of synthetic targets and inactivated samples down to single-digit copy numbers per reaction for a one-pot RPA–Cas12a chemistry, so that ground-truth positivity spans the entire faint-band regime where calibration must hold. For the image modality we use the LFT-Grounding corpus of 325 annotated real-world COVID test images Interpreting COVID Lateral Flow Tests' Results with Foundation Models, supplemented by our dilution-series bench images captured under varied lighting.

A secondary thread extends the same calibration layer to the amplification-side classifiers. The 1D-CNN that predicts sequence-specific dropout in multi-template PCR — where a single CGTG motif adjacent to a primer site halves a sequence's abundance every 14 cycles — is evaluated only by AUROC 0.88 and AUPRC 0.44, never by calibration Predicting sequence-specific amplification efficiency in multi-template PCR with deep learning. Because amplification is exponential, an uncalibrated dropout probability compounds into orders-of-magnitude abundance error per cycle. Similarly, guide-design predictors such as DeepCas13 output uncalibrated 0-to-1 scores with AUC 0.87 on 22,599 guides Modeling CRISPR-Cas13d on-target and off-target effects using machine learning approaches, and no reported result found on Lacuna for the Expected Calibration Error of any of these models. We will measure their calibration error directly and apply the same margin-aware scaling, but this thread is deliberately secondary; the faint-band readout problem is where calibrated deferral changes clinical decisions.

Baselines

The naive reference point is the fixed-threshold reader: a test is called positive if the measured test-line intensity (or curve crossover time) exceeds a constant cutoff chosen on a development set, with every read issued a binary verdict and nothing deferred. This is how most deployed rapid tests and automated curve callers work, and it is the "do nothing" comparator for expert labor: it uses zero referral but misclassifies the faint regime silently. The strongest existing automated reader baseline is the zero-shot vision-language model reading of LFT-Grounding images, where GPT-4V reached 64% to 74% accuracy on general prompts and gained only about 5% from context injection Interpreting COVID Lateral Flow Tests' Results with Foundation Models; we will run the same models on the same images and split rules, since no reported result found on Lacuna for the calibration error of any of these readers. The strongest calibration baseline is the isotonic-regression-calibrated cascade recipe of Calibrated Deferral Routing for Cost-Efficient Guardrails, which reduced out-of-the-box calibration error of 6%–28% to below 2.5% on large text benchmarks; we will reimplement it on our readers with the same tuning budget of held-out calibration samples given to every method, including ours. The key ablation isolates the margin-awareness: the identical reader, identical calibration data, with global temperature scaling swapped in for the margin-conditioned temperature. Beating the baselines means, on retained (non-deferred) reads, higher accuracy than the 74% best reported zero-shot reader result while keeping calibration error at or below the isotonic cascade's, and, at matched expert-referral budget, higher sensitivity in the single-digit-copy regime than the fixed-threshold reader.

Why not just…?

Why not just use GPT-4V or another large vision-language model zero-shot? The evidence against this is direct: 64%–74% accuracy on real COVID test images, catastrophic localization of the result window (4.69% for GLaMM), and systematic misidentification of the device itself Interpreting COVID Lateral Flow Tests' Results with Foundation Models. More fundamentally, these models emit fluent verdicts, not calibrated probabilities, and a fluent wrong answer at the limit of detection is the most dangerous failure mode a diagnostic reader can have. We will still run them as baselines, and if any of them turns out to be well calibrated out of the box — which no reported result on Lacuna speaks to either way — that would be a genuine finding and would change the proposal.

Why not just apply isotonic regression and a threshold? This is the most serious alternative, and we treat it as such: isotonic regression beat temperature scaling on large stationary guardrail benchmarks Calibrated Deferral Routing for Cost-Efficient Guardrails. The counterargument is sample size and shift. Our calibration sets will be small (dozens to low hundreds of images or reactions), and the regime that matters — faint bands — is distributionally shifted away from the bulk of training data; SMART demonstrated that non-parametric calibration overfits in exactly this shifted, small-sample regime while a 49-parameter margin-aware temperature network stayed calibrated with as few as 50 validation samples Sample Margin-Aware Recalibration of Temperature Scaling. The decisive experiment is a head-to-head with a calibration-set size sweep (10, 25, 50, 100 samples) and a held-out split deliberately skewed toward faint bands. If isotonic wins there too, we will say so and adopt it; the deferral architecture is orthogonal to which calibrator sits underneath it.

Why not just fine-tune a better detector instead of calibrating? Because discrimination and calibration are separable: a model can rank positives above negatives perfectly and still assign 99% confidence to predictions that are right 70% of the time, as the calibration literature has repeatedly documented Sample Margin-Aware Recalibration of Temperature Scaling. The dropout-prediction CNN is a concrete warning: AUPRC of 0.44 with AUROC of 0.88 means its raw scores are badly unreliable near the decision boundary even though its ranking is decent Predicting sequence-specific amplification efficiency in multi-template PCR with deep learning. Fine-tuning also cannot manufacture an abstain option — deferral needs calibrated probabilities regardless of how accurate the detector becomes. Our fixed-reader ablation (calibrate, don't retrain) directly tests whether the gains come from calibration rather than extra fitting capacity.

Why not just send all ambiguous tests to the laboratory, as clinicians do informally today? Unconditional referral wastes the scarce resource: expert readers and centralized RT-PCR capacity. The semiquantitative group-testing analysis of AC-DC: Amplification Curve Diagnostics for Covid-19 Group Testing shows that quantized, threshold-calibrated readouts buy a threefold saving in tests over binary calls at a 5% prevalence, and it explicitly flags that its quantization thresholds require laborious manual calibration per assay chemistry — which is exactly the bottleneck our post-hoc calibration layer removes. The comparison is coverage–risk: referral-everything and referral-nothing are the two endpoints of the same curve, and our method is only worth publishing if it dominates a sensible fixed rule in between.

Decisive Checks

Three results would establish the claim. First, on LFT-Grounding plus our bench dilution series, the margin-aware calibrated reader must show lower Expected Calibration Error than the uncalibrated reader, global temperature scaling, and isotonic regression on the faint-band-skewed split, at calibration-set sizes of 50 or fewer — mirroring the improvement from 5.62% to 0.48% ECE that SMART achieved on ImageNet with a 49-parameter network Sample Margin-Aware Recalibration of Temperature Scaling. Second, the coverage–risk curve of the deferral policy must dominate the fixed-threshold reader: at each referral budget, retained-read sensitivity in the single-digit-copy regime (near the 12 copies per microliter floor of the Cas12a assay Mengyu Wang et al. (2022)) must be higher. Third, as a falsifiable sanity check, the measured line-intensity margin must actually predict calibration error — if faint-band samples are not systematically the miscalibrated ones, the margin-conditioned mechanism has no footing and the project should retreat to the simpler calibrators. Success here gives point-of-care nucleic acid testing the one capability it currently lacks at the limit of detection: knowing when it does not know.