Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Advertisement

npj Computational Materials
  • View all journals
  • Search
  • My Account Login
  • Content Explore content
  • About the journal
  • Publish with us
  • Sign up for alerts
  • RSS feed
  1. nature
  2. npj computational materials
  3. articles
  4. article
A Unified preprocessing framework for high-throughput diffraction pattern analysis
Download PDF
Download PDF
  • Article
  • Open access
  • Published: 02 March 2026

A Unified preprocessing framework for high-throughput diffraction pattern analysis

  • Mingyu Liu1,
  • Zian Mao1,2,
  • Zhu Liu1,3,
  • Jintao Guo1,
  • Haoran Zhang1,2,
  • Xi Huang4,
  • Chun Cheng5,
  • Jun Ding6,
  • Jian Hui7,
  • Shufen Chu1,
  • Xiaoqin Zeng8,9 &
  • …
  • Yujun Xie1 

npj Computational Materials , Article number:  (2026) Cite this article

  • 1576 Accesses

  • Metrics details

We are providing an unedited version of this manuscript to give early access to its findings. Before final publication, the manuscript will undergo further editing. Please note there may be errors present which affect the content, and all legal disclaimers apply.

Subjects

  • Engineering
  • Materials science
  • Mathematics and computing
  • Optics and photonics

Abstract

Four-dimensional scanning transmission electron microscopy (4D-STEM) is a high-throughput automated data acquisition technique with great potential for real-time data collection and analysis in automated STEM. However, its practical implementation is limited by challenges in data preprocessing, which hinder the timely and accurate interpretation of the large amounts of data it generates. Issues like pervasive noise, beam center drift, and elliptical distortions during high-throughput acquisition inevitably degrade diffraction patterns, leading to systematic errors in quantitative measurements. Conventional calibration algorithms are often material-specific and fail to provide a robust, generalizable solution. In this work, we introduce 4D-PreNet, an end-to-end deep-learning pipeline that integrates attention-enhanced U-Net and ResNet architectures to simultaneously perform denoising, center calibration, and ellipse calibration. The network is trained on extensive simulated datasets that cover a broad range of noise levels, drift magnitudes, and distortion types, thereby enabling generalization to experimental data obtained under different acquisition conditions. Quantitative evaluations demonstrate that 4D-PreNet reduces mean squared error by up to 50% in denoising and achieves sub-pixel center localization with average errors below 0.04 pixels. Compared to conventional algorithms, 4D-PreNet shows improved noise suppression and accurate restoration of diffraction features, enabling reliable real-time analysis of 4D-STEM data and supporting automated STEM workflows.

Similar content being viewed by others

Improved ACOM pattern matching in 4D-STEM through adaptive sub-pixel peak detection and image reconstruction

Article Open access 29 May 2024

Disentangling multiple scattering with deep learning: application to strain mapping from electron diffraction patterns

Article Open access 14 December 2022

Template-Derived Masks for 4D-STEM

Article Open access 20 March 2026

Data availability

The datasets generated and analyzed during the current study are not publicly available due to the internal data sharing policies of the participating institutions, but are available from the corresponding author on reasonable request. The code for implementing the 4D-STEM preprocessing framework—including denoising, beam center calibration, and ellipse calibration networks—is currently under preparation. It will be released via a public GitHub repository upon publication to support reproducibility and community use.

Code availability

The code for implementing the 4D-STEM preprocessing framework—including denoising, beam center calibration, and ellipse calibration networks—is currently under preparation. It will be released via a public GitHub repository upon publication to support reproducibility and community use.

