SpaIM: single-cell spatial transcriptomics imputation via style transfer

Bo Li

TL;DR

SpaIM is a novel style-transfer learning framework that solves a major bottleneck in spatial transcriptomics (ST): data sparsity and limited gene coverage. By treating biological signals as "content" and platform-specific variations as "style," SpaIM leverages single-cell RNA sequencing (scRNA-seq) data to accurately predict unmeasured gene expressions across diverse spatial imaging and sequencing platforms, outperforming 12 state-of-the-art methods.

What Problem Does This Paper Address?

Spatial transcriptomics (ST) has revolutionized biology by allowing researchers to see where genes are expressed within a tissue slice. However, current ST technologies face a frustrating trade-off. Imaging-based methods offer high spatial resolution (down to the single-cell level) but can only probe a few hundred to a thousand pre-selected genes. Sequencing-based methods cover the whole genome but suffer from low sensitivity and high "dropout" rates (missing data).

To fill in these blanks, researchers often try to integrate ST data with single-cell RNA sequencing (scRNA-seq) data, which provides deep, whole-genome coverage but lacks spatial coordinates. Existing integration methods typically rely on local alignment techniques to map the two datasets. However, these approaches struggle because they overlook the fundamental technical differences—or "domain shifts"—between how scRNA-seq and ST capture data.

Methods

The authors introduce SpaIM (Spatial transcriptomics IMputation), which cleverly reframes gene imputation as a computer vision-style style transfer problem.

SpaIM decomposes gene expression into two components:

  1. Content: The intrinsic biological expression patterns across different cell clusters (shared between scRNA-seq and ST).
  2. Style: The platform-specific technical biases, capture efficiencies, and noise unique to a given ST technology.

The architecture relies on a Multilayer Recursive Style Transfer (ReST) model consisting of two main blocks that share a common decoder:

  • ST Autoencoder: Uses scRNA-seq as a reference to disentangle the raw ST data into separate content and style representations.
  • ST Generator: Takes scRNA-seq data as input, extracts its rich biological content, and applies the learned ST "style" to predict what the unmeasured genes would look like if they had been successfully captured by the ST platform.
Overview of the SpaIM architecture, featuring the ST Autoencoder and ST Generator built on recursive style transfer (ReST) layers.

Datasets

The authors rigorously benchmarked SpaIM across an impressive collection of 53 datasets spanning various tissue types (breast, prostate, kidney, brain) and species (human, mouse, zebrafish):

  • 21 10x Visium datasets (sequencing-based).
  • 7 other sequencing-based datasets (Slide-seq, Slide-seq V2, Seq-scope, HDST).
  • 25 imaging-based datasets (NanoString CosMx SMI, MERSCOPE, seqFISH, seqFISH+, MERFISH, STARmap, ISS, osmFISH).

Key Insights and Ideas

  • Imputation as Domain Adaptation: Instead of forcing a direct spatial alignment between single cells and spatial spots, treating platform differences as a "style" allows the model to learn generalizable transfer rules. This makes SpaIM highly robust across wildly different technologies (e.g., transitioning from sequencing to fluorescence microscopy).
  • Progressive Disentanglement: Using Shapley value analysis, the authors proved that SpaIM's recursive layers successfully separate biology from technical artifacts. Biological pathways (like apoptosis or tumor-intrinsic traits) map cleanly to "content," while microenvironmental and immune-related platform variations map to "style."
  • Unlocking Downstream Analysis: Imputation isn't just about making cleaner pictures; it directly improves downstream biological discovery. SpaIM-imputed data successfully recovered cell-type-specific marker genes and critical ligand-receptor interactions (like VEGFA-ITGB1) that were completely invisible in the sparse, raw ST data.

Key Results

SpaIM consistently outperformed 12 state-of-the-art imputation methods (including Tangram, gimVI, and stDiff) across all 53 benchmark datasets.

  • Accuracy and Correlation: On a human breast cancer Visium dataset, SpaIM achieved a Pearson Correlation Coefficient (PCC) of 0.70 ± 0.02, significantly beating the second-best model, Tangram (PCC: 0.62 ± 0.02). Its Structural Similarity Index (SSIM) was also 10% higher than Tangram's.
  • Differentially Expressed Genes (DEGs): In a NanoString CosMx lung cancer dataset, raw data only identified 59 lymphocyte-specific DEGs. SpaIM expanded this to 92 significant genes, whereas competing methods actually reduced the number of detected DEGs compared to the raw baseline.
  • Spatial Domain Identification: SpaIM achieved the highest Adjusted Rand Index (ARI = 0.50) for cellular domain characterization, closely matching the ground truth, while competitors like gimVI and Tangram suffered from fragmented or blended cell-type misclassifications.
Benchmarking performance across 53 diverse spatial transcriptomics datasets, showing SpaIM's superior performance in correlation, similarity, and accuracy metrics.

Limitations and Future Work

While SpaIM represents a major leap forward, the authors note a few areas for improvement:

  • Network Architecture: SpaIM currently uses standard multi-layer perceptrons (MLPs) for its encoders. Upgrading to more sophisticated architectures, such as Graph Transformers or Mamba blocks, could better capture spatial relationships between neighboring cells.
  • Tailored Initial Styles: The generator currently relies on independent initial input values. Developing customized initial styles tailored to specific tissue architectures could further sharpen imputation accuracy.

Summary updated

BibTeX
@inproceedings{li2025spaim,
  author = {Bo Li},
  title = {{SpaIM: single-cell spatial transcriptomics imputation via style transfer}},
  booktitle = {Nature Communications},
  year = {2025},
  doi = {10.1038/s41467-025-63185-9},
}
Figure