Skip to main content

AutoEMX

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

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

AutoEMX 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 AutoEMX in action on a desktop SEM-EDS system at https://youtu.be/Bym58gNxlj0

๐Ÿงช Test AutoEMX 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
  • Works with spectra from any microscope, although recalibration is recommended for maximum compositional accuracy

๐Ÿงช 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, probed by defining a grid of points.
  • Manual navigation of any sample.

โš™๏ธ Requirements

  • Cross-platform: runs on Linux, macOS, and Windows
  • Quick installation via pip

๐Ÿ“‘ Table of Contents


๐Ÿ“˜ Documentation

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

๐Ÿ‘‰ https://cedergrouphub.github.io/AutoEMX/


๐Ÿ“ฆ 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 AutoEMX:

  • ๐Ÿ 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:

AutoEMX/
โ”œโ”€โ”€ autoemx/                 # Main package source code
โ”‚   โ”œโ”€โ”€ config/                 # Configuration files, including default values to employ during measurements.
โ”‚   โ”œโ”€โ”€ core/                   # Core objects and source code
โ”‚   โ”œโ”€โ”€ data/                   # Libraries of X-ray data
โ”‚   โ”œโ”€โ”€ microscope_drivers/              # Electron Microscope driver (โš ๏ธ adapt to your own instrument)
โ”‚   โ”œโ”€โ”€ runners/                # Runner functions calling on core objects
โ”‚   โ”œโ”€โ”€ scripts/                # Scripts to run acquisition, quantification, etc. (see full list below)
โ”‚   โ”œโ”€โ”€ calibrations/             # 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/                     # CI smoke suite (`test_ci_smoke.py`) + offline workflow/unit tests
โ”‚                               # Hardware-only scripts stay capitalized (`Test_EM_driver.py`)
โ”œโ”€โ”€ 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 AutoEMX. Each script is tailored for a specific task in spectral acquisition, calibration, quantification, or analysis. Below are the main scripts available in autoemx/scripts/ and their purposes:

๐Ÿ”ฌ Acquisition, Quantification & Analysis

  • Run_Acquisition.py โ€” Acquire X-ray spectra from the microscope (supports automated and manual modes).
  • Run_Quantification.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_AutoEMX_Spectrum.py โ€” Fit and optionally quantify a single spectrum measured with AutoEMX. 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.
  • Quantify_External_Spectra.py โ€” Quantify spectra acquired outside AutoEMX (e.g., from other SEM-EDS systems).

๐Ÿ“Š Particle Size Distribution Measurements

  • collect_particle_statistics.py - Analyse sample, collecting particle size statistics and distribution.
  • process_particle_stats_files.py - Process acquired particle 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 AutoEMX 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{Giunto2025AutoEMX,
  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_analysis.py scripts within the folder.


๐Ÿ“ฌ Contact

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autoemx-1.0.3.tar.gz (50.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autoemx-1.0.3-py3-none-any.whl (50.3 MB view details)

Uploaded Python 3

File details

Details for the file autoemx-1.0.3.tar.gz.

File metadata

  • Download URL: autoemx-1.0.3.tar.gz
  • Upload date:
  • Size: 50.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for autoemx-1.0.3.tar.gz
Algorithm Hash digest
SHA256 e143c6fdc2879d4ecb29d68982eed67aa63526de34068bfeebe13019c4d302be
MD5 df6a4854f2bb73ede40856a9d06b5b68
BLAKE2b-256 3cfc10781036ba71bd3b1e94682766d70b3b22a24b79c706e75b360d6521a0ef

See more details on using hashes here.

File details

Details for the file autoemx-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: autoemx-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 50.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for autoemx-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0f030915cdb7d1dcb9f80cdd547b099e2033358232193fd725efb1eceee91f16
MD5 f60e3267ab206c276fffa448d5926cd5
BLAKE2b-256 4463098065e33ae53412ebef726c8a3aaacade71cde00b02cbd434cb155703a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page