GeneFlow: Discrete Eulerian and Rectified-Flow Models
- 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 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 , , 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, and , with local densities and in a -dimensional domain. Both are advected by a prescribed velocity field , diffuse, reproduce and die with logistic competition, and experience a selective advantage for 0. In the nondimensional form that measures time in units of the birth rate 1 and space in units of 2, the governing equations are (Guccione et al., 2019):
3
4
Here 5 is the prescribed advecting field, 6 is the diffusion coefficient, 7 is the intrinsic birth rate, 8 is the selective advantage of 9, 0 is the carrying-capacity per mesh cell, and 1 are independent space-time white noises with 2. Under the assumption 3, it is convenient to work with the fraction 4, which yields the stochastic FKPP equation under advection:
5
Within this reduced equation, 6 advects allele frequency, 7 smooths spatial heterogeneity, 8 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 9 per-cell cost even for large 0. The domain is discretized into 1 cells of volume 2, and each cell 3 stores two integers, 4 and 5. Each time step 6 is split into four sub-steps for 7 (Guccione et al., 2019).
- Step 1 (Diffusion): each of the 8 individuals in cell 9 is assigned a random subcell position 0 within a slightly enlarged box of size 1 centered on 2, with 3. This is equivalent to a nearest-neighbor random hopping operator that converges to 4 in the limit 5.
- Step 2 (Advection): each virtual particle is moved by 6.
- Step 3 (Relabeling): each advected particle is re-binned to its new cell index 7, producing temporary counts 8.
- Step 4 (Birth–Death / Competition): in each cell 9, stochastic birth and death are applied a total of 0 times, with birth rate 1 and death rate 2, where the minus sign is for 3 and the plus sign for 4. Births and deaths can be sampled using binomial or Poisson variates.
Validation without flow proceeds by setting 5, reducing the method to a stochastic reaction-diffusion algorithm. Three tests are reported. First, for the 1D Fisher equation 6, the measured front speed 7 for 8 and 9 exhibits a cross-over between strong-drift scaling 0 at low 1 and Brunet–Derrida cutoff behavior
2
at large 3. Second, heterozygosity decay 4 follows 5 in 1D, with simulations at 6 following this power law, and 7 in 2D, with simulations at 8 on a 9 grid producing 0. Third, for an initial fraction 1 of type 2 in total population 3, the well-mixed Kimura formula
4
is recovered in 1D and 2D for 5 up to 6.
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
7
for which 8 alternates sources and sinks. In 2D, the generalization is
9
with two sources and two sinks per period. In the weak-compressibility regime, 0, the approximation 1 is still used, and the effective compressibility parameter is 2 (Guccione et al., 2019).
A new length scale emerges near each source,
3
beyond which an organism is swept away into a sink and is unlikely to return. In this regime, the fixation probability for 4 remains Kimura-like but with an effective population size determined by the source region:
5
where 6 and 7 is an 8 constant fixed by fitting, with 9–0. For small 1,
2
For larger 3, the limiting factor becomes the ability of a growing 4-cluster to escape the source before advection removes it. Balancing advection with the Fisher-wave speed 5 defines
6
and hence a second effective population scale:
7
For larger 8, the fixation curve is fitted by replacing 9 with 00. Simulations on 01 grids with 02, 03, and 04–05 confirm that for 06, data collapse onto the small-07 Kimura curve with 08, while for 09, the large-10 curve with 11 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 12 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 13, where 14 is a gene-expression matrix with up to 15 cells and 16 genes, and 17 is the corresponding 18 histology tile. The pipeline first compresses 19 into a latent vector 20, then combines 21 with a sinusoidal time embedding 22 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 23, two factors 24 and 25 are predicted via a small MLP, and the enriched representation is
26
which introduces learned gene-gene interactions at rank 27. Global gene attention then applies learnable scores 28:
29
Each 30 is passed through two residual blocks to produce a 256-dimensional cell embedding 31, and multi-head cell attention aggregates the cell-level information. For head 32, one computes 33, obtains logits 34, applies a mask 35 for real cells, and forms
36
followed by 37 and a gating layer yielding the RNA code 38.
The image generator is a conditional U-Net with skip connections, where every ResBlock is jointly conditioned on 39 and 40. Rectified flow is defined by the deterministic ODE
41
which transports Gaussian noise 42 to 43. During training, the method introduces the reference path
44
with target velocity
45
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
46
with 47 as a sparsity regularizer on the first encoder layer. An optional spatial regularization term gives
48
where 49 is a warm-up schedule. Two variants of 50 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 Xenium51, Xenium52, Xenium53, and HEST-1k. Xenium54 and Xenium55 are 10× Genomics Xenium human skin panels with approximately 300 genes, Xenium56 is a Xenium Prime panel with 57 genes, and HEST-1k contains 59 human samples from 12 organs and 1.6M paired patches. Modalities include H&E 58 with or without DAPI/18S, and the preprocessing uses 59 crops centered on cell centroids, log-normalization, and QC that removes the bottom 60 low-count cells. The metrics are FID, SSIM, and feature distance in Inception/v2 latent space.
| Setting | Method | Reported values |
|---|---|---|
| Single-cell, Xenium61 | Rectified flow | FID 62, SSIM 63 |
| Single-cell, Xenium64 | Diffusion-baseline | FID 65, SSIM 66 |
| Cross-dataset transfer, 67 | Single-cell | FID 68, SSIM 69 |
Human evaluation involved three board-certified pathologists, who rated similarity to ground truth with median 70 and preferred rectified flow versus diffusion in 71 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.