Dr. Lukas Pielsticker,
Dr. Rachel L. Nicholls,
Dr. Serena DeBeer,
Dr. Mark Greiner
|
xpsdeeplearning
is a toolbox for X-ray Photoelectron Spectroscopy (XPS) data analysis using Convolutional Neural Networks, designed for speeding up your XPS analysis.
The package combines
- simulation tools for creating large data sets of synthetic (yet realistic) transition-metal XP spectra base on reference data and
- a supervised machine learning framework based on artificial convolutional neural networks that is able to accurately perform automated quantitative analysis of the phases present in such XP spectra.
It is recommended to use python 3.11 (you will need at least python 3.9) with a dedicated virtual environment for this package. Learn how to manage python versions and virtual environments.
The quickest way to get started is to clone this repository:
git clone https://github.com/surfaceanalytics/xpsdeeplearning.git
cd xpsdeeplearning
...and install it with pip:
pip install .
In case you want to save and plot an image of your Tensorflow/Keras model during training/prediction, you can call the save_and_print_model_image
method of the Classifier
class. This method utilizes the plot_model
function of Keras to convert the model to dot format and save the image to a file. However, for the conversion to work, you need to have graphviz
installed locally. You can simply download the binary and install.
For conda users, it is also possible to install the binary in a a decicated environment by running
conda install anaconda::graphviz
The software tools for data simulation are located inside simulation
, with exemplary JSON files containing the parameters used during simulation available in the params
subfolder. The reference data that is used as input for the simulation is available inside data
. Simulation runs can be performed using the run
script or the simulate
tool from the command line (see below.)
The code for convolutional neural network training and quantitative prediction is located inside network
. The design of the model architectures as well as the training and testing of the neural networks were performed using TensorFlow and Keras. In order to run the training and prediction pipelines, it is generally advised to use the notebooks
, either through your local Jupyter installation or through Google Colab
. These notebooks allow visualization of the training/prediction inputs and outputs as well as saving of all results.
In addition, both training and prediction can be run from the command line using JSON files as input (see the README) for more information.
There are several tools available that allow the user to run the simulation, training, and quantification routines from the command line:
- simulate: Simulate large artificial XPS data sets.
- train: Simplified pipeline for tensorflow model training.
- predict: Simplified pipeline for quantitative prediction using trained models.
You can find more information on how to use these tools in the individual READMEs available through the links above.
Some simulated data sets and trained models are available through the KEEPER
archive of the Max Planck society.
All tools are shipped with unit tests located in tests
.
Convolutional neural network framework for the automated analysis of transition metal X-ray photoelectron spectra - L. Pielsticker, R. L. Nicholls, S. DeBeer, and M. Greiner, Anal. Chim. Acta, 2023, 1271, 341433.
DeepXPS: Data Sets and Trained Models - L. Pielsticker, R. L. Nicholls, S. DeBeer, and M. Greiner, KEEPER archive, 2023.
Install the package with its dependencies:
git clone https://github.com/surfaceanalytics/xpsdeeplearning.git \\
--branch main xpsdeeplearning
cd xpsdeeplearning
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -e ".[dev]"
There is also a pre-commit hook available which formats the code and checks the linting before actually commiting. It can be installed with
pre-commit install
from the root of this repository.
Especially relevant for developers, there exists a basic test framework written in pytest which can be used as follows:
python -m pytest -sv tests
To ask further questions, to make suggestions how we can improve xpsdeeplearning
, to get advice
on how to build on this work, or to get your XPS data ready for neural network analysis, you can:
- Open an issue on the xpsdeeplearning GitHub
- Contact directly the lead developer (Lukas Pielsticker).
This project is licensed under the MIT License - see the LICENSE file for details.