An electron microscope scans a sample and records how electrons scatter off atoms at each point. The result is a giant stack of images — one for every point. These images encode information about how atoms are arranged: in neat rows or with a tilt, the orientation of the crystal lattice, and whether there are internal strains.
The problem is that there are millions of such images, and sorting through them by hand is impossible. The authors propose automatically finding regions where the scattering pattern is nearly identical. Similar images are grouped together, and for each group, an averaged pattern is produced — sharp and noise-free. Thus, from the chaos of millions of images, a map of a few dozen regions emerges.
This approach drastically reduces data volume — by hundreds of times. Importantly, no details are lost; instead, they become more visible: averaging removes random noise. The method is useful not only for static samples but also for observing processes in real time, such as crystal growth.
The authors tested the algorithm on data from the growth of gold nanoparticles in a liquid medium. The microscope recorded video of particles coarsening, and the program classified frames on the fly by crystal packing type. This made it possible to see how each particle's structure changes individually.
Now materials scientists have a tool that turns raw microscope data into a clear map: where each phase is, how the lattice is oriented, and where strains exist. This speeds up analysis and helps uncover patterns that were previously lost in noise.
as written by the authors arXiv:2601.17262
Four-dimensional scanning transmission electron microscopy (4D-STEM) enables mapping of diffraction information with nanometer-scale spatial resolution, offering detailed insight into local structure, orientation, and strain. However, as data dimensionality and sampling density increase, particularly for in situ scanning diffraction experiments (5D-STEM), robust segmentation of structurally consistent behavior across sequential measurements becomes essential for efficient and physically meaningful analysis. Here, we introduce a clustering framework that identifies crystallographically distinct domains from 4D-STEM datasets. By using local diffraction-pattern similarity as a metric, the method extracts closed contours delineating spatially contiguous regions. This approach produces cluster-averaged diffraction patterns that improve signal quality while reducing data volume by orders of magnitude, enabling rapid and accurate orientation, phase, and strain mapping. We demonstrate the applicability of this approach to in situ liquid-cell 4D-STEM data of gold nanoparticle growth. Our method provides a scalable and generalizable route for spatially coherent segmentation, data compression, and quantitative structure-strain mapping across diverse 4D-STEM modalities. The full analysis code and example workflows are publicly available to support reproducibility and reuse.
Averaging diffraction patterns improves signal quality so much that weak reflections, invisible in individual images, become apparent.