Skip to content

Menu

WorksComputer Science

Spatial Transcriptomics Prediction from Histology via Topology-Informed Graph Attention and Gene-Semantics Conditioning

Download PDFView on arXiv

Ask your agent about this work

Your agent reads this work through Valency, with its citations and similar works. Paste this at the start of a chat.

Use the Valency MCP. Work: W_86s49qkr. Fetch it with get_paper_by_id, then find its nearest works with find_similar_papers and tell me what it adds.

Works with any MCP client. Not connected yet? Connect your agent

Abstract

Spatial transcriptomics (ST) profiles gene expression with spatial context but remains costly, motivating models that infer expression from H&E images. Existing approaches face three key limitations: (i) a single patch embedding is often insufficient: morphologically similar regions can exhibit distinct expression due to spatial context, while naive neighborhood aggregation can over-smooth boundaries; (ii) conventional fixed, gene-indexed output heads treat genes independently and cannot directly support strict zero-shot prediction for unseen genes; and (iii) common metrics under-measure spatial pattern fidelity and boundary resolution. To address these challenges, we propose TIGEM, a topology-informed, gene-conditioned framework for histology-to-ST inference. TIGEM learns topology-aware spot representations by regularizing graph attention with tissue-level topology and morphology cues to avoid cross-compartment smoothing, and uses gene semantic modulation to replace gene-indexed heads, enabling zero-shot prediction for unseen genes. We also introduce Graph Spectral Correlation (GSC) to evaluate spatial pattern fidelity and boundary resolution complement to PCC/MSE. Across three large-scale ST datasets, TIGEM achieves overall state-of-the-art performance and significantly improved boundary prediction resolution, and further demonstrates the ability to predict expression patterns for genes unseen during training, extending prior zero-shot histology-to-ST efforts with topology-aware spatial propagation and PLM-based gene conditioning.

Introduction

Spatial transcriptomics (ST) profiles gene expression while preserving tissue architecture, enabling links between molecular activity, morphology, and spatial organization [16, 32]. Standard workflows partition hematoxylin and eosin (H&E)-stained whole-slide images (WSI) into thousands of micrometer-scale spots and measure spot-level expression [22, 23], providing insights into cellular heterogeneity and tissue microenvironments [24, 28]. However, ST remains costly and operationally complex, limiting clinical deployment. In contrast, H&E slides are inexpensive and routinely collected in clinical settings, motivating models that infer spatial gene expression directly from histology.

A common paradigm in histology-to-ST prediction is to extract a H&E patch-level embedding for each spot and then regress spot-level expression [8, 21, 39, 45], optionally with graph-based neighborhood aggregation to incorporate spatial context [4, 11, 12, 25, 30, 41, 44]. Although this formulation appears straightforward, it relies on a strong implicit assumption: that local patch appearance (or together with all spatial neighbors) is sufficiently informative for downstream expression inference. In practice, however, this assumption is often invalid. Morphologically similar spots may still exhibit markedly different transcriptional programs when their surrounding tissue organization differs, for example across glandular lumens, compartment boundaries, stromal interfaces, or other microenvironmental transitions [5, 46]. Some methods attempt to solve this problem by replacing deterministic regression with generative modeling and sampling-based prediction. Yet the core input assumption remains largely unchanged: the model is still asked to infer expression primarily from a single patch-level representation without explicitly modeling the surrounding tissue context. Meanwhile, we should also noticed that naive neighborhood aggregation can mix distinct tissue contexts into overly similar representations, leading to over-smoothed predictions and reduced fidelity near spatial expression boundaries.

These observations suggest that the missing ingredient is not merely a stronger regressor, but a context-aware propagation rule that adapts message passing to slide-specific tissue organization. In particular, spatial modeling should be guided by a learned notion of where information can plausibly travel in the tissue plane, instead of assuming that spatial location proximity alone implies expression coupling.

A second limitation is that gene semantics remain underutilized in many histology-to-ST predictors. Conventional methods typically employ a fixed, gene-indexed output head of size ∣Gtrain∣|G_{\mathrm{train}}|, restricting prediction to predefined training genes and preventing direct inference for unseen genes under a strict zero-shot split (Gtest∩Gtrain=∅G_{\mathrm{test}} \cap G_{\mathrm{train}} = \varnothing) without modifying or retraining the output layer. Recent studies[3, 40] have begun to explore semantic conditioning for unseen-gene prediction, but they largely focus on gene-level generalization without explicitly modeling tissue topology or boundary-aware spatial propagation. This motivates gene-conditioned predictors that can transfer across genes while preserving spatial context.

Together, these limitations not only limit prediction resolution and boundary accuracy but also hinder clinical generalization. In addition, existing evaluation metrics are often overly simplistic, relying primarily on Pearson correlation. As a result, the spatial fidelity of a model at the boundary-level is often overlooked, and such metrics do not quantify the extent to which the predictions preserve biologically meaningful and spatially localized heterogeneity.

To address these limitations, we propose TIGEM (Topology-Informed Graph attention with gEne semantic Modulation), a framework for predicting both seen and unseen spatial gene expression from histology images (Figure 1). TIGEM first introduces a Topology-Informed Graph attention (TIG) module that learns a slide-specific continuous barrier field from morphology and topology cues to regularize graph attention, encouraging within-region propagation while suppressing message passing across potential tissue boundaries. TIGEM further replaces conventional gene-indexed output heads with a Gene Semantic Modulation unit (GSMu), where pretrained gene embeddings condition the readout and enable strict zero-shot inference by swapping in unseen-gene embeddings at test time. Together, these modules address both indiscriminate neighborhood aggregation and the fixed-output limitation of conventional predictors. We additionally introduce Graph Spectral Correlation (GSC), a graph-spectral metric that complements spot-wise measures such as PCC by evaluating spatial pattern fidelity. We provide its mathematical formulation and biological interpretation, and use it as a complementary criterion for benchmarking spatial expression patterns. We summarize our contributions as follows:

Overview of TIGEM

Figure 1. Overview of TIGEM. TIGEM includes two main modules: TIG module and GSMu module, enabling accurate spatial expression prediction and zero-shot gene inference.

  • We present TIGEM, a topology-informed graph attention framework for histology-to-ST prediction, which significantly improves both overall expression accuracy and boundary fidelity, and achieves state-of-the-art results on three diverse ST benchmarks.

  • By adopting pretrained pathology vision models (PVM) and protein language models (PLMs) [2, 17, 19] for the patch and gene embedding generation, TIGEM also significantly reduce the computational cost compared to existing prediction models.

  • We extend zero-shot histology-to-ST prediction by introducing a PLM-conditioned GSMu decoder that supports strict unseen-gene inference, and combine it with topology-informed graph attention to improve spatial fidelity for clinically relevant biomarkers.

  • We propose GSC, a graph-spectral metric that complements conventional magnitude-based measures (e.g., MSE and PCC) by quantifying spatial pattern preservation and boundary-resolving ability.

Related works

ST prediction from histology images. Predicting spatially resolved gene expression from H&E-stained WSIs has attracted growing interest in computational pathology. Existing methods can fall into regression-based and generative paradigms. Regression approaches range from spot-wise predictors such as ST-Net [8] to spatial-context models that aggregate neighborhood information and even multi-model information, such as HisToGene [25], Hist2ST [41], TRIPLEX [4], and newly published M2TGLGO [30]. Complementary lines improve robustness by aligning images and genes via contrastive-based designs (BLEEP [36], EGN [39]). Generative predictors are more recent, exemplified by STEM [45] using conditional diffusion. Despite these advances, most methods still instantiate a single mapping from morphology to expression and treat genes as independent targets, which can blur region-specific variability and limit generalization, especially to unseen genes.

Zero-shot gene expression prediction. Recent studies have begun to explore gene-level generalization beyond fixed gene-indexed prediction heads. SGN [40] introduces semantic gene information to enable zero-shot prediction of unseen genes from histology, while other methods such as M2TGLGO[30], stImpute[42], and HEIST [20] explore gene relationships, imputation, or gene-generalizable representation learning in spatial transcriptomics. These studies highlight the value of semantic or relational gene information, but differ substantially in task setting and input modality. TIGEM builds on this direction by combining PLM-based gene conditioning with topology-informed, boundary-aware graph propagation, jointly modeling unseen-gene transfer and spatial tissue context.

Pathology vision models (PVMs). Pathology vision models aim to learn general-purpose representations of histology image patches that can be transferred to downstream tasks such as gene expression prediction and prognosis analysis. Leveraging large-scale histology datasets, models such as UNI [2], CONCH [19], Virchow[33], and H-Optimus [29] are trained with self-supervised or multimodal objectives. These foundation models capture rich morphological information that implicitly reflects cellular organization and molecular context, making them valuable for computational pathology and spatial omics applications.

TIGEM

Preliminary

Spatial transcriptomics and spots. For a given slide, ST data provides a set of NN measurement spots V={1,…,N}\mathcal{V} = \{1,\ldots,N\} and si=(xi,yi)\mathbf{s}_i = (x_i,y_i) denotes the spot coordinate in the WSI. Around each spot ii, a fixed-size image patch Ii∈RH×W×3I_i \in\mathbb{R}^{H \times W \times3} (224 × 224 pixels) is cropped from the H&E slide. Benefiting from pretrained pathology vision models (PVMs), we can directly use their patch embeddings instead of extracting features from scratch, substantially improving computational efficiency. We assume a pretrained PVM fPVM(⋅)f_{PVM}(\cdot) maps IiI_i to a feature vector vi∈Rdv\mathbf{v}_i \in\mathbb{R}^{d_v}, following

vi=fPVM(Ii).(1)\mathbf{v}_i = f_{PVM}(I_i). \tag*{(1)}

In our experiments, we benchmark multiple PVM backbones and their combinations, and use the best-performing combination UNI-2[2]+Virchow-2[33] as vi\mathbf{v}_i. We further use a trainable graph encoder (GE) fGEf_{GE} to encode neighborhood information into the primary morphology feature vi\mathbf{v}_i, obtaining the spot histology representation hi\mathbf{h}_i.

hi=fGE(vi).(2)\mathbf{h}_i = f_{GE}(\mathbf{v}_i). \tag*{(2)}

For a set of GG genes G={g1,…,gG}\mathcal{G} = \{g_1,\ldots,g_G\}, we denote the observed expression at spot ii as yi=(yi,g)g∈G∈RG\mathbf{y}_i = (y_{i,g})_{g \in\mathcal{G}} \in\mathbb{R}^{G}, where yi,gy_{i,g} is the log-normalized gene expression value.

Gene embedding. For each gene, we use its corresponding protein embedding eg∈Rdg\mathbf{e}_g \in\mathbb{R}^{d_g}, obtained from the pretrained protein language model fPLM(⋅)f_{PLM}(\cdot) following

eg=fPLM(gprotein).(3)\mathbf{e}_g = f_{PLM}(g_{\mathrm{protein}}). \tag*{(3)}

In practice, we use ESM2[18] to generate eg\mathbf{e}_g from the amino-acid sequence of gene gg.

Topology-Informed GAT (TIG) Module

The goal of the TIG module (Figure 1) is to learn boundary-aware spot representations on a spatial graph. Because tissue architecture is non-homogeneous, we adopt graph attention (GAT) to enable task-driven neighbor weighting. However, standard GAT still normalizes attention over geometric neighbors using only patch-derived features, which can lead to information leakage across compartment boundaries and thus over-smoothed predictions near expression transitions. To address this, we introduce a global barrier-field branch that estimates a slide-specific barrier map and uses it to regularize attention, discouraging cross-boundary propagation.

Field branch for continuous barrier estimation. We learn a continuous barrier field over the tissue plane from fused morphology–topology cues. We first construct a dense spatial feature map

F=[Fmorph∥Ftopo]∈RC×Hf×Wf,(4)F = [F_{\mathrm{morph}} \mathbin\Vert F_{\mathrm{topo}}] \in\mathbb{R}^{C \times H_f \times W_f}, \tag*{(4)}

aligned with slide coordinates, and predict a nonnegative barrier map via a lightweight U-Net,

B=ffield(F)∈RHf×Wf,(5)B = f_{\mathrm{field}}(F) \in\mathbb{R}^{H_f \times W_f}, \tag*{(5)}

where larger values indicate regions through which propagation is less plausible.

Morphology channels. Given spot embeddings xi∈Rdx\mathbf{x}_i \in\mathbb{R}^{d_x} and spot coordinates si\mathbf{s}_i, we project each embedding into a lower-dimensional morphology space,

x~i=Wxxi∈Rdm,(6)\widetilde{\mathbf{x}}_i = W_x \mathbf{x}_i \in\mathbb{R}^{d_m}, \tag*{(6)}

and rasterize these projected features onto a 2D grid using Gaussian splatting:

Fmorph(u)=∑i=1NKσ(u−si)x~i,(7)F_{\mathrm{morph}}(\mathbf{u}) = \sum_{i=1}^{N} K_{\sigma}(\mathbf{u} - \mathbf{s}_i)\widetilde{\mathbf{x}}_i, \tag*{(7)}

where uu is a grid location and KσK_{\sigma} is a Gaussian kernel with bandwidth σ\sigma.

Topology channels. To further incorporate spatial structural information beyond patch appearance, we construct an additional topology cue map FtopoF_{\mathrm{topo}}. We use CellViT[10] (which is the default in HEST-1k dataset [13]) to perform cell segmentation for the slide. In practice, this map includes processed cell- or tissue-level descriptors such as cell density, local nuclei count, and anisotropy statistics extracted from the histology image. These channels provide complementary evidence about local connectivity, discontinuity, and compartment transitions that are not fully captured by morphology embeddings alone. The detailed constructions of the topology descriptors are provided in the Supplementary Material.

Ftopo=[Fdensity∥Fcount∥Fanisotropy](8)F_{\mathrm{topo}} = [F_{\mathrm{density}} \mathbin\Vert F_{\mathrm{count}} \mathbin\Vert F_{\mathrm{anisotropy}]} \tag*{(8)}

Barrier cost. For an edge (i,j)∈E(i,j) \in\mathcal{E}, let ℓij(t)=(1−t)si+tsj\ell_{ij}(t) = (1-t)s_i + ts_j, t∈[0,1]t \in[0,1], denote the line segment connecting the two spots. We sample TT points uniformly along this segment and define the traversal cost

cij=∥si−sj∥2T∑t=1TB(ℓij(τt)),(9)c_{ij} = \frac{\lVert s_i-s_j\rVert_2}{T}\sum_{t=1}^{T} B\bigl(\ell_{ij}(\tau_t)\bigr), \tag*{(9)}

where {τt}t=1T\{\tau_t\}_{t=1}^{T} are uniformly spaced samples in [0,1][0,1].

Pairwise supervision for training the barrier field. The field branch is pre-trained with an independent weak pairwise objective defined on edges. We construct positive edges P\mathcal{P} that are likely within the same compartment and negative edges N\mathcal{N} that likely cross a boundary (based on morphology/topology cues; see Supplementary). The barrier field is trained to assign smaller traversal costs to positives than to negatives using a margin ranking loss:

