PyWPEM · Paper page

AI-Driven Structure Refinement of X-ray Diffraction

A physics-constrained bridge between AI-generated crystal hypotheses and crystallographic validation.

Bin Cao1, Qian Zhang2, Zhenjie Feng2, Taolue Zhang1, Jiaqiang Huang1, Lu-Tao Weng1, Tong-Yi Zhang1

Project lead and contact: Cao Bin

1 HKUST (Guangzhou) · 2 Shanghai University

Whole-pattern expectation-maximization (WPEM) embeds Bragg-law constraints into probabilistic whole-pattern decomposition for stable, refinement-ready XRD analysis.

Figure 1 from the PyWPEM paper showing the AI-to-refinement workflow

Abstract

Physics-constrained refinement for modern AI-enabled crystallography

Artificial intelligence can generate plausible crystal hypotheses from X-ray diffraction, but these hypotheses often fail during refinement when intensities become non-identifiable under strong peak overlap. WPEM addresses this bottleneck by embedding Bragg consistency directly into batch expectation-maximization, producing a continuous, component-resolved intensity representation that is physically admissible, numerically stable, and refinement-ready.

Across reference benchmarks and challenging real-world regimes—including multiphase mixtures, semicrystalline polymers, operando tracking, disordered solids, and synchrotron archaeological samples—PyWPEM delivers robust whole-pattern decomposition while preserving crystallographic rigor.

Highlights

Core contributions

Physics-constrained refinement

WPEM converts AI-generated structure proposals into Bragg-admissible, refinement-ready inputs.

Stable in severe overlap

Responsibility-weighted EM offers a soft, overlap-aware decomposition where conventional profile fitting may become fragile.

Quantitative interpretation

The method supports phase fractions, lattice tracking, and component-resolved analysis across complex XRD regimes.

Applications

Validated across representative scientific cases

Benchmarks. Lower profile factors than FullProf and TOPAS on PbSO4 and Tb2BaCoO5 under matched settings.
Operando XRD. Robust time-series refinement for lattice evolution tracking during electrochemical cycling.
Disordered solids. Automated screening of candidate occupations in complex Ru–Mn oxide systems.
Archaeological samples. Phase-resolved decomposition of a heavily overlapped ancient Egyptian make-up pattern.
Semicrystalline polymers. Unified separation of crystalline peaks and amorphous halos for crystallinity analysis.
Reproducible workflows. Open code, cases, and documentation for research and deployment.

Figures from main.pdf

Key results from the paper

Codebase

A modular scientific toolkit

PyWPEM includes modules for simulation, Bragg optimization, refinement, graph construction, amorphous analysis, and XAS/XPS extensions. The implementation is designed for reproducible research workflows rather than visual complexity.

XRDSimulation EMBraggOpt Refinement StructureOpt GraphStructure Extinction Amorphous WPEMXAS / WPEMXPS

Citation

If this work contributes to your research, please cite the paper

@article{cao2026wpem,
  title   = {AI-Driven Structure Refinement of X-ray Diffraction},
  author  = {Bin Cao and Qian Zhang and Zhenjie Feng and Taolue Zhang and Jiaqiang Huang and Lu-Tao Weng and Tong-Yi Zhang},
  journal = {arXiv preprint},
  year    = {2026}
}