arXiv:2611.05202cs.LGNov 2026

Manuscript Offprint

arXiv:2611.05202

Empirical Bayes Flow Matching for Continuous Cryo-EM Heterogeneity

Daniel Aibinder, Azmi Haider, Dan Rosenbaum

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We address the problem of learning generative priors over high-dimensional latent variables from indirect, noisy observations, with a focus on continuous heterogeneity in cryo-electron microscopy (cryo-EM). In this setting, 3D atomic structures x∈R3Nax \in \mathbb{R}^{3N_a} are never directly observed and must be inferred from 2D projection images yy generated by a complex, non-linear forward operator. We propose Empirical Bayes Flow Matching (EB-FM), a method that learns a flow matching prior pθ(x)p_\theta(x) directly from observations using a Monte Carlo stochastic approximation Expectation-Maximization framework. EB-FM alternates between an E-step that performs approximate posterior sampling from pθ(x∣y)p_\theta(x \mid y) via guided flow-based generation while maintaining persistent latent estimates through stochastic approximation, and an M-step that updates the flow model using these stabilized latent variables as training targets. This approach eliminates the need for pretraining on clean data and naturally accommodates non-linear forward models. We validate our method on controlled inverse problems using two-moons and MNIST data, and demonstrate its effectiveness on simulated cryo-EM data with known poses, showing that EB-FM can recover continuous distributions of protein conformations directly in atomic-coordinate space.

1 Introduction

In the natural sciences, quantities of interest are typically not directly observed but inferred from indirect measurements. This inverse-modelling task is central to experimental science, and its success depends on how faithfully we can represent the distribution of the underlying quantities of interest.

Inferring protein structure using cryogenic electron microscopy (cryo-EM) is a prime example of this task [1, 2, 3]. Proteins carry out their biological functions as dynamic molecules, adopting multiple conformational states that mediate essential cellular processes such as transport and signalling [4, 5]. Cryo-EM is uniquely positioned to observe this structural heterogeneity: a biological sample is flash-frozen, preserving the ensemble of conformations present in solution, and an electron beam then produces thousands of noisy 2D projection images of the 3D structures, each in a random, unknown orientation [1, 2, 3, 6]. In contrast to models like AlphaFold [7, 8], which primarily target high confidence static structures, cryo-EM data directly reflects the full distribution of conformations that a protein occupies, and recovering this distribution is essential for understanding function [9]. The task is therefore not to reconstruct a single 3D structure, but to infer a distribution p(x)p(x) over 3D atomic configurations from indirect observations. This can be framed as an Empirical Bayes problem [10, 11, 12].

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Figure

Figure 1: Overview of EB-FM, illustrated for the cryo-EM setting. Each observation yiy_i is associated with a persistent latent x~i\tilde{x}_i that tracks the posterior mean. In the E-step, the current flow matching prior pθ(x)p_\theta(x) generates a posterior sample x^i\hat{x}_i via gradient-based guidance through the differentiable forward operator A\mathcal{A}, and x~i\tilde{x}_i is updated by EMA. In the M-step, the prior is trained by conditional flow matching on the persistent latents {x~i}\{\tilde{x}_i\} in place of clean data.

Classical cryo-EM reconstruction pipelines [13, 14] target single consensus structures and handle heterogeneity only through discrete clustering. Recent deep-learning methods (cryoDRGN [15], 3DFlex [16], cryoFIRE [17], cryoSPHERE [18], mixture-of-neural-fields [19]) learn continuous latent representations of conformational variability, but all share a structural limitation: they operate in a two-stage regime in which the 2D projections are first used to reconstruct 3D density / voxel grids, and atomic models are fit to those densities only as a separate downstream step. This decoupling of the generative model from the underlying atomic physics prevents the use of strong structural priors: the density stage has no access to atomic-coordinate priors, and the atom-fitting stage no longer has access to the raw observations. This matters most when the observations are under-determined and have low signal-to-noise ratios, precisely the regime where a strong atomic prior should help the most. The exception in the literature is [20], which operates directly in atomic-coordinate space and couples an atomic-coordinate prior to the raw image observations using a variational autoencoder. We follow this direction, incorporating modern generative-modelling approaches for the prior.