Lfield=1∣P∣∑(i,j)∈P1∣N(i)∣∑(i,k)∈N(i)max⁡(0,m+cij−cik),(10)\mathcal{L}_{\mathrm{field}} = \frac{1}{\lvert\mathcal{P}\rvert}\sum_{(i,j)\in\mathcal{P}}\frac{1}{\lvert\mathcal{N}(i)\rvert}\sum_{(i,k)\in\mathcal{N}(i)}\max(0,m+c_{ij}-c_{ik}), \tag*{(10)}

where m>0m>0 is a margin and N(i)={k∣(i,k)∈N}\mathcal{N}(i)=\{k\mid(i,k)\in\mathcal{N}\}. This prevents degenerate solutions (e.g., a flat BB) and provides a direct learning signal for updating ffieldf_{\mathrm{field}}.

Finally, the barrier-induced distribution over the neighborhood of node ii is then derived from the pre-trained fixed cijc_{ij}

qij=softmax⁡j∈N(i)(−cijτb),(11)q_{ij} = \operatorname{softmax}_{j\in\mathcal{N}(i)}\left(-\frac{c_{ij}}{\tau_b}\right), \tag*{(11)}

where τb\tau_b is a temperature parameter.

Topology-informed graph attention. Given node features hi(l−1)\mathbf{h}_i^{(l-1)} from layer (l−1)(l-1), a multi-head graph attention layer computes attention logits

eij(m,l)=Attn⁡(m,l)(hi(l−1),hj(l−1)),(12)e_{ij}^{(m,l)} = \operatorname{Attn}^{(m,l)}\left(\mathbf{h}_i^{(l-1)},\mathbf{h}_j^{(l-1)}\right), \tag*{(12)}

for head mm and neighbor j∈N(i)j\in\mathcal{N}(i).

Gene Semantic Modulation unit (GSMu)

TIGEM targets Visium-style layouts, where each spot has a canonical first-ring neighborhood of 6 hexagonal neighbors. Thus N(i)\mathcal{N}(i) is the surrounding 6 nearest neighbors (Figure 1). The corresponding attention distribution is

pij(m,l)=softmax⁡j∈N(i)(eij(m,l)).(13)p_{ij}^{(m,l)} = \operatorname{softmax}_{j\in\mathcal{N}(i)}\left(e_{ij}^{(m,l)}\right). \tag*{(13)}

We use the average attention across heads as

pˉij(l)=1M∑m=1Mpij(m,l).(14)\bar{p}_{ij}^{(l)} = \frac{1}{M}\sum_{m=1}^{M}p_{ij}^{(m,l)}. \tag*{(14)}

The topology-informed aggregation at layer ll is given by

h~i(l)=∥m=1M∑j∈N(i)pij(m,l)WV(m,l)hj(l−1),(15)\widetilde{\mathbf{h}}_i^{(l)} = \mathbin\Vert_{m=1}^{M}\sum_{j\in\mathcal{N}(i)}p_{ij}^{(m,l)}W_V^{(m,l)}\mathbf{h}_j^{(l-1)}, \tag*{(15)}

where ∥\mathbin\Vert denotes concatenation over heads. Each TIG block further includes a residual connection, layer normalization, and a position-wise feed-forward network:

h^i(l)=LN⁡(hi(l−1)+h~i(l)),(16)\widehat{\mathbf{h}}_i^{(l)} = \operatorname{LN}\left(\mathbf{h}_i^{(l-1)}+\widetilde{\mathbf{h}}_i^{(l)}\right), \tag*{(16)}
hi(l)=LN⁡(h^i(l)+FFN⁡(l)(h^i(l))).(17)\mathbf{h}_i^{(l)} = \operatorname{LN}\left(\widehat{\mathbf{h}}_i^{(l)}+\operatorname{FFN}^{(l)}\left(\widehat{\mathbf{h}}_i^{(l)}\right)\right). \tag*{(17)}

Stacking LL TIG blocks yields the final node embedding matrix

H=[h1,…,hN]T∈RN×d.(18)H=[\mathbf{h}_1,\ldots,\mathbf{h}_N]^{\mathsf{T}}\in\mathbb{R}^{N\times d}. \tag*{(18)}

Topology supervision. The learned barrier field does not directly predict expression. Instead, it provides a spatially structured distribution that regularizes graph attention. We use a KL divergence between the field-induced distribution in Eq. (11) and the GAT attention distribution:

Ltopo=1L∑l=1L1N∑i=1NKL⁡(stopgrad⁡(qi) ∥ pˉi(l)).(19)\mathcal{L}_{\mathrm{topo}}=\frac{1}{L}\sum_{l=1}^{L}\frac{1}{N}\sum_{i=1}^{N}\operatorname{KL}\left(\operatorname{stopgrad}(q_i)\,\middle\|\,\bar{p}_i^{(l)}\right). \tag*{(19)}

Importantly, gradients are stopped through qq (and thus BB) in Ltopo\mathcal{L}_{\mathrm{topo}}, so this term updates only the GAT encoder and prevents the field branch from trivially adapting to match the GAT attention.

Given the learned node embeddings H∈RN×dH\in\mathbb{R}^{N\times d} from the TIG encoder and gene embeddings E∈RG×dgE\in\mathbb{R}^{G\times d_g} from ESM2, our goal is to perform gene-conditioned expression readout. Instead of learning GG independent prediction heads, we use the gene embeddings to modulate a shared morphological representation, so that each gene is decoded as this tissue pattern, as seen from the perspective of this gene. Herein, we design a GSMu module that combines cross-attention and feature-wise linear modulation (FiLM)-style conditioning [27] (Figure 1). Gene tokens and cross-attention. We first normalize and linearly project each gene embedding ege_g from ESM2 to the encoder dimension, obtaining gene tokens ϕg∈Rd\phi_g \in\mathbb{R}^d, g=1,…,Gg = 1, \ldots, G. A single cross-attention layer then lets each gene token “look at” the tissue morphology: gene tokens act as queries, and the node embeddings HH provide keys and values,

zggene=CrossAttn⁡(ϕg,H)∈Rd,(20)z^{\mathrm{gene}}_g = \operatorname{CrossAttn}(\phi_g, H) \in\mathbb{R}^d, \tag*{(20)}

so that zggenez^{\mathrm{gene}}_g becomes a morphology-aware representation of gene gg. This step explicitly aligns sequence-level semantics with slide-specific histology before decoding expression.

FiLM modulation for gene-specific readout. From each refined gene token zggenez^{\mathrm{gene}}_g we generate FiLM parameters via a small MLP, producing a channel-wise scaling and shift (γg,βg)∈Rd×Rd(\gamma_g, \beta_g) \in\mathbb{R}^d \times\mathbb{R}^d. Given a node embedding hi∈Rdh_i \in\mathbb{R}^d, we obtain a gene-specific modulated feature

h~i,g=γg⊙hi+βg,(21)\tilde{h}_{i,g} = \gamma_g \odot h_i + \beta_g, \tag*{(21)}

and apply a shared readout MLP to predict expression:

y^i,g=fhead(h~i,g).(22)\hat{y}_{i,g} = f_{\mathrm{head}}\left(\tilde{h}_{i,g}\right). \tag*{(22)}

This removes gene-indexed parameters from the output and instead decodes expression through semantic conditioning.

Zero-shot prediction for unseen genes. Because GSMu is fully conditioned on gene embeddings (rather than gene indices), TIGEM supports strict zero-shot inference. At test time, for an unseen gene g∗g^* we compute its embedding eg∗e_{g^*}, form the token ϕg∗\phi_{g^*}, and reuse the same cross-attention and FiLM-conditioned readout to predict y^i,g∗\hat{y}_{i,g^*}. The topology-informed encoder remains unchanged.

Total Training Objective

We train the model to predict log-transformed expression for spot ii and gene gg. The main supervision is a mean squared error (MSE) over all observed spots and genes. In addition, we use the topology-guided KL term from § 3.2 to align attention distributions with the topology prior. The overall loss is

L=LMSE+λtopoLtopo,(23)\mathcal{L} = \mathcal{L}_{\mathrm{MSE}} + \lambda_{\mathrm{topo}}\mathcal{L}_{\mathrm{topo}}, \tag*{(23)}

where λtopo\lambda_{\mathrm{topo}} controls the strength of topology guidance.

Experiments

Datasets

We selected three publicly available spatial transcriptomics datasets, named HEART, COAD, and MEND datasets, to do the benchmarking. Specifically, HEART [15] consists of 9 human heart tissue sections from independent samples, COAD [9] contains 13 human colorectal cancer samples, and MEND [6] includes 14 human prostate cancer sections. These datasets are also available in HEST-1k[13].

Experiment Setting

All H&E slides are cropped into 224 × 224 patches centered at each spot. For all benchmark comparisons, TIGEM analyses, and ablation studies, we adopt leave-one-out cross-validation (LOOCV) over all slides. In each fold, one slide is held for testing and the remaining slides are used for training. We report the mean and standard deviation across folds.

Across baselines, we select the top 500 genes from the intersection of highly expressed and highly variable genes (HEHVG) as targets, and apply log1p to all counts. Hyperparameters are reported in the Supplementary; we initialize from official settings and tune key hyperparameters on the validation split for fair comparison.

Evaluation Metric

We report mean squared error (MSE) and Pearson correlation coefficient (PCC), following prior work [4, 45]. PCC is evaluated at two scales, PCC(50) and PCC(200), calculating the average of top 50 and top 200 PCC values.

Meanwhile, we also notice that MSE and PCC primarily measure vector-level agreement and may overlook spatial fidelity. In practice, predicted expression maps are often smoother than the ground truth [36, 45], making PCC less sensitive to gene spatial pattern mismatches, while MSE is dominated by magnitude differences and does not explicitly assess spatial structure. To explicitly evaluate spatial pattern fidelity, we design Graph Spectral Correlation (GSC) in collaboration with biological experts. GSC is a graph signal processing metric that compares predictions and ground truth in the graph Fourier domain. Given the spot adjacency graph with the normalized Laplacian L=I−D−1/2AD−1/2L = I - D^{-1/2}AD^{-1/2} and eigenbasis UU, we compute the cosine similarity between the truncated spectral coefficients that retain a proportion pp of cumulative spectral energy:

GSC⁡(p)=⟨x^true(p),x^pred(p)⟩∥x^true(p)∥2∥x^pred(p)∥2+ε.(24)\operatorname{GSC}(p) = \frac{\langle\hat{x}_{\mathrm{true}}^{(p)}, \hat{x}_{\mathrm{pred}}^{(p)} \rangle}{\lVert\hat{x}_{\mathrm{true}}^{(p)} \rVert_2 \lVert\hat{x}_{\mathrm{pred}}^{(p)} \rVert_2 + \varepsilon}. \tag*{(24)}

We report GSC@90% in the main results as a resolution-oriented metric. Take Figure 2 as a justification, GSC@90% faithfully measures spatial pattern than PCC. Although Stem model achieves noticeably higher PCC than ST-Net and BLEEP, its predictions are overly smoothed, resulting in blurred boundaries and failure to recover the spatial pattern of KLK3. Thus it does not exhibit a corresponding advantage under GSC@90%, highlighting the metric’s ability to penalize spatial mismatches that PCC overlooks. A complete mathematical proof and biological interpretation of GSC are provided in the Supplementary Material.

Visualization of biomarker expression prediction across methods

Figure 2. Visualization of biomarker expression prediction across methods. Top shows the prediction of prostate cancer marker KLK3 on the MEND dataset. Region 1–3 are tumor regions. Bottom shows the prediction of epicardium marker DCN on the HEART dataset.

To provide an independent assessment of spatial fidelity, we additionally report Structural Similarity Index (SSIM) with top 50 values SSIM (50), an established image-structure metric that is independent of both GSC and the TIGEM training objective.

ST Expression Prediction

Comparing with H&E-based ST prediction models. We first benchmarked our method with 11 published ST prediction models. As shown in Table 1, TIGEM consistently outperforms all baseline models across all evaluation metrics and achieves state-of-the-art performance on three datasets spanning distinct tissue types and pathological conditions. Benefiting from the incorporation of cell-level geometric topology, TIGEM more effectively preserves spatial expression structure, leading to substantially higher GSC@90% scores compared with competing methods. Importantly, TIGEM also achieves the highest SSIM on all three datasets, independently corroborating the spatial improvements observed with GSC@90% using an established spatial-structure metric. Since all histology sections originate from different patients or sequencing batches, these results also suggest that TIGEM is robust to technical noise and generalizes well to unseen query slices.

