From Spots to Pixels: Dense Spatial Gene Expression Prediction from Histology Images

Ruikun Zhang, Yan Yang, Liyuan Pan

TL;DR

PixNet reformulates spatial gene expression prediction from a rigid, spot-level regression task into a flexible, pixel-level dense prediction task. By generating a continuous gene expression map directly from histopathology images, it can predict expression profiles across arbitrary scales and resolutions—down to single-cell levels—significantly outperforming current state-of-the-art methods.

What Problem Does This Paper Address?

Spatial transcriptomics (ST) is a powerful technique that maps gene expression within tissue architectures, providing vital insights into disease progression and tumor microenvironments. However, ST is incredibly expensive and technically demanding. To circumvent this, researchers use deep learning to predict gene expression directly from widely available, cost-effective hematoxylin and eosin (H&E) stained histology slides.

Existing methods typically crop fixed-size regions (called "spots") from the slide image and train models to map each spot to a corresponding gene expression profile. This approach suffers from two major flaws:

  1. Loss of Spatial Resolution: Standard spots (often $\ge 100$ µm) contain a mixture of multiple cell types, blurring distinct single-cell expression profiles.
  2. Inflexibility to Scale: Models trained on a specific spot size cannot adapt to varying scales or newer high-resolution technologies, such as Visium HD, which operates at a near single-cell resolution of 2 µm.
Figure 1. Overview of fields. (a) Existing approaches treat spatial gene expression prediction as a regression problem, training vari- ous networks on fixed crops from a slide image. (b) Our method formulates it as a dense prediction task, generating a gene expres- sion map and aggregating values within spots of interest.

Methods

The authors introduce PixNet, a framework that shifts the paradigm from spot-level regression to pixel-level dense prediction. Instead of predicting a single vector per image patch, PixNet outputs a continuous, dense gene expression map across the entire histology slide.

The architecture consists of three main stages:

  1. Pyramidal Feature Extraction: PixNet leverages a pretrained pathology foundation model (UNI2-h) to extract multi-scale feature maps from the input slide image, capturing both fine-grained morphological details and broader contextual structures.
  2. Gene Expression Map Decoding: A U-Net-style decoder progressively upsamples these features into a high-resolution dense gene expression map. To optimize feature merging, the authors designed a Separable Attention Fusion Block (SAFB) that uses lightweight, relation-aware attention to preserve local fidelity and global consistency. Deep layers utilize a Depth-to-Space Upsampling Block (DSUB) to minimize information loss.
  3. Arbitrary Region Aggregation & Sparse Supervision: To predict expression for a specific spot of interest during inference, PixNet simply integrates (sums) the pixel values within that spot's circular boundary. During training, because ground-truth ST data is only available at discrete spot locations rather than continuously across the tissue, the model employs a sparse loss function (combining Mean Squared Error and Pearson Correlation Coefficient) that evaluates only the pixels corresponding to measured spots.
Detailed overview of the PixNet framework architecture and the Separable Attention Fusion Block (SAFB).

Datasets

PixNet was evaluated on four widely used spatial transcriptomics datasets:

  • STNet: 68 breast cancer slide images containing roughly 30,000 spots at a 100 µm resolution.
  • Her2ST: 36 breast cancer slide images containing around 13,000 spots at a 100 µm resolution.
  • Breast Cancer Visium HD: 2 high-resolution slide images providing millions of spots across 2 µm, 8 µm, and 16 µm resolutions.
  • Brain Cancer Visium HD: 2 mouse brain slide images providing millions of spots across 2 µm, 8 µm, and 16 µm resolutions.

Key Insights and Ideas

  • Dense Prediction Unlocks Zero-Shot Scale Generalization: By treating gene expression as a continuous field rather than discrete patches, PixNet can be trained on coarse data (100 µm spots) and successfully evaluate fine-grained data (2 µm spots) without retraining.
  • Sparse Supervision Bridges the Gap: You don't need pixel-perfect continuous ground truth to train a pixel-level model. Masking the loss function to only calculate gradients on regions with available spot data allows standard dense architectures to excel on sparse biological data.
  • Foundation Models Matter: Ablation studies demonstrated that utilizing a specialized pathology foundation model (like UNI2-h) drastically improves prediction metrics compared to general-purpose vision models like ResNet or standard CLIP.

Key Results

PixNet achieved state-of-the-art performance across all four benchmarks, showing particularly massive gains in capturing relative gene expression variations (measured by the mean Pearson Correlation Coefficient, or PCC@M):

  • Visium HD Breast Cancer: PixNet achieved a PCC@M of 0.325, representing a 43.8% improvement over the previous best method, SGN (0.226).
  • Her2ST Dataset: PixNet achieved a PCC@M of 0.453, a 12.1% improvement over the previous top performer, TRIPLEX (0.404).
  • Cross-Scale Generalization: When trained on 100 µm spots (STNet) and tested directly on 2 µm single-cell scale spots (Visium HD), PixNet significantly outperformed competing models, proving its robust adaptability to unseen spatial resolutions.
Qualitative comparison showing that PixNet's predicted expression maps closely mirror ground-truth cancer hotspots at both 100 µm and 2 µm scales.

Limitations and Future Work

Despite its strong performance and multi-scale flexibility, PixNet still relies entirely on paired, sparsely supervised data (histology images explicitly matched with ST data) for training. Collecting paired data remains a bottleneck. The authors note that future work will focus on exploring unsupervised or self-supervised learning paradigms to leverage the vast amounts of unlabelled, large-scale histopathology data available in clinical repositories.

Summary updated

BibTeX
@inproceedings{zhang2026from,
  author = {Ruikun Zhang and Yan Yang and Liyuan Pan},
  title = {{From Spots to Pixels: Dense Spatial Gene Expression Prediction from Histology Images}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=GCKlycziip},
}
Figure