Papers
Topics
Authors
Recent
Search
2000 character limit reached

GeneFlow: Discrete Eulerian and Rectified-Flow Models

Updated 4 July 2026
  • GeneFlow is a term that denotes two distinct frameworks: one simulating genetic drift under flow dynamics and another mapping gene expression to cellular imagery.
  • The population genetics model employs a discrete Eulerian algorithm to simulate diffusion, advection, and fixation using stochastic FKPP equations validated through reaction-diffusion tests.
  • The transcriptomics framework uses an attention-based RNA encoder and conditional U-Net with rectified flow ODE integration to generate detailed histopathological image tiles.

GeneFlow is a name used in two distinct arXiv contexts. In population genetics and fluid dynamics, it denotes a discrete Eulerian algorithm for stochastic competition, diffusion, and advection on a lattice, introduced in “Discrete Eulerian model for population genetics and dynamics under flow,” where the focus is weakly compressible flow, FKPP-type dynamics, and fixation under sources and sinks (Guccione et al., 2019). In spatial transcriptomics and computational pathology, GeneFlow denotes a framework that maps single-cell gene expression to paired histopathological images via rectified flow, combining an attention-based RNA encoder, a conditional U-Net, and high-order ODE integration to generate 256×256256\times256 cellular image tiles with modalities such as H&E and DAPI (Wang et al., 31 Oct 2025).

1. Terminological scope and disambiguation

A common source of confusion is terminological rather than methodological: the same name refers to unrelated research programs in different domains. One concerns stochastic population genetics under advection, logistic competition, and demographic noise; the other concerns conditional generative modeling from transcriptomics to imaging phenotypes. A plausible implication is that use of the name alone is insufficient for identification, and the arXiv id is the decisive disambiguator (Guccione et al., 2019, Wang et al., 31 Oct 2025).

Usage of “GeneFlow” Domain Core object
Discrete Eulerian model Population genetics under flow Lattice algorithm for pAp_A, pBp_B, fixation, and advection
Rectified-flow framework Spatial transcriptomics and histopathology Mapping from gene-expression matrices to image tiles

The population-genetic usage is organized around continuum PDEs and a mesh-based stochastic simulation procedure. The histopathology usage is organized around representation learning for RNA, conditional image generation, and deterministic transport in latent-image space. The shared name therefore does not indicate a shared formalism.

2. Continuum formulation in population genetics under flow

In the fluid-mechanical setting, GeneFlow considers two competing genotypes, AA and BB, with local densities pA(x,t)p_A(x,t) and pB(x,t)p_B(x,t) in a dd-dimensional domain. Both are advected by a prescribed velocity field v(x,t)v(x,t), diffuse, reproduce and die with logistic competition, and experience a selective advantage ss for pAp_A0. In the nondimensional form that measures time in units of the birth rate pAp_A1 and space in units of pAp_A2, the governing equations are (Guccione et al., 2019):

pAp_A3

pAp_A4

Here pAp_A5 is the prescribed advecting field, pAp_A6 is the diffusion coefficient, pAp_A7 is the intrinsic birth rate, pAp_A8 is the selective advantage of pAp_A9, pBp_B0 is the carrying-capacity per mesh cell, and pBp_B1 are independent space-time white noises with pBp_B2. Under the assumption pBp_B3, it is convenient to work with the fraction pBp_B4, which yields the stochastic FKPP equation under advection:

pBp_B5

Within this reduced equation, pBp_B6 advects allele frequency, pBp_B7 smooths spatial heterogeneity, pBp_B8 captures selection, and the square-root noise term represents genetic drift. This formulation is the analytical backbone of the method and of its interpretation under weak compressibility.

3. Eulerian discretization, stochastic update scheme, and no-flow validation

