Skip to content

CederGroupHub/AutoEMXSp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AutoEMXSp

PyPI version Python Version License: Custom Non-Commercial Research Square Preprint
Docs PR Welcome

Automated Electron Microscopy X-Ray Spectroscopy for Compositional Characterization of Materials

AutoEMXSp is a fully automated framework for SEM-EDS workflows β€” from spectral acquisition and quantification, to principled filtering and compositional analysis β€” all in one click.

πŸŽ₯ Watch AutoEMXSp in action on a desktop SEM-EDS system at https://youtu.be/Bym58gNxlj0

πŸ§ͺ Test AutoEMXSp to fit and quantify EDS spectra you have collected on your commercial SEM-EDS system (see Tutorials).

πŸ“– This work is described in:
A. Giunto et al., Accurate SEM‑EDS Quantification, Automation, and Machine Learning Enable High‑Throughput Compositional Characterization of Powders, 2025.
DOI: https://doi.org/10.21203/rs.3.rs-7837297/v2

✨ Key Features

  • Fully automated SEM-EDS phase-level compositional analysis workflow, which includes:

    • Acquisition of EDS spectra, including particle localization if sample is powder. Compatible also with bulk samples, or manual navigation.
    • Quantification of compositions using the peak-to-background method
    • Rule-based filtering of compositions to discard poorly quantified spectra from the analysis
    • Unsupervised machine learning–based analysis to identify the compositions of individual phases in the sample
  • Scripts for fitting and quantification of single EDS spectra exported by proprietary commercial software (.msa, .emsa, .txt files)

  • Automated experimental standard collection scripts

  • Automated particle size distribution measurements scripts

  • Extensible architecture β€” adaptable to other techniques such as

    • Wavelength Dispersive Spectroscopy (WDS)
    • Scanning Transmission Electron Microscopy (STEM) with EDS
  • Extensible hardware support β€” includes driver for ThermoFisher Phenom Desktop SEM series, and can be extended to any electron microscope with a Python API

πŸ“Š Performance

  • Benchmarked on 74 single-phase samples with compositions spanning 38 elements (from nitrogen to bismuth), it achieved <5–10% relative deviation from expected values
  • Machine learning compositional analysis detects individual phase composition in multi-phase samples, including minor phases
  • Intermixed phases can also be resolved

πŸ§ͺ Supported Use Cases

  • Scanning Electron Microscopy (SEM) with Energy-Dispersive Spectroscopy (EDS)
  • Powders and rough samples, e.g. rough films, or pellets, with automated segmentation.
  • Bulk, flat samples, navigated by defining a grid of points to probe.
  • Manual navigation of any sample.

βš™οΈ Requirements

  • Cross-platform: runs on Linux, macOS, and Windows
  • Quick installation
  • Requires calibration for use with different electron microscopes for maximum compositional accuracy, though EDS quantification can be tested without recalibration.

πŸ“‘ Table of Contents


πŸ“˜ Documentation

Installation instructions, usage examples, and workflow descriptions are available in the AutoEMXSp documentation:

πŸ‘‰ https://cedergrouphub.github.io/AutoEMXSp/


πŸ“¦ Requirements

  • Python 3.11 or newer
  • All dependencies are installed automatically via pip or conda.
  • Tested versions of dependencies are specified in pyproject.toml.

    The package may work with more recent versions, but these have not been tested.


Electron Microscope Support

  • βœ… Developed and tested for Thermo Fisher Phenom Desktop SEMs.
  • βœ… Compatible with any Phenom microscope equipped with PPI (Phenom Programming Interface).
  • ⚠️ For other microscope models, the driver must be adapted to the appropriate API commands.

πŸ†• Coming Soon

Here’s what’s planned for future releases of AutoEMXSp:

  • 🐍 Verify with the latest Python version for improved compatibility with current scientific libraries
  • πŸ“ New scripts for spectral parameter calibration to extend the XSp_calibs library to your own instrument.

πŸ“‚ Project Structure

The repository is organized as follows:

AutoEMXSp/
β”œβ”€β”€ autoemxsp/                 # Main package source code
β”‚   β”œβ”€β”€ _custom_plotting.py     # Customizable clustering plot function
β”‚   β”œβ”€β”€ config/                 # Configuration files, including default values to employ during measurements.
β”‚   β”œβ”€β”€ core/                   # Core objects and source code
β”‚   β”œβ”€β”€ data/                   # Libraries of X-ray data
β”‚   β”œβ”€β”€ EM_driver/              # Electron Microscope driver (⚠️ adapt to your own instrument)
β”‚   └── Results/                # Example acquired data (used for unit tests)
β”‚   β”œβ”€β”€ runners/                # Runner functions calling on core objects
β”‚   β”œβ”€β”€ scripts/                # Scripts to run acquisition, quantification, etc. (see full list below)
β”‚   β”œβ”€β”€ XSp_calibs/             # X-ray spectral calibrations (⚠️ adapt to your own instrument)
β”‚   β”œβ”€β”€ utils/                  # Utility functions and strings employed by the program
β”‚
β”œβ”€β”€ examples/                  # Example scripts for fitting, quantification and compositional analysis of example data
β”œβ”€β”€ tests/                     # Unit tests for fitting, quantification, compositional analysis and image processing
β”‚                               # (Acquisition tests require proper EM drivers)
β”œβ”€β”€ paper_data/                # Raw paper data uploaded on Git LFS (Dowload instructions in Paper Data section below)
β”‚
β”œβ”€β”€ LICENSE.txt
β”œβ”€β”€ README.md
└── pyproject.toml

πŸ“ Scripts

This repository includes a collection of scripts that streamline the use of AutoEMXSp.
Each script is tailored for a specific task in spectral acquisition, calibration, quantification, or analysis.

πŸ”¬ Acquisition, Quantification & Analysis

  • Run_Acquisition_Quant_Analysis.py β€” Acquire X-ray spectra and optionally perform quantification and composition analysis.
  • Run_Quantification_Analysis.py β€” Quantify acquired spectra (single or multiple samples) and perform machine-learning analysis.
  • Run_Analysis.py β€” Launch customized machine-learning analysis on previously quantified data.
  • Fit_Quant_Single_AutoEMXSp_Spectrum.py β€” Fit and optionally quantify a single spectrum measured with AutoEMXSp. Prints fitting parameters and plots fitted spectrum for detailed inspection of model performance.
  • Fit_Quant_Single_MSA_Spectrum.py β€” Fit and optionally quantify a single spectrum exported by proprietary software.

πŸ“Š Particle Size Distribution Measurements

  • Collect_Particle_Statistics.py - Analyse sample, collecting particle size statistics and distribution.
  • Process_Particle_Stats_Files.py - Process acquired aprticle size data and recompute.

πŸ› οΈ Miscellaneous

  • Run_Experimental_Standard_Collection.py β€” Acquire and fit experimental standards.
  • Run_SDD_Calibration.py β€” Perform calibration of the SDD detector.

βš—οΈ Characterize Extent of Intermixing in Known Powder Mixtures

(see Chem. Mater. 2025, 37, 6807βˆ’6822 for example)
Use the same scripts as regular composition characterization, as described in the docs Tutorial.

πŸ‘‰ All scripts can be executed directly from the command line or imported into a Python environment, making them accessible from anywhere on your system.


🀝 Contributing

Contributions are welcome!

Open to collaborations to extend this package to different tools or to different types of samples, for example thin films. Please contact me at agiunto@lbl.gov


πŸ“„ License

This project is licensed under a NON-COMMERCIAL USE ONLY, LICENSE β€” see the LICENSE file for details.


πŸ“– Citation

If you use AutoEMXSp in your research, please cite the following publication:

A. Giunto, Y. Fei, P. Nevatia, B. Rendy, N. Szymanski and G. Ceder; Accurate SEM‑EDS Quantification, Automation, and Machine Learning Enable High‑Throughput Compositional Characterization of Powders, 2025.
DOI: https://doi.org/10.21203/rs.3.rs-7837297/v1

BibTeX

@article{Giunto2025AutoEMXSp,
  author  = {Giunto, Andrea and Fei, Yuxing and Nevatia, Pragnay and Rendy, Bernardus and Szymanski, Nathan and Ceder, Gerbrand},
  title   = {Accurate SEM‑EDS Quantification, Automation, and Machine Learning Enable High‑Throughput Compositional Characterization of Powders},
  year    = {2025},
  doi     = {10.21203/rs.3.rs-7837297/v2},
  url     = {https://doi.org/10.21203/rs.3.rs-7837297/v2}
}

πŸ“‚ Paper Data

The raw data used in the associated publication is stored in the paper_data/ directory.
These files are tracked with Git LFS (Large File Storage).

πŸ”½ Download with Git LFS

The repository is automatically cloned without Git LFS; you will only see placeholder files instead of the actual datasets inside paper_data/.
To download the full data, on the terminal go to the repo directory and:

# 1. Install Git LFS (only needed once per machine)
git lfs install

# 2. Fetch the data files
git lfs fetch --all
git lfs checkout

Alternatively, download manually from the github repo Download button.

After downloading, run the Run_Analysis.py or Run_Quantification.py scripts within the folder.


πŸ“¬ Contact

For questions or issues, please open an issue on GitHub.


About

Automated Electron Microscopy X-Ray Spectroscopy for Compositional Characterization of Materials. Currently supporting SEM EDS.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published