Notice: The reproducibility variables underlying each score are classified using an automated LLM-based pipeline, validated against a manually labeled dataset. LLM-based classification introduces uncertainty and potential bias; scores should be interpreted as estimates. Full accuracy metrics and methodology are described in Coakley et alK. L. Coakley, T. Snelleman, H. Hoos, and O. E. Gundersen, "The embrace of open science: An analysis of a decade of AI research and 56 800 conference papers," Under Review, 2026..

Modeling Microenvironment Trajectories on Spatial Transcriptomics with NicheFlow

Authors: Kristiyan Sakalyan, Alessandro Palma, Filippo Guerranti, Fabian J. Theis, Stephan Günnemann

NeurIPS 2025 | Venue PDF | LLM Run Details

Reproducibility Variable Result LLM Response
Research Type Experimental We propose quantitative and qualitative evaluations of our algorithm. Quantitatively, we test whether source-conditioned samples generated by our model preserve the biological structure and shape of future tissue states. Qualitatively, we demonstrate that our approach accurately captures compositional shifts in substructural components and developmental trajectories across time.
Researcher Affiliation Academia 1School of Computation, Information and Technology, Technical University of Munich 2Munich Centre for Machine Learning (MCML) 3Institute of Computational Biology, Helmholtz Munich 4Munich Data Science Institute (MDSI), Technical University of Munich 5TUM School of Life Sciences Weihenstephan, Technical University of Munich Correspondence to: EMAIL
Pseudocode Yes E Algorithms Here, we present the algorithmic procedures underlying Niche Flow. To streamline the exposition, we first define compact notation for representing noisy microenvironments and their interpolations. We denote a single noisy microenvironment (simplifying Eq. (11)) as: Mz N(0, ID+2)1 k = {(cz i , zi) | cz i N(0, I2), zi N(0, ID), i = 1, . . . , k} , (33) where k denotes the number of spatial points per microenvironment, cz i are 2D cell coordinates, and zi are associated feature vectors in RD. For a collection of N microenvironments, we define the corresponding set of noisy microenvironments Mz N(0, ID+2)N k = Mz i N(0, ID+2)1 k | i = 1, . . . , N . (34) Given a noisy sample Mz and a corresponding ground-truth microenvironment M1, we define their linear interpolation at time t [0, 1] as: Mt = (1 t)Mz + t M1, where the interpolation is performed element-wise across the matrix rows. For batched data, this generalizes to: Mt = (1 t)Mz + t M1. (35) Algorithm 1 SAMPLEANDINTERPOLATE Input: Number of samples N, feature dimension D, microenvironment size k, OT plan π ϵ,λ Output: Source (M0), target (M1), interpolated (Mt), and noisy (Mz) microenvironments 1: (M0, M1) Sample from K-Means regions Initial microenvironment pairs 2: (M0, M1) π ϵ,λ(M0, M1) Resample with OT plan 3: Mz N(0, ID+2)N k Noisy initial states 4: t U(0, 1) Random interpolation time 5: Mt (1 t)Mz + t M1 Linearly interpolated states E.1 OT Conditional Flow Matching The OT Conditional Flow Matching (OT-CFM) algorithm consists of a training and a generation phase. During training, the model learns a time-dependent vector field uθ t conditioned on a source microenvironment M0, which maps a noisy microenvironment Mz sampled from Gaussian noise to its corresponding target microenvironment M1. The supervision is provided via source-target pairs (M0, M1) obtained through EOT over pooled microenvironment representations. At generation time, the learned vector field is integrated starting from Mz, conditioned on a given source M0, to generate the predicted target microenvironment M1. We optimize the following loss: L(M0, M1, Mt, Mz; θ) = 1 M0 M0 Mz Mz uθ t (Mt, M0) (M1 Mz) 2 The full pseudocode for both phases is provided in Algs. 2 and 3. Algorithm 2 OT CFM Training Input: Number of samples N, feature dimension D, microenvironment size k, OT plan π ϵ,λ, conditional velocity field uθ t Output: Trained parameters θ of uθ t 1: (M0, M1, Mt, Mz) SAMPLEANDINTERPOLATE(N, D, k, π ϵ,λ) Microenvironments (Alg. 1) 2: θ θL(M0, M1, Mt, Mz; θ) Compute loss (Eq. (36)) & update parameters θ Algorithm 3 OT CFM Generation Input: Source microenvironment M0, learned conditional velocity field uθ t Output: Generated microenvironment M1 1: Mz N(0, ID+2)1 k Sample noisy sample 2: M1 Mz + R 1 0 uθ t (Mt, M0) dt Solve ODE E.2 OT Gaussian Variational Flow Matching The OT Gaussian Variational Flow Matching (OT-GVFM) algorithm adopts a variational perspective on Flow Matching. Instead of directly learning a time-dependent conditional velocity field, the model learns a factorized variational posterior qθ t (M1 | Mt, M0) over target microenvironments M1, conditioned on an interpolated microenvironment Mt and a source microenvironment M0. The predicted velocity field is then computed as the difference between the posterior mean µθ t (Mt, M0) and the current state M1. The training objective minimizes the discrepancy between ground-truth targets and the predicted posterior means ( f θ t , rθ t ): L(M0, M1, Mt; µθ t) = 1 ( f θ t , rθ t ) µθ t (Mt,M0) c1 f θ t 2 2 + x1 rθ t 2 2 . (37) At generation time, trajectories are generated by integrating the vector field µθ t (Mt, M0) Mt, starting from a noise-sampled microenvironment Mz and conditioned on a given source M0. To ensure stability near t = 1, the vector field is scaled by a time-dependent denominator, as in prior VFM formulations. The pseudocode for both phases is provided in Algs. 4 and 5. Algorithm 4 OT-GVFM Training Input: Number of samples N, feature dimension D, microenvironment size k, OT plan π ϵ,λ, source-conditioned posterior mean predictor µθ t Output: Trained parameters θ of µθ t 1: (M0, M1, Mt, Mz) SAMPLEANDINTERPOLATE(N, D, k, π ϵ,λ) Microenvironments (Alg. 1) 2: θ θL(M0, M1, Mt; µθ t ) Compute loss (Eq. (37)) & update parameters θ Algorithm 5 OT-GVFM Generation Input: Source microenvironment M0, learned source-conditioned posterior mean predictor µθ t Output: Generated microenvironment M1 1: Mz N(0, ID+2)1 k Sample noisy sample 2: M1 Mz + R 1 0 µθ t (Mt,M0) Mt 1 t+ϵ dt Solve ODE E.3 Niche Flow: OT Gaussian-Laplace Variational Flow Matching Niche Flow extends OT-GVFM by modifying the variational posterior: it assumes a Gaussian distribution for gene expression features and a Laplace distribution for spatial coordinates. This change leads to a hybrid loss that combines an L2 loss on gene expression and an L1 loss on spatial locations: L(M0, M1, Mt; θ) = X ( f θ t , rθ t ) µθ t (Mt,M0) c1 f θ t 1 + 1 2 x1 rθ t 2 2 At generation time, the model integrates the velocity field defined by the difference between the predicted mean µθ t(Mt, M0) and the current state M1, starting from noise and conditioned on the source M0, identical to the OT-GVFM procedure.
Open Source Code Yes 1Project page: https://www.cs.cit.tum.de/daml/nicheflow
Open Datasets Yes We assess model performance across three spatiotemporal datasets: (i) Mouse embryogenesis [20, 8] and (ii) the axolotl brain development [42], two Stereo-seq datasets profiling the spatially-resolved cellular development of a mouse embryo and axolotl brain across three (E9.5, E10.5 and E11.5) and five time points, respectively. We also consider the (iii) mouse brain ageing dataset [43], profiled with MERFISH [44] across twenty time points (see Apps. F.1 and F.2).
Dataset Splits No The paper does not explicitly provide training/test/validation dataset splits with percentages, counts, or references to predefined splits for reproducibility. It describes an evaluation data construction method but not how it relates to training data splits.
Hardware Specification Yes All models were trained on a single NVIDIA GeForce GTX 1080 Ti GPU with 11GB of memory.
Software Dependencies No The paper mentions software like the AdamW optimizer, but does not provide specific version numbers for any software libraries or dependencies used (e.g., Python, PyTorch, CUDA versions).
Experiment Setup Yes Input feature dimension: 50 PCA-based gene expression features concatenated with a one-hot encoding of the time-point, resulting in a total dimensionality of 50 + |T |, where |T | is the number of slides (timepoints) in the dataset. Input coordinate dimension: 2 Embedding dimension: 128 MLP hidden dimension: 256 Number of attention heads: 4 Number of encoder layers: 2 Number of decoder layers: 2 Dropout rate: 0.1 Output dimension: 52 (gene expressions features + coordinates) OT and mini-batching. To ensure spatial diversity and computational tractability, we uniformly sample 256 source target microenvironment pairs from the K spatial clusters obtained via K-Means. We then compute the entropic OT plan between these sampled pairs and resample 64 source-target pairs from this plan to define a single training instance. During training, we process 16 such instances per batch. Optimization. All models are trained using the Adam W optimizer with a learning rate of 2 10 4 and a weight decay of 1 10 5. We train each model until convergence.