ModelHEART (LOOCV) MSE ↓PCC(50) ↑PCC(200) ↑GSC@90% ↑SSIM (50) ↑COAD (LOOCV) MSE ↓PCC(50) ↑PCC(200) ↑GSC@90% ↑SSIM (50) ↑MEND (LOOCV) MSE ↓PCC(50) ↑PCC(200) ↑GSC@90% ↑SSIM (50) ↑
ST prediction methods
ST-Net [8]0.365₍.074₎0.208₍.083₎0.109₍.027₎0.054₍.015₎0.063₍.013₎1.078₍.093₎0.574₍.055₎0.448₍.044₎0.402₍.053₎0.359₍.045₎0.333₍.029₎0.577₍.056₎0.428₍.030₎0.338₍.026₎0.364₍.038₎
HistoGene [25]0.468₍.055₎0.159₍.029₎0.082₍.032₎0.044₍.012₎0.049₍.009₎1.019₍.094₎0.561₍.063₎0.470₍.058₎0.452₍.046₎0.413₍.033₎0.354₍.030₎0.387₍.035₎0.238₍.038₎0.176₍.032₎0.202₍.019₎
THItoGene [14]0.528₍.088₎0.125₍.048₎0.098₍.022₎0.041₍.014₎0.040₍.011₎1.893₍.101₎0.528₍.050₎0.400₍.045₎0.288₍.050₎0.231₍.042₎0.578₍.042₎0.278₍.039₎0.179₍.029₎0.101₍.039₎0.135₍.022₎
BLEEP [36]0.327₍.070₎0.276₍.049₎0.198₍.034₎0.101₍.016₎0.103₍.018₎0.992₍.098₎0.577₍.062₎0.483₍.040₎0.427₍.036₎0.360₍.041₎0.361₍.031₎0.594₍.044₎0.439₍.037₎0.329₍.022₎0.350₍.035₎
TRIPLEX [4]0.545₍.057₎0.295₍.051₎0.212₍.048₎0.114₍.014₎0.117₍.019₎0.726₍.083₎0.697₍.067₎0.598₍.049₎0.553₍.049₎0.515₍.035₎0.318₍.024₎0.669₍.036₎0.529₍.033₎0.399₍.030₎0.428₍.036₎
Stem [45]0.503₍.050₎0.224₍.045₎0.114₍.022₎0.089₍.021₎0.086₍.013₎1.387₍.116₎0.567₍.064₎0.467₍.056₎0.507₍.036₎0.449₍.047₎0.537₍.033₎0.574₍.041₎0.388₍.029₎0.336₍.036₎0.382₍.029₎
istar [43]0.321₍.058₎0.252₍.040₎0.154₍.032₎0.123₍.018₎0.120₍.020₎0.897₍.076₎0.664₍.055₎0.604₍.041₎0.541₍.051₎0.487₍.035₎0.435₍.032₎0.638₍.050₎0.484₍.045₎0.360₍.026₎0.392₍.030₎
M2TGLGO [7]0.328₍.044₎0.292₍.048₎0.155₍.037₎0.120₍.025₎0.114₍.016₎0.874₍.077₎0.672₍.068₎0.583₍.055₎0.530₍.043₎0.493₍.054₎0.376₍.036₎0.609₍.052₎0.497₍.043₎0.371₍.045₎0.409₍.034₎
mclSTExp [21]0.297₍.037₎0.236₍.032₎0.144₍.026₎0.118₍.013₎0.113₍.017₎0.913₍.079₎0.611₍.048₎0.523₍.056₎0.497₍.036₎0.448₍.034₎0.316₍.028₎0.602₍.033₎0.472₍.030₎0.348₍.036₎0.376₍.050₎
STFlow [11]0.324₍.041₎0.281₍.039₎0.149₍.030₎0.113₍.017₎0.114₍.016₎0.861₍.082₎0.669₍.071₎0.589₍.043₎0.558₍.041₎0.522₍.042₎0.322₍.036₎0.687₍.048₎0.534₍.036₎0.411₍.035₎0.447₍.039₎
MERGE [7]0.355₍.049₎0.358₍.051₎0.221₍.043₎0.143₍.015₎0.149₍.023₎0.813₍.086₎0.705₍.059₎0.619₍.043₎0.538₍.040₎0.477₍.030₎0.424₍.032₎0.674₍.050₎0.507₍.039₎0.359₍.047₎0.387₍.029₎
PVM encoders
Virchow2 [33]0.366₍.033₎0.258₍.035₎0.181₍.039₎0.065₍.013₎0.069₍.008₎0.907₍.068₎0.562₍.047₎0.482₍.039₎0.468₍.045₎0.417₍.020₎0.327₍.027₎0.613₍.039₎0.495₍.033₎0.334₍.032₎0.374₍.034₎
CONCH [9]0.380₍.024₎0.189₍.041₎0.106₍.018₎0.042₍.010₎0.040₍.008₎1.125₍.118₎0.505₍.042₎0.395₍.046₎0.337₍.042₎0.266₍.028₎0.346₍.024₎0.541₍.032₎0.427₍.041₎0.297₍.028₎0.339₍.035₎
UNI-2 [2]0.348₍.044₎0.243₍.032₎0.205₍.038₎0.093₍.016₎0.097₍.011₎0.922₍.077₎0.581₍.063₎0.476₍.044₎0.438₍.031₎0.364₍.038₎0.324₍.032₎0.608₍.037₎0.478₍.028₎0.288₍.031₎0.369₍.041₎
GigaPath [3]0.351₍.042₎0.218₍.039₎0.123₍.036₎0.072₍.012₎0.075₍.011₎0.997₍.084₎0.537₍.044₎0.428₍.030₎0.417₍.038₎0.355₍.028₎0.330₍.033₎0.550₍.046₎0.447₍.032₎0.288₍.037₎0.322₍.023₎
UNI-2 + Virchow20.328₍.037₎0.277₍.033₎0.212₍.031₎0.098₍.016₎0.103₍.015₎0.904₍.085₎0.585₍.063₎0.496₍.038₎0.480₍.040₎0.437₍.029₎0.320₍.024₎0.624₍.044₎0.499₍.033₎0.346₍.047₎0.388₍.042₎
CONCH + UNI-20.349₍.054₎0.228₍.035₎0.203₍.040₎0.091₍.013₎0.088₍.017₎1.007₍.093₎0.548₍.052₎0.468₍.039₎0.387₍.040₎0.340₍.024₎0.337₍.032₎0.600₍.039₎0.467₍.028₎0.325₍.039₎0.362₍.044₎
CONCH + UNI-2 + Virchow20.334₍.044₎0.264₍.039₎0.215₍.041₎0.102₍.015₎0.106₍.018₎0.972₍.083₎0.559₍.053₎0.503₍.048₎0.491₍.038₎0.455₍.033₎0.322₍.025₎0.634₍.039₎0.485₍.034₎0.335₍.028₎0.377₍.044₎
Ours
TIGEM0.245₍.049₎0.388₍.044₎0.241₍.049₎0.160₍.015₎0.175₍.020₎0.687₍.074₎0.718₍.061₎0.631₍.043₎0.584₍.034₎0.539₍.046₎0.308₍.033₎0.701₍.038₎0.549₍.045₎0.422₍.038₎0.466₍.042₎

Table 1. Benchmark results of TIGEM, existing ST prediction models, and PVM baselines (Group 1). Best and second-best results in each column are highlighted with red and blue backgrounds, respectively. Higher is better for PCC(50), PCC(200), GSC@90%, and SSIM (50), while lower is better for MSE. All values are reported as mean with standard deviation shown in the subscript.

Evaluated TIGEM against recent pathology vision models (PVMs). To assess whether TIGEM performance comes merely from strong histology embeddings, we included several open-source PVMs (Virchow2, UNI-2, CONCH, and GigaPath) as well as their combinations. We followed the HEST-1K protocol by training a random forest regressor on their patch embeddings. Across all datasets, TIGEM still surpasses these models and their combinations on all metrics, with a particularly large margin on the spatial-pattern metric GSC@90% (Table 1). This demonstrates that TIGEM predicts expression in a higher resolution than using PVM embeddings alone, and that its framework substantially enhances the spatial organization awareness of existing pathology encoders.

Biomarker Recovery

One key application of spatial gene expression prediction is to uncover the relationship between disease progression and tissue morphology, which requires accurate biomarker estimation. We therefore evaluated TIGEM and the top eight baseline methods on four biomarker genes across both healthy H&E sections (HEART dataset) and cancer tissue (MEND dataset, prostate cancer). In MEND, we selected two established prostate cancer markers, KLK3[26, 31] and AZGP1[35]; in HEART, we evaluated the cardiomyocyte marker ANKRD1[1] and the epicardium marker DNC[38]. As shown in Figure 2, TIGEM’s predictions exhibit strong alignment with the ground truth and closely overlap with pathology-annotated regions, producing sharply defined expression boundaries. These results demonstrate TIGEM’s strong ability to capture spatially coherent biomarker patterns under topology-informed guidance. Additional visualizations are shown in Supplementary Material.

Unseen Gene Prediction

Using PLM-derived gene semantic embeddings, TIGEM can generalize to genes absent from training. To evaluate this ability, we constructed six training–testing splits with different proportions of seen and unseen genes. The top 500 HEHVGs were used for training, while the remaining top 100, 250, and 500 HEHVGs formed three unseen test sets (ratios 5:1, 2:1, and 1:1). To further assess generalization to functionally related but unseen genes, we created another three test sets by selecting the top 100, 250, and 500 semantic-related genes (SRGs) whose PLM embeddings were closest to the training genes.

As summarized in Table 2, zero-shot performance varies across datasets. TIGEM achieves meaningful unseen-gene prediction on COAD and MEND, whereas performance on HEART is substantially weaker, indicating that zero-shot transfer remains challenging and dataset-dependent. Nevertheless, SRG test sets generally outperform their HEHVG counterparts, particularly on COAD and MEND, suggesting that PLM-derived gene semantics facilitate transfer to functionally related unseen genes. We further compare TIGEM with SGN[40], a recent zero-shot histology-to-ST method, under the same SRG 5:1 setting across all three datasets. TIGEM consistently outperforms SGN, with detailed results reported in Supplementary Material.

SettingRatioHEART (MISC142)COAD (MISC36)MEND (MEND146)
MSE ↓PCC(all) ↑GSC@90% ↑MSE ↓PCC(all) ↑GSC@90% ↑MSE ↓PCC(all) ↑GSC@90% ↑
HEHVG5:10.328.0070.328_{.007}0.092.0050.092_{.005}0.087.0090.087_{.009}1.289.0091.289_{.009}0.582.0110.582_{.011}0.622.0080.622_{.008}0.403.0060.403_{.006}0.293.0110.293_{.011}0.308.0090.308_{.009}
2:10.335.0070.335_{.007}0.084.0090.084_{.009}0.083.0080.083_{.008}1.425.0101.425_{.010}0.555.0090.555_{.009}0.610.0100.610_{.010}0.410.0080.410_{.008}0.276.0070.276_{.007}0.293.0100.293_{.010}
1:10.329.0110.329_{.011}0.086.0040.086_{.004}0.081.0070.081_{.007}1.341.0071.341_{.007}0.559.0090.559_{.009}0.614.0080.614_{.008}0.413.0050.413_{.005}0.276.0100.276_{.010}0.288.0070.288_{.007}
SRG5:10.265.0050.265_{.005}0.107.0040.107_{.004}0.109.0050.109_{.005}0.973.0050.973_{.005}0.639.0060.639_{.006}0.687.0090.687_{.009}0.327.0070.327_{.007}0.312.0050.312_{.005}0.328.0060.328_{.006}
2:10.293.0110.293_{.011}0.092.0070.092_{.007}0.089.0080.089_{.008}1.085.0101.085_{.010}0.607.0070.607_{.007}0.661.0090.661_{.009}0.355.0090.355_{.009}0.291.0080.291_{.008}0.312.0090.312_{.009}
1:10.322.0060.322_{.006}0.081.0070.081_{.007}0.076.0030.076_{.003}1.117.0081.117_{.008}0.577.0100.577_{.010}0.641.0080.641_{.008}0.385.0120.385_{.012}0.286.0100.286_{.010}0.299.0100.299_{.010}

Table 2. Zero-shot prediction performance of TIGEM under different unseen gene settings. Best and second-best results in each column are highlighted with red and blue backgrounds, respectively.

GPCPD1 gene prediction

(a) GPCPD1 gene prediction

TSPAN8 gene prediction

(b) TSPAN8 gene prediction

Figure 3. Visualization of unseen biomarker gene prediction.

::::

Beyond aggregate performance, we further examined whether TIGEM can recover biologically meaningful spatial patterns for individual unseen genes. We evaluated the epithelial marker GPCPD1 in COAD and the prostate cancer-associated marker TSPAN8 in MEND, both excluded from training. As shown in Figure 3a, TIGEM recovers the spatial expression pattern of GPCPD1 with high agreement with the ground truth (PCC = 0.897, GSC@90% = 0.922). TIGEM also preserves the cancer-associated spatial localization of TSPAN8 in prostate tissue (Figure 3b). These gene-level examples complement the aggregate evaluation and demonstrate that, when semantic transfer is effective, TIGEM can recover biologically relevant spatial patterns for genes unseen during training.

Extended Analysis on TIGEM

Ablation study. We further perform both fine-grained and module-level ablations in Table 3. Full TIGEM achieves the best performance across all metrics on all three datasets. Within the topology design, removing either the morphology or topology channel consistently degrades performance, demonstrating that the two sources provide complementary cues for learning the barrier field. Removing TopoKL further reduces performance across datasets, confirming the contribution of topology-guided attention regularization. At the module level, removing Residual/FFN or GSMu also consistently degrades performance, although the effect of GSMu is relatively smaller. Finally, all TIGEM variants generally outperform vanilla GAT, supporting the benefit of the proposed topology-aware architecture over standard graph aggregation.

Choice of PVM encoders. We benchmark several pretrained PVM backbones and combinations [2, 19, 33, 37]. As shown in Table 4, multi-PVM combinations consistently outperform single backbones, indicating complementary feature scales. Among two-model pairings, Virchow2+UNI-2 offers the best overall balance, reaching top GSC@90% with competitive MSE/PCC. Adding more PFMs yields only marginal gains (e.g., slightly better MSE/PCC(200)) while substantially increasing preprocess-

SettingHEART (LOOCV)COAD (LOOCV)MEND (LOOCV)
MSE↓PCC(50)↑PCC(200)↑GSC@90%↑MSE↓PCC(50)↑PCC(200)↑GSC@90%↑MSE↓PCC(50)↑PCC(200)↑GSC@90%↑
Fine-grained ablation of the topology design
w/o Morphology channel0.272.0390.272_{.039}0.371.0480.371_{.048}0.226.0360.226_{.036}0.150.0280.150_{.028}0.715.0720.715_{.072}0.673.0450.673_{.045}0.604.0290.604_{.029}0.561.0270.561_{.027}0.325.0370.325_{.037}0.685.0480.685_{.048}0.539.0380.539_{.038}0.414.0470.414_{.047}
w/o Topology channel0.274.0450.274_{.045}0.368.0370.368_{.037}0.228.0410.228_{.041}0.147.0380.147_{.038}0.720.0640.720_{.064}0.676.0610.676_{.061}0.599.0480.599_{.048}0.553.0340.553_{.034}0.331.0530.331_{.053}0.679.0360.679_{.036}0.533.0320.533_{.032}0.411.0380.411_{.038}
Broad ablation of each module
w/o Residual/FFN0.271.0300.271_{.030}0.369.0340.369_{.034}0.228.0450.228_{.045}0.149.0380.149_{.038}0.706.0630.706_{.063}0.689.0400.689_{.040}0.610.0510.610_{.051}0.562.0430.562_{.043}0.320.0310.320_{.031}0.684.0400.684_{.040}0.536.0450.536_{.045}0.414.0330.414_{.033}
w/o TopoKL0.278.0380.278_{.038}0.363.0400.363_{.040}0.223.0360.223_{.036}0.144.0220.144_{.022}0.728.0580.728_{.058}0.668.0540.668_{.054}0.592.0370.592_{.037}0.547.0330.547_{.033}0.329.0280.329_{.028}0.679.0630.679_{.063}0.531.0350.531_{.035}0.409.0340.409_{.034}
w/o GSMu0.260.0320.260_{.032}0.379.0520.379_{.052}0.235.0350.235_{.035}0.157.0200.157_{.020}0.692.0450.692_{.045}0.711.0420.711_{.042}0.626.0390.626_{.039}0.578.0350.578_{.035}0.309.0510.309_{.051}0.696.0320.696_{.032}0.545.0520.545_{.052}0.417.0290.417_{.029}
vanilla GAT0.284.0370.284_{.037}0.358.0440.358_{.044}0.219.0530.219_{.053}0.144.0220.144_{.022}0.746.0660.746_{.066}0.652.0470.652_{.047}0.589.0410.589_{.041}0.540.0420.540_{.042}0.336.0360.336_{.036}0.673.0460.673_{.046}0.521.0430.521_{.043}0.404.0460.404_{.046}
Full TIGEM0.245.0490.245_{.049}0.388.0640.388_{.064}0.241.0490.241_{.049}0.160.0150.160_{.015}0.687.0740.687_{.074}0.718.0610.718_{.061}0.631.0430.631_{.043}0.584.0340.584_{.034}0.308.0430.308_{.043}0.701.0380.701_{.038}0.549.0450.549_{.045}0.422.0380.422_{.038}

Table 3. Ablation study with LOOCV across datasets. Each variant removes a key component of TIGEM. Best and second-best results in each column are highlighted with red and blue backgrounds, respectively.