The computational contribution in the population-genetic work is a fixed-grid algorithm with pBp_B9 per-cell cost even for large AA0. The domain is discretized into AA1 cells of volume AA2, and each cell AA3 stores two integers, AA4 and AA5. Each time step AA6 is split into four sub-steps for AA7 (Guccione et al., 2019).

  • Step 1 (Diffusion): each of the AA8 individuals in cell AA9 is assigned a random subcell position BB0 within a slightly enlarged box of size BB1 centered on BB2, with BB3. This is equivalent to a nearest-neighbor random hopping operator that converges to BB4 in the limit BB5.
  • Step 2 (Advection): each virtual particle is moved by BB6.
  • Step 3 (Relabeling): each advected particle is re-binned to its new cell index BB7, producing temporary counts BB8.
  • Step 4 (Birth–Death / Competition): in each cell BB9, stochastic birth and death are applied a total of pA(x,t)p_A(x,t)0 times, with birth rate pA(x,t)p_A(x,t)1 and death rate pA(x,t)p_A(x,t)2, where the minus sign is for pA(x,t)p_A(x,t)3 and the plus sign for pA(x,t)p_A(x,t)4. Births and deaths can be sampled using binomial or Poisson variates.

Validation without flow proceeds by setting pA(x,t)p_A(x,t)5, reducing the method to a stochastic reaction-diffusion algorithm. Three tests are reported. First, for the 1D Fisher equation pA(x,t)p_A(x,t)6, the measured front speed pA(x,t)p_A(x,t)7 for pA(x,t)p_A(x,t)8 and pA(x,t)p_A(x,t)9 exhibits a cross-over between strong-drift scaling pB(x,t)p_B(x,t)0 at low pB(x,t)p_B(x,t)1 and Brunet–Derrida cutoff behavior

pB(x,t)p_B(x,t)2

at large pB(x,t)p_B(x,t)3. Second, heterozygosity decay pB(x,t)p_B(x,t)4 follows pB(x,t)p_B(x,t)5 in 1D, with simulations at pB(x,t)p_B(x,t)6 following this power law, and pB(x,t)p_B(x,t)7 in 2D, with simulations at pB(x,t)p_B(x,t)8 on a pB(x,t)p_B(x,t)9 grid producing dd0. Third, for an initial fraction dd1 of type dd2 in total population dd3, the well-mixed Kimura formula

dd4

is recovered in 1D and 2D for dd5 up to dd6.

4. Weakly compressible flows, source–sink structure, and fixation in marine contexts

The extension to weakly compressible flow is motivated by organisms such as phytoplankton living at a specific depth in the three-dimensional, incompressible ocean while experiencing upwelling and downwelling events. In 1D, the toy flow is

dd7

for which dd8 alternates sources and sinks. In 2D, the generalization is

dd9

with two sources and two sinks per period. In the weak-compressibility regime, v(x,t)v(x,t)0, the approximation v(x,t)v(x,t)1 is still used, and the effective compressibility parameter is v(x,t)v(x,t)2 (Guccione et al., 2019).

A new length scale emerges near each source,

v(x,t)v(x,t)3

beyond which an organism is swept away into a sink and is unlikely to return. In this regime, the fixation probability for v(x,t)v(x,t)4 remains Kimura-like but with an effective population size determined by the source region:

v(x,t)v(x,t)5

where v(x,t)v(x,t)6 and v(x,t)v(x,t)7 is an v(x,t)v(x,t)8 constant fixed by fitting, with v(x,t)v(x,t)9–ss0. For small ss1,

ss2

For larger ss3, the limiting factor becomes the ability of a growing ss4-cluster to escape the source before advection removes it. Balancing advection with the Fisher-wave speed ss5 defines

ss6

and hence a second effective population scale:

ss7

For larger ss8, the fixation curve is fitted by replacing ss9 with pAp_A00. Simulations on pAp_A01 grids with pAp_A02, pAp_A03, and pAp_A04–pAp_A05 confirm that for pAp_A06, data collapse onto the small-pAp_A07 Kimura curve with pAp_A08, while for pAp_A09, the large-pAp_A10 curve with pAp_A11 captures the turnover.

The biological interpretation stated for marine settings is that upwelling sources act as evolutionary “hot spots,” whereas downwelling sinks are demographic “sieves” that purge diversity. The net effect of weak compressibility is therefore to reduce the effective population to organisms born within pAp_A12 of a source, amplifying genetic drift and reducing the role of selection in the bulk.

5. Transcriptome-to-image GeneFlow: RNA encoder, conditional U-Net, and rectified flow

In the spatial-transcriptomic setting, GeneFlow starts from a paired dataset pAp_A13, where pAp_A14 is a gene-expression matrix with up to pAp_A15 cells and pAp_A16 genes, and pAp_A17 is the corresponding pAp_A18 histology tile. The pipeline first compresses pAp_A19 into a latent vector pAp_A20, then combines pAp_A21 with a sinusoidal time embedding pAp_A22 to condition a U-Net, which serves as the backbone of a rectified-flow image generator (Wang et al., 31 Oct 2025).