References

  1. Roccapriore, K. M. et al. Automated experiment in 4d-stem: Exploring emergent physics and structural behaviors. ACS Nano 16, 7605–7614 (2022).

    Google Scholar 

  2. Kalinin, S. V. et al. Machine learning in scanning transmission electron microscopy. Nat. Rev. Methods Prim. 2, 11 (2022).

    Google Scholar 

  3. Spurgeon, S. R. et al. Towards data-driven next-generation transmission electron microscopy. Nat. Mater. 20, 274–279 (2021).

    Google Scholar 

  4. Ophus, C. A fast image simulation algorithm for scanning transmission electron microscopy. Adv. Struct. Chem. Imaging 3, 13 (2017).

    Google Scholar 

  5. Zeltmann, S. E. et al. Patterned probes for high precision 4D-stem Bragg measurements. Ultramicroscopy 209, 112890 (2020).

    Google Scholar 

  6. Wang, Z. et al. 4d-misr: A unified model for low-dose super-resolution imaging via feature fusion. AI Sci. 1, 015003 (2025).

    Google Scholar 

  7. Savitzky, B. H. et al. Image registration of low signal-to-noise cryo-stem data. Ultramicroscopy 191, 56–65 (2018).

    Google Scholar 

  8. Zhang, C., Han, R., Zhang, A. R. & Voyles, P. M. Denoising atomic resolution 4D scanning transmission electron microscopy data with tensor singular value decomposition. Ultramicroscopy 219, 113123 (2020).

    Google Scholar 

  9. Wu, C. H., Reynolds, W. T. & Murayama, M. A software tool for automatic analysis of selected area diffraction patterns within digital micrograph™. Ultramicroscopy 112, 10–14 (2012).

    Google Scholar 

  10. Lábár, J. L. & Das, P. P. Pattern center and distortion determined from faint, diffuse electron diffraction rings from amorphous materials. Microsc. Microanal. 23, 647–660 (2017).

    Google Scholar 

  11. Pekin, T. C. et al. Optimizing disk registration algorithms for nanobeam electron diffraction strain mapping. Ultramicroscopy 176, 170–176 (2017).

    Google Scholar 

  12. Jones, L. et al. Managing dose-, damage- and data-rates in multi-frame spectrum-imaging. Microscopy67, i98–i113 (2018).

    Google Scholar 

  13. Yuan, R., Zhang, J. & Zuo, J.-M. Lattice strain mapping using circular hough transform for electron diffraction disk detection. Ultramicroscopy 207, 112837 (2019).

    Google Scholar 

  14. Savitzky, B. H. et al. Py4dstem: A software package for four-dimensional scanning transmission electron microscopy data analysis. Microsc. Microanal. 27, 712–743 (2021).

    Google Scholar 

  15. Kim, J. et al. Self-supervised machine learning framework for high-throughput electron microscopy. Sci. Adv. 11, eads5552 (2025).

    Google Scholar 

  16. Lobato, I. et al. Deep convolutional neural networks to restore single-shot electron microscopy images. npj Comput. Mater. 10, 1188 (2024).

    Google Scholar 

  17. Ziletti, A., Kumar, D., Scheffler, M. & Ghiringhelli, L. M. Insightful classification of crystal structures using deep learning. Nat. Commun. 9, 2775 (2018).

    Google Scholar 

  18. Aguiar, J. A., Gong, M. L. & Tasdizen, T. Crystallographic prediction from diffraction and chemistry data for higher throughput classification using machine learning. Comput. Mater. Sci. 173, 109409 (2020).

    Google Scholar 

  19. Han, Y. et al. Deep learning stem-edx tomography of nanocrystals. Nat. Mach. Intell. 3, 267–274 (2021).

    Google Scholar 

  20. Zheng, H., Lu, X. & He, K. In situ transmission electron microscopy and artificial intelligence enabled data analytics for energy materials. J. Energy Chem. 68, 454–493 (2022).

    Google Scholar 

  21. Kaufmann, K. et al. Crystal symmetry determination in electron diffraction using machine learning. Science 367, 564–568 (2020).

    Google Scholar 

  22. Xu, W. & LeBeau, J. M. A deep convolutional neural network to analyze position averaged convergent beam electron diffraction patterns. Ultramicroscopy 188, 59–69 (2018).

    Google Scholar 

  23. Sadri, A. et al. Unsupervised deep denoising for four-dimensional scanning transmission electron microscopy. npj Comput. Mater. 10, 243 (2024).

    Google Scholar 

  24. Nordahl, G., Dagenborg, S., Sørhaug, J. & Nord, M. Exploring deep learning models for 4D-stem-dpc data processing. Ultramicroscopy 267, 114058 (2024).

    Google Scholar 

  25. Ge, M. et al. Automatic center identification of electron diffraction with multi-scale transformer networks. Ultramicroscopy 259, 113926 (2024).

    Google Scholar 

  26. Xie, Y. et al. Spatially resolved structural order in low-temperature liquid electrolyte. Sci. Adv. 9, eadc9721 (2023).

    Google Scholar 

  27. Martin, B. R. et al. abTEM: Transmission electron microscopy simulations with the atomic potential. Open Res. Eur. 2, 13015 (2022).

    Google Scholar 

  28. Ronneberger, O., Fischer, P. & Brox, T. U-Net: Convolutional networks for biomedical image segmentation. Med. Image Comput. Comput. -Assist. Inter. 9351, 234–241 (2015).

    Google Scholar 

  29. He, K., Zhang, X., Ren, S. & Sun, J. Deep residual learning for image recognition. Proc. IEEE Conf. Comput. Vis. Pattern Recognit. 770, 778 (2016).

    Google Scholar 

  30. Woo, S., Park, J., Lee, J.-Y. & Kweon, I. S. CBAM: Convolutional block attention module. Proc. Eur. Conf. Comput. Vis. 11211, 3–19 (2018).

    Google Scholar 

  31. Han, S., Mao, H. & Dally, W. J. Deep compression: Compressing deep neural networks with pruning, trained quantization and Huffman coding. Proc. Int. Conf. Learn. Represent. (2016).

  32. Lehtinen, J. et al. Noise2Noise: Learning Image Restoration without Clean Data. Proc. Int. Conf. Mach. Learn. 80, 2965–2974 (2018).

    Google Scholar 

  33. Ede, J. M. Deep learning in electron microscopy. Mach. Learn.: Sci. Technol. 2, 011004 (2021).

    Google Scholar 

  34. Bengio, Y. Practical recommendations for gradient-based training of deep architectures. In Neural Networks: Tricks of the Trade (eds Montavon, G., Orr, G. B. & Müller, K.-R.) 437–478 (Springer, 2012).

  35. Sun, K., Xiao, B., Liu, D. & Wang, J. Deep high-resolution representation learning for human pose estimation. Proc. IEEE Conf. Comput. Vis. Pattern Recognit. 5686, 5696 (2019).

    Google Scholar 

  36. Zhang, C. et al. Understanding deep learning (still) requires rethinking generalization. Commun. ACM 64, 107–115 (2021).

    Google Scholar 

  37. Ruiz, N., Chong, E. & Rehg, J. Fine-grained head pose estimation without keypoints. Proc. IEEE Conf. Comput. Vis. Pattern Recognit. Workshops 2074, 2083 (2018).

    Google Scholar 

  38. Jain, A. et al. Commentary: The materials project: A materials genome approach to accelerating materials innovation. APL Mater. 1, 011002 (2013).

    Google Scholar 

  39. Kingma, D. P. & Ba, J. Adam: A method for stochastic optimization. Proc. Int. Conf. Learn. Represent. (2014).

  40. Shi, C. et al. Uncovering material deformations via machine learning combined with four-dimensional scanning transmission electron microscopy. npj Comput. Mater. 8, 114 (2022).

    Google Scholar 

