MollFlow: Learning Spatially Resolved Inference from H&E Images with Mollified Flow Matching

Rongchao Zhang, Siheng Wang, Guangyuan Dong, Zhengtao Yao, Junhao Dong, Haoyang LiNeurIPS 2026

TL;DR

Can we look at a cheap, routine microscope slide of a tumor and accurately deduce which genes are switched on across every square millimeter of the tissue? MollFlow shows we can do this faster and more accurately than before by combining pathology foundation models with a smoothed-out ("mollified") generative flow-matching process. Instead of guessing gene activity from pure random noise like standard diffusion models, it starts with an educated guess derived straight from the image and learns a smooth, stochastic path to refine it—achieving up to a 20× speedup over diffusion baselines while boosting predictive accuracy.

What Problem Does This Paper Address?

Standard single-cell RNA sequencing is a bit like putting a fruit smoothie in a mass spectrometer: you get a fantastic molecular inventory, but you lose all sense of where the strawberries were relative to the bananas. Spatial transcriptomics fixes this by measuring gene expression across intact tissue slices, preserving the neighborhood geometry of cells. The catch? It is eye-wateringly expensive, experimentally finicky, and low-throughput.

Meanwhile, hospitals have millions of dirt-cheap, routinely collected Hematoxylin and Eosin (H&E) stained biopsy images. Inferring spatial gene expression directly from H&E images is an enticing computational shortcut, but the mapping is fundamentally messy and multimodal: two cells that look identical under a microscope might have different transcriptional states, and vice versa.

Deterministic models predict a single "average" answer, blurring out real biological variation. Diffusion models capture this variation much better, but they are slow at inference. Newer flow matching models (which learn continuous velocity fields to push a source distribution into a target distribution via Ordinary Differential Equations) are faster, yet naive linear paths between smooth image features and sparse, heavy-tailed gene counts cut straight through "dead zones"—low-density regions of mathematical space that don't represent real biology, destabilizing training.

Methods

MollFlow rethinks conditional flow matching with three clever modifications so it doesn't have to bridge two wildly different modalities from scratch:

Figure 1: Overview of MollFlow. We extract spatial priors from H&E stained sections, encode the morphological features as the initial state, and train a network to learn the trajectory from the prior distribution to the actual gene expression. During training, we sample time t, builds flow trajectories through interpolation, and optimize the network by minimizing errors in velocity field prediction.
  1. Image-Informed Initialization (New Application): Standard generative models start at $t=0$ with isotropic Gaussian noise. Instead, MollFlow uses a supervised encoder (built on the discriminative TRIPLEX framework and distilled from pathology foundation models UNI and CONCH) to generate a deterministic "first draft" of gene expression ($\vec{g}_0$) from the H&E patch. Now, the flow matching network (a 12-layer Transformer) doesn't translate images to genes; it simply refines an initial gene estimate into the true expression profile ($\vec{g}_1$) entirely within gene-expression space.
  2. Stochastic Interpolation: Rather than drawing rigid straight lines between $\vec{g}_0$ and $\vec{g}_1$, the authors inject a zero-mean Gaussian noise bubble in the middle of the trajectory (inspired by diffusion bridges). This widens the "tube" of intermediate states explored during training so the velocity field doesn't get tripped up by sparse data manifolds.
  3. Boundary Mollification (Key Novelty): At the exact start ($t=0$) and end ($t=1$), the stochastic noise normally collapses to zero, which can cause sharp, unstable density gradients when matching spiky gene data. MollFlow mollifies (softens) the boundaries by convolving the endpoints with a small Gaussian perturbation ($\beta$). This keeps variance strictly positive everywhere, smoothing out numerical kinks at the endpoints. At inference, Heun’s second-order ODE solver integrates the learned velocity field in 50 steps.

Datasets

No new datasets were introduced; the authors followed prior benchmarks on two distinct human spatial transcriptomics datasets using slide-level holdouts (preventing data leakage between neighboring spots):

  • HER2ST (Breast Cancer): 36 tissue sections from 8 patients on the Spatial Transcriptomics platform (slide B1 held out for testing), evaluating 300 high-mean/high-variance genes (HMHVGs) and 296 differentially expressed genes (DEGs).
  • Human Kidney Spatial Atlas (10x Visium): 23 sections from 22 individuals spanning healthy tissue, chronic kidney disease, and acute kidney injury (AKI slide 20-0038 held out), evaluating HMHVGs and highly variable genes (HVGs).