Diffusion [21, 22, 23] and flow matching [24, 25, 26] models have become the dominant framework for learning complex high-dimensional distributions, with striking successes in molecular and structural biology [27, 28, 29, 30, 8]. Recent work has demonstrated that pre-trained diffusion priors can be successfully leveraged to solve inverse problems directly in protein space. Notably, Levy et al. [31] and CryoBoltz [32] successfully guide pre-trained diffusion models to fit heterogeneous cryo-EM density maps at inference time. However, utilizing a pre-trained prior is not feasible for de novo structural discovery, where no clean atomic structures of the target distribution are available and the training data consists only of indirect, noisy projections {yi}\{y_i\}. The central question is therefore how to train a modern generative prior when the data is itself the output of the inverse problem we are trying to solve.

We propose Empirical Bayes Flow Matching (EB-FM), a method that learns a flow matching prior over atomic structures from indirect observations, by iteratively inverting the forward model during training. Like [20], we operate in atomic-coordinate space, but we depart from its VAE framing in two important ways. First, we replace the variational-autoencoder prior with a flow matching model, which can capture complex multi-modal structural distributions. Second, instead of an amortised encoder, we maintain persistent per-observation latents {x~i}\{\tilde{x}_i\} that are inferred via optimization during the model training. This is formulated as a Monte Carlo stochastic approximation Expectation-

Maximization algorithm [33]. We optimize the marginal likelihood of the observations by alternating between an E-step, where each latent x^i\hat{x}_i is refined via deterministic approximate posterior sampling using the current prior and the observation yiy_i, and an M-step, in which the flow matching prior is retrained on the stabilized latent ensemble {x^i}\{\hat{x}_i\}.

Several lines of work train generative priors directly from corrupted observations rather than clean data, including AmbientDiffusion [34] for structured measurement corruption. Most relevant to our setting, DiEM [35] proposes a similar empirical Bayes scheme with a diffusion prior, but under two restrictions that prevent its application in our setting. First, DiEM is formulated exclusively for linear Gaussian forward models p(y∣x)=N(y∣Ax,Σy)p(y \mid x) = \mathcal{N}(y \mid Ax, \Sigma_y), for which the intermediate-state marginal likelihood admits a closed form via moment matching. Our cryo-EM forward model is structurally non-linear as the 3D atomic coordinates enter the projected image through a sum of radial-basis exponentials. Second, DiEM's E-step relies on solving a large linear system via a Conjugate-Gradient method at every discretization step. This requires evaluating Vector-Jacobian Products through the generative network, which becomes computationally prohibitive in the case of high dimensional observations. EB-FM bypasses these limitations, targeting non-linear differentiable forward models with a tractable E-step.

We first validate EB-FM on controlled benchmarks using 2D two-moons data and MNIST, where we can ablate design choices. We then apply it to the cryo-EM task of inferring heterogeneous protein structure, with data generated by molecular-dynamics and electron-microscopy simulators [6, 36]. We adopt known poses as a simplifying assumption that isolates the EB-FM contribution from the joint pose-estimation problem. While unknown poses and mismatch between simulated and real data remain substantial open challenges, EB-FM provides the methodological foundation on which those extensions can be built. Our contributions can be summarized as follows:

  1. We develop empirical Bayes flow matching (EB-FM), a method for learning flow matching generative priors from indirect observations by iteratively inverting a possibly non-linear forward model during training.
  2. On controlled benchmarks we validate our design choices that stabilize the E-step and reduce the posterior sampling variance: flow matching with gradient based guidance and persistent latents, which reduce variance across iterations.
  3. We apply EB-FM on simulated cryo-EM data and demonstrate the recovery of 3D conformational distributions from 2D projections directly in atomic-coordinate space, under known poses.

Code is available at: https://daiyral.github.io/Empirical-Bayes-Flow-Matching-for-Continuous-Cryo-EM-Heterogeneity/

References (40)