Download references

Acknowledgements

National Natural Science Foundation of China (12474186, 52401159, and 52425101) is acknowledged for funding this research.

Author information

Authors and Affiliations

  1. Global Institute of Future Technology, Shanghai Jiao Tong University, Shanghai, China

    Mingyu Liu, Zian Mao, Zhu Liu, Jintao Guo, Haoran Zhang, Shufen Chu & Yujun Xie

  2. University of Michigan-Shanghai Jiao Tong University Joint Institute, Shanghai Jiao Tong University, Shanghai, China

    Zian Mao & Haoran Zhang

  3. School of Chemistry and Chemical Engineering, Shanghai Jiao Tong University, Shanghai, China

    Zhu Liu

  4. School of Nuclear Science and Engineering, East China University of Technology, Nanchang, China

    Xi Huang

  5. Instrumental Analysis Center, Shanghai Jiao Tong University, Shanghai, China

    Chun Cheng

  6. Center for Alloy Innovation and Design, State Key Laboratory for Mechanical Behavior of Materials, Xi’an Jiaotong University, Xi’an, China

    Jun Ding

  7. Suzhou Laboratory, Suzhou, China

    Jian Hui

  8. School of Materials Science and Engineering, Shanghai Jiao Tong University, Shanghai, China

    Xiaoqin Zeng

  9. National Engineering Research Center of Light Alloy Net Forming and State Key Laboratory of Metal Matrix Composites, Shanghai Jiao Tong University, Shanghai, China

    Xiaoqin Zeng

