---
title: 'MEP-Diffusion: Hybrid Electron Ptychography'
url: https://www.emergentmind.com/topics/mep-diffusion
type: topic
---

# MEP-Diffusion: Hybrid Electron Ptychography

MEP-Diffusion is a hybrid reconstruction framework for **multislice electron ptychography (MEP)** that combines a **learned diffusion prior over crystal structures** with a **traditional physics-based ptychographic solver**. Its central idea is not to replace existing iterative reconstruction machinery, but to **augment it with a generative model** that knows what plausible crystal structures look like. The method is integrated into reconstruction through **Diffusion Posterior Sampling (DPS)**, and is motivated by the ill-posedness of recovering a 3D crystal volume from diffraction measurements, especially the weak depth information in MEP [2507.17800].

## 1. Definition and conceptual scope

In multislice electron ptychography, a focused electron probe is scanned across a specimen on a 2D grid, and at each scan position the scattered wave is recorded as a 2D diffraction pattern. Collectively, this produces a **4D dataset**: a stack of diffraction images indexed by scan position. MEP-Diffusion addresses the inverse problem of reconstructing the underlying **3D crystal structure** from those measurements by combining a learned prior with the physical measurement model [2507.17800].

The framework is explicitly **hybrid**. The diffusion model supplies a prior over plausible atomic volumes, while the ptychographic forward model enforces measurement consistency. This design reflects the paper’s claim that the diffusion prior should **augment rather than replace** the physical solver. In practical terms, the method is aimed at failure modes of existing iterative solvers such as blurry reconstructions, depth collapse, and suboptimal local minima.

In this usage, **MEP** denotes **multislice electron ptychography**. This differs from the separate literature in which **MEP** denotes a **minimum energy pathway** in atomistic simulation. Recent work on minimum energy pathway discovery has instead used active-learning surrogates for nudged elastic band calculations [2512.14993], while a distinct line of work has used the string method to compute MEPs and principal curves from pretrained diffusion models [2602.22122]. This suggests that “MEP-Diffusion” is not a universally standardized term across domains.

## 2. Forward model and inverse-problem structure

The reconstructed structure is represented as a 3D real-valued volume

$$
\mathbf{x} \in \mathbb{R}^{D \times H \times W},
$$

where \(D\) is depth and \(H,W\) are lateral dimensions. Under the strong phase approximation,

$$
\mathbf{O}(\mathbf{r}) \approx \exp\!\left(i \sigma_e V(\mathbf{r})\right),
$$

where \(V(\mathbf{r})\) is the atomic scattering potential and \(\sigma_e\) is the electron interaction parameter. The formulation absorbs the exponential and works with

$$
\mathbf{x} := \sigma_e V(\mathbf{r}),
$$

which is the structure to be recovered. The simplified forward model is written as

$$
\mathbf{y} = f(\mathbf{x}; \boldsymbol{\phi}, \boldsymbol{\Omega}),
$$

where \(f\) describes how the probe \(\boldsymbol{\phi}\) interacts with the material at scan positions \(\boldsymbol{\Omega}\), producing measured diffraction patterns \(\mathbf{y}\) [2507.17800].

The inverse problem is described as inherently ill-posed for several reasons. First, **depth resolution is much worse than lateral resolution**: lateral resolution can be sub-angstrom, while depth resolution is around \(2\,\text{nm}\), roughly 100 times worse than lateral dimensions. Second, the forward model loses information because the measurements are diffraction intensities rather than direct 3D atomic coordinates. Third, real measurements are noisy. Fourth, conventional iterative solvers remain weakly constrained even with regularization. The paper notes that this combination can leave physics-only methods vulnerable to depth ambiguity and poor local minima.

The empirical consequence is a characteristic reconstruction pathology: different 3D structures can explain essentially the same diffraction data, and conventional solvers may reconstruct nearly uniform depth slices. MEP-Diffusion is formulated specifically to counter this by introducing a prior over realistic crystal lattices and atomic arrangements.

## 3. Diffusion prior, architecture, and training data

The diffusion component is a **diffusion probabilistic model (DPM)** trained on a large corpus of crystal structures. The forward noising process is

$$
\mathbf{z}_t = \alpha_t \mathbf{x} + \sigma_t \boldsymbol{\epsilon}, \qquad \boldsymbol{\epsilon} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}),
$$

with a continuous noise parameterized by log signal-to-noise ratio,

$$
\lambda_t = \log\!\left(\frac{\alpha_t^2}{\sigma_t^2}\right).
$$

The model uses a variance-preserving parameterization,

$$
\alpha_t^2 = \mathrm{sigmoid}(\lambda_t), \qquad \sigma_t^2 = \mathrm{sigmoid}(-\lambda_t).
$$

Training uses a **velocity-prediction objective**,

