More Genes, Faster Inference: Efficient Large-Panel Spatial Transcriptomics Prediction from Histology
Authors: Songming Zhang, Yuxiao Luo, Shifu Luo, Siran Chen, Shuquan Su, Jinyan Li
Organizations: School of Computer Science, Nanjing University · Faculty of Computer Engineering and Artificial Intelligence, Shenzhen University of Advanced Technology · Department of Land Surveying and Geospatial Science (LSGS), The Hong Kong Polytechnic University · Faculty of Health Sciences, University of Macau · Tencent
Spatial transcriptomics (ST) prediction from histology aims to infer spatially resolved gene expression profiles directly from tissue images. This is a challenging problem that is currently often addressed with complicated model architectures, additional inputs, and complicated training procedures, while remaining limited to fixed, small gene panels. This raises a natural question: Is there an efficient method for large-panel ST prediction? Here, we present GeneFlow, a simpler yet effective framework for large-scale spatial gene expression prediction that unifies flow-matching generative modeling with structured multimodal fusion. Specifically, GeneFlow first encodes both histological morphology and cross-gene interactions in spatial spots through histology and gene tokenizers. The model directly predicts spatial gene expression, rather than an intermediate velocity field, while being trained with a velocity-based flow-matching objective. We show that, even without relying on heavy generative pipelines, GeneFlow achieves state-of-the-art performance across multiple ST benchmarks, with up to 56.8% gains in 1,000-gene prediction. Extensive experiments further show that GeneFlow produces biologically meaningful spot profiles while reducing computational cost by orders of magnitude, thereby improving efficiency and scalability, particularly in clinical settings. We believe GeneFlow provides an opportunity for leveraging widely available histology images for downstream biological discovery. Code is available at: https://github.com/ZZhangsm/GeneFlow
Figures & tables
Figure 1. Average PCC- 1000 vs. inference time across all datasets. GeneFlow delivers high accuracy with low inference time.
Figure 2. Overview of GeneFlow. The training data for GeneFlow consists of ST datasets with paired H&E histology images and spot-level expression profiles. Gene expressions are first tokenized into latent representations, while image patches centered at each spot are encoded using a pretrained pathology foundation model to provide conditioning features. These image features guide a genetic flow-based network to learn endpoint-based gene expression prediction with velocity loss. At inference time, GeneFlow iteratively predicts gene expression from a given histology image patch.
Figure 3. Visualization of GeneFlow architecture.
Dataset
Metric
StNet
EGN
BLEEP
TRIPLEX
Stem
STFlow
GeneFlow
Δ(↑)
(Nat. BE, 2020)
(CVPR, 2023)
(NeurIPS, 2023)
(CVPR, 2024)
(ICLR, 2025)
(ICML, 2025)
Kidney
PCC-10
0.4337
0.3039
0.2779
0.4641
0.4662
0.3301
0.5837 ± 0.0012
+25.21%
PCC-50
0.3680
0.1807
0.2165
0.3823
0.4121
0.2544
0.5345 ± 0.0023
+29.71%
PCC-200
0.2936
0.1562
0.1632
0.2769
0.3200
0.1824
0.4545 ± 0.0013
+42.03%
PCC-1000
0.1604
0.1473
0.0532
0.1923
0.1752
0.0800
0.3159 ± 0.0013
+64.27%
Mouse Brain
PCC-10
0.5412
0.4687
0.3800
0.5373
0.5393
0.4757
0.5886 ± 0.0005
+8.76%
Table 1. The results of gene expression prediction across spatial omics datasets. Bold indicates the best performance, underlined indicates the second-best performance.
Figure 4. Visualization of biomarker gene expression with the corresponding PCC values. The color scale ranges from blue (low expression) to red (high expression). Predicted expression of Rab5a and Atp1a2 on the Mouse Brain tissue slide NCBI667.
Model
Param (M)
GFLOPs
Time (s)
StNet
8.0
5.57
3.52
EGN
231
17.66
20.42
BLEEP
12.5
3.63
48.3
TRIPLEX
85.1
33.56
4.35
STFlow
8.1
53.35
1.02
Stem
35.0
42.79
554
Table 2. Computational efficiency comparison using torch.profiler .
Figure 5. Results of the ablation study on the scalability of GeneFlow to large gene sets. Here, gene num represents the number of predicted genes provided to the model.
Figure 6. Effect of Training and Sampling Steps.
PCC-10
PCC-50
PCC-200
PCC-1000
GeneFlow
0.5888
0.5277
0.4424
0.2874
w/o gene tokenizer
0.5070
0.4521
0.3880
0.1997
w/o CONCH
0.3024
0.2379
0.1686
0.0645
w/o UNI
0.2478
0.1865
0.1312
0.0374
w/ v -pred / x -loss
0.5342
0.4731
0.3848
0.2642
w/ v -pred / v -loss
0.5214
0.4608
0.3824
0.2498
Table 3. Ablation study of GeneFlow.
Figure 7. Correlation between PCC and MSE/MAE
Prior Type
PCC-10
PCC-50
PCC-200
PCC-1000
Zero
0.5108
0.4417
0.3411
0.1763
Gaussian
0.5641
0.5023
0.4137
0.2625
ZINB
(0.1, 1)
0.5743
0.5121
0.4252
0.2739
(0.1, 2)
0.5666
0.5043
0.4144
0.2674
(0.1, 4)
0.5432
0.4848
0.3936
0.2374
(0.2, 1)
0.5535
0.4938
0.4056
0.2582
Table 5. Performance under different prior types and ZINB parameter settings
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Oncotree
Num. of Slides
Tech.
Slide ID
Test Slide
PRAD
23
Visium
MEND139-162
MEND145
Kidney
23
Visium
NCBI692-715
NCBI697
Mouse Brain
14
Visium
NCBI658-672
NCBI667
HER2ST
37
Visium
SPA119-155
SPA148
Appendix
Table 6. Dataset statistics of spatially resolved transcriptomics dataset.
Figure 8. The distribution of PCC scores across all predicted genes for each model on MEND145 and NCBI667.
DiT depth
PCC-10
PCC-50
PCC-200
PCC-1000
3
0.5761
0.5109
0.4192
0.2616
6
0.5716
0.5122
0.4208
0.2545
9
0.5743
0.5180
0.4243
0.2633
12
0.5743
0.5121
0.4252
0.2739
Appendix
Table 7. Performance metrics under different DiT depths.
Figure 9. Visualization of biomarker genes. Predicted expression of KLK3 and MSMB in PRAD tissue slide MEND145.
Dim. H
PCC-10
PCC-50
PCC-200
PCC-1000
12
0.5502
0.4872
0.3919
0.2299
24
0.5888
0.5277
0.4424
0.2874
36
0.5851
0.5254
0.4369
0.2834
48
0.5856
0.5238
0.4287
0.2723
96
0.5741
0.5123
0.4237
0.2725
Appendix
Table 8. Performance under different hidden dimensions of gene tokenizer
Figure 10. GO Biological Process Enrichment heatmap for learned gene tokens in GeneFlow.
Figure 11. Training loss curves across different hidden dimensions of the gene tokenizer.
Spatial transcriptomics (ST) provides spatially resolved gene expression profiling but remains expensive, motivating the prediction of ST from histology images. Generative models have emerged as a mainstream paradigm for ST prediction due to their ability to model the conditional distribution of gene expression and capture its inherent stochasticity. However, these methods typically treat genes as independent prediction targets and overlook the intrinsic gene-gene interactions in biological systems, which limits their ability to preserve biologically meaningful co-expression patterns. We argue that gene-gene interactions, which reflect shared pathways and regulatory mechanisms, are essential for generating numerically accurate and biologically coherent ST profiles. In this paper, we propose CorrFlow, a correlation-guided flow matching framework for histology-to-ST prediction that explicitly models gene-gene dependencies through two complementary mechanisms. First, we introduce an annealed masked flow matching strategy, where subsets of genes are progressively masked following a timestep-dependent annealing schedule, encouraging the model to infer masked genes conditioned on the remaining genes and promoting joint conditional modeling beyond per-gene marginal estimation. Second, we devise a gene graph-regularized optimization scheme that integrates prior knowledge from the STRING database and data-driven co-expression estimated by WGCNA to construct a gene affinity graph, which enforces both local consistency and global smoothness in the predicted expression. Extensive experiments across 12 datasets show that CorrFlow achieves the best average PCC and HPCC among evaluated methods, leading to more biologically coherent ST predictions.
Yupei Zhang, Hao Chen, Li Pan +2
Department of Clinical Neurosciences University of Cambridge UK · Usher Institute The University of Edinburgh EH16 RUX · Department of Diagnostic Radiology National University of Singapore Singapore
Spatial Transcriptomics (ST) measures gene expression while preserving spatial context, but its high cost and low throughput leave public datasets small. Inferring expression directly from widely available Hematoxylin and Eosin (H&E) stained histology offers a cost-effective alternative. However, existing approaches face several limitations: regression methods over-smooth toward the conditional mean, while generative methods are faithful but require slow multi-step inference; most methods treat genes as independent and equally important, ignoring inter-gene dependencies and heterogeneous gene informativeness; and most are tailored to a single resolution, either spot-level or cell-level. To address these issues, we propose DriftST, a unified framework for inferring spatially resolved gene expression from H&E images. DriftST builds on a Cellular Drifting generative model that learns a direct drift from a histology-conditioned source to the expression distribution, retaining generative expressiveness while enabling efficient one-step generation. To capture gene structure, we introduce the STransformer, which combines a co-expression attention module for inter-gene dependencies with a gene residual gate for differential gene importance. Operating on a generic gene-panel representation, DriftST applies directly to both spot-level and cell-level data in one framework, and extensive experiments across diverse tissues and platforms show that it achieves state-of-the-art performance at both resolutions.
Yuhang Yang, Yonggan Bu, Shengyuan Zhou +2
University of Science and Technology of China, Hefei, China · Peking University Cancer Hospital, Beijing, China
Spatial transcriptomics offers spatially resolved gene expression profiling within tissue sections, but its cost and limited throughput hinder large-scale deployment. To extend this capability to routine practice, recent computational methods aim to infer spatial gene expression directly from ubiquitous hematoxylin and eosin-stained histology slides. However, most existing models assume Cartesian or geometry-agnostic locality, despite the hexagonal sampling of widely used spot-array platforms, and point-wise regression objectives often yield over-smoothed gene expression profiles, obscuring gene-specific spatial heterogeneity. To address these, we propose HEXST, a geometry-aligned Transformer for spatial gene expression prediction from histology. HEXST operates directly on hexagonal spot coordinates to enable efficient local-to-global contextual modeling via tailored shifted-window attention mechanism and hexagonal rotary positional encoding. To enhance gene-wise spatial contrast, HEXST complements point-wise regression with a contrast-sensitive differential objective and transcriptomic priors from a pretrained single-cell foundation model during training. Across seven spatial transcriptomics datasets, HEXST consistently outperforms state-of-the-art models, providing accurate and robust spatial gene expression predictions while preserving gene-wise contrast and spatial heterogeneity.
Keunho Byeon, Jin Tae Kwak
School of Electrical Engineering, Korea University, Seoul