TL;DR
SpaFactor is a lightweight, highly efficient framework that predicts spatial gene expression directly from standard H&E histology images. By combining parameter-free spatial context aggregation with a low-rank gene program factorization layer, it outperforms heavy graph- and transformer-based models while explicitly capturing biological gene-gene coordination.
What Problem Does This Paper Address?
Spatial transcriptomics (ST) is a powerful technology that maps gene expression to exact anatomical locations within a tissue. However, high costs and experimental complexity prevent it from being used routinely in clinics. Predicting spatial gene expression directly from widely available, inexpensive Hematoxylin and Eosin (H&E) stained tissue images offers a scalable alternative.
The catch? Conventional image-to-expression methods typically treat thousands of genes as completely independent prediction targets. This ignores the fundamental reality of biology: genes don't act alone; they co-vary in coordinated pathways and programs. While some recent attempts have tried to model these dependencies, they rely on computationally heavy graph neural networks, complex cross-spot attention mechanisms, or external biological databases. The authors of SpaFactor set out to build a compact, lightweight downstream model that bridges the gap between tissue morphology and coordinated gene expression without the massive computational overhead.
Methods
SpaFactor introduces a streamlined, morphology-to-program-to-gene workflow that operates entirely on top of a frozen pathology foundation model (Prov-GigaPath).
The framework consists of three main components:
- Spatial Context Aggregation: Instead of relying on expensive graph message-passing during training, SpaFactor precomputes parameter-free local ($k=4$) and regional ($k=16$) neighborhood mean embeddings from the slide. These are concatenated with the central spot's embedding to capture microenvironmental heterogeneity.
- Residual Morphology-to-Program Encoder: A compact, 4-block residual MLP maps this combined spatial-context vector into a low-dimensional latent space representing $K=256$ latent "gene program" activities.
- Factor Decoder: A shared, trainable loading matrix decodes these 256 latent factors into the final multi-gene expression panel. This low-rank bottleneck forces the model to learn coordinated gene expression patterns rather than independent, noisy fluctuations.
The authors also present SpaFactor-Cal, a variant that uses an optional multi-modal teacher network during training to calibrate predictions. Crucially, this teacher is discarded at test time, keeping the inference pipeline strictly H&E-only.
Datasets
The model was rigorously evaluated across five public spatial transcriptomics cohorts spanning different tissue types and technologies from the STimage-1K4M and HEST-1k collections:
- Primary Breast: 108 sections (45,306 spots) using the original Spatial Transcriptomics platform.
- Visium Breast: 87 sections (163,931 spots).
- Bowel: 73 sections (205,642 spots).
- Brain: 91 sections (322,572 spots).
- Skin: 62 sections (61,634 spots).
In total, the evaluation encompassed 421 tissue sections and 799,085 spots using strict slide-level fivefold cross-validation.
Key Insights and Ideas
- Architecture Over Capacity: Extensive sensitivity analyses revealed a clear hierarchy: structural design choices (like factorized decoding and spatial context) matter far more than simply scaling up model depth, increasing latent capacity, or heavily tuning loss functions.
- Regional Context Dominates Local Detail: Ablation studies showed that incorporating broader regional tissue organization ($k=16$) recovers the vast majority of the model's performance gains, whereas immediate local context ($k=4$) provides only minor, complementary details.
- Data-Driven Biological Fidelity: Even without being fed explicit pathway labels or external gene ontologies, SpaFactor’s low-rank factor space successfully grouped co-expressed genes. It naturally recovered organized spatial patterns for complex functional pathways like oxidative phosphorylation.
Key Results
- State-of-the-Art Performance: Across all five cohorts, SpaFactor consistently outperformed established baselines (such as ST-Net, HisToGene, and HE2RNA). It showed the most dramatic improvements in recovering Spatially Variable Genes (SVGs), achieving a 36.36% Gene PCC and 63.41% VR-PCC@200 on the primary breast benchmark.
- High Efficiency: Because the spatial neighborhoods are precomputable and the model relies entirely on dense tensor operations, SpaFactor is highly economical. For a standard 2,000-gene panel, its factorized output module is 62.1% smaller than a direct linear regression layer.
- Sharp Boundary Preservation: Qualitatively, the model successfully mapped distinct tumor and stromal boundaries for critical breast cancer biomarkers (COL1A1, GATA3, ERBB2, and ESR1) simultaneously, proving it doesn't achieve performance simply through naive spatial smoothing.
Limitations and Future Work
While SpaFactor delivers a highly optimized downstream architecture, it remains inherently dependent on the quality of the frozen upstream pathology foundation model features. Additionally, while the model effectively aggregates multi-scale regional context using fixed kNN averages, it does not dynamically learn adaptive spatial weights during inference.
The authors suggest that future work could explore adapting this lightweight factorization approach to single-cell resolution imaging data or expanding it to directly predict multi-modal clinical outcomes.
Summary updated