SettingMSE ↓PCC(50) ↑PCC(200) ↑GSC@90% ↑
CONCH only0.317.0080.317_{.008}0.539.0090.539_{.009}0.370.0120.370_{.012}0.219.0210.219_{.021}
UNI-2 only0.306.0020.306_{.002}0.545.0050.545_{.005}0.378.0100.378_{.010}0.227.0130.227_{.013}
GigaPath only0.311.0170.311_{.017}0.538.0090.538_{.009}0.372.0250.372_{.025}0.215.0090.215_{.009}
CONCH + UNI-20.301.0150.301_{.015}0.544.0110.544_{.011}0.376.0180.376_{.018}0.227.0110.227_{.011}
UNI-2 + GigaPath0.303.0100.303_{.010}0.547.0150.547_{.015}0.380.0080.380_{.008}0.228.0190.228_{.019}
CONCH + GigaPath0.308.0140.308_{.014}0.540.0070.540_{.007}0.372.0120.372_{.012}0.221.0070.221_{.007}
Virchow2 + UNI-20.291.0160.291_{.016}0.552.0100.552_{.010}0.381.0240.381_{.024}0.230.0110.230_{.011}
CONCH + UNI-2 + GigaPath0.294.0160.294_{.016}0.548.0170.548_{.017}0.377.0180.377_{.018}0.226.0110.226_{.011}
CONCH + Virchow2 + GigaPath0.292.0110.292_{.011}0.547.0090.547_{.009}0.381.0060.381_{.006}0.229.0080.229_{.008}
Virchow2 + UNI-2 + GigaPath0.291.0120.291_{.012}0.551.0160.551_{.016}0.382.0080.382_{.008}0.226.0190.226_{.019}
CONCH + UNI-2 + GigaPath + Virchow20.289.0170.289_{.017}0.550.0250.550_{.025}0.383.0180.383_{.018}0.230.0140.230_{.014}

Table 4. Ablation study on the choice of PVMs (HEART dataset). Best and second-best results in each column are highlighted with red and blue backgrounds, respectively.

ing cost, so we adopt a compact but effective combination in our main experiments.

Zero-shot evidence. To justify the feasibility of strict Gtest∩Gtrain=∅G_{\mathrm{test}} \cap G_{\mathrm{train}} = \varnothing inference with gene embedding, we added sensitivity analyses (Table 5) on MEND and COAD under the SRG 5:1 split and compared TIGEM with non-semantic conditioning baselines, including random gene embeddings and one-hot gene identifiers. Semantic gene/protein embedding variants substantially outperform these baselines, indicating that the gain does not come from simply providing a gene identifier but from meaningful gene-level semantics. The additional dataset is presented in Supplementary Material.

SettingCOADMEND
MSE ↓PCC (All) ↑GSC@90% ↑MSE ↓PCC (All) ↑GSC@90% ↑
SRG 5:10.973.0050.973_{.005}0.639.0060.639_{.006}0.687.0090.687_{.009}0.327.0070.327_{.007}0.312.0050.312_{.005}0.328.0060.328_{.006}
Random1.585.0101.585_{.010}0.422.0090.422_{.009}0.459.0100.459_{.010}0.450.0060.450_{.006}0.199.0060.199_{.006}0.192.0070.192_{.007}
One-hot1.596.0091.596_{.009}0.425.0080.425_{.008}0.464.0050.464_{.005}0.431.0080.431_{.008}0.203.0050.203_{.005}0.185.0050.185_{.005}

Table 5. Justification of the feasibility of strict Gtest∩Gtrain=∅G_{\mathrm{test}} \cap G_{\mathrm{train}} = \varnothing inference.

Effect of hyperparameters and model scale. We next analyzed the impact of key hyperparameters, including the temperature τ\tau, the KL weight λtopo\lambda_{\mathrm{topo}}, and the number of GAT layers LL in the TIG module. The result figures provided in the Supplementary Material show that lowering the temperature (sharper topology prior) or increasing λtopo\lambda_{\mathrm{topo}} consistently improves model performance, supporting the importance of the topology prior for guiding spatial prediction.

We also assessed model scaling by varying the number of GAT layers in the TIG module. As reported in the Supplementary Material, moderate increases in depth improve accuracy, but performance plateaus once the model reaches 3–5 blocks, indicating limited benefit from further growth.

Computational Cost. We further summarized the computational cost of TIGEM and all baselines on a single-slide sample per LOOCV fold, with all runs conducted on the same NVIDIA A40 GPU. The results are provided in the Supplementary Material. We report parameter counts and wall-clock training time (to convergence/early stopping) for all methods, while inference time is reported only for Stem since its DiT-based sampling introduces substantial prediction overhead. Notably, TIGEM’s training time already includes patch embedding extraction; with pre-generated patch embeddings and cached topology priors, TIGEM avoids training image encoders from scratch and is consistently among the fastest methods. In contrast, Stem is orders of magnitude slower.

Conclusion

We present TIGEM, a topology-informed graph attention framework with gene semantic modulation for histology-to-spatial transcriptomics prediction. TIGEM regularizes graph message passing with a topology-guided prior distribution to reduce cross-region over-smoothing, and decodes expression through a gene-conditioned GSMu head, enabling strict zero-shot inference for unseen genes by swapping in gene embeddings at test time. We also introduce GSC, a complementary graph-spectral metric for evaluating spatial-pattern fidelity beyond conventional spot-wise metrics. Across diverse ST datasets, TIGEM consistently outperforms existing methods under MSE, PCC, and GSC, while improvements in the established SSIM metric independently corroborate the spatial fidelity captured by GSC. Ablation studies further demonstrate consistent contributions from the topology barrier field, TopoKL, and GSMu, while zero-shot experiments show the potential to recover biologically relevant expression patterns for genes absent from training. Together, these results establish TIGEM as a generalizable framework that integrates topology-aware spatial modeling with gene-semantic conditioning for histology-to-ST prediction.

Dataset Description

In this work, we benchmarked our method on three large-scale ST datasets, whose details are summarized in Table 6.

DatasetTechnology#SamplesAvg. spotsTotal spotsOrgan
HEART10X Visium9246125861Heart
COAD10X Visium13335443605Bowel
MEND10X Visium14245534370Prostate

Table 6. Datasets statistics

All three datasets were sourced from HEST-1K[13]. The HEART dataset contains samples MISC132–142 (excluding MISC137, 134), the COAD dataset includes samples MISC33–45, and the MEND dataset contains samples 140–153. Raw expression counts were transformed by the log1p numpy function. All experiment results can be reproduced by directly downloading the datasets we mentioned without further preprocessing.

Topology cue construction

We construct three topology cue channels from CellViT cell segmentation [10] to form Ftopo=[Fdensity∥Fcount∥Fanisotropy]F_{\mathrm{topo}} = [F_{\mathrm{density}} \mathbin{\|} F_{\mathrm{count}} \mathbin{\|} F_{\mathrm{anisotropy}}]. CellViT provides a set of nuclei (or cell) centroids C={cm=(xm,ym)}m=1MC = \{c_m = (x_m, y_m)\}_{m=1}^{M} in the same slide coordinate system as spot centers. All topology maps are computed on a regular grid of size Hf×WfH_f \times W_f aligned with the WSI, with grid location u\mathbf{u} representing the corresponding pixel coordinate.

Kernelized density map. We define a smooth cell density field by Gaussian kernel density estimation (KDE):

Fdensity(u)=∑m=1MKσd(u−cm),Kσ(r)=exp⁡(−∥r∥222σ2)(25)F_{\mathrm{density}}(\mathbf{u}) = \sum_{m=1}^{M} K_{\sigma_d}(\mathbf{u} - c_m), \qquad K_{\sigma}(\mathbf{r}) = \exp\left(-\frac{\lVert\mathbf{r}\rVert_2^2}{2\sigma^2}\right) \tag*{(25)}

where σd\sigma_d controls the spatial smoothing bandwidth. This channel captures local cellularity and highlights tissue compartments with distinct cell packing.

Local nuclei count map. To provide a complementary, less-smoothed signal, we compute a local count within a fixed-radius neighborhood:

Fcount(u)=∑m=1M1[∥u−cm∥2≤rc](26)F_{\mathrm{count}}(\mathbf{u}) = \sum_{m=1}^{M} \mathbf{1}\left[\lVert\mathbf{u} - c_m\rVert_2 \le r_c\right] \tag*{(26)}

where rcr_c is a counting radius (in pixels). Compared with KDE density, this produces a piecewise-constant map that is sensitive to sharp transitions.

Anisotropy / structure map. We quantify local directional organization by measuring the anisotropy of the centroid distribution in a neighborhood. For each grid point u\mathbf{u}, let N(u)={m:∥u−cm∥2≤ra}\mathcal{N}(\mathbf{u}) = \{m : \lVert\mathbf{u} - c_m\rVert_2 \le r_a\} be nearby centroids. We compute the weighted second-moment matrix

S(u)=1Z(u)∑m∈N(u)wm(u)(cm−μ(u))(cm−μ(u))T,(27)S(\mathbf{u}) = \frac{1}{Z(\mathbf{u})} \sum_{m \in\mathcal{N}(\mathbf{u})} w_m(\mathbf{u}) (c_m - \mu(\mathbf{u}))(c_m - \mu(\mathbf{u}))^{\mathsf{T}}, \tag*{(27)}

where wm(u)=Kσa(u−cm)w_m(\mathbf{u}) = K_{\sigma_a}(\mathbf{u} - c_m), Z(u)=∑m∈N(u)wm(u)Z(\mathbf{u}) = \sum_{m \in\mathcal{N}(\mathbf{u})} w_m(\mathbf{u}), and μ(u)=1Z(u)∑m∈N(u)wm(u)cm\mu(\mathbf{u}) = \frac{1}{Z(\mathbf{u})}\sum_{m \in\mathcal{N}(\mathbf{u})} w_m(\mathbf{u})c_m. Let λ1(u)≥λ2(u)≥0\lambda_1(\mathbf{u}) \ge\lambda_2(\mathbf{u}) \ge0 denote eigenvalues of S(u)S(\mathbf{u}). We define an anisotropy index

Fanisotropy(u)=λ1(u)−λ2(u)λ1(u)+λ2(u)+ϵ,(28)F_{\mathrm{anisotropy}}(\mathbf{u}) = \frac{\lambda_1(\mathbf{u}) - \lambda_2(\mathbf{u})}{\lambda_1(\mathbf{u}) + \lambda_2(\mathbf{u}) + \epsilon}, \tag*{(28)}

where ϵ\epsilon is a small constant. This channel is high in locally aligned or elongated structures (e.g., stromal bands) and low in isotropic regions, providing cues about boundaries and compartment transitions.

Normalization and stacking. Before concatenation, each channel is robustly normalized per slide:

F~(u)=clip⁡(F(u)−median⁡(F)IQR⁡(F)+ϵ,[−3,3]),(29)\widetilde{F}(\mathbf{u}) = \operatorname{clip}\left(\frac{F(\mathbf{u}) - \operatorname{median}(F)}{\operatorname{IQR}(F) + \epsilon}, [-3,3]\right), \tag*{(29)}

and we set Ftopo=[F~density∥F~count∥F~anisotropy]F_{\mathrm{topo}} = [\widetilde{F}_{\mathrm{density}} \mathbin{\|} \widetilde{F}_{\mathrm{count}} \mathbin{\|} \widetilde{F}_{\mathrm{anisotropy}}]. In summary, these three channels are chosen to provide a compact but expressive summary of cell-level geometry that is most relevant to spatial expression inference. FdensityF_{\mathrm{density}} captures cellularity and coarse compartmental structure (e.g., tumor-rich vs. stroma-rich regions), which is strongly associated with broad transcriptional programs. FcountF_{\mathrm{count}} complements KDE density by retaining sharp local discontinuities and abrupt changes in cellular abundance that frequently occur near lumens, invasive fronts, and tissue interfaces—precisely where message passing should be attenuated. FanisotropyF_{\mathrm{anisotropy}} encodes organization and alignment of local cell arrangements, highlighting directional stromal bands, glandular boundaries, and other architectural motifs that are not well represented by scalar density alone. Together, these cues cover three fundamental geometric factors—how many cells are present (mass), how abruptly this changes (discontinuity), and how cells are arranged (orientation/structure)—which empirically explain most topology-driven variation in tissue microenvironments at Visium resolution. We therefore treat Ftopo=[Fdensity∥Fcount∥Fanisotropy]F_{\mathrm{topo}} = [F_{\mathrm{density}} \Vert F_{\mathrm{count}} \Vert F_{\mathrm{anisotropy}]} as a lightweight yet sufficient topology descriptor set for learning slide-specific barrier fields, while keeping the field branch inexpensive and robust to segmentation noise.

Constructing positive/negative edge sets for barrier-field supervision

We build a spot graph G=(V,E)\mathcal{G} = (\mathcal{V}, \mathcal{E}) (Visium 6-neighbors MNN). For each edge (i,j)∈E(i,j) \in\mathcal{E}, we compute two scores:

Morphology discrepancy.

dijmorph=∥xi−xj∥2,(30)d_{ij}^{\mathrm{morph}} = \lVert\mathbf{x}_i - \mathbf{x}_j \rVert_2, \tag*{(30)}

where xi\mathbf{x}_i is the patch embedding.

Topology discrepancy. Let ti∈R3\mathbf{t}_i \in\mathbb{R}^3 be the topology descriptor at spot ii, obtained by sampling [Fdensity,Fcount,Fanis][F_{\mathrm{density}}, F_{\mathrm{count}}, F_{\mathrm{anis}}] at si\mathbf{s}_i.

dijtopo=∥ti−tj∥2.(31)d_{ij}^{\mathrm{topo}} = \lVert\mathbf{t}_i - \mathbf{t}_j \rVert_2. \tag*{(31)}

We define positive edges P\mathcal{P} (likely within-compartment) and negative edges N\mathcal{N} (likely cross-boundary) by thresholding these discrepancies using per-slide quantiles:

(i,j)∈P⟺dijmorph≤Qα(dmorph)∧dijtopo≤Qα(dtopo)(32)(i,j) \in\mathcal{P} \Longleftrightarrow d_{ij}^{\mathrm{morph}} \le Q_{\alpha}(d^{\mathrm{morph}}) \land d_{ij}^{\mathrm{topo}} \le Q_{\alpha}(d^{\mathrm{topo}}) \tag*{(32)}
(i,j)∈N⟺dijmorph≥Qβ(dmorph)∨dijtopo≥Qβ(dtopo)(33)(i,j) \in\mathcal{N} \Longleftrightarrow d_{ij}^{\mathrm{morph}} \ge Q_{\beta}(d^{\mathrm{morph}}) \lor d_{ij}^{\mathrm{topo}} \ge Q_{\beta}(d^{\mathrm{topo}}) \tag*{(33)}

with α<β\alpha< \beta (e.g., α=0.3\alpha= 0.3, β=0.7\beta= 0.7). This yields weak but effective pseudo-labels for boundary supervision.

Barrier-field loss. Given the barrier map B=ffield(F)B = f_{\mathrm{field}}(F), we compute the traversal cost cijc_{ij} along the straight segment between si\mathbf{s}_i and sj\mathbf{s}_j (Eq. (10) in the main text). We supervise BB by enforcing that positive edges have lower costs than negative edges incident to the same anchor node ii:

Lfield=1∣P∣∑(i,j)∈P1∣N(i)∣∑(i,k)∈N(i)max⁡(0,m+cij−cik),(34)\mathcal{L}_{\mathrm{field}} = \frac{1}{\lvert\mathcal{P} \rvert} \sum_{(i,j)\in\mathcal{P}} \frac{1}{\lvert\mathcal{N}(i)\rvert} \sum_{(i,k)\in\mathcal{N}(i)} \max(0,m+c_{ij}-c_{ik}), \tag*{(34)}

where N(i)={(i,k)∈N}\mathcal{N}(i) = \{(i,k) \in\mathcal{N}\} and m>0m > 0 is a margin. This provides a direct training signal for ffieldf_{\mathrm{field}} and avoids degeneracy of the barrier map.

The barrier field BB is optimized to rank traversal costs on local graph edges: for an anchor spot ii, edges in P\mathcal{P} (likely within the same compartment/state) are enforced to have lower line-integral cost cijc_{ij} than edges in N(i)\mathcal{N}(i) (likely crossing a boundary), up to a margin mm (Eq. (34)). Since cijc_{ij} aggregates BB along the straight segment connecting si\mathbf{s}_i and sj\mathbf{s}_j, the only way to satisfy these inequalities consistently across many anchors is to assign high BB values to spatial locations that are repeatedly traversed by negative edges but rarely by positive edges. These locations correspond to persistent transition regions in the tissue plane (e.g., lumens, stromal interfaces, compartment borders), while homogeneous regions accumulate low BB.

As a result, BB induces a data-driven propagation prior on the spot graph: edges whose connecting paths pass through high-barrier regions receive large cijc_{ij} and are down-weighted, whereas edges staying within low-barrier regions receive small cijc_{ij} and are favored. Converting costs to a neighborhood distribution via qij∝exp⁡(−cij/τb)q_{ij} \propto\exp(-c_{ij}/\tau_b) therefore yields a topology-aware teacher graph that preserves within-compartment connectivity while suppressing cross-boundary leakage. Importantly, this supervision is independent of the GAT attention and does not rely on matching the student; thus the learned field does not trivially collapse to the model’s current attention pattern and provides a stable geometric prior for boundary-aware message passing.

Pseudocode of TIGEM

Due to restrictions on external links, we provide pseudocode for our implementation in the manuscript instead of sharing an anonymous GitHub repository. Following the modular structure of our codebase, we decompose the framework into four components and present pseudocode for each. The topology prior construction is given in Algorithm 1, train barrier field is shown in Algorithm 2 and TIG block details are shown in Algorithm 4, the GSMU algorithm is provided in Algorithm 5, and unseen gene prediction is provided in Algorithm 6. The official code base will be provided after being accepted.

TIGEM implementation and training

Here we provide the implementation details of our TIGEM for reproduction. Generally, our model is implemented based on Pytorch v2.7.

Backbone encoder. We stack L=3L=3 identical TIG blocks. Each block applies Pre-Norm LayerNorm, a multi-head GATv2 layer on the spot graph (H=4H=4 heads, hidden d=512d=512), ELU and dropout (p=0.2p=0.2), followed by a residual projection and a position-wise FFN (GELU, expansion ratio 2×2\times) with a second residual. The topology appears via a KL regularizer.

Node features and graphs. For each slide we concatenate UNI-2 and Virchow2 embeddings. The spot graph is built by kNN→\rightarrowMNN with k=6k=6 on full-resolution pixel coordinates and pruned by a global threshold τ=c⋅median⁡\tau=c\cdot\operatorname{median}

Algorithm 1 Topology prior construction for TIGEM

Require: Spot coordinates {si}i=1N\{\mathbf{s}_i\}_{i=1}^{N}, patch embeddings {xi}i=1N\{\mathbf{x}_i\}_{i=1}^{N}, CellViT cell centroids C={(um,vm)}m=1M\mathcal{C}=\{(u_m,v_m)\}_{m=1}^{M}

Require: Hyperparameters: kk (neighbors), grid size (Hf,Wf)(H_f,W_f), splat bandwidth σ\sigma, thresholds (τdens,τani,τmorph)(\tau_{\mathrm{dens}},\tau_{\mathrm{ani}},\tau_{\mathrm{morph}})

Ensure: Spot graph G=(V,E)\mathcal{G}=(\mathcal{V},\mathcal{E}), positive edges P\mathcal{P}, negative edges N\mathcal{N}

  1. Build spot graph E←MNN⁡({si},k)\mathcal{E}\leftarrow\operatorname{MNN}(\{\mathbf{s}_i\},k) ▷ or Visium 6-neighbor

  2. Rasterize morphology Fmorph←∑i=1NKσ(⋅−si)WxxiF_{\mathrm{morph}}\leftarrow\sum_{i=1}^{N}K_{\sigma}(\cdot-\mathbf{s}_i)W_x\mathbf{x}_i

  3. Compute topology cues from C\mathcal{C}:

  4. density map FdensF_{\mathrm{dens}}; anisotropy map FaniF_{\mathrm{ani}}; nuclei-count map FcntF_{\mathrm{cnt}}

  5. Ftopo←[Fdens∥Fcnt∥Fani]F_{\mathrm{topo}}\leftarrow[F_{\mathrm{dens}}\parallel F_{\mathrm{cnt}}\parallel F_{\mathrm{ani}}]

  6. F←[Fmorph∥Ftopo]∈RC×Hf×WfF\leftarrow[F_{\mathrm{morph}}\parallel F_{\mathrm{topo}}]\in\mathbb{R}^{C\times H_f\times W_f}

  7. Score each edge (i,j)∈E(i,j)\in\mathcal{E} using cue differences:

  8. dijmorph←∥Wmxi−Wmxj∥2d_{ij}^{\mathrm{morph}}\leftarrow\lVert W_m\mathbf{x}_i-W_m\mathbf{x}_j\rVert_2

  9. dijdens←∣Fdens(si)−Fdens(sj)∣d_{ij}^{\mathrm{dens}}\leftarrow\lvert F_{\mathrm{dens}}(\mathbf{s}_i)-F_{\mathrm{dens}}(\mathbf{s}_j)\rvert

  10. dijani←∣Fani(si)−Fani(sj)∣d_{ij}^{\mathrm{ani}}\leftarrow\lvert F_{\mathrm{ani}}(\mathbf{s}_i)-F_{\mathrm{ani}}(\mathbf{s}_j)\rvert

  11. rij←1[dijmorph<τmorph]⋅1[dijdens<τdens]⋅1[dijani<τani]r_{ij}\leftarrow\mathbb{1}[d_{ij}^{\mathrm{morph}}<\tau_{\mathrm{morph}}]\cdot\mathbb{1}[d_{ij}^{\mathrm{dens}}<\tau_{\mathrm{dens}}]\cdot\mathbb{1}[d_{ij}^{\mathrm{ani}}<\tau_{\mathrm{ani}}]

  12. Construct pseudo-label sets

  13. P←{(i,j)∈E:rij=1}\mathcal{P}\leftarrow\{(i,j)\in\mathcal{E}:r_{ij}=1\} ▷ likely within-compartment

  14. N←{(i,j)∈E:rij=0}\mathcal{N}\leftarrow\{(i,j)\in\mathcal{E}:r_{ij}=0\} ▷ likely cross-boundary

  15. return G,P,N,F\mathcal{G},\mathcal{P},\mathcal{N},F

with c=1.5c=1.5; self-loops are removed and the graph is symmetrized.

Training. We optimize the mean squared error on log⁡(1+counts)\log(1+\text{counts}) plus λtopoLtopo\lambda_{\mathrm{topo}}\mathcal{L}_{\mathrm{topo}} with AdamW (lr 10−410^{-4}, weight decay 10−510^{-5}), gradient clipping (5.0), batch size 2 slides, 500 epochs. Weights are Xavier-initialized; we fix random seeds and use deterministic cuDNN settings.

Inference and zero-shot. Given a trained encoder, unseen genes g∗g^* are handled without retraining: compute the ESM2 embedding, project to a gene token, run the cross-attention+FiLM head, and read out Y^⋅,g∗\hat{Y}_{\cdot,g^*}. The topology prior is reused as is.

Experiment Implementation

Running environment The experiments and model training are conducted on two Linux servers. Server 1: Most of the experiments are conducted on the server with the AMD EPYC 7452 32-Core Processor, 503G RAM, and 4 Nvidia A40 48 GB GPUs. Server 2: To speed up the model training, we put the heavy tasks (including Stem model training and inference and TIGEM training) on the server with the AMD EPYC 9354 32-Core Processor, 1.0T RAM, and 1 Nvidia H200 141GB GPU.

Algorithm 2 Training the barrier field branch

Require: Fused feature map FF, spot coords {si}\{\mathbf{s}_i\}, edge sets P,N\mathcal{P},\mathcal{N}, temperature τb\tau_b, margin mm, samples TT

Require: Barrier network ffield(⋅)f_{\mathrm{field}}(\cdot), optimizer OPT, training steps SS

Ensure: Trained barrier field network ffieldf_{\mathrm{field}}

  1. for t=1t=1 to SS do

  2. B←softplus⁡(ffield(F))B\leftarrow\operatorname{softplus}(f_{\mathrm{field}}(F)) ▷ nonnegative barrier map

  3. Lfield←0\mathcal{L}_{\mathrm{field}}\leftarrow0

  4. for all (i,j)∈P(i,j)\in\mathcal{P} do

  5. Sample negatives N(i)={(i,k)∈N}\mathcal{N}(i)=\{(i,k)\in\mathcal{N}\} (or a subset)

  6. cij←LineCost⁡(B,si,sj,T)c_{ij}\leftarrow\operatorname{LineCost}(B,\mathbf{s}_i,\mathbf{s}_j,T)

  7. for all (i,k)∈N(i)(i,k)\in\mathcal{N}(i) do

  8. cik←LineCost⁡(B,si,sk,T)c_{ik}\leftarrow\operatorname{LineCost}(B,\mathbf{s}_i,\mathbf{s}_k,T)

  9. Lfield+=max⁡(0,m+cij−cik)\mathcal{L}_{\mathrm{field}}+=\max(0,m+c_{ij}-c_{ik})

  10. end for

  11. end for

  12. Lfield←Lfield/(∣P∣⋅∣N(i)∣)\mathcal{L}_{\mathrm{field}}\leftarrow\mathcal{L}_{\mathrm{field}}/(|\mathcal{P}|\cdot|\mathcal{N}(i)|)

  13. OPT.zero_grad⁡(); backprop⁡ ∇Lfield; OPT.step()⁡\operatorname{OPT.zero\_grad}();\ \operatorname{backprop}\ \nabla\mathcal{L}_{\mathrm{field}};\ \operatorname{OPT.step()}

  14. end for

  15. return ffieldf_{\mathrm{field}}

Algorithm 3 LINECOST(B,si,sj,T)(B,\mathbf{s}_i,\mathbf{s}_j,T)

Require: Barrier map BB, endpoints si,sj\mathbf{s}_i,\mathbf{s}_j, samples TT

Ensure: Traversal cost cijc_{ij}

  1. ℓij(t)←(1−t)si+tsj\ell_{ij}(t)\leftarrow(1-t)\mathbf{s}_i+t\mathbf{s}_j

  2. {τr}r=1T←\{\tau_r\}_{r=1}^{T}\leftarrow uniform grid in [0,1][0,1]

  3. cij←∥si−sj∥2T∑r=1TB(ℓij(τr))c_{ij}\leftarrow\frac{\lVert\mathbf{s}_i-\mathbf{s}_j\rVert_2}{T}\sum_{r=1}^{T}B(\ell_{ij}(\tau_r))

  4. return cijc_{ij}

Baseline training. This subsection presents the implementation details of the baseline models to guarantee a consistent and fair comparison with TIGEM. All input preprocessing follows the procedures described in § 6.

ST-Net. ST-Net adopts a DenseNet pretrained on ImageNet as its initialization and fine-tunes it on ST data by substituting the final regression layer. In our implementation, we set the learning rate as 10−410^{-4} while maintaining other hyperparameters and the architectural design reported in the original work.

HistoGene. This model employs a Vision Transformer (ViT) to encode each spot-level image patch from the WSI. Following the configuration reported in the original work, we use 4 transformer layers with 16 attention heads, a hidden dimension of 128, and a dropout rate of 0.1. Spot coordinates are projected through a linear embedding layer before being fused with visual features.

THItoGene. THItoGene extracts molecular features

Algorithm 4 TIG Block with Barrier-Field Teacher and Topology-KL

Require: Prev features H(ℓ−1)∈RN×dH^{(\ell-1)} \in\mathbb{R}^{N \times d}; spot graph edge_index; spot coordinates {si}i=1N\{s_i\}_{i=1}^{N}; fused raster map FF; barrier network ffieldf_{\mathrm{field}}; temperature τb\tau_b; samples TT; TopoKL weight λtopo\lambda_{\mathrm{topo}}; task loss Ltask\mathcal{L}_{\mathrm{task}}.

