Table of Contents
Fetching ...

Unsupervised clustering algorithm for efficient processing of 4D-STEM and 5D-STEM data

Serin Lee, Stephanie M. Ribet, Arthur R. C. McCray, Andrew Barnum, Jennifer A. Dionne, Colin Ophus

TL;DR

This work tackles the challenge of analyzing high-dimensional 4D-STEM/5D-STEM data by introducing an unsupervised marching-square clustering framework that segments diffraction patterns into spatially coherent crystallographic domains. The method leverages local diffraction-pattern similarity to delineate domain boundaries and produces cluster-averaged diffraction cubes, which significantly improve signal-to-noise and reduce data volume, enabling rapid orientation, phase, and strain mapping. By applying correlative prefiltering and an efficient clustering pipeline, the approach achieves substantial data compression (reducing the effective data size by orders of magnitude) while maintaining physically meaningful structural information. Demonstrated on in situ liquid-cell 4D-STEM of Au nanoparticle growth, the framework yields robust grain delineation and smooth strain gradients, and is implemented as an open-source module within py4DSTEM to support reproducibility and reuse.

Abstract

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 spatially coherent regions 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 regions of coherent structural behavior. This approach produces cluster-averaged diffraction patterns that improve signal-to-noise and reduce 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.

Unsupervised clustering algorithm for efficient processing of 4D-STEM and 5D-STEM data

TL;DR

This work tackles the challenge of analyzing high-dimensional 4D-STEM/5D-STEM data by introducing an unsupervised marching-square clustering framework that segments diffraction patterns into spatially coherent crystallographic domains. The method leverages local diffraction-pattern similarity to delineate domain boundaries and produces cluster-averaged diffraction cubes, which significantly improve signal-to-noise and reduce data volume, enabling rapid orientation, phase, and strain mapping. By applying correlative prefiltering and an efficient clustering pipeline, the approach achieves substantial data compression (reducing the effective data size by orders of magnitude) while maintaining physically meaningful structural information. Demonstrated on in situ liquid-cell 4D-STEM of Au nanoparticle growth, the framework yields robust grain delineation and smooth strain gradients, and is implemented as an open-source module within py4DSTEM to support reproducibility and reuse.

Abstract

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 spatially coherent regions 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 regions of coherent structural behavior. This approach produces cluster-averaged diffraction patterns that improve signal-to-noise and reduce 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.
Paper Structure (16 sections, 13 equations, 7 figures)

This paper contains 16 sections, 13 equations, 7 figures.

Figures (7)

  • Figure 1: Schematic of the clustering process based on marching-square algorithm.
  • Figure 2: Applying clustering to the 4D-STEM dataset. a. Virtual dark field image of the Au nanoparticles formed by the electron-beam induced reduction of Au cation precursors. b. (left) Diffraction pattern from the reference pixel (yellow box; marked as the yellow dot in panel a). Neighboring pixels with diffraction patterns above the similarity threshold are highlighted in green, while those below the threshold are shown in red. (right) Schematic illustration of the resulting cluster, where each square corresponds to a probe position within the cluster. c. Plot of the similarity values ($\bar{S}(x,y)$), where the color range spans from 0 to 1. d. Real-space mask generated for the background thresholding. e. Cluster map, where colors were iterated over ten distinct color codes to differentiate clusters.
  • Figure 3: Comparing diffraction patterns with and without clustering. (a) Virtual dark-field image with colored markers indicating the six cluster seeds. (b) Diffraction patterns from the same positions with clustering (top) and without clustering (bottom).
  • Figure 4: Bragg disk detection with clustering. Bragg disk detector (a) and orientation mapping by ACOM template matching (b) on diffraction patterns.
  • Figure 5: Orientation and strain mapping with (a) and without clustering (b). a. (left) In-plane orientation map, (middle) out-of-plane orientation map, and (right) dilation map of a clustered dataset. b. (left) In-plane orientation map, (middle) out-of-plane orientation map, and (right) dilation map of a non-clustered dataset. c. Color legend of the orientation maps.
  • ...and 2 more figures