Manuscript Offprint
arXiv:2610.26988REST: Reliability-Guided Spatial Transcriptomics Supervision for Gene Expression Prediction from Histopathological HE-Stained Images
ABSTRACT
Histopathology is central to cancer diagnosis, but morphology in Hematoxylin and Eosin (H&E)-stained images does not directly reveal the molecular states that characterize disease heterogeneity and inform tumor characterization, prognostic assessment, and biomarker discovery. Spatial Transcriptomics (ST) measures spatially resolved gene expression, providing molecular information within tissue architecture, yet differences in assay coverage and spot informativeness make paired H&E-ST observations unequally reliable for representation learning. We propose Reliability-Guided Spatial Transcriptomics (REST) supervision with Biological Program Bank (BPB), a program-structured and reliability-guided ST-supervised training framework for predicting molecular information from H&E images. REST constructs BPB from curated signature, pathway, and cell-type gene sets to provide a shared structure for ST encoding, reliability estimation, and molecular reconstruction. Guided by BPB, SpotReliability Contrastive Alignment (SRCA) measures the reliability of each spot from assay-level program coverage and spot-level activity dispersion, and reweights H&E-ST alignment accordingly. Biology-Informed Program Reconstruction (BIPR) further uses learnable program queries to reconstruct member-gene expression from histological morphology. REST's training corpus comprised 209 samples (407,475 spots across 16 organs); evaluation used 70 disjoint samples (230,056 spots across eight organs) for gene-expression, pathway activity, and cell-signature prediction. REST achieved the highest Macro correlation among state-of-the-art ST-supervised training methods and outperformed existing pathology foundation models. Code is available at https://github.com/lanfz2000/REST.
Index Terms— spatial transcriptomics, computational pathology, representation learning, contrastive learning, molecular prediction
1. INTRODUCTION
Hematoxylin and Eosin (H&E)-stained images in histopathology are central to cancer diagnosis and treatment prediction, as they reveal tissue architecture, cellular morphology, and tumor organization [1]. However, morphology alone does not directly expose the molecular states that characterize disease heterogeneity and inform tumor characterization, prognostic assessment, and biomarker discovery. Spatial Transcriptomics (ST) measures spatially resolved gene expression, providing molecular information in the context of tissue architecture and linking local molecular variation to histological morphology [2, 3]. However, ST requires dedicated tissue processing and sequencing and remains far less accessible than routine H&E images. These practical constraints motivate predicting local molecular profiles directly from H&E images [4, 5].
Such prediction requires visual representations that connect local tissue morphology with molecular state. Large-scale self-supervised and vision-language pretraining provides transferable histology encoders [6, 7, 8, 9, 10, 11, 12], but these objectives do not explicitly capture local transcriptomic variation. Paired H&E-ST data provide molecular supervision for histology encoders, including through batch-agnostic contrastive learning for image recognition [13].
Histology–transcriptomics methods have explored bulk-level molecular modeling [4, 14], spot-wise regression [5, 15], spatial graph modeling [16], and H&E-ST contrastive learning [17]. Among them, OmiCLIP represents each spot as a sequence of highly expressed genes and contrasts it with the paired H&E patch [18], HAGE combines global and local alignment with hierarchical centroid constraints and gene prediction [19], STAMP augments symmetric contrastive learning with Hallmark-program gene reconstruction [20], and SEAL learns an ST latent space before aligning pathology with molecular embeddings [21]. These studies highlight the importance of ST-supervised training objectives, but two limitations remain.
First, gene availability and molecular coverage vary across ST assays and samples, yet standard contrastive objectives weight matched H&E-ST pairs equally. Pairs from assays with limited program coverage or spots with weakly discriminative program profiles may therefore provide unreliable cross-modal supervision. Second, directly reconstructing individual genes exposes the model to high-dimensional and sparsely observed gene-level noise. Molecular signature, pathway, and cell-type marker collections provide an interpretable structure for organizing related genes [22, 23, 24], but the gene-type and pathway priors used by HAGE and STAMP [19, 20] do not explicitly determine assay- and spot-dependent reliability weights for H&E-ST alignment. Effective ST supervision should therefore account for assay- and spot-dependent reliability while using biological structure throughout training.
To address these issues, we propose Reliability-Guided Spatial Transcriptomics (REST) supervision with Biological Program Bank (BPB), a program-structured and reliability-guided training framework for learning molecularly informative histology representations from paired H&E-ST data. BPB integrates curated signature, pathway, and cell-type gene sets into a unified molecular structure,
Correspondence to Guotai Wang (guotai.wang@uestc.edu.cn)
(a) Spatial transcriptomics-supervised training
(b) Downstream tasks

Fig. 1. Overview of REST for obtaining ST-aware features from H&E images for gene expression prediction. BPB: Biological Program Bank.
and provides the shared basis for two training mechanisms: Spot-Reliability Contrastive Alignment (SRCA) estimates the reliability of each spot from assay-level program coverage and spot-level activity dispersion, whereas Biology-Informed Program Reconstruction (BIPR) uses program-specific queries to reconstruct member-gene expression from H&E features. Across HEST-derived gene, pathway, and cell-signature tasks, REST achieves the highest Macro Pearson correlation among state-of-the-art ST-supervised training methods and outperforms existing pathology foundation models. Our contributions are:
-
We propose REST with BPB, a unified bank of molecular signatures, pathways, and cell-type markers that guides ST encoding, reliability estimation, and reconstruction for molecularly informed histology representation learning.
-
We introduce SRCA, which estimates spot reliability from assay-level program coverage and spot-level activity dispersion to reweight H&E–ST contrastive alignment.
-
We introduce BIPR, which uses learnable program queries to extract program-specific visual features for reconstructing member-gene expression.
2.1. Problem Formulation and Overview
Let denote an H&E patch and the normalized expression profile of its paired ST spot over a unified vocabulary of genes. Each spot is paired with the H&E patch cropped at the same tissue location. ST is measured at discrete spots rather than over the whole slide image, and different assays cover different gene panels, so each profile is only partially observed. We encode this with a binary gene measurement mask , where if gene is measured by the assay that produced spot and 0 otherwise. We aim to train an ST-aware pathology encoder for molecular prediction from H&E.
As illustrated in Fig. 1, REST first constructs a Biological Program Bank (BPB) and then trains with two BPB-guided mechanisms. SRCA uses BPB to estimate spot reliability for H&E-ST alignment, while BIPR uses program-specific queries to reconstruct member-gene expression from histology.
Table 1. Composition of BPB. Note that a gene may belong to multiple programs and sources.
| Dataset | Program type | Programs | Unique genes |
|---|---|---|---|
| Hallmark [22] | Molecular signature | 50 | 4,384 |
| KEGG [23] | Pathway | 186 | 5,245 |
| PanglaoDB [24] | Cell-type marker | 151 | 3,111 |
| Union | - | 387 | 8,607 |
2.2. Biological Program Bank and ST Encoding
As gene coverage varies across ST assays and individual counts are sparse, we encode each spot by biological programs rather than by individual genes. Signature, pathway, and cell-type programs group related genes so that the ST encoder represents their joint activity rather than isolated measurements. HAGE [19] incorporates gene-type priors into gene-expression prediction, while STAMP [20] uses Hallmark pathways for ST encoding, H&E-ST alignment, and gene reconstruction. REST extends program-based supervision with BPB, which spans multiple program types and shares their memberships across ST encoding, reliability estimation, and molecular reconstruction. A useful BPB should cover genes measured by ST assays and span both molecular and cell-type programs, since an ST profile reflects both. We therefore use three complementary curated sources: Hallmark [22] molecular signatures, KEGG [23] pathways, and PanglaoDB [24] cell-type markers. After standardizing gene symbols, we remove programs with fewer than three valid genes and retain overlapping memberships, since one gene may participate in multiple biological processes. This yields BPB with programs over a unified vocabulary of genes, comprising 50 Hallmark, 186 KEGG, and 151 PanglaoDB-derived programs (Table 1). We encode BPB as a binary membership matrix , where indicates that gene belongs to program .
For each ST spot, raw gene counts are normalized by total library size, scaled to 10,000, and transformed with . The resulting expression profile is mapped to the unified gene vocabulary. Genes unavailable in a given sequencing assay are zero-filled and masked by , while measured zero expression remains a valid target.
We then encode each ST spot as one token per biological program. Let be the genes in program . For spot , let denote the expression vector of genes in and their gene measurement mask. A program-specific projection and bias map the masked expression to an ST token, where denotes the element-wise product:
The projected tokens are stacked as rows of . A Transformer encoder aggregates them through a learnable class (CLS) token, whose output is linearly projected and -normalized to obtain . This program-aware encoding makes signature, pathway, and cell-type structure explicit before cross-program aggregation.
2.3. Spot-Reliability Contrastive Alignment
ST supervision varies in reliability because sequencing assays differ in gene coverage and individual spots exhibit program profiles with different levels of informativeness. Standard contrastive learning treats all matched H&E-ST pairs equally, allowing pairs from assays with limited coverage or spots with weakly informative program profiles to contribute as strongly as reliable ones. We therefore introduce Spot-Reliability Contrastive Alignment (SRCA), which assigns each spot a parameter-free reliability weight during H&E-ST alignment. Let denote the sequence of visual tokens produced by for patch . We pool and project it to obtain , where is learned and norm denotes normalization; is the paired ST embedding. Their pairwise similarity is defined as , where is a learned positive scale parameter.
We estimate pair reliability using two complementary properties: program coverage and program activity dispersion. For program k, the gene coverage and mean activity of spot i are computed as
Let denote the programs observed for spot , with . We summarize its overall molecular coverage as and its activity dispersion as , where is the mean program activity. Higher indicates broader assay coverage, whereas higher indicates a more distinctive spot-level program profile.
We combine the two factors with square-root compression as and normalize by the batch mean, , where and is the batch size. Thus, a pair receives a large reliability weight only when its assay provides sufficient gene coverage and its spot exhibits informative variation across biological programs.
Finally, SRCA applies these reliability weights to symmetric H&E-ST contrastive learning, where the two terms are the H&E-to-ST and ST-to-H&E losses:
2.4. Biology-Informed Program Reconstruction
SRCA aligns H&E and ST representations at the spot level, but does not explicitly specify which molecular signals should be encoded in local visual features. Direct reconstruction of thousands of individual genes is also sensitive to noisy and sparse gene measurements. We therefore introduce Biology-Informed Program Reconstruction (BIPR), which organizes molecular supervision according to curated signature, pathway, and cell-type programs.
For each H&E patch, BIPR operates on the visual token sequence produced by . We associate each biological program with a learnable query . A cross-modal decoder performs cross-attention [25] from the program queries to the projected visual tokens, so that each query retrieves the visual evidence most relevant to its program:
where is a learned projection and the decoder applies self-attention over followed by cross-attention over . The output token aggregates visual evidence for program .
Program decoding maps to predicted member-gene expression: , where contains the genes in program , and is the prediction for gene .
Because different sequencing assays measure different genes, only observed genes contribute to the reconstruction objective. In addition, a gene may belong to multiple programs. To avoid repeatedly over-weighting shared genes, we use inverse membership weights , where counts the programs of type containing gene . Let index the programs of type , and let denote all valid reconstruction targets for program type , corresponding to molecular signatures, pathways, and cell-type markers, respectively. The BIPR objective averages the expression reconstruction losses equally across the three program types:
2.5. Overall Training and Inference
REST jointly optimizes SRCA and BIPR.
where is the BIPR training weight. For each downstream task, we fit a ridge-regression head using frozen features and ST-derived targets from the downstream training folds (Fig. 1(b)). At inference, the frozen encoder and fitted task head predict molecular targets from H&E patches without ST measurements.
3. EXPERIMENTS
3.1. Benchmark, Protocol, and Implementation Details
We evaluated histology representations on HEST-derived gene-expression, pathway-activity, and cell-signature prediction tasks [31]. The Gene task evaluated individual-gene expression, the Pathway task evaluated scores for 32 KEGG gene sets, and the Cell task evaluated scores for six cell-type marker sets. We used 637,531 paired H&E-ST spots from 279 public HEST samples acquired using Visium or Visium HD [31]. The ST-supervision training corpus contained 209 samples (407,475 spots; 16 organs), and the downstream evaluation cohort contained 70 samples (230,056 spots; eight organs). The two cohorts shared no samples or spots. Performance was measured by Pearson correlation, which quantifies the linear association between
Table 2. Comparison with state-of-the-art methods. All entries report Pearson correlation (%).
| Method | Gene | Pathway | Cell | Macro |
|---|---|---|---|---|
| Without ST-supervised training | ||||
| UNI2 [8] | 40.54 | 36.99 | 27.27 | 34.93 |
| H0-mini [26] | 38.14 | 35.11 | 31.34 | 34.86 |
| Virchow2 [27] | 37.43 | 38.14 | 28.82 | 34.80 |
| GigaPath [28] | 38.29 | 36.95 | 27.51 | 34.25 |
| CONCHv1.5 [29] | 36.69 | 35.79 | 28.23 | 33.57 |
| CONCH [11] | 36.11 | 33.69 | 27.87 | 32.56 |
| H-optimus-1 [30] | 41.13 | 36.09 | 29.89 | 35.70 |
| With ST-supervised training (initialized from H-optimus-1) | ||||
| STAMP [20] | 40.41 | 40.65 | 33.67 | 38.24 |
| HAGE [19] | 41.09 | 40.71 | 34.08 | 38.63 |
| OmiCLIP [18] | 41.07 | 39.25 | 31.86 | 37.39 |
| SEAL [21] | 41.15 | 36.66 | 31.17 | 36.32 |
| REST | 41.14 | 42.39 | 35.66 | 39.73 |
predicted and ST-derived target values, with higher values indicating stronger positive agreement. For Gene, Pearson was computed per target gene across test spots and averaged over genes within each benchmark task; for Pathway and Cell, it was computed per target within each test sample and averaged over valid sample-target pairs with at least 20 spots and nonzero variance. Macro Pearson correlation was the unweighted mean of the Gene, Pathway, and Cell correlations.
All ST-supervised methods were initialized from H-optimus-1 [30]. BPB comprised 387 programs covering 8,607 genes (Table 1). H-optimus-1 produces visual tokens with dimension . The ST encoder, BIPR program queries, and contrastive embeddings use a common hidden dimension of . Both the ST encoder and BIPR decoder contain two Transformer layers with eight attention heads and a dropout rate of 0.1. To update the histology encoder efficiently, we apply LoRA to the query and value slices of the fused query-key-value projection in each attention layer, leaving the key slice frozen, with rank 8, scaling factor 16, and dropout 0.1. Training was performed for 10 epochs with a global batch size of 256 using AdamW. The learning rate was , with a weight decay of 0.2 and 500 warm-up steps. The logit scale was initialized to . We used for the BIPR objective.
Within the evaluation cohort, we froze each histology encoder and fitted task-specific heads on the downstream training folds (Fig. 1(b)). All tasks used the same linear evaluation pipeline, following prior work [31, 21]: feature standardization, principal component analysis to 256 dimensions, and a ridge-regression task head. All preprocessing and regression parameters were fitted on the training folds only and then applied unchanged to the held-out test folds, without task-specific encoder fine-tuning. Test predictions used H&E patches alone; test ST measurements were used only to compute the evaluation metrics.
3.2. Comparison with State-of-the-Art Methods
Table 2 reports two comparisons. The upper section compares REST with pretrained pathology foundation models, including H-optimus-1 [30], Virchow2 [27], UNI2 [8], H0-mini [26], GigaPath [28], CONCHv1.5 [29], and CONCH [11], evaluated without ST-supervised training. REST outperformed these pretrained encoders across all three tasks, with a Macro Pearson correlation of 39.73%. Relative to its H-optimus-1 initialization, REST improved Gene, Pathway, and Cell prediction by 0.01, 6.30, and 5.77 percentage points, respectively, resulting in a 4.03-point gain in Macro correlation. This corresponds to an 11.29% relative improvement in Macro correlation. The larger gains on Pathway and Cell indicate that REST primarily strengthens representations of coordinated molecular programs and cell-type-associated states.
Table 3. Ablation of REST under the H-optimus-1 backbone. All entries report Pearson correlation (%).
| Configuration | BPB | SRCA | BIPR | Gene | Pathway | Cell | Macro |
|---|---|---|---|---|---|---|---|
| H-optimus-1 | - | - | - | 41.13 | 36.09 | 29.89 | 35.70 |
| InfoNCE | - | - | - | 40.50 | 39.06 | 34.00 | 37.86 |
| InfoNCE | ✓ | - | - | 40.90 | 39.81 | 35.12 | 38.61 |
| SRCA only | ✓ | ✓ | - | 40.89 | 42.06 | 35.31 | 39.42 |
| REST | ✓ | ✓ | ✓ | 41.14 | 42.39 | 35.66 | 39.73 |
The lower section compares ST-supervised training methods, including STAMP [20], HAGE [19], OmiCLIP [18], and SEAL [21], all initialized from the same H-optimus-1 backbone to isolate differences among training objectives. REST achieved the highest Pathway, Cell, and Macro correlations and the second-best performance on gene prediction, trailing the best result by only 0.01 percentage points. Compared with HAGE, the strongest competing method by Macro score, REST improved Gene, Pathway, Cell, and Macro correlation by 0.05, 1.68, 1.58, and 1.10 percentage points, respectively. These controlled results show that the REST training objective uses paired ST supervision more effectively than competing objectives.
3.3. Ablation Study
We evaluated the contribution of each REST training objective in Table 3. Standard InfoNCE training achieved a Macro score of . Adding BPB improved Gene, Pathway, Cell, and Macro performance by 0.40, 0.75, 1.12, and 0.75 percentage points, respectively. With BPB in place, SRCA further improved Pathway, Cell, and Macro performance by 2.25, 0.19, and 0.81 percentage points, respectively, with a negligible 0.01-point decrease in Gene correlation. SRCA uses BPB to measure assay-level coverage and spot-level activity dispersion, indicating that BPB-guided reliability weighting primarily benefits structured molecular targets. Adding BIPR increased Gene, Pathway, Cell, and Macro performance by 0.25, 0.33, 0.35, and 0.31 percentage points, respectively, raising the Macro score to . This consistent improvement supports using the same BPB to organize reconstruction targets in addition to its role in reliability estimation.
4. CONCLUSION
We proposed REST, an ST-supervised training framework that uses BPB to connect reliability-weighted H&E-ST alignment with structured molecular reconstruction. Evaluation on 230,056 spots from 70 samples showed that REST outperformed competing ST-supervised training methods in Macro correlation across gene, pathway, and cell-signature prediction. Larger gains on pathway and cell-signature prediction support learning coordinated molecular features through program-structured supervision. Scaling REST with larger, more diverse paired datasets could support foundation models for molecularly informed pathology. Future work should evaluate prognosis and treatment-response prediction across institutions using independent cohorts with clinical outcome annotations, and extend REST to other spatial omics platforms.
5. COMPLIANCE WITH ETHICAL STANDARDS
This retrospective study used publicly available human histology and spatial transcriptomics data from HEST [31]. No new samples were collected for this study.
6. ACKNOWLEDGMENTS
This work was supported by the Natural Science Foundation of Sichuan Province under grant 2025ZNSFSC0455.
7. REFERENCES
[1] Gabriele Campanella, et al., “Clinical-grade computational pathology using weakly supervised deep learning on whole slide images,” Nature Medicine, vol. 25, no. 8, pp. 1301–1309, 2019.
[2] Patrik L. Ståhl, et al., “Visualization and analysis of gene expression in tissue sections by spatial transcriptomics,” Science, vol. 353, no. 6294, pp. 78–82, 2016.
[3] Sanja Vickovic, et al., “High-definition spatial transcriptomics for in situ tissue profiling,” Nature Methods, vol. 16, pp. 987–990, 2019.
[4] Benoît Schmauch, et al., “A deep learning model to predict RNA-Seq expression of tumours from whole slide images,” Nature Communications, vol. 11, pp. 3877, 2020.
[5] Bryan He, et al., “Integrating spatial gene expression and breast tumour morphology via deep learning,” Nature Biomedical Engineering, vol. 4, pp. 827–834, 2020.
[6] Xiyue Wang, et al., “Transformer-based unsupervised contrastive learning for histopathological image classification,” Medical Image Analysis, vol. 81, pp. 102559, 2022.
[7] Xiyue Wang, et al., “RetCCL: Clustering-guided contrastive learning for whole-slide image retrieval,” Medical Image Analysis, vol. 83, pp. 102645, 2023.
[8] Richard J. Chen, et al., “Towards a general-purpose foundation model for computational pathology,” Nature Medicine, vol. 30, pp. 850–862, 2024.
[9] Eugene Vorontsov, et al., “A foundation model for clinical-grade computational pathology and rare cancers detection,” Nature Medicine, vol. 30, pp. 2924–2935, 2024.
[10] Zhi Huang, et al., “A visual-language foundation model for pathology image analysis using medical Twitter,” Nature Medicine, vol. 29, pp. 2307–2316, 2023.
[11] Ming Y. Lu, et al., “A visual-language foundation model for computational pathology,” Nature Medicine, vol. 30, pp. 863–874, 2024.
[12] Qifeng Zhou, et al., “Contrastive pretraining for computational pathology with visual-language models,” in ISBI, 2025, pp. 1–4.
[13] Kazuya Nishimura, et al., “Towards spatial transcriptomics-guided pathological image recognition with batch-agnostic encoder,” in ISBI, 2025, pp. 1–5.
[14] Richard J. Chen, et al., “Pan-cancer integrative histology-genomic analysis via multimodal deep learning,” Cancer Cell, vol. 40, no. 8, pp. 865–878.e6, 2022.
[15] Yuran Jia, et al., “THItoGene: a deep learning method for predicting spatial transcriptomics from histological images,” Briefings in Bioinformatics, vol. 25, no. 1, pp. bbad464, 2024.
[16] Yuansong Zeng, et al., “Spatial transcriptomics prediction from histology jointly through Transformer and graph neural networks,” Briefings in Bioinformatics, vol. 23, no. 5, pp. bbac297, 2022.
[17] Ronald Xie, et al., “Spatially resolved gene expression prediction from histology images via bi-modal contrastive learning,” in NeurIPS, 2023, vol. 36, pp. 70626–70637.
[18] Weiqing Chen, et al., “A visual–omics foundation model to bridge histopathology with spatial transcriptomics,” Nature Methods, vol. 22, no. 7, pp. 1568–1582, 2025.
[19] Thao M. Dang, et al., “HAGE: Hierarchical alignment gene-enhanced pathology representation learning with spatial transcriptomics,” in MICCAI, 2025, vol. 15960, pp. 228–238.
[20] Fengtao Zhou, et al., “Spatial transcriptomics-guided alignment enhances molecular profiling in pathology foundation model,” arXiv preprint arXiv:2606.03644, 2026.
[21] Konstantin Hemker, et al., “Towards spatial transcriptomics-driven pathology foundation models,” arXiv preprint arXiv:2602.14177, 2026.
[22] Arthur Liberzon, et al., “The molecular signatures database (MSigDB) hallmark gene set collection,” Cell Systems, vol. 1, no. 6, pp. 417–425, 2015.
[23] Minoru Kanehisa, et al., “KEGG for taxonomy-based analysis of pathways and genomes,” Nucleic Acids Research, vol. 51, no. D1, pp. D587–D592, 2023.
[24] Oscar Franzén, et al., “PanglaoDB: a web server for exploration of mouse and human single-cell RNA sequencing data,” Database, vol. 2019, pp. baz046, 2019.
[25] Ashish Vaswani, et al., “Attention is all you need,” in NeurIPS, 2017, vol. 30, pp. 5998–6008.
[26] Alexandre Filiot, et al., “Distilling foundation models for robust and efficient models in digital pathology,” in MICCAI, 2025, vol. 15966, pp. 162–172.
[27] Eric Zimmermann, et al., “Virchow2: Scaling self-supervised mixed magnification models in pathology,” arXiv preprint arXiv:2408.00738, 2024.
[28] Hanwen Xu, et al., “A whole-slide foundation model for digital pathology from real-world data,” Nature, vol. 630, pp. 181–188, 2024.
[29] Tong Ding, et al., “A multimodal whole-slide foundation model for pathology,” Nature Medicine, vol. 31, no. 11, pp. 3749–3761, 2025.
[30] Marin Scalbert, et al., “Abstract LB174: H-optimus-1: A foundation model for computational histopathology,” Cancer Research, vol. 86, no. 8 (Supplement), pp. LB174–LB174, 2026.
[31] Guillaume Jaume, et al., “HEST-1k: A dataset for spatial transcriptomics and histology image analysis,” in NeurIPS, 2024, vol. 37, pp. 53798–53833.