The attention-based RNA encoder contains three modules: low-rank gene relations, gene attention, and multi-head cell attention. For each flattened cell expression pAp_A23, two factors pAp_A24 and pAp_A25 are predicted via a small MLP, and the enriched representation is

pAp_A26

which introduces learned gene-gene interactions at rank pAp_A27. Global gene attention then applies learnable scores pAp_A28:

pAp_A29

Each pAp_A30 is passed through two residual blocks to produce a 256-dimensional cell embedding pAp_A31, and multi-head cell attention aggregates the cell-level information. For head pAp_A32, one computes pAp_A33, obtains logits pAp_A34, applies a mask pAp_A35 for real cells, and forms

pAp_A36

followed by pAp_A37 and a gating layer yielding the RNA code pAp_A38.

The image generator is a conditional U-Net with skip connections, where every ResBlock is jointly conditioned on pAp_A39 and pAp_A40. Rectified flow is defined by the deterministic ODE

pAp_A41

which transports Gaussian noise pAp_A42 to pAp_A43. During training, the method introduces the reference path

pAp_A44

with target velocity

pAp_A45

The paper states that rectified flow with high-order ODE solvers creates a continuous, bijective mapping between transcriptomics and image manifolds, addressing the many-to-one relationship inherent in the problem.

6. Training objectives, evaluation regime, and reported implications in histopathology

The primary training criterion in the image-generation GeneFlow is the velocity-matching mean-squared error

pAp_A46

with pAp_A47 as a sparsity regularizer on the first encoder layer. An optional spatial regularization term gives

pAp_A48

where pAp_A49 is a warm-up schedule. Two variants of pAp_A50 are specified: a segmentation-based variant using nuclear morphology, neighbor distances, and density, and a gradient-based variant using Sobel gradients and local patch statistics. No adversarial or GAN loss is used. Inference integrates the ODE using a 5th-order Dormand–Prince (Runge–Kutta) method with adaptive step size, while the abstract also describes inference as solving the ODE with a 5th-order Runge–Kutta integrator (Wang et al., 31 Oct 2025).

The reported datasets are XeniumpAp_A51, XeniumpAp_A52, XeniumpAp_A53, and HEST-1k. XeniumpAp_A54 and XeniumpAp_A55 are 10× Genomics Xenium human skin panels with approximately 300 genes, XeniumpAp_A56 is a Xenium Prime panel with pAp_A57 genes, and HEST-1k contains 59 human samples from 12 organs and 1.6M paired patches. Modalities include H&E pAp_A58 with or without DAPI/18S, and the preprocessing uses pAp_A59 crops centered on cell centroids, log-normalization, and QC that removes the bottom pAp_A60 low-count cells. The metrics are FID, SSIM, and feature distance in Inception/v2 latent space.

Setting Method Reported values
Single-cell, XeniumpAp_A61 Rectified flow FID pAp_A62, SSIM pAp_A63
Single-cell, XeniumpAp_A64 Diffusion-baseline FID pAp_A65, SSIM pAp_A66
Cross-dataset transfer, pAp_A67 Single-cell FID pAp_A68, SSIM pAp_A69

Human evaluation involved three board-certified pathologists, who rated similarity to ground truth with median pAp_A70 and preferred rectified flow versus diffusion in pAp_A71 of pairwise comparisons. Qualitatively, the generated H&E and DAPI images are reported to faithfully reproduce nuclear shape, nucleoli, cell-cell juxtapositions, and melanoma-specific phenotypes. The method is also described as outperforming a diffusion-based baseline in all experiments.

The stated implications are biological and practical. By generating morphology from transcriptomes, the framework enables in silico exploration of how a cell would look if its gene expression were altered. Conditioning on multi-cell patches permits probing intercellular interactions. In cancer, the framework is proposed as a way to reveal dysregulated imaging patterns such as EMT features and nuclear pleomorphism associated with oncogenic pathways. Potential applications listed in the paper include minimally invasive transcriptome-guided biopsy imaging, augmentation of training data for AI-based histopathology, and virtual perturbation studies.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to GeneFlow.