Authors
  1. Mingyu Liu
    View author publications

    Search author on:PubMed Google Scholar

  2. Zian Mao
    View author publications

    Search author on:PubMed Google Scholar

  3. Zhu Liu
    View author publications

    Search author on:PubMed Google Scholar

  4. Jintao Guo
    View author publications

    Search author on:PubMed Google Scholar

  5. Haoran Zhang
    View author publications

    Search author on:PubMed Google Scholar

  6. Xi Huang
    View author publications

    Search author on:PubMed Google Scholar

  7. Chun Cheng
    View author publications

    Search author on:PubMed Google Scholar

  8. Jun Ding
    View author publications

    Search author on:PubMed Google Scholar

  9. Jian Hui
    View author publications

    Search author on:PubMed Google Scholar

  10. Shufen Chu
    View author publications

    Search author on:PubMed Google Scholar

  11. Xiaoqin Zeng
    View author publications

    Search author on:PubMed Google Scholar

  12. Yujun Xie
    View author publications

    Search author on:PubMed Google Scholar

Contributions

M.L. and Y.X. conceived and designed the study. M.L. and Z.M. developed the model, performed simulations, and drafted the manuscript. Z.M., S.C., and Y.X. co-supervised the research and contributed to model refinement and theoretical analysis. Z.L. and J.G. implemented the algorithm and conducted training. H.Z. and X.H. supported dataset preprocessing and validation. S.C. and C.C. assisted with simulation and data augmentation. J.D. provided materials science expertise. J.H. provided assistance with crystal orientation determination and strain calculations during the revision process. X.Z. provided additional datasets required for the revision and offered guidance on data analysis. All authors reviewed the manuscript.

Corresponding authors

Correspondence to Zian Mao, Shufen Chu, Xiaoqin Zeng or Yujun Xie.

Ethics declarations

Competing interests

The authors declare no competing interests.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Supplementary Information (download PDF )

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Liu, M., Mao, Z., Liu, Z. et al. A Unified preprocessing framework for high-throughput diffraction pattern analysis. npj Comput Mater (2026). https://doi.org/10.1038/s41524-026-01993-3

Download citation

  • Received: 27 September 2025

  • Accepted: 30 January 2026

  • Published: 02 March 2026

  • DOI: https://doi.org/10.1038/s41524-026-01993-3

Share this article

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

Download PDF

Associated content

Collection

Machine learning for automated experimentation in scanning transmission electron microscopy (STEM)

Advertisement

Explore content

  • Research articles
  • Reviews & Analysis
  • News & Comment
  • Collections
  • Follow us on X
  • Sign up for alerts
  • RSS feed

About the journal

  • Aims & Scope
  • Content types
  • Journal Information
  • Open Access
  • About the Editors
  • Contact
  • Editorial policies
  • Journal Metrics
  • About the partner

Publish with us

  • For Authors and Referees
  • Language editing services
  • Open access funding
  • Submit manuscript

Search

Advanced search

Quick links

  • Explore articles by subject
  • Find a job
  • Guide to authors
  • Editorial policies

npj Computational Materials (npj Comput Mater)

ISSN 2057-3960 (online)

nature.com footer links

About Nature Portfolio

  • About us
  • Press releases
  • Press office
  • Contact us

Discover content

  • Journals A-Z
  • Articles by subject
  • protocols.io
  • Nature Index

Publishing policies

  • Nature portfolio policies
  • Open access

Author & Researcher services

  • Reprints & permissions
  • Research data
  • Language editing
  • Scientific editing
  • Nature Masterclasses
  • Research Solutions

Libraries & institutions

  • Librarian service & tools
  • Librarian portal
  • Open research
  • Recommend to library

Advertising & partnerships

  • Advertising
  • Partnerships & Services
  • Media kits
  • Branded content

Professional development

  • Nature Awards
  • Nature Careers
  • Nature Conferences

Regional websites

  • Nature Africa
  • Nature China
  • Nature India
  • Nature Japan
  • Nature Middle East
  • Privacy Policy
  • Use of cookies
  • Legal notice
  • Accessibility statement
  • Terms & Conditions
  • Your US state privacy rights
Springer Nature

© 2026 Springer Nature Limited

Nature Briefing AI and Robotics

Sign up for the Nature Briefing: AI and Robotics newsletter — what matters in AI and robotics research, free to your inbox weekly.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing: AI and Robotics