Key Insights and Ideas

  • Don't start from static when you have a map: Ablating the image-informed prior drops Top-300 gene correlation from 0.6963 down to 0.6064. Turning cross-modal generation into intra-modal refinement does massive heavy lifting.
  • A little fuzziness at the edges helps: Mathematical perfection at $t=0$ and $t=1$ actually hurts when your target data is sparse and heavy-tailed. Relaxing the endpoints via Gaussian mollification stabilizes the velocity field and lowers prediction errors (MAE/MSE).
  • Accuracy vs. Variance is a real trade-off: While MollFlow crushes deterministic baselines in preserving spatial variance, the pure diffusion baseline (Stem) still edges out MollFlow on Relative Variance Difference (RVD)—showing that starting from a strong deterministic prior slightly compresses dynamic range compared to pure noise-to-data diffusion.

Key Results

  • Higher Predictive Correlations: On HER2ST, MollFlow achieves state-of-the-art Pearson Correlation Coefficients (PCC) and lowest error metrics (MAE/MSE) across the board. Notably, on Top-300 HMHVGs, it hits 0.6963 PCC compared to 0.5984 for diffusion-based Stem and 0.5766 for TRIPLEX. Similar PCC wins hold on Kidney Visium (0.4467 Top-200 HMHVG vs. Stem's 0.4257).
  • Massive Speedups: Because flow matching integrates smooth trajectories in 50 ODE steps rather than lengthy DDPM denoising chains, MollFlow runs 15.3× faster on an A100 (2.24 min vs. 34.3 min for Stem) and 20× faster on an RTX 4090 (6.6 min vs. 134 min).
  • Sharper Spatial Biology: Qualitatively, when reconstructing immune-related genes like CCL19, deterministic methods smear expression across the slide, whereas MollFlow crisply isolates localized high-expression hotspots.
Figure 2: Visualisation results of Ground Truth and gener- ated CCL19 gene expression profiles.

Limitations and Future Work

The authors candidly note four main caveats:

  1. Limited Cohort Diversity: Evaluations rely on small patient cohorts; holding out a single slide doesn't fully test generalization across different hospitals, staining protocols, or patient demographics.
  2. Prior Bottleneck: Because MollFlow leans heavily on its supervised prior, garbage in means garbage out—if the initial encoder or pathology foundation model struggles on an unseen tissue type, transport refinement may suffer.
  3. Unverified Intermediate Biology: Broadening intermediate probability paths helps the math converge, but intermediate states aren't guaranteed to represent biologically real cell states.
  4. Variance Compression: Higher RVD compared to pure diffusion indicates slight dynamic-range compression on certain genes, leaving room to better balance point accuracy with full distributional spread.

Summary updated

Abstract

Spatially resolved gene expression inference aims to predict local transcriptomic profiles from histopathological images, offering a computationally scalable complement to experimental spatial transcriptomics. However, substantial distributional discrepancies between histological morphology and transcriptomic profiles, together with the limited throughput of spatial transcriptomics technologies, pose significant challenges to accurate inference. Existing methods often struggle to align these heterogeneous modalities and adequately capture the diversity of gene expression patterns, resulting in incomplete distributional coverage. Here, we propose MollFlow, a novel generative framework that integrates image-informed initialization with stochastic flow matching for gene expression inference. MollFlow constructs an expression prior from Hematoxylin and Eosin stained histology image features and learns a transport process that refines this prior toward the target expression distribution. To address the challenges of cross-modal coupling, we further adopt a boundary mollification strategy that facilitates broader exploration of intermediate expression states during stochastic transport without imposing overly restrictive transport trajectories. This formulation accommodates heterogeneous expression patterns while mitigating boundary degeneracy in the interpolation process. Extensive experiments across multiple tissue datasets demonstrate improved predictive correlations over representative baselines, together with substantial inference-time reductions relative to the evaluated diffusion method.
BibTeX
@inproceedings{zhang2026mollflow,
  author = {Rongchao Zhang and Siheng Wang and Guangyuan Dong and Zhengtao Yao and Junhao Dong and Haoyang Li},
  title = {{MollFlow: Learning Spatially Resolved Inference from H\&E Images with Mollified Flow Matching}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=oLyNGLsplV},
}
Figure