$$
\mathbb{E}_{\boldsymbol{\epsilon} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}),\, t \sim \mathcal{U}(0,1)} \left[ w(\lambda_t)\, \left\| \mathbf{v_\theta}(\mathbf{z}_t,\lambda_t) - \mathbf{v} \right\|_2^2 \right],
$$

where

$$
\mathbf{v} = \alpha_t \boldsymbol{\epsilon} - \sigma_t \mathbf{x}.
$$

A notable design choice is the weighting function

$$
w(\lambda_t) = \frac{1}{Z}\,\mathcal{N}(\lambda_t; -7, 3),
$$

which places extra emphasis on **low logSNR / high-noise regimes**. The stated motivation is that, for crystal data, periodic structure emerges very early in the reverse process, so the model must learn to recover the onset of periodicity from near-Gaussian noise [2507.17800].

The denoiser is a **3D UNet** modified for anisotropic voxel spacing,

$$
(1.6\,\text{\AA}, 0.2\,\text{\AA}, 0.2\,\text{\AA}),
$$

so the network first downsamples only in height and width, then performs full 3D downsampling, with symmetric reversal during upsampling. The model has about **100M parameters**.

The training set is constructed from the **Inorganic Crystal Structure Database (ICSD)**. The pipeline starts with \(\sim 258{,}000\) entries, keeps materials with all lattice vectors \(<20\,\text{\AA}\), yields \(\sim 211{,}000\) unique materials, renders each in 3 orientations, and thereby produces \(\sim 633{,}000\) examples. The procedure also randomly removes \(1\%\) of atoms to simulate vacancies. Each crystal is rendered as a tensor of size \((16,100,100)\), and training uses crops of size \((8,64,64)\). Validation uses **5,000 materials = 15,000 examples**, and the test set uses **100 materials = 300 examples**.

## 4. Posterior sampling and physics-guided guidance

MEP-Diffusion is incorporated into reconstruction through **Diffusion Posterior Sampling**. The posterior score is decomposed as

$$
\nabla_{\mathbf{z}_t} \log p_t(\mathbf{z}_t \mid \mathbf{y}) = \nabla_{\mathbf{z}_t} \log p_t(\mathbf{z}_t) + \nabla_{\mathbf{z}_t} \log p_t(\mathbf{y} \mid \mathbf{z}_t).
$$

Because \(p_t(\mathbf{y}\mid \mathbf{z}_t)\) is difficult to compute directly, the method uses an approximation based on the model’s MMSE estimate of the clean sample,

$$
\nabla_{\mathbf{z}_t} \log p_t(\mathbf{z}_t \mid \mathbf{y}) \approx \nabla_{\mathbf{z}_t} \log p_t(\mathbf{z}_t) + \nabla_{\mathbf{z}_t} \log p_t\!\left(\mathbf{y}\mid \mathbf{x_\theta}(\mathbf{z}_t,\lambda_t)\right).
$$

Operationally, this yields a correction to the model’s \(\mathbf{x}\)-prediction,

$$
\mathbf{x}_{\theta}'(\mathbf{z}_t,\lambda_t) = \mathbf{x}_{\theta}(\mathbf{z}_t,\lambda_t) - g(\lambda_t)\, \nabla_{\mathbf{z}_t}\left\| f\!\left(\mathbf{x}_{\theta}(\mathbf{z}_t,\lambda_t)\right) - \mathbf{y} \right\|_2^2.
$$

This is the core hybrid step: the diffusion model proposes a plausible crystal structure, while the physical gradient nudges it toward consistency with the observed diffraction data [2507.17800].

The guidance schedule is treated as a major algorithmic component rather than a minor hyperparameter. The paper reports that standard schedules can fail in MEP because excessively strong late-stage physical guidance can collapse reconstructions into nearly identical depth slices. To avoid this, the method uses a **Shifted Sigmoid** schedule,

$$
g(\lambda_t) \propto \mathrm{sigmoid}(4 - \lambda_t)^{1/2},
$$

which anneals the physical guidance toward zero as sampling proceeds. The stated intuition is that early sampling should use physics to establish global periodic structure, while late sampling should allow the learned prior to refine atomic detail and avoid depth collapse. This schedule is reported to outperform the simpler baseline \(g(\lambda_t)\propto \alpha_t\).

## 5. Evaluation protocol, quantitative results, and computational behavior

Evaluation uses simulated diffraction patterns generated with **abTEM** under realistic conditions: **300 kV** acceleration voltage, **21.4** semi-convergence angle, **200 \(\text{\AA}\)** overfocus, **500 nm** spherical aberration, **0.512 \(\text{\AA}\)** scan step size, **\(26 \times 26\)** scan positions, and dose **\(10^6\,e^-/\text{\AA}^2\)**. Reconstruction quality is measured with **PSNR** and **SSIM**. Because absolute intensity scale can vary across materials and ptychography is only defined up to an arbitrary phase offset, all reconstructions are **instance-normalized to \([0,1]\)** before computing metrics. The paper reports results for both **full 3D reconstruction** and **depth-summed 2D projection** [2507.17800].

For full 3D reconstruction, the reported results are as follows:

| Method | PSNR | SSIM |
|---|---:|---:|
| LSQ-ML | 27.49 | 0.3949 |
| PtyRAD[Adam] | 26.85 | 0.4629 |
| PtyRAD[L-BFGS] | 31.49 | 0.6506 |
| **MEP-Diffusion** | **33.7190** | **0.7523** |

For depth-summed 2D reconstruction, the reported results are:

| Method | PSNR | SSIM |
|---|---:|---:|
| LSQ-ML | 27.97 | 0.4279 |
| PtyRAD[Adam] | 27.42 | 0.4896 |
| PtyRAD[L-BFGS] | 33.56 | 0.7096 |
| **MEP-Diffusion** | **41.5101** | **0.8852** |

The paper states that MEP-Diffusion outperforms all baselines and highlights a **90.50% SSIM improvement** over existing methods. It also states that all improvements are statistically significant with \(p < 10^{-4}\). Qualitatively, the central contrast with the baselines is the recovery of distinct depth slices rather than nearly uniform ones.

An ablation on the guidance schedule reinforces the importance of annealed conditioning. For full 3D reconstruction, the **Alpha** schedule \(g(\lambda_t)\propto \alpha_t\) gives PSNR **32.7677** and SSIM **0.6494**, whereas the **Shifted Sigmoid** schedule gives PSNR **33.7190** and SSIM **0.7523**. For depth-summed metrics, the corresponding SSIM values are **0.7745** and **0.8852**.

The method also exposes a quality–time trade-off. The paper reports that **100 sampling steps** already beat the conventional baselines, that additional steps improve quality further, and that gains saturate beyond about **1000 steps**. All time experiments were run on a **single NVIDIA H100 GPU**. This supports the intended use of the framework as a tunable posterior sampler rather than a fixed-cost solver.

## 6. Limitations and relation to adjacent research

The paper identifies several remaining failure modes: **slice misordering**, **missing or extra atoms**, **incorrect local structures**, and errors concentrated in the **depth dimension**. It also notes that the method may still suffer when the forward model is ambiguous. These caveats are significant because they indicate that the learned prior mitigates, but does not eliminate, the observability limits of multislice electron ptychography [2507.17800].

The broader significance of MEP-Diffusion is clearest when set against neighboring literatures. In minimum-energy-pathway discovery, the main computational bottleneck is repeated energy and force evaluation along a path. One recent solution, **Neural Network Bayesian Algorithm Execution (NN-BAX)**, replaces repeated simulator calls inside NEB with an actively refined surrogate, achieving a one to two order of magnitude reduction in energy and force evaluations with negligible loss in MEP accuracy and scalability to \(>100\)-dimensional systems [2512.14993]. That framework addresses the same general question of efficient path discovery, but it does so through active-learning-based NEB rather than a diffusion prior.

A second adjacent line of work uses the **string method** to probe pretrained diffusion models directly. There, one evolves a curve under the learned score field to obtain either pure transport paths, **minimum energy paths**, or **finite-temperature principal curves**. In image models, the reported result is that MEPs can pass through high-likelihood but unrealistic “cartoon” intermediates, whereas principal curves produce more realistic transitions; in protein structure prediction, the same machinery yields physically plausible pathways between metastable conformers [2602.22122]. This is conceptually related to MEP-Diffusion only at the level of score-based geometric reasoning.

A further neighboring example comes from biased surface diffusion. For \(\mathrm{H_2O}\) on Al(111), NEB combined with constant-\(\mu_{\rm e}\) methods shows that the MEP, adsorption site, and activation barrier depend strongly on applied bias, and that the relevant thermodynamic potential is the grand potential \(\Omega\) rather than only the total energy \(E_{\rm tot}\) [2012.10090]. This underscores that “MEP” in the atomistic literature typically refers to a pathway on an energy landscape, not to electron ptychographic reconstruction.

Taken together, these adjacent results indicate that **MEP-Diffusion** in the strict sense of [2507.17800] is a **physics-guided generative reconstruction method for multislice electron ptychography**, whereas nearby “MEP” literatures concern **minimum energy pathways** in learned or atomistic landscapes. A plausible implication is that the term is best interpreted through its host field: in ptychography, it denotes a crystal-reconstruction framework; in atomistic simulation, it denotes transition-path computation.

Source: https://www.emergentmind.com/topics/mep-diffusion