Distance-Preserving Representations for Genomic Spatial Reconstruction

Wenbin Zhou, Jin‐Hong Du

TL;DR

Researchers have developed dp-VAE, a new deep learning framework that reconstructs the physical "map" of where cells are located in a tissue using only their gene expression data. By adding a "distance-preserving" rule to a standard Variational Autoencoder, the model learns to align the geometry of genetic data with physical space, enabling spatial analysis for datasets that previously lacked it.

What Problem Does This Paper Address?

In modern genomics, we have two main ways of looking at cells: scRNA-seq, which gives us a high-resolution list of every gene a single cell is "using," and Spatial Transcriptomics (ST), which tells us where genes are being expressed in a tissue slice.

The catch? scRNA-seq usually requires breaking the tissue apart, losing all information about where the cells were originally located. Conversely, many ST methods are "coarse"—they might tell you what's happening in a small area, but they can't always zoom in to the level of an individual cell.

The authors tackle a fundamental question: Can we "impute" or reconstruct the missing spatial coordinates for single cells using only their gene expression profiles? If successful, this would allow scientists to unlock spatial insights from massive, existing libraries of non-spatial genomic data.

Methods

The core of the paper is dp-VAE (Distance-Preserving Variational Autoencoder).

Standard VAEs compress complex data (like thousands of gene expressions) into a low-dimensional "latent space." Usually, this space is organized however the model finds most efficient for reconstruction. The authors change the rules of the game by introducing a Distance-Preserving Loss ($\mathcal{L}_{DP}$).

The dp-VAE pipeline: Training on paired data (X, S) and using a constrained optimizer for spatial reconstruction during testing.

During training, the model is given a reference dataset where both gene expression ($X$) and spatial coordinates ($S$) are known. The $\mathcal{L}_{DP}$ term forces the model to ensure that if two cells are physically close in the tissue, their representations in the latent space must also be close.

When it comes time to use the model on new, non-spatial data, the encoder maps the gene expression to the latent space. Then, a constrained optimizer (like Multidimensional Scaling) is used to translate those latent positions back into estimated physical coordinates ($\hat{S}$).

Datasets

The authors validated their approach using 27 publicly available Visium Spatial Gene Expression datasets from 10x Genomics. These datasets primarily cover various regions of the mouse brain. To ensure the model remained stable and focused on the most informative signals, they filtered the data to the top 100 most variable genes for each sample.

Key Insights and Ideas

  • The Biological Link: The entire premise relies on the fact that a cell's location and its gene expression are linked. The authors proved this by showing a statistically significant positive correlation between gene expression similarity and physical proximity across 23 of their 27 datasets.
Pearson correlation between gene expression distance and spatial distance across 27 datasets.
  • Geometry as a Regularizer: By forcing the latent space to mimic physical geometry, the model is "nudged" to pay attention to marker genes that are specifically relevant to spatial organization, rather than just general cell functions.
  • Theoretical Grounding: The authors didn't just hack the loss function; they connected it to the bi-Lipschitz condition, a mathematical concept that describes how much a mapping distorts distances. They proved that as the distance-preserving loss decreases, the model's "smoothness" and accuracy in mapping expression to space increase.

Key Results

  • Superior Reconstruction: Compared to a vanilla VAE, dp-VAE was far better at capturing the global shape and local clusters of tissue. In visualizations, the dp-VAE latent space looks remarkably like the original tissue slice, whereas a standard VAE often produces a disorganized "blob."
Latent space visualization: dp-VAE (top) recovers the triangular shape of anchor points much faster and more accurately than a standard VAE (bottom).
  • Robustness: The model is remarkably stable. Even when the weight of the distance-preserving loss ($\alpha_2$) was increased by orders of magnitude, the training converged reliably without crashing.
  • Transfer Learning: The model showed promise in "zero-shot" scenarios—training on one brain slice and predicting coordinates for a different, similar slice. However, this remains a much harder task than predicting coordinates for unseen cells from the same slice.

Limitations and Future Work

The biggest hurdle is out-of-distribution (OOD) performance. When the model is trained on one part of the brain and asked to predict coordinates for a completely different anatomical region, the error increases significantly. This is because different brain regions have vastly different "spatial-expression mappings."

The authors suggest that future work should focus on fine-tuning—using a small amount of spatial data from the target tissue to "calibrate" a pre-trained model. They also aim to explore more complex masking procedures to see if the model can learn from even sparser spatial information.

Summary updated

BibTeX
@article{zhou2025distance,
  author = {Wenbin Zhou and Jin‐Hong Du},
  title = {{Distance-Preserving Representations for Genomic Spatial Reconstruction}},
  journal = {IEEE Transactions on Computational Biology and Bioinformatics},
  year = {2025},
  doi = {10.1109/tcbbio.2025.3628794},
}
Figure