TL;DR
Deep learning can predict spatial gene expression directly from routine H&E-stained tissue images, but to use these "virtual" measurements in practice, we need to know when a prediction is untrustworthy. This paper benchmarks uncertainty estimation in virtual spatial transcriptomics and uncovers a sobering catch: while predicted uncertainty looks like it tracks errors, it mostly just tracks the predicted expression level (the mean). Once you account for the mean, uncertainty provides very little extra information about which individual predictions are actually unreliable.
What Problem Does This Paper Address?
Spatial transcriptomics (ST) maps gene expression across a tissue slice while preserving its spatial layout, but it is expensive and requires specialized processing. Deep learning models offer a scalable alternative—predicting ST directly from standard H&E histology slides—yet they typically output a single point estimate per spot and gene.
Probabilistic models can also output uncertainty, which could theoretically let practitioners flag unreliable predictions or prioritize regions for real molecular profiling. However, gene expression counts are naturally overdispersed: their variance grows with their mean. If both predicted uncertainty and prediction error grow with the mean, an uncertainty score might look great on paper simply because it echoes the predicted mean, not because it knows which specific predictions are wrong. The authors therefore separate calibration (do predicted distributions match observed outcomes in aggregate?) from informativeness (does uncertainty identify larger errors beyond what the predicted mean already tells us?).
Methods
To isolate the effect of uncertainty estimation, the authors build a controlled benchmark using a shared, frozen image encoder (Midnight-12k) and a fixed multilayer perceptron (MLP) trunk, varying only the probabilistic readout and uncertainty estimator:
- Aleatoric uncertainty (data noise): Evaluated via three likelihood families—Gaussian (heteroscedastic, gene-homoscedastic, and spot-homoscedastic), Poisson, and Negative Binomial.
- Epistemic uncertainty (model uncertainty): Approximated via deep ensembles ($M=5$), Monte Carlo dropout (30 forward passes), and a last-layer Laplace approximation.
- Baselines: A mean-only model, a "marginal" baseline (fitting one distribution per gene without using histology at all), a training-free neighborhood distance baseline in embedding space, and STimage (a published readout).
Models are evaluated using leave-one-patient-out cross-validation. Calibration is measured via the probability integral transform, while informativeness is tested using partial Spearman correlation (controlling for the predicted mean) and selective withholding within bins of the predicted mean.
Datasets
The benchmark uses three published 10x Visium cohorts with paired H&E histology, each restricted to its 3,000 most highly variable genes:
- Tumor Profiler: 18 slides, 7 donors (metastatic melanoma).
- Kidney/Lung TLS: 6 slides, 6 donors (kidney and lung tumors enriched for tertiary lymphoid structures).
- NSCLC: 36 slides, 8 donors (non-small cell lung carcinoma).
Key Insights and Ideas
- Calibration $\neq$ Informativeness: A simple marginal baseline that completely ignores the H&E image achieves calibration comparable to full probabilistic models. Good calibration mostly reflects choosing a distribution family (like Negative Binomial) that fits the data's overall shape, not an ability to spot unreliable predictions.
- The Mean-Variance Trap: Measured gene expression has a strong mean-variance relationship ($\rho \ge 0.95$). Probabilistic models learn this structure, so their predicted uncertainty closely follows the predicted mean.
- Controlling for the Mean Collapses the Signal: Uncontrolled correlations between uncertainty and absolute error look impressive (reaching $0.8$ across genes of a spot), but controlling for the predicted mean drops them to near zero.
- Epistemic and Training-Free Signals Don't Save the Day: Epistemic estimators and neighborhood-distance baselines are generally weaker than aleatoric uncertainty and inconsistent across cohorts.
Key Results
- Accuracy: Probabilistic readouts preserve mean prediction accuracy compared to the mean-only baseline (with top-50 gene slide-aware Pearson correlations of $0.55$, $0.26$, and $0.24$ across Tumor Profiler, Kidney/Lung TLS, and NSCLC, respectively).
- Correlation: Across the genes of a spot on Tumor Profiler, the Negative Binomial's correlation with absolute error drops from $+0.79$ to $+0.05$ after controlling for the mean; the heteroscedastic Gaussian drops from $+0.66$ to $+0.15$. Across all controlled analyses, correlations lie between $-0.07$ and $+0.22$.
- Selective Withholding: On all entries within predicted-mean bins, withholding the most uncertain predictions beats withholding by the predicted mean alone in only 3 of 9 comparisons. Even when restricting to "detected" (non-zero) entries—a subset that cannot be identified at prediction time—uncertainty recovers at most $30\%$ of the oracle error reduction (lowering mean error by at most $16\%$).
Limitations and Future Work
- In-distribution evaluation: Testing held-out patients from the same cohorts does not capture real-world batch, scanner, or H&E staining shifts.
- Measurement noise: Observed ST counts contain technical and biological variability that cannot be separated from model error without replicate measurements.
- Frozen encoder & small cohorts: Using a single frozen image encoder means epistemic uncertainty only reflects the readout head, not the image representation, and the cohorts are relatively small (6–8 donors each).
- Future directions: The authors suggest fitting uncertainty scores directly to prediction residuals, using replicate measurements to isolate model error, and fine-tuning or ensembling the image encoder itself.
Summary updated