████████████╗╗ ██████████╗╗ ████████████╗╗ ████╗╗████████████╗╗ ████████████╗╗ ██████████╗╗ ████████████╗╗ ████╗╗████████████╗╗ ████╔╔════████╗╗████╔╔════████╗╗████╔╔════████╗╗████║║████╔╔════████╗╗ ████╔╔════████╗╗████╔╔════████╗╗████╔╔════████╗╗████║║████╔╔════████╗╗ ████████████╔╔╝╝██████████████║║████████████╔╔╝╝████║║████║║ ████║║ ████████████╔╔╝╝██████████████║║████████████╔╔╝╝████║║████║║ ████║║ ████╔╔════████╗╗████╔╔════████║║████╔╔══════╝╝ ████║║████║║ ████║║ ████╔╔════████╗╗████╔╔════████║║████╔╔══════╝╝ ████║║████║║ ████║║ ████║║ ████║║████║║ ████║║████║║ ████║║████████████╔╔╝╝ ████║║ ████║║████║║ ████║║████║║ ████║║████████████╔╔╝╝ ╚╚══╝╝ ╚╚══╝╝╚╚══╝╝ ╚╚══╝╝╚╚══╝╝ ╚╚══╝╝╚╚══════════╝╝
RAPID automates Rietveld refinement of powder X-ray diffraction (XRD) data using convolutional neural networks. A CNN predicts crystallographic and profile parameters from a diffraction pattern in a single forward pass (~2 ms), then initializes automated FullProf refinement. The three-stage pipeline covers data augmentation, CNN training, and automated refinement.
Please cite the following paper if you use this code in your research:
@article{Mun:yr5164,
author = "Mun, Suk Jin and Nam, Yoonsoo and Choi, Sungkyun",
title = "{Automation of Rietveld refinement through machine learning}",
journal = "Journal of Applied Crystallography",
year = "2026",
volume = "59",
number = "2",
pages = "",
month = "Apr",
doi = {10.1107/S1600576726001494},
url = {https://doi.org/10.1107/S1600576726001494},
}
This code requires Python 2.7 (for AutoFP/FullProf refinement), Python 3.11 with PyTorch, NumPy, SciPy, and matplotlib (for CNN training and inference), and the FullProf Suite. Windows only.
To install via conda, create the two environments using the provided environment files.
Python 2.7 environment (for AutoFP data augmentation and Rietveld refinement):
conda env create -f environment_py27.yml
conda activate rapid_py27Python 3.11 environment (for CNN training and inference):
conda env create -f environment_py311.yml
conda activate rapid_py311For detailed setup instructions, see INSTALLATION_SETUP_GUIDE.md.
- Data Augmentation: Place
.cifand.datfiles indat_vestacif_files/, configureinputs.txt, rundata_augmentation.bat - CNN Training: Configure
CNN/macro_inputs/ML_inputs_1.txt, runCNN/train_CNN_macro.bat - XRD Analysis: Run
xrd_analysis.batto identify unknown materials and perform automated refinement
For detailed usage instructions, input file formats, and configuration options, refer to RAPID_manual.pdf.
This project uses AutoFP for automated Rietveld refinement and the FullProf Suite as the refinement engine.