Ensure: Updated features H(ℓ)H^{(\ell)} and total loss L\mathcal{L}.

  1. (Barrier-field teacher) B←softplus⁡(ffield(F))B \gets\operatorname{softplus}(f_{\mathrm{field}}(F)) B∈RHf×WfB \in\mathbb{R}^{H_f \times W_f}, nonnegative For each edge (i,j)∈(i,j) \in edge_index, compute line cost cij←LineCost⁡(B,si,sj,T)c_{ij} \gets\operatorname{LineCost}(B,s_i,s_j,T) by sampling TT points on the segment. Teacher distribution: qij←softmax⁡j∈N(i)(−cij/τb)q_{ij} \gets\operatorname{softmax}_{j \in\mathcal{N}(i)}(-c_{ij}/\tau_b), and we detach it: q~←stopgrad⁡(q)\tilde{q} \gets\operatorname{stopgrad}(q).

  2. (Student attention + TIG update) Z←LN⁡(H(ℓ−1))Z \gets\operatorname{LN}(H^{(\ell-1)})

  3. (Z_{\mathrm{gat}},(eidx,\alpha)) \gets\operatorname{MultiHead\mathchar`-GATv2}(Z,\texttt{edge\_index}) ▹α∈RE×M\triangleright\alpha\in\mathbb{R}^{E \times M}

  4. Zgat←Dropout⁡(ELU⁡(Zgat))Z_{\mathrm{gat}} \gets\operatorname{Dropout}(\operatorname{ELU}(Z_{\mathrm{gat}}))

  5. H~←Proj⁡(H(ℓ−1))+Zgat\tilde{H} \gets\operatorname{Proj}(H^{(\ell-1)}) + Z_{\mathrm{gat}} ▹\triangleright Proj only if dims differ

  6. H(ℓ)←H~+FFN⁡(LN⁡(H~))H^{(\ell)} \gets\tilde{H} + \operatorname{FFN}(\operatorname{LN}(\tilde{H}))

  7. (Topology-KL regularization) Mask non-self: M←{k∣eidx0[k]≠eidx1[k]}M \gets\{k \mid eidx_0[k] \ne eidx_1[k]\}; src←eidx0[M]src \gets eidx_0[M], α←α[M]\alpha\gets\alpha[M].

  8. pedge←mean_heads⁡(α)p_{\mathrm{edge}} \gets\operatorname{mean\_heads}(\alpha)

  9. p←softmax_by_src⁡(pedge,src)p \gets\operatorname{softmax\_by\_src}(p_{\mathrm{edge}},src) ▹\triangleright student probs aligned with (src,dst)(src,dst) Align q~\tilde{q} to current (src,dst)(src,dst) order (same edge list); obtain q~\tilde{q} per source node.

  10. Ltopo(ℓ)←1∣B∣∑i∑j∈N(i)q~ij(log⁡(q~ij+ϵ)−log⁡(pij+ϵ))\mathcal{L}_{\mathrm{topo}}^{(\ell)} \gets\frac{1}{|B|}\sum_i \sum_{j \in\mathcal{N}(i)} \tilde{q}_{ij}\left(\log(\tilde{q}_{ij}+\epsilon)-\log(p_{ij}+\epsilon)\right)

  11. L←Ltask+λtopoLtopo(ℓ)\mathcal{L} \gets\mathcal{L}_{\mathrm{task}}+\lambda_{\mathrm{topo}}\mathcal{L}_{\mathrm{topo}}^{(\ell)}

  12. return H(ℓ),LH^{(\ell)},\mathcal{L}

from each spot’s patch using a dynamic convolution module and an Efficient-Capsule block. Spot coordinates are embedded through a positional encoding module. These visual and positional features are then globally modeled with a ViT to capture long-range spatial relationships. Finally, a GAT layer adaptively aggregates neighborhood information to predict gene expression. Similar to HistoGene, we use 4 transformer layers. Learning rate is set as 1e-5.

BLEEP. BLEEP learns a joint embedding space for histology images and gene expression profiles through a contrastive objective. For each spot, the model retrieves the kk most similar spots from a reference pool and uses their averaged expression as the prediction. In our implementation, a pretrained pathology foundation model serves as the visual encoder, while shallow MLP heads project both image features and gene vectors into the shared space. We used batch size 256 and learning rate 5×10−45 \times10^{-4}. We set the contrastive temperature to 1 and use k=50k=50 retrieved neighbors.

Algorithm 5 GSMu

Require: Node embeddings H∈RN×dH \in\mathbb{R}^{N \times d}; gene embeddings E∈RG×dgE \in\mathbb{R}^{G \times d_g}; projection WeW_e

Ensure: Predictions Y^∈RN×G\hat{Y} \in\mathbb{R}^{N \times G}

  1. Φ←LN⁡(E)We∈RG×d\Phi\gets\operatorname{LN}(E)W_e \in\mathbb{R}^{G \times d} ▹\triangleright align genes to encoder dim

  2. (Cross-attention) For each gene gg: Zg←CrossAttn⁡(q=Φg,K=H,V=H)∈RdZ_g \gets\operatorname{CrossAttn}(q=\Phi_g,K=H,V=H) \in\mathbb{R}^{d}

  3. (FiLM) (γg,βg)←MLP⁡FiLM(Zg)(\gamma_g,\beta_g) \gets\operatorname{MLP}_{\mathrm{FiLM}}(Z_g) with γg≈1,βg≈0\gamma_g \approx1,\beta_g \approx0 at init (tanh-gated)

  4. Shared readout u∈Rdu \in\mathbb{R}^{d}

  5. Y^i,g←uT(γg⊙Hi+βg)\hat{Y}_{i,g} \gets u^{\mathsf{T}}(\gamma_g \odot H_i+\beta_g) (apply Softplus to ensure non-negativity)

  6. return Y^\hat{Y}

Algorithm 6 Zero-Shot Gene Prediction

Require: Unseen gene embedding eg∗∈Rdge_{g_*} \in\mathbb{R}^{d_g}; frozen encoder output HH

Ensure: y^:,g∗∈RN\hat{y}_{:,g_*} \in\mathbb{R}^{N}

  1. Φg∗←LN⁡(eg∗)We\Phi_{g_*} \gets\operatorname{LN}(e_{g_*})W_e

  2. Zg∗←CrossAttn⁡(q=Φg∗,K=H,V=H)Z_{g_*} \gets\operatorname{CrossAttn}(q=\Phi_{g_*},K=H,V=H)

  3. (γg∗,βg∗)←MLP⁡FiLM(Zg∗)(\gamma_{g_*},\beta_{g_*}) \gets\operatorname{MLP}_{\mathrm{FiLM}}(Z_{g_*})

  4. y^i,g∗←uT(γg∗⊙Hi+βg∗)\hat{y}_{i,g_*} \gets u^{\mathsf{T}}(\gamma_{g_*} \odot H_i+\beta_{g_*})

  5. return y^:,g∗\hat{y}_{:,g_*}

TRIPLEX. TRIPLEX integrates information from multiple spatial scales through four modules: a target encoder, a local neighborhood encoder, a global WSI encoder, and a fusion encoder that aggregates their outputs. Following the official setup, each spot image is first embedded with a pretrained pathology foundation model before entering the network. According to the original paper, the APEG module is used in the model. Default settings are used in the benchmarking.

Stem. Stem adopts a Diffusion Transformer (DiT)-based conditional generative model to predict spot-level gene expression. During training, each patch is encoded by a pretrained pathology foundation model, and the resulting embedding is used as the conditioning signal for denoising the gene expression vector. At inference time, Stem generates multiple samples and averages them to obtain the final prediction. We used a batch size of 128 and 5×10−55 \times10^{-5} learning rate with 300K iterations for all experiments.

M2TGLGO. M2TGLGO models gene relationships and spatial information for histology-based spatial gene expression prediction. In our implementation, we follow the architectural design and training strategy reported in the original work and evaluate the model using the same data splits as TIGEM.

STFlow. STFlow employs a flow-based generative framework to predict spatial gene expression from histology images. In our implementation, we follow the network architecture and hyperparameter settings reported in the original work and retrain the model using the same training and testing splits as TIGEM.

MERGE. MERGE integrates histological representations and spatial information for spatial gene expression prediction. In our implementation, we follow the original model architecture and training configuration and evaluate it under the same data splits as TIGEM.

SGN. SGN leverages semantic gene representations to enable zero-shot prediction of unseen genes from histology images. In our implementation, we follow the architecture and training strategy reported in the original work and evaluate SGN under the same SRG 5:1 setting as TIGEM for a direct zero-shot comparison.

iStar. iStar predicts spatial gene expression from histology by leveraging pretrained histology representations and spatial context. In our implementation, we follow the architectural design and training configuration reported in the original work and evaluate the model using the same data splits as TIGEM.

mclSTExp. mclSTExp employs a DenseNet-121 image encoder and a Transformer-based spot encoder with positional encoding to learn a joint embedding space between histology and spatial gene expression through contrastive learning. Gene expression is predicted by similarity-based retrieval and weighted aggregation of the top-kk reference expression profiles. In our implementation, we follow the architectural design and training configuration reported in the original work.

PVMs. We use the official pretrained weights for all PVMs and follow the image preprocessing procedures recommended in their HuggingFace tutorials, including ImageNet mean–std normalization. Following the HEST-1K evaluation protocol, all patch embeddings are reduced to 128 dimensions using PCA. A Random Forest regressor with 100 trees is then used to predict.

Evaluation Metrics

To assess the quality of spatial expression prediction, we employ three established metrics: the Pearson Correlation Coefficient (PCC), Mean Squared Error (MSE), and Structural Similarity Index Measure (SSIM), together with our proposed Graph Spectral Correlation (GSC). All metrics are computed in the log-transformed expression domain to reduce count-scale variability.

For each gene, PCC evaluates how well the predicted expression captures the directional trend of the ground truth across spatial spots, while MSE reflects the average squared deviation between prediction and measurement. Since the predictive difficulty varies substantially across genes, we follow standard practice [4, 45] and summarize PCC at two levels. Specifically, we compute PCC for every gene in a slide, rank all genes by their PCC values, and report the mean PCC over the top 50 and top 200 genes, denoted PCC(50) and PCC(200), respectively.

Formally, given prediction y^i,j\hat{y}_{i,j} and ground truth yi,jy_{i,j} at spot ii for gene jj, PCC and MSE for gene jj are defined as

PCCj=∑i=1n(y^i,j−y^ˉj)(yi,j−yˉj)∑i=1n(y^i,j−y^ˉj)2∑i=1n(yi,j−yˉj)2(35)PCC_j = \frac{\sum_{i=1}^{n}(\hat{y}_{i,j}-\bar{\hat{y}}_j)(y_{i,j}-\bar{y}_j)}{\sqrt{\sum_{i=1}^{n}(\hat{y}_{i,j}-\bar{\hat{y}}_j)^2}\sqrt{\sum_{i=1}^{n}(y_{i,j}-\bar{y}_j)^2}} \tag*{(35)}
MSEj=1n∑i=1n(yi,j−y^i,j)2.(36)MSE_j = \frac{1}{n}\sum_{i=1}^{n}(y_{i,j}-\hat{y}_{i,j})^2. \tag*{(36)}

For a slide with mm genes, we then compute:

PCC(50)=150∑j∈top-50PCCj,(37)PCC(50) = \frac{1}{50}\sum_{j \in\mathrm{top\text{-}50}} PCC_j, \tag*{(37)}
PCC(200)=1200∑j∈top-200PCCj,(38)PCC(200) = \frac{1}{200}\sum_{j \in\mathrm{top\text{-}200}} PCC_j, \tag*{(38)}
MSE=1m∑j=1mMSEj.(39)MSE = \frac{1}{m}\sum_{j=1}^{m} MSE_j. \tag*{(39)}

In addition to these spot-wise metrics, we employ SSIM [34] as an established measure of spatial structural similarity. For each gene, the predicted and ground-truth expression values are mapped onto the same two-dimensional spatial lattice, and SSIM evaluates their agreement in local intensity, contrast, and spatial structure. We report SSIM(50) as the mean SSIM over the 50 genes with the highest PCC values:

SSIM(50)=150∑j∈top-50SSIM(Y^j,Yj),(40)SSIM(50) = \frac{1}{50}\sum_{j \in\mathrm{top\text{-}50}} SSIM\left(\hat{\mathbf{Y}}_j,\mathbf{Y}_j\right), \tag*{(40)}

where Y^j\hat{\mathbf{Y}}_j and Yj\mathbf{Y}_j denote the predicted and ground-truth two-dimensional spatial expression maps for gene jj, respectively. SSIM is used exclusively for evaluation and is independent of both the TIGEM training objective and the proposed GSC metric.

While PCC and MSE primarily quantify spot-wise numerical agreement, and SSIM provides an established image-based assessment of local spatial structure, they do not explicitly characterize expression patterns with respect to the underlying spatial graph of ST spots. For spatial transcriptomics, such graph-structured organization is particularly relevant for capturing spatial domains and region-specific expression patterns. To complement these established metrics, we introduce GSC, which measures the consistency between predicted and ground-truth expression patterns in the graph spectral domain.

Graph Spectral Correlation

We propose Graph Spectral Correlation (GSC), a metric that serves as a supplementary for Pearson Correlation Coefficient (PCC). GSC could capture the similarity of the global structure between predicted spatial transcriptomic and ground truth.

Firstly, for one sample, we pick one gene gg to measure the quality of prediction. We define the predicted signals as xgx_g and the ground truth as ygy_g.

PCC is widely used to measure the quality of spatial transcriptomic prediction, defined as:

PCCg=⟨xg,yg⟩∥xg∥∥yg∥=xgTIyg∥xg∥∥yg∥=xgTIygxgTIxgygTIyg(41)PCC_g = \frac{\langle x_g,y_g\rangle}{\lVert x_g\rVert\lVert y_g\rVert} = \frac{x_g^{\mathsf{T}} I y_g}{\lVert x_g\rVert\lVert y_g\rVert} = \frac{x_g^{\mathsf{T}} I y_g}{\sqrt{x_g^{\mathsf{T}} I x_g}\sqrt{y_g^{\mathsf{T}} I y_g}} \tag*{(41)}

Our GSC is computed by measuring the cosine similarity between the prediction’s and the label’s spectrum after graph Fourier transform. We first construct the normalized graph Laplacian

L=I−D−1/2AD−1/2L = I - D^{-1/2} A D^{-1/2}

and perform eigendecomposition to obtain the graph Fourier basis. The eigenmodes are ordered according to ascending eigenvalues. From the eigendecomposition of the normalized graph Laplacian, we obtain an orthonormal matrix

U=[u0,u1,…,un−1].U = [u_0,u_1,\ldots,u_{n-1}].

We discard the trivial zero-frequency mode and retain the spectral components corresponding to modes 1 through kk (kk is automatically selected based on the cumulative energy proportion) to compute the final similarity score.

Uk=[u1,…,uk].U_k = [u_1,\ldots,u_k].

Then, for a graph signal xx, its truncated graph Fourier spectrum is given by UkTxU_k^{\mathsf{T}}x.

Hence, for a gene gg and a truncated top kk spectrum, our GSC is defined as:

GSCg,k=⟨UkTxg,UkTyg⟩∥UkTxg∥∥UkTyg∥=xgTUkUkTygxgTUkUkTxgygTUkUkTyg(42)GSC_{g,k} = \frac{\langle U_k^{\mathsf{T}}x_g,U_k^{\mathsf{T}}y_g\rangle}{\lVert U_k^{\mathsf{T}}x_g\rVert\lVert U_k^{\mathsf{T}}y_g\rVert} = \frac{x_g^{\mathsf{T}}U_kU_k^{\mathsf{T}}y_g}{\sqrt{x_g^{\mathsf{T}}U_kU_k^{\mathsf{T}}x_g}\sqrt{y_g^{\mathsf{T}}U_kU_k^{\mathsf{T}}y_g}} \tag*{(42)}

Similarly to PCC, the final GSC-measure is the mean value of GSC across genes.

Mathematical Proof

To reveal our GSC’s capability to consider the spatial pattern while PCC only evaluates node-wise similarity, we give a simple proof here:

We firstly define

K:=UkUkT={Kij}i,j=1n(43)K := U_kU_k^{\mathsf{T}} = \{K_{ij}\}_{i,j=1}^{n} \tag*{(43)}

so the GSC can be rewritten as

GSCg,k=xgTKygxgTKxgygTKyg=∑i=1n∑j=1nKijxg,iyg,j∑i=1n∑j=1nKijxg,ixg,j∑i=1n∑j=1nKijyg,iyg,j.(44)GSC_{g,k} = \frac{x_g^{\mathsf{T}}K y_g}{\sqrt{x_g^{\mathsf{T}}Kx_g}\sqrt{y_g^{\mathsf{T}}Ky_g}} = \frac{\sum_{i=1}^{n}\sum_{j=1}^{n}K_{ij}x_{g,i}y_{g,j}}{\sqrt{\sum_{i=1}^{n}\sum_{j=1}^{n}K_{ij}x_{g,i}x_{g,j}}\sqrt{\sum_{i=1}^{n}\sum_{j=1}^{n}K_{ij}y_{g,i}y_{g,j}}}. \tag*{(44)}

Here, each element of KK is given by

Kij=∑m=1kui(m)uj(m),K_{ij} = \sum_{m=1}^{k}u_i^{(m)}u_j^{(m)},

where ui(m)u_i^{(m)} denotes the ii-th element of the mm-th eigenvector in UkU_k. It could also be noted as Uk,imU_{k,im}.

Proposition: K=UkUkTK = U_kU_k^{\mathsf{T}} is not a diagonal matrix, given that:

  1. Uk∈Rn×kU_k \in\mathbb{R}^{n\times k} consists of kk columns selected from an orthonormal matrix U∈Rn×nU \in\mathbb{R}^{n\times n} (1≤k<n−11 \le k < n-1) (excluding the DC component u0u_0), where UU is the Graph Fourier basis of a connected undirected graph.

  2. nn is the number of nodes in the connected undirected graph with adjacency matrix AA and degree matrix D=diag⁡(d1,…,dn)D = \operatorname{diag}(d_1,\ldots,d_n), where di≥1d_i \ge1 for all i∈{1,…,n}i \in\{1,\ldots,n\}.

Proof by contradiction: Let r1T,r2T,…,rnTr_1^{\mathsf{T}},r_2^{\mathsf{T}},\ldots,r_n^{\mathsf{T}} denote the row vectors of UkU_k. We can represent UkU_k as

Uk=[r1Tr2T⋮rnT]U_k = \begin{bmatrix} r_1^{\mathsf{T}}\\ r_2^{\mathsf{T}}\\ \vdots\\ r_n^{\mathsf{T}} \end{bmatrix}

Therefore, KK can be rewritten by the inner product of its row vectors:

Kij=riTrj=⟨ri,rj⟩K_{ij} = r_i^{\mathsf{T}}r_j = \langle r_i,r_j\rangle

Assume KK is a diagonal matrix. This implies that all off-diagonal elements are zero, so we can rewrite as

⟨ri,rj⟩=0(∀i≠j)\langle r_i,r_j\rangle= 0 \quad(\forall i \ne j)

Under this assumption, the set {r1,r2,…,rn}\{r_1,r_2,\ldots,r_n\} must be an orthogonal set of vectors.

Since rank⁡(K)=rank⁡(UkUkT)=rank⁡(Uk)=k\operatorname{rank}(K) = \operatorname{rank}(U_kU_k^{\mathsf{T}}) = \operatorname{rank}(U_k) = k, a diagonal matrix with rank kk must have exactly kk non-zero diagonal elements. Consequently, exactly kk rows of UkU_k are non-zero vectors, and the remaining n−kn-k rows must zero vectors. Without loss of generality, by reordering the nodes, we can partition UkU_k as

Uk=[Vk×k0(n−k)×k]U_k=\begin{bmatrix} V_{k\times k} \\ \mathbf{0}_{(n-k)\times k} \end{bmatrix}

where VV is a k×kk \times k non-singular submatrix.

Consider the full orthogonal matrix U=[u0,Uk,Urest]U=[u_0,U_k,U_{\mathrm{rest}}]. We partition the constant vector u0u_0 accordingly:

U=[u0,topVUrest,topu0,bottom0Urest,bottom]U=\begin{bmatrix} u_{0,\mathrm{top}} & V & U_{\mathrm{rest,top}} \\ u_{0,\mathrm{bottom}} & \mathbf{0} & U_{\mathrm{rest,bottom}} \end{bmatrix}

where u0,top∈Rku_{0,\mathrm{top}}\in\mathbb{R}^k. Because the columns of an orthogonal matrix must be mutually orthogonal, u0u_0 must be orthogonal to every column in UkU_k:

u0⊤Uk=0⊤⟹[u0,top⊤,u0,bottom⊤][V0]=0⊤u_0^\top U_k=\mathbf{0}^\top\Longrightarrow[u_{0,\mathrm{top}}^\top,u_{0,\mathrm{bottom}}^\top]\begin{bmatrix}V\\\mathbf{0}\end{bmatrix}=\mathbf{0}^\top

Expanding this:

u0,top⊤V=0⊤u_{0,\mathrm{top}}^\top V=\mathbf{0}^\top

Since VV is a non-singular matrix of rank kk,

u0,top=0u_{0,\mathrm{top}}=\mathbf{0}

The result u0,top=0u_{0,\mathrm{top}}=\mathbf{0} implies that the first kk components of the constant vector u0u_0 are zero. However, for a connected graph, the unit eigenvector u0u_0 corresponding to the smallest eigenvalue λ0=0\lambda_0=0 is unique, and the corresponding eigenvector u0u_0 satisfies

Lu0=0⟹D−1/2AD−1/2u0=u0.Lu_0=0 \Longrightarrow D^{-1/2}AD^{-1/2}u_0=u_0.

Writing component wise, for every every pair (i,j)(i,j) such that Aij>0A_{ij}>0:

u0,idi=u0,jdj⟹u0,i=cdi,∀i,\frac{u_{0,i}}{\sqrt{d_i}}=\frac{u_{0,j}}{\sqrt{d_j}}\Longrightarrow u_{0,i}=c\sqrt{d_i},\quad\forall i,

while cc is a constant. After normalization, the absolute value of its ii-th component is given by:

∣u0,i∣=di∑j=1ndj\lvert u_{0,i}\rvert=\frac{\sqrt{d_i}}{\sqrt{\sum_{j=1}^{n}d_j}}

The degree of each node must satisfy di≥1d_i\geq1. Consequently, for every node ii, we have:

∣u0,i∣>0⟹u0,i≠0\lvert u_{0,i}\rvert>0\Longrightarrow u_{0,i}\neq0

This directly contradicts the requirement u0,top=0u_{0,\mathrm{top}}=\mathbf{0} obtained from our assumption. Hence, UkU_k cannot have only kk non-zero rows. Similarly, we can also prove that UkU_k cannot have only k′<kk'<k non-zero rows. The number of non-zero row vectors mm must satisfy m>km>k.

In a kk-dimensional space Rk\mathbb{R}^k, the maximum number of mutually orthogonal non-zero vectors is kk. Since we have m>km>k non-zero row vectors rir_i in Rk\mathbb{R}^k, these vectors must be linearly dependent and cannot be mutually orthogonal. Therefore, the assumption is false. There exists at least one pair i≠ji\neq j such that ⟨ri,rj⟩≠0\langle r_i,r_j\rangle\neq0, meaning KK contains off-diagonal non-zero elements. Thus, KK is not a diagonal matrix. ■

Now we have proved that KK is not diagonal. Revisiting Eq. (41), we can find that PCC’s use a II matrix which means for all ii, PCC’s calculation only compares xix_i and yiy_i. This preserves the strict matching among spot-pairs, making each spot exactly the same influence to the overall calculated relationship. On the other hand, non-diagonal KK brings un-matching pairs xix_i and yjy_j to GSC’s calculation. This type of choice enables more spatial-induced weights in computation. Since our spectrum picking from graph Fourier transform keeps low-frequency, which captures relatively large-scale oscillation. The GSC focuses more on large-scale boundaries and borders across regions, which is closely related to the former proved spatial weighted measurement.

Considering the lack of attention on region borders from PCC’s universal equal weighting, the proposed GSC could serve as a meaningful complementary metric. It avoids neglecting critical boundaries and local structures on graph as they often get averaged in PCC calculation. Combining these two metrics as a structural quality benchmark could examine both the global numeric relation performance and the significant-regional pattern awareness of models.

Biological Interpretation

In spatial transcriptomics, expression level is not independent but spatially autocorrelated, forming morphologically distinct clusters of high or low expression. This spatial co-expression phenomenon often leads to different features at the tissue level. Spatial expression pattern refers to the systematic distribution of a single gene across the spatial domain of a tissue or sample. It stresses the regional feature of gene expression in space. This concept is used to describe the overall spatial organization of gene expression shaped by tissue structure, functional compartments, or local microenvironments. Spatial expression patterns are largely shaped by tissue-scale spatial organization such as anatomical compartmentalization and developmental or pathological boundaries, and thus reflect a global property of gene expression rather than a point-wise characteristic.

Considering the overly strict point-wise matching imposed by the definition of PCC across individual sequencing spots, its adaptability to spatial expression patterns is easily weakened by local outliers. With reduced pattern information loss caused by local mismatches, our GSC stresses more in the quantification of spatial gene express pattern in sample level. Therefore, GSC more accurately reflects the global characteristics of spatial gene expression.

Additional biomarker visualization

As we mentioned in main § 4.5, we further visualized the cancer marker AZGP1 in the MEND dataset (MEND146) and the cardiomyocyte marker gene ANKRD in the HEART dataset (MISC142). The results are provided in Figure 5, which show that TIGEM performs well on different marker genes.

Visualization of biomarker expression prediction across methods

Figure 5. Visualization of biomarker expression prediction across methods. Top shows the prediction of prostate cancer marker AZGP1 on the MEND dataset (MEND146). Bottom shows the prediction of cardiomyocyte marker ANKRD1 on the HEART dataset (MISC142).

SGN zero-shot prediction benchmarking

To further evaluate TIGEM against existing zero-shot histology-to-ST methods, we compare it with SGN under the same SRG 5:1 setting across all three datasets. As shown in Table 7, TIGEM consistently outperforms SGN across all datasets and evaluation metrics. The improvement is particularly pronounced on COAD, where TIGEM increases PCC from 0.527 to 0.639 and GSC@90% from 0.544 to 0.687, while reducing MSE from 1.256 to 0.973. Consistent improvements are also observed on MEND and HEART. Although the absolute zero-shot performance on HEART remains relatively low for both methods, TIGEM still consistently improves over SGN. These results demonstrate that combining gene-semantic conditioning with topology-aware spatial modeling provides additional benefits for unseen-gene prediction.

MethodHEART (MISC142)HEART (MISC142)HEART (MISC142)COAD (MISC36)COAD (MISC36)COAD (MISC36)MEND (MEND146)MEND (MEND146)MEND (MEND146)
MSE ↓\downarrowPCC(all) ↑\uparrowGSC@90% ↑\uparrowMSE ↓\downarrowPCC(all) ↑\uparrowGSC@90% ↑\uparrowMSE ↓\downarrowPCC(all) ↑\uparrowGSC@90% ↑\uparrow
SGN0.304.0030.304_{.003}0.087.0070.087_{.007}0.085.0030.085_{.003}1.256.0021.256_{.002}0.527.0040.527_{.004}0.544.0050.544_{.005}0.435.0030.435_{.003}0.266.0060.266_{.006}0.284.0050.284_{.005}
TIGEM0.265.0050.265_{.005}0.107.0040.107_{.004}0.109.0050.109_{.005}0.973.0050.973_{.005}0.639.0060.639_{.006}0.687.0090.687_{.009}0.327.0070.327_{.007}0.312.0050.312_{.005}0.328.0060.328_{.006}

Table 7. Zero-shot comparison between TIGEM and SGN under the SRG 5:1 setting. Best results in each column are highlighted with red backgrounds.

Additional HEART dataset in zero-shot evidence experiment

Here we show the zero-shot evidence experiment on the HEART dataset.

Effect of hyperparameters and model scale

We next analyzed the impact of key hyperparameters, including the temperature τ\tau, the KL weight λtopo\lambda_{topo}, and the number of GAT layers LL in the TIG module. As shown in Figure 4, lowering the temperature (sharper topology prior) or increasing λtopo\lambda_{topo} consistently improves model performance, supporting the importance of the topology prior for guiding spatial prediction.

TIGEM performance with different hyperparameter values on the HEART dataset

Figure 4. TIGEM performance with different hyperparameter values on the HEART dataset MISC142.

We also assessed model scaling by varying the number of GAT layers in the TIG module. As reported in Table 9, moderate increases in depth improve accuracy, but performance plateaus once the model reaches 3–5 blocks, indicating limited benefit from further parameter growth.

TIG Block No.Params.MSE ↓\downarrowPCC (50) ↑\uparrowPCC(200) ↑\uparrowGSC@90% ↑\uparrow
122M0.302.0020.302_{.002}0.522.0090.522_{.009}0.360.0150.360_{.015}0.210.0050.210_{.005}
226M0.300.0280.300_{.028}0.532.0190.532_{.019}0.371.0050.371_{.005}0.223.0130.223_{.013}
330M0.291.0160.291_{.016}0.552.0100.552_{.010}0.381.0240.381_{.024}0.230.0010.230_{.001}
539M0.292.0210.292_{.021}0.549.0140.549_{.014}0.375.0170.375_{.017}0.232.0130.232_{.013}
1060M0.299.0060.299_{.006}0.546.0100.546_{.010}0.375.0040.375_{.004}0.225.0080.225_{.008}

Table 9. Effect of TIG block number on spatial gene expression prediction (MISC142).

Computational Cost Comparison

Table 10, Table 11, and Table 12 provide a detailed comparison of computational cost between TIGEM and all baseline models, measured on a single-slide sample for each fold in each dataset. All timing experiments are run on the Nvidia A40 GPU for fairness. The table reports model parameter counts as well as training and inference times. Training time for TIGEM already includes topology prior calculation and patch embedding generation. Both times are reported in seconds. Training time corresponds to the duration required for each model to reach convergence (or early stopping), while inference time is reported only for Stem, as its DiT-based generative architecture incurs substantial computational overhead during prediction.

Model# ParamsTraining time (sec)Inference time (sec)
ST-Net7.5M2.12×1042.12 \times10^{4}-
HistoGene73.2M6769-
THItoGene237M6180-
BLEEP24.3M1.59×1041.59 \times10^{4}-
TRIPLEX23M2.32×1042.32 \times10^{4}-
Stem37.5M2.06×1052.06 \times10^{5}7.55×1047.55 \times10^{4}
TIGEM30M5806-

Table 10. Computation cost benchmarking on HEART dataset

Model# ParamsTraining time (sec)Inference time (sec)
ST-Net7.5M2.45×1042.45 \times10^{4}-
HistoGene73.2M3552-
THItoGene237M7095-
BLEEP24.3M3.42×1043.42 \times10^{4}-
TRIPLEX23M2.96×1042.96 \times10^{4}-
Stem37.5M2.06×1052.06 \times10^{5}1.26×1051.26 \times10^{5}
TIGEM30M6147-

Table 11. Computation cost benchmarking on COAD dataset

Model# ParamsTraining time (sec)Inference time (sec)
ST-Net7.5M2.21×1042.21 \times10^{4}-
HistoGene73.2M4508-
THItoGene237M4876-
BLEEP24.3M2.64×1042.64 \times10^{4}-
TRIPLEX23M1.82×1041.82 \times10^{4}-
Stem37.5M2.07×1052.07 \times10^{5}6.08×1046.08 \times10^{4}
TIGEM30M6454-

Table 12. Computation cost benchmarking on MEND dataset

Benefiting from pre-generated patch embeddings and cached topology priors, TIGEM does not need to train the image feature extractor from scratch thus achieves significantly faster training speed than most of the models across all dataset scales. Notably, Stem requires substantially longer training. Each training takes approximately two to three days, which makes full cross-validation infeasible.

SettingMSE ↓\downarrowPCC (All) ↑\uparrowGSC@90% ↑\uparrow
SRG 5:10.265.0050.265_{.005}0.107.0040.107_{.004}0.109.0050.109_{.005}
Random0.725.0030.725_{.003}0.048.0070.048_{.007}0.053.0040.053_{.004}
One-hot0.748.0020.748_{.002}0.042.0040.042_{.004}0.050.0030.050_{.003}

Table 8. Justification of the feasibility of strict Gtest∩Gtrain=∅G_{\mathrm{test}} \cap G_{\mathrm{train}} = \varnothing inference on HEART.

References

  1. [1]Takuro Arimura, J Martijn Bos, Akinori Sato, Toru Kubo, Hiroshi Okamoto, Hirofumi Nishi, Haruhito Harada, Yoshinori Koga, Mousumi Moulik, Yoshinori L Doi, et al. Cardiac ankyrin repeat protein gene (ankrd1) mutations in hypertrophic cardiomyopathy. Journal of the American College of Cardiology, 54(4):334–342, 2009. 6DOI
  2. [2]Richard J Chen, Tong Ding, Ming Y Lu, Drew FK Williamson, Guillaume Jaume, Bowen Chen, Andrew Zhang, Daniel Shao, Andrew H Song, Muhammad Shaban, et al. Towards a general-purpose foundation model for computational pathology. Nature Medicine, 2024. 2, 3, 6, 7DOI
  3. [3]Yuqi Cheng, Boshuai Zhang, Chandra Sekhar Reddy Edula, Mo Sun, Ziqi Zhang, and Xiuw ei Zhang. Mixture-of-residuals meets llm-semantic gene conditioning: Interpretable spatial transcriptomic prediction from h&e images. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2, pages 10716–10727, 2026. 2DOI
  4. [4]Youngmin Chung, Ji Hun Ha, Kyeong Chan Im, and Joo Sang Lee. Accurate spatial gene expression prediction by integrating multi-resolution features. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11591–11600, 2024. 1, 2, 5, 6arxiv.org/abs/2403.07592
  5. [5]Ofer Elhanani, Raz Ben-Uri, and Leaat Keren. Spatial profiling technologies illuminate the tumor microenvironment. Cancer Cell, 41(3):404–420, 2023. 1DOI
  6. [6]Andrew Erickson, Mengxiao He, Emelie Berglund, Maja Marklund, Reza Mirzazadeh, Niklas Schultz, Linda Kvastad, Alma Andersson, Ludvig Bergenstråhle, Joseph Bergenstråhle, et al. Spatially resolved clonal copy number alterations in benign and malignant tissue. Nature, 608(7922):360–367, 2022. 5DOI
  7. [7]Aniruddha Ganguly, Debolina Chatterjee, Wentao Huang, Jie Zhang, Alisa Yurovsky, Travis Steele Johnson, and Chao Chen. Merge: Multi-faceted hierarchical graph-based gnn for gene expression prediction from whole slide histopathology images. In 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 15611–15620. IEEE, 2025. 6arxiv.org/abs/2412.02601
  8. [8]Bryan He, Ludvig Bergenstråhle, Linnea Stenbeck, Abubakar Abid, Alma Andersson, Åke Borg, Jonas Maaskola, Joakim Lundeberg, and James Zou. Integrating spatial gene expression and breast tumour morphology via deep learning. Nature biomedical engineering, 4(8):827–834, 2020. 1, 2, 6DOI
  9. [9]Cody N Heiser, Alan J Simmons, Frank Revetta, Eliot T McKinley, Marisol A Ramirez-Solano, Jiawei Wang, Harsimran Kaur, Justin Shao, Gregory D Ayers, Yu Wang, et al. Molecular cartography uncovers evolutionary and microenvironmental dynamics in sporadic colorectal tumors. Cell, 186(25):5620–5637, 2023. 5DOI
  10. [10]Fabian Hörst, Moritz Rempe, Lukas Heine, Constantin Seibold, Julius Keyl, Giulia Baldini, Selma Ugurel, Jens Siveke, Barbara Grünwald, Jan Egger, et al. Cellvit: Vision transformers for precise cell segmentation and classification. Medical Image Analysis, 94:103143, 2024. 4, 1DOI
  11. [11]Tinglin Huang, Tianyu Liu, Mehrtash Babadi, Wengong Jin, and Rex Ying. Scalable generation of spatial transcriptomics from histology images via whole-slide flow matching. arXiv preprint arXiv:2506.05361, 2025. 1, 6arxiv.org/abs/2506.05361
  12. [12]Tinglin Huang, Tianyu Liu, Mehrtash Babadi, Rex Ying, and Wengong Jin. Spath: a generative foundation model for integrating spatial transcriptomics and whole-slide images. NPJ Digital Medicine, 8(1):659, 2025. 1DOI
  13. [13]Guillaume Jaume, Paul Doucet, Andrew H. Song, Ming Y. Lu, Cristina Almagro-Perez, Sophia J. Wagner, Anurag J. Vaidya, Richard J. Chen, Drew F. K. Williamson, Ahrong Kim, and Faisal Mahmood. Hest-1k: A dataset for spatial transcriptomics and histology image analysis. In Advances in Neural Information Processing Systems, 2024. 4, 5, 1arxiv.org/abs/2406.16192
  14. [14]Yuran Jia, Junliang Liu, Li Chen, Tianyi Zhao, and Yadong Wang. Thitogene: a deep learning method for predicting spatial transcriptomics from histological images. Briefings in Bioinformatics, 25(1), 2023. 6DOI
  15. [15]Kazumasa Kanemaru, James Cranley, Daniele Muraro, Antonio MA Miranda, Siew Yen Ho, Anna Wilbrey-Clark, Jan Patrick Pett, Krzysztof Polanski, Laura Richardson, Monika Litvinukova, et al. Spatially resolved multiomics of human cardiac niches. Nature, 619(7971):801–810, 2023. 5DOI
  16. [16]Ludvig Larsson, Jonas Frisén, and Joakim Lundeberg. Spatially resolved transcriptomics adds a new dimension to genomics. Nature methods, 18(1):15–18, 2021. 1DOI
  17. [17]Zeming Lin, Halil Akin, Roshan Rao, Brian Hie, Zhongkai Zhu, Wenting Lu, Nikita Smetanin, Allan dos Santos Costa, Maryam Fazel-Zarandi, Tom Sercu, Sal Candido, et al. Language models of protein sequences at the scale of evolution enable accurate structure prediction. bioRxiv, 2022. 2
  18. [18]Zeming Lin, Halil Akin, Roshan Rao, Brian Hie, Zhongkai Zhu, Wenting Lu, Nikita Smetanin, Robert Verkuil, Ori K abeli, Yaniv Shmueli, et al. Evolutionary-scale prediction of atomic-level protein structure with a language model. Science, 379(6637):1123–1130, 2023. 3DOI
  19. [19]Ming Y Lu, Bowen Chen, Drew FK Williamson, Richard J Chen, Ivy Liang, Tong Ding, Guillaume Jaume, Igor Odintsov, Long Phi Le, Georg Gerber, et al. A visual-language foundation model for computational pathology. Nature Medicine, 30:863–874, 2024. 2, 6, 7DOI
  20. [20]Hiren Madhu, João Felipe Rocha, Tinglin Huang, Siddharth Viswanath, Smita Krishnaswamy, and Rex Ying. Heist: a graph foundation model for spatial transcriptomics and proteomics data. In International Conference on Learning Representations, pages 65453–65476, 2026. 2pubmed.ncbi.nlm.nih.gov/41040798
  21. [21]Wenwen Min, Zhicheng Shi, Jun Zhang, Jun Wan, and Changmiao Wang. Multimodal contrastive learning for spatial gene expression prediction using histology images. Briefings in Bioinformatics, 25(6):bbae551, 2024. 1, 6arxiv.org/abs/2407.08216
  22. [22]Jeffrey R Moffitt, Emma Lundberg, and Holger Heyn. The emerging landscape of spatial profiling technologies. Nature Reviews Genetics, 23(12):741–759, 2022. 1DOI
  23. [23]Lambda Moses and Lior Pachter. Museum of spatial transcriptomics. Nature methods, 19(5):534–546, 2022. 1
  24. [24]Michelle Faria de Oliveira, Juan Pablo Romero, Mei Chung, Stephen R Williams, Andrew D Gottscho, Anushka Gupta, Susan E Pilipauskas, Seayar Mohabbat, Nandhini Raman, David J Sukovich, et al. High-definition spatial transcriptomic profiling of immune cell populations in colorectal cancer. Nature Genetics, pages 1–12, 2025. 1
  25. [25]Minxing Pang, Kenong Su, and Mingyao Li. Leveraging information in spatial transcriptomics to predict super-resolution gene expression from histology images. BioRxiv, pages 2021–11, 2021. 1, 2, 6DOI
  26. [26]Kathryn L Penney, Fredrick R Schumacher, Peter Kraft, Lorelei A Mucci, Howard D Sesso, Jing Ma, Yuxin Niu, Jit Kong Cheong, David J Hunter, Meir J Stampfer, et al. Association of klk3 (psa) genetic variants with prostate cancer risk and psa levels. Carcinogenesis, 32(6):853–859, 2011. 6DOI
  27. [27]Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. In Proceedings of the AAAI conference on artificial intelligence, 2018. 4arxiv.org/abs/1709.07871
  28. [28]Anjali Rao, Dalia Barkley, Gustavo S França, and Itai Yanai. Exploring tissue architecture using spatial transcriptomics. Nature, 596(7871):211–220, 2021. 1DOI
  29. [29]Charlie Saillard, Rodolphe Lenoir, Felipe Llinares-López, Zelda Mariet, David Cahané, Eric Durand, and Jean-Philippe Vert. H-optimus-0, 2024. 2
  30. [30]Hang Shi, Changxi Chi, Peng Wan, Daoqiang Zhang, and Wei Shao. Multi-modal topology-embedded graph learning for spatially resolved genes prediction from pathology images with prior gene similarity information. In 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 20810–20819. IEEE, 2025. 1, 2
  31. [31]Srilakshmi Srinivasan, Thomas Kryza, Nathalie Bock, Brian WC Tse, Kamil A Sokolowski, Panchadasaram Janaththani, Achala Fernando, Leire Moya, Carson Stephens, Ying Dong, et al. A psa snp associates with cellular function and clinical outcome in men with prostate cancer. Nature communications, 15(1):9587, 2024. 6
  32. [32]Patrik L Ståhl, Fredrik Salmén, Sanja Vickovic, Anna Lundmark, José Fernández Navarro, Jens Magnusson, Stefania Giacomello, Michaela Asp, Jakub O Westholm, Mikael Huss, et al. Visualization and analysis of gene expression in tissue sections by spatial transcriptomics. Science, 353 (6294):78–82, 2016. 1DOI
  33. [33]Eugene Vortonsov, Alican Bozkurt, Adam Casson, George Shaikovski, Michal Zelechowski, Kristen Severson, Eric Zimmermann, James Hall, Neil Tenenholtz, Nicolo Fusi, Ellen Yang, Philippe Mathieu, Alexander van Eck, Donghun Lee, Julian Viret, Eric Robert, Yi Kan Wang, Jeremy D. Kunz, Matthew C. H. Lee, Jan H. Bernhard, Ran A. Godrich, Gerard Oakley, Ewan Millar, Matthew Hanna, Hannah Wen, Juan A. Retamero, William A. Moye, Razik Yousfi, Christopher Kanan, David S. Klimstra, Brandon Rothrock, Siqi Liu, and Thomas J. Fuchs. A foundation model for clinical-grade computational pathology and rare cancers detection. Nature Medicine, 2024. 2, 3, 6, 7
  34. [34]Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simonc​​elli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600–612, 2004. 5pubmed.ncbi.nlm.nih.gov/15376593
  35. [35]Ru M Wen, Zhengyuan Qiu, G Edward W Marti, Eric E Peterson, Fernando Jose Garcia Marques, Abel Bermudez, Yi Wei, Rosalie Nolley, Nathan Lam, Alex LaPat Polasko, et al. Azgp1 deficiency promotes angiogenesis in prostate cancer. Journal of translational medicine, 22(1):383, 2024. 6
  36. [36]Ronald Xie, Kuan Pang, Sai Chung, Catia Perciani, Sonya MacParland, Bo Wang, and Gary Bader. Spatially resolved gene expression prediction from histology images via bi-modal contrastive learning. Advances in Neural Information Processing Systems, 36:70626–70637, 2023. 2, 5, 6DOI
  37. [37]Hanwen Xu, Naoto Usuyama, Jaspreet Bagga, Sheng Zhang, Rajesh Rao, Tristan Naumann, Cliff Wong, Zelelem Gero, Javier González, Yu Gu, et al. A whole-slide foundation model for digital pathology from real-world data. Nature, 630(8015):181–188, 2024. 6, 7DOI
  38. [38]Wen Yan, Peihua Wang, Chun Xia Zhao, Jiarong Tang, Xiao Xiao, and Dao Wen Wang. Decorin gene delivery inhibits cardiac fibrosis in spontaneously hypertensive rats by modulation of transforming growth factor-β/smad and p38 mitogen-activated protein kinase signaling pathways. Human gene therapy, 20(10):1190–1200, 2009. 6DOI
  39. [39]Yan Yang, Md Zakir Hossain, Eric A Stone, and Shafin Rahman. Exemplar guided deep neural network for spatial transcriptomics analysis. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 5039–5048, 2023. 1, 2arxiv.org/abs/2210.16721
  40. [40]Yan Yang, Md Zakir Hossain, Xuesong Li, Shafin Rahman, and Eric Stone. Spatial transcriptomics analysis of zero-shot gene expression prediction. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 492–502. Springer, 2024. 2, 7arxiv.org/abs/2401.14772
  41. [41]Yuansong Zeng, Zhuoyi Wei, Weijang Yu, Rui Yin, Yuchen Yuan, Bingling Li, Zhonghui Tang, Yutong Lu, and Yuedong Yang. Spatial transcriptomics prediction from histology jointly through transformer and graph neural networks. Briefings in Bioinformatics, 23(5), 2022. 1, 2DOI
  42. [42]Yuansong Zeng, Yujie Song, Chengyang Zhang, Haoxuan Li, Yongkang Zhao, Weijiang Yu, Shiqi Zhang, Hongyu Zhang, Zhiming Dai, and Yuedong Yang. Imputing spatial transcriptomics through gene network constructed from protein language model. Communications Biology, 7(1):1271, 2024. 2DOI
  43. [43]Daiwei Zhang, Amelia Schroeder, Hanying Yan, Haochen Yang, Jian Hu, Michelle YY Lee, Kyung S Cho, Katalin Susztak, George X Xu, Michael D Feldman, et al. Inferring super-resolution tissue architecture by integrating spatial transcriptomics with histology. Nature biotechnology, 42(9):1372–1377, 2024. 6DOI
  44. [44]Weiqin Zhao, Zhuo Liang, Xianjie Huang, Yuanhua Huang, and Lequan Yu. Hist2cell: deciphering fine-grained cellular architectures from histology images. Cell Genomics, 6(3), 2026. 1DOI
  45. [45]Sichen Zhu, Yuchen Zhu, Molei Tao, and Peng Qiu. Diffusion generative modeling for spatially resolved gene expression inference from histology images. arXiv preprint arXiv:2501.15598, 2025. 1, 2, 5, 6arxiv.org/abs/2501.15598
  46. [46]Chunman Zuo, Junjie Xia, and Luonan Chen. Dissecting tumor microenvironment from spatially resolved transcrip- tomics data by heterogeneous graph learning. Nature Communications, 15(1):5057, 2024. 1

AI tools statement

No AI-use declaration is available for this version in Valency.

The available record does not establish whether AI systems or models contributed to this work.

How AI tools are recorded

Paper details

Cite this paper

Publication

Published
Version
Latest

Data & code

Code, data, proofs and workflows the authors linked for testing, review and reproduction. These links are part of this work’s metadata and are released under the same license as the rest of that metadata. Valency doesn’t host the files; each keeps the license set where it’s hosted.

Pick where to look, or just type