Skip to content

EmilSkaaning/MLstructureMining-workflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChemRxiv | Paper

MLstructureMining Workflow

MLstructureMining Workflow is a comprehensive package tailored for working with crystal structures, with a particular focus on simulating and analyzing Pair Distribution Function (PDF) data. The package encompasses everything from obtaining CIF files from renowned databases like the Crystallography Open Database (COD), preparing and simulating PDF data, to training a XGBoost classifier for structure suggestions based on the simulated PDFs. With a combination of well-known techniques, including Bayesian optimization and adversarial attacks using the Zeroth Order Optimization (ZOO) technique from the Adversarial Robustness Toolbox (ART), this toolkit offers an integrated solution for researchers working with crystal structures and their corresponding PDFs.

Install

To run MLstructureMining Workflow please follow the steps below:

  1. Make sure that you are running a Python 3.7 on a Linux or MacOS as DiffPy-CMI requires that. Let us first create a new environment:
conda create --name ciff-env python=3.7
  1. To install DiffPy-CMI used for simulating Pair Distribution Function (PDF) data, please follow the steps found HERE or run the following code:
conda config --add channels diffpy
conda install diffpy-cmi
  1. When the installation is completed, then install the required packages.
pip install -r requirements.txt
  1. Congratulations! You are now ready to training your own XGBoost model for structure suggestion of PDF data.

Code Structure

  1. Get structure from Crystallograhy Open Database (COD).
    • This section explains how to download COD, construct a local library and search through the CIFs to obtain a desired selection of structures.
    • This step is optional as CIFs can be obtain via several databases, Inorganic Crystal Structure Database (ICSD), American Mineralogist Crystal Structure Database (AMCSD), Crystal Structure Database for Minerals (MINCRYST) and many more.
  2. Prepare data and simulate.
    • When a desired selection of CIFs have been obtained this will check that the CIFs are compatible with DiffPy-CMI, simulates Pair Distribution Function (data) data and constructs a structure catalog with similar PDFs using the Pearson Correlation Coefficient (PCC).
  3. Train model.
    • Trains, validates, and tests an XGBoost classifier using the simulated PDFs.
    • Bayesian optimization can be used for performing hyperparameter optimization.
    • After training, the models are further evaluated against adversarial attacks using the Zeroth Order Optimization (ZOO) technique from the Adversarial Robustness Toolbox (ART).
  4. Utilities.
    • Contains the functionalities of the package.
  5. Tests.
    • Contains the tests of the package. Execute the following command to run the tests:
    pytest ./tests
    

Cite

If you use our code or our results, please consider citing our paper. Thanks in advance!

Author

Emil T. S. Kjaer - emil.thyge.kjaer@gmail.com.

License

This project is licensed under the Apache License Version 2.0, January 2004 - see the LICENSE file for details.

About

How to train your own structure-finder.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages