Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Virtual dark field, digital dark field, and ML clustering

Because a 4D-STEM dataset contains the entire diffraction pattern at every probe position, any STEM detector geometry can be applied after the experiment: integrate the intensity inside a chosen region of the diffraction pattern at each probe position, and the result is an image. This is virtual imaging, and it is usually the first, and often the most informative, analysis applied to any 4D-STEM dataset. Virtual bright field and dark field reconstruction in this sense was popularized by Rauch and co-workers alongside scanning precession diffraction and ACOM VILADOT et al. (2013), Rauch & Véron (2014), and generalized to arbitrarily shaped virtual apertures by Gammer et al. Gammer et al. (2015).

Virtual bright field and dark field

A circular mask over the central beam gives a virtual bright field (BF) image; an annulus outside it gives a virtual annular dark field (ADF). The two are complementary: electrons scattered out of the BF disk land in the DF detector, so regions that darken in BF brighten in DF. Unlike physical detectors, virtual detectors are free: you can try any inner/outer radius, any shape, any position, and iterate until the contrast isolates the feature you care about Paterson et al. (2020):

Virtual detector geometries applied to a diffraction pattern: a single aperture, an annular aperture, and an array of apertures over the diffracted spots

Virtual detectors are defined in software after the experiment: a single aperture over one reflection, an annulus, or an aperture array matched to a whole family of diffracted spots.

Digital dark field

Classical dark field TEM tilts the beam (or shifts the objective aperture) so one chosen Bragg reflection forms the image:

Ray diagram of dark field imaging in conventional TEM using an objective aperture in the back focal plane

Conventional dark field TEM: an objective aperture in the back focal plane selects a single diffracted beam to form the image: one reflection, one exposure, one tilt condition at a time.

The 4D-STEM equivalent, digital dark field (DDF) MacLaren et al. (2024), places a virtual aperture over one (or several) specific Bragg reflections and maps where in real space that reflection is excited. Every reflection in the dataset is available simultaneously, from a single scan:

Flowchart of the digital dark field workflow, from probe template and peak finding through single apertures, aperture arrays, or points-list reduction to virtual dark field images

The DDF workflow: after peak finding and g-vector identification, images can be formed from a single virtual aperture, from a mask built on a whole array of aperture positions, or by reducing the detected points list directly against the aperture array.

This is enormously powerful for microstructure:

Digital dark field maps of a perovskite film formed from different superlattice and higher-order Laue zone reflections, each highlighting a different ordered region

Digital dark field in action on a perovskite thin film: virtual apertures on different superlattice and higher-order Laue zone reflections (right) map chemically and structurally distinct ordered regions through the film (left), all from one 4D-STEM scan.

Machine-learning clustering

A 4D-STEM dataset from a complex microstructure can contain thousands of distinct diffraction patterns: different phases, orientations, domains, and overlaps. Designing virtual detectors by hand (as in the previous section) works when you know what you are looking for; unsupervised machine learning lets the data tell you what distinct patterns exist and where they occur, with no prior assumptions about the structures present Martineau et al. (2019).

The idea

Treat each probe position as one observation (a vector of detector-pixel intensities) and ask: what small set of characteristic patterns, mixed in varying proportions, explains the whole dataset? Two families of methods are widely used:

Comparison of many clustering algorithms applied to toy 2D datasets, showing how each algorithm partitions differently shaped clusters

No single “right” clustering algorithm: the scikit-learn comparison grid shows how k-means, spectral, agglomerative, DBSCAN, Gaussian-mixture, and other methods partition the same toy datasets very differently. The same is true for diffraction data.

A typical workflow: preprocess (align the zero beam, mask the central disk or take a log/power scaling so weak reflections count, optionally bin) → reduce dimensionality → decompose or cluster → inspect the component patterns as diffraction patterns and interpret them crystallographically → refine.

Why this works so well for diffraction data

Unlike natural images, diffraction patterns from a given phase/orientation are highly reproducible; the “signal manifold” is low-dimensional. Clustering therefore tends to recover physically meaningful classes: distinct phases, orientation variants, ordered vs. disordered regions, and even subtle symmetry-breaking distortions that are hard to see by eye Kalinin et al. (2022). The output is a phase/domain map plus a library of representative patterns, obtained in minutes from datasets far too large to inspect manually:

A grid of mean diffraction patterns for each cluster found in a 4D-STEM dataset

The payoff: each cluster’s mean diffraction pattern, extracted automatically from a 4D-STEM scan. Each class corresponds to a distinct diffraction condition (a phase, orientation variant, or overlap), ready for crystallographic interpretation.

Caveats

References
  1. VILADOT, D., VÉRON, M., GEMMI, M., PEIRÓ, F., PORTILLO, J., ESTRADÉ, S., MENDOZA, J., LLORCA‐ISERN, N., & NICOLOPOULOS, S. (2013). Orientation and phase mapping in the transmission electron microscope using precession‐assisted diffraction spot recognition: state‐of‐the‐art results. Journal of Microscopy, 252(1), 23–34. 10.1111/jmi.12065
  2. Rauch, E. F., & Véron, M. (2014). Automated crystal orientation and phase mapping in TEM. Materials Characterization, 98, 1–9. 10.1016/j.matchar.2014.08.010
  3. Gammer, C., Burak Ozdol, V., Liebscher, C. H., & Minor, A. M. (2015). Diffraction contrast imaging using virtual apertures. Ultramicroscopy, 155, 1–10. 10.1016/j.ultramic.2015.03.015
  4. Paterson, G. W., Webster, R. W. H., Ross, A., Paton, K. A., Macgregor, T. A., McGrouther, D., MacLaren, I., & Nord, M. (2020). Fast Pixelated Detectors in Scanning Transmission Electron Microscopy. Part II: Post-Acquisition Data Processing, Visualization, and Structural Characterization. Microscopy and Microanalysis, 26(5), 944–963. 10.1017/s1431927620024307
  5. MacLaren, I., Fraser, A. T., Lipsett, M. R., & Ophus, C. (2024). Digital Dark Field—Higher Contrast and Greater Specificity Dark Field Imaging Using a 4DSTEM Approach. Microscopy and Microanalysis, 31(1). 10.1093/mam/ozae104
  6. MacLaren, I., Frutos-Myro, E., McGrouther, D., McFadzean, S., Weiss, J. K., Cosart, D., Portillo, J., Robins, A., Nicolopoulos, S., Nebot del Busto, E., & Skogeby, R. (2020). A Comparison of a Direct Electron Detector and a High-Speed Video Camera for a Scanning Precession Electron Diffraction Phase and Orientation Mapping. Microscopy and Microanalysis, 26(6), 1110–1116. 10.1017/s1431927620024411
  7. Martineau, B. H., Johnstone, D. N., van Helvoort, A. T. J., Midgley, P. A., & Eggeman, A. S. (2019). Unsupervised machine learning applied to scanning precession electron diffraction data. Advanced Structural and Chemical Imaging, 5(1). 10.1186/s40679-019-0063-3
  8. Kalinin, S. V., Ophus, C., Voyles, P. M., Erni, R., Kepaptsoglou, D., Grillo, V., Lupini, A. R., Oxley, M. P., Schwenker, E., Chan, M. K. Y., Etheridge, J., Li, X., Han, G. G. D., Ziatdinov, M., Shibata, N., & Pennycook, S. J. (2022). Machine learning in scanning transmission electron microscopy. Nature Reviews Methods Primers, 2(1). 10.1038/s43586-022-00095-w