
Engineering and Technology
A convolutional neural network for defect classification in Bragg coherent X-ray diffraction
B. Lim, E. Bellec, et al.
This paper highlights a groundbreaking 3D convolutional neural network (CNN) designed for swift and precise identification of defects in nanocrystals by analyzing Bragg coherent X-ray diffraction patterns. With training on extensive simulations, the CNN adeptly identifies dislocation types, marking a significant leap towards automated defect detection in materials science. This innovative research was conducted by Bruce Lim, Ewen Bellec, Maxime Dupraz, Steven Leake, Andrea Resta, Alessandro Coati, Michael Sprung, Ehud Almog, Eugen Rabkin, Tobias Schülli, and Marie-Ingrid Richard.
~3 min • Beginner • English
Introduction
The study addresses the challenge of detecting and classifying crystal defects—specifically dislocations—in nanomaterials directly from Bragg coherent X-ray diffraction patterns (CXDPs), without relying on slow phase-retrieval reconstructions. Defects, and their associated strain fields, critically affect material properties across mechanical, optical, electrical, and catalytic domains. While techniques like TEM can image individual defects, they require demanding sample preparation. With higher coherent flux at modern synchrotrons, Bragg coherent diffraction imaging (BCDI) provides sensitivity to elastic strain and defects, but phase retrieval can be slow and may fail in highly strained systems. The research question is whether a 3D convolutional neural network, trained on realistic simulated CXDPs from physically relaxed atomistic models of fcc nanocrystals, can (a) automatically detect the presence of dislocations and (b) classify their type (screw vs edge) directly from reciprocal-space data. Achieving this would accelerate experimental workflows, enable live feedback during operando or high-throughput measurements, and support targeted defect studies.
Literature Review
Prior work has used pattern classification and neural networks for fault detection in interferometric and microscopy contexts. Deep learning has been successful for optical surface-defect detection and STEM defect segmentation. In diffraction, deep learning has classified crystal structures from large sets of simulated 2D diffraction maps, though 2D fingerprints can be non-unique across space groups. Recent studies employed deep learning for phase retrieval in coherent diffraction, highlighting the growing role of deep learning in CXD/BCDI. However, major challenges include the need for extensive, diverse, and physically realistic training data, as well as ensuring generalization to experimental conditions. The present work builds on these trends by generating physically relaxed 3D atomistic configurations and corresponding 3D CXDPs to train a 3D CNN for direct defect detection and classification.
Methodology
Data generation pipeline: fcc nanocrystals (Al, Au, Ag, Pt) were constructed using Wulff/Winterbottom geometries to mimic freestanding particles on substrates. The Winterbottom shape was generated with MERLIN by cutting a cubic lattice along ⟨111⟩ and ⟨110⟩ directions with cut positions set by surface energy ratios γ111/γ100 and γ110/γ100. Lattice axes were x[100], y[010], z[001]. The interface plane was chosen randomly among {111} and truncated at 65–75% of the particle height. Two sizes were used: small (40×40×40 unit cells; ~15×15×(9–12) nm³; 1–1.4×10^5 atoms) and large (80×80×80 unit cells; ~30×30×(19–25) nm³; 8–9.5×10^5 atoms), with exact height/atom count depending on interface position and lattice parameter.
Defect insertion: Single line defects (edge or screw dislocations) with Burgers vector b = [110] were introduced using two strategies: centered dislocations (CD), confined within 10% of the lateral particle size near the center, and random position dislocations (RPD) placed anywhere in the crystal. Initial line directions were t = [110] (screw) and t = [1 1 2] (edge). Randomized interface plane selection ensured a wide distribution of dislocation orientations relative to the interface normal.
Atomistic relaxation: Molecular statics (LAMMPS) at 0 K using conjugate gradient minimization and EAM potentials appropriate for each element (Al: Mishin et al.; Ag: Williams et al.; Au: Grochola et al.; Pt: Zhou et al.) to accurately capture elastic and stacking fault energies. For RPD, an energy tolerance of 1e−6 (relative change per iteration) was used as a stopping criterion to prevent dislocation escape at free surfaces while allowing dissociation into Shockley partials. Limiting steps minimized rotation toward mixed character, preserving nominal screw/edge character even near surfaces. Each dataset typically comprised ~1000 relaxed configurations with one-third each of defect-free, screw, and edge. Relaxation time per full dataset: 10–25 min (small) or 1.5–4 h (large).
Diffraction simulation: 3D CXDPs were computed with PyNX (GPU-accelerated), summing atomic scattering contributions in the kinematic approximation on 64×64×64 q-space grids. Each CXDP computation took ~0.25 s (small) or ~2 s (large). Datasets of 10,000 CXDPs were generated in ~40 min (small) to ~6 h (large) on a POWER9 machine. To diversify and avoid overfitting, each CXDP was randomly rotated around the selected Q vector (typically 10 orientations per relaxed configuration) and the reciprocal-space sampling δq was varied (consistent with experimental oversampling; all cases met Sayre’s criterion). Simulated particles were smaller than experimental ones, implying a larger fraction of the Brillouin zone sampled, but this had little impact on prediction accuracy. Prior to training, dislocation position distributions were estimated by comparing intensity maxima to defect-free crystals with similar atom counts.
Neural network architecture and training: Input is the 3D CXDP intensity (64×64×64). The model comprises five 3D convolutional layers with ReLU activations and dropout (rate 0.2) applied in all layers to mitigate overfitting, followed by two fully connected layers and a final softmax for multi-class classification (defect-free, screw, edge). Optimization used Adam with learning rate 1e−3 and batch size 64. Training, validation, and test splits were 85%, 10%, and 5%. Training was stopped at validation accuracy plateau. Typical training time was 15–30 min (8–10 s/epoch; 100–200 epochs) on two NVIDIA Tesla V100 GPUs and a POWER9 system, using Keras with TensorFlow backend. Loss was categorical cross-entropy. Weights were randomly initialized; data order randomized; independent trainings yielded similar probability distributions. Occlusion sensitivity analysis indicated the network primarily leverages regions near the Bragg peak for decisions.
Experimental validation: 3D reciprocal-space maps of Pt nanoparticles were measured at SixS (SOLEIL) at asymmetrical 111 and P10 (PETRA) at specular 111 reflections. Data were orthonormalized (xrayutilities), CXDP centers of mass aligned to array center, and intensities normalized to unit maximum before inference. Examples included defect-free and defective particles; some P10 crystals were measured repeatedly under varying conditions to assess prediction consistency.
Key Findings
- On simulated test data (11,556 CXDPs from 1,284 atomistic configurations), the CNN achieved 97.2% total accuracy. The confusion matrix showed most errors (4.7%) were edge dislocations misclassified as screw; defect-free predictions were near-perfect. A simpler two-class model (defect-free vs defective) achieved even higher accuracy.
- Occlusion sensitivity demonstrated that features near the Bragg peak dominate the classification cues.
- Experimental validation: All presented experimental Pt nanoparticle CXDPs were correctly classified by the best model, typically with very high confidence (>95%). For P10 data with mixed dislocations (dominant screw character, closer to free surfaces), predicted screw probabilities ranged ~82–94%, reflecting mixed character and weaker distortions.
- Training dataset composition critically affected generalization to experiments. Models trained on unrelaxed vs relaxed atomistic data both identified defect-free cases, but unrelaxed models failed on mixed dislocations. Relaxation substantially improved screw identification in SixS data. Crystal size (small vs large) had minor impact, with slight benefits for large crystals.
- Including multiple elements (Au and Pt) improved predictions for SixS data and generally enhanced performance versus single-element datasets. Introducing random dislocation positions (RPD) improved predictions for P10 mixed cases but could degrade screw vs edge discrimination for SixS unless combined with centered dislocations.
- The best generalization across both beamlines was obtained with a mixed training set of multi-element, relaxed large crystals combining 75% centered dislocations and 25% random-position dislocations, yielding correct, high-confidence predictions for all experimental examples (Table 1).
Discussion
The work demonstrates that a 3D CNN trained on physically grounded, atomistically relaxed simulations can directly interpret 3D coherent Bragg diffraction patterns to detect and classify line defects in fcc nanocrystals, addressing the need for rapid, in situ/operando-compatible analysis without phase retrieval. The high simulated accuracy (97.2%) and successful experimental generalization highlight that the network captures robust, defect-specific reciprocal-space signatures, particularly around the Bragg peak. Importantly, the study shows that faithful modeling of dislocation displacement fields, inclusion of multiple chemical elements, and diversity in dislocation positioning (centered and near surfaces) are essential for reliable transfer to experimental data. This approach enables fast screening of nanoparticles to identify defect presence and type, guiding experiment selection and potentially enabling automated or unsupervised data collection at high-throughput beamlines.
Conclusion
The study introduces an automatic, high-accuracy method to classify defects (defect-free, screw, edge) in fcc metal nanocrystals directly from 3D coherent X-ray diffraction patterns using a 3D CNN trained on realistic, relaxed atomistic simulations. It achieves strong performance on simulated data and correctly classifies multiple experimental Pt nanoparticle CXDPs, including challenging mixed or near-surface dislocations. The work underscores the necessity of realistic training datasets (relaxed structures, multiple elements, varied dislocation positions) to generalize to experiments. This tool can provide rapid feedback during measurements, facilitate targeted defect studies, and support high-throughput, potentially unsupervised, data acquisition. Future directions include extending to mixed dislocation classification, broader defect types (e.g., stacking faults, twins), different crystal structures beyond fcc, additional reflections, and integrating domain adaptation techniques to further bridge simulation–experiment gaps.
Limitations
- Generalization depends strongly on the realism and diversity of the simulated training data (e.g., relaxed displacement fields, multi-element composition, dislocation positions). Inadequate datasets reduce experimental performance.
- Current classification focuses on three classes (defect-free, screw, edge); mixed-character dislocations can be partially ambiguous, with some tendency to confuse edge and screw.
- Simulated particles are smaller than experimental ones; although found to have limited effect here, size and sampling differences could impact transferability in other systems.
- The study targets fcc metals and 111 Bragg reflections; applicability to other structures, reflections, and defect types is not yet validated.
- The Burgers vector and initial line directions were fixed during simulation, potentially limiting coverage of all realistic dislocation configurations.
- Reliance on kinematic scattering and idealized conditions may omit multiple-scattering or experimental noise/systematics; preprocessing alignment and normalization are required.
Related Publications
Explore these studies to deepen your understanding of the subject.