Engineering and Technology
Extracting local nucleation fields in permanent magnets using machine learning
M. Gusenbauer, H. Oezelt, et al.
Permanent magnets are crucial for green energy technologies, and their performance depends on intrinsic magnetic properties and microstructural features. MnAl-C is a rare-earth-free candidate material whose microstructure contains defects such as grain boundaries, twins, and antiphase boundaries, which strongly affect coercivity. The research goal is to rapidly predict local nucleation fields from microstructure images and to identify weak spots influencing coercivity. The study leverages EBSD microscopy to capture crystallographic orientation and uses micromagnetic simulations to compute nucleation fields, but due to computational cost and model size limits, it explores machine learning to predict these local fields directly from image-derived features. This aims to provide fast qualitative insights into nucleation field distributions and microstructural weak regions, even if absolute coercivity cannot yet be predicted quantitatively.
The microstructural origins of coercivity in permanent magnets and the role of defects are well established, with specific attention to MnAl-C exhibiting twins and antiphase boundaries (e.g., Bittner et al.; Bance et al.). Kronmüller and Goll provided a framework relating microstructure to coercivity in hard magnetic materials. Micromagnetics has been used to reproduce trends in demagnetization and coercive fields but often exhibits offsets from experiments due to size limitations and incomplete microstructural information. EBSD offers an efficient way to map crystallographic orientation over large areas compared with TEM. Machine learning has been increasingly applied in materials science to uncover structure–property relationships, automate characterization, and accelerate discovery (e.g., work on steels and twinning in Mg alloys). Prior ML applications in magnetism include microstructure analysis, suggesting that ML can help reduce computational costs and bridge scales. This study builds on these insights by integrating EBSD-derived features, physics-informed descriptors (e.g., Stoner–Wohlfarth minimum switching field), and tree-based regressors to predict local nucleation fields.
Data acquisition and preprocessing: EBSD map EBSD-A (180 × 120 µm², 600 × 400 pixels, 0.3 µm pixel size) is used to generate training data. The EBSD provides grain indices and crystallographic orientation matrices; orientations are converted to unit vectors assuming uniaxial anisotropy. About 600 unique 10 × 10 pixel selections are sampled on a regular grid with duplicates (e.g., identical intra-grain selections) removed to avoid bias. Each selection is extruded to a quasi-3D mesh using an automated Salome-based meshing pipeline that smooths grain boundaries with Bezier curves and generates high-quality tetrahedral meshes. Meshes are scaled 1:15 (1 µm → 67 nm), with typical selection volume about 200 × 200 × 40 nm³ and ~370,000 tetrahedra.
Micromagnetic simulations: A hybrid finite element boundary method solves the LLG equation to compute demagnetization curves with free boundary conditions. Intrinsic parameters (from bulk MnAl-C at 300 K): Js = 0.8 T, A = 19.9 pJ/m, K = 1.5 MJ/m³. External field swept from 4 to −4 T/µ0 at 40 mT/ns; Gilbert damping α = 1; mesh size ≤ 3 nm. Labels are local nucleation fields Hn defined as the external field at the first irreversible switching event (first step) along the demagnetization curve; this choice was validated by a classification task discriminating the lowest 20% of switching fields.
Feature engineering: Five feature groups are derived for each selection: (1) PIXEL (300 features): three components of the orientation unit vector for each of 10 × 10 pixels. (2) GRAIN (60 features): three components for up to 20 grains’ orientation unit vectors, zero-padded. (3) SIZE (20 features): areas (sizes) for up to 20 grains, zero-padded. (4) SW (1 feature): minimum Stoner–Wohlfarth switching field HN,min across grains, computed from misorientation βi relative to the applied field (y-axis). (5) TWIN (1 feature): minimum dot product between adjacent grains’ orientation unit vectors as a proxy for maximum misalignment at interfaces (twin influence). The concatenated fixed-length feature vector is F = [PIXEL, GRAIN, SIZE, SW, TWIN].
Machine learning models and training: Supervised regression models include random forest (RF) and gradient boosting (GB) decision trees, combined via a Voting Regressor (VR) to average predictions. Linear regression (ordinary least squares) is also evaluated using physics-informed features (SW and TWIN). Models are implemented in Python using scikit-learn. Hyperparameters for RF and GB are optimized via GridSearchCV (5-fold cross-validation) scoring by negative mean squared error on the full feature set; robustness to hyperparameter variations was confirmed. Performance metrics are mean absolute error (MAE) and root mean squared error (RMSE). Validation is conducted on EBSD-A with 5-fold cross-validation. Generalization is tested on a new EBSD map, EBSD-B (from another sector of the same sample; 180 × 81 µm², 600 × 270 pixels), using the EBSD-A-trained models; about 400 simulated selections (10 × 10 pixels) provide labels for testing. Residual analysis compares Hn,comp − Hn,pred versus Hn,pred to assess bias and variance.
Bulk property construction: As a proof-of-concept, hysteresis curves for the full EBSD-A map are constructed from predicted local Hn by counting the fraction of selections reversed at each applied field (neglecting inter-selection stray fields and exchange coupling), yielding a qualitative demagnetization curve.
- Feature importance and model performance: Physics-informed features SW (minimum Stoner–Wohlfarth switching field) and TWIN (maximum misalignment between adjacent grains via minimum dot product) are the most influential predictors. Partial dependence plots show nearly linear positive dependence on SW and strong negative impact of large misalignment (TWIN), with their interaction indicating that strong misalignment severely reduces Hn even for large SW.
- Best-performing feature sets: Among single features, GRAIN yields the lowest errors; PIXEL performs slightly worse due to redundancy and higher dimensionality. The best combinations exclude PIXEL: GRAIN + SIZE + SW + TWIN provided top performance without redundant location data. Reported VR cross-validated scores on EBSD-A achieved MAE as low as ~0.137 T/µ0 (RMSE ~0.216) with GRAIN + SIZE + SW + TWIN, and MAE ~0.132 T/µ0 (RMSE ~0.218) when including all five features. On EBSD-B (unseen test set), VR with GRAIN + SIZE + SW + TWIN achieved MAE ~0.166 T/µ0 and RMSE ~0.234.
- Linear regression with SW + TWIN: Despite its simplicity, linear regression using only SW and TWIN achieved competitive generalization on EBSD-B (MAE 0.166 T/µ0, RMSE 0.245) with slightly inferior training performance on EBSD-A (MAE 0.186 T/µ0, RMSE 0.258) compared with the VR.
- Microstructural complexity: Prediction error increases with the number of grains per selection: for 1 grain, MAE 0.035 T/µ0; 2 grains, MAE 0.132; 3 grains, MAE 0.161; >3 grains, MAE 0.188 (VR with GRAIN, SIZE, SW, TWIN), indicating increased reversal complexity and need for more training data in complex regions.
- Spatial predictions and residuals: Predicted Hn maps reproduce trends seen in simulations: lower Hn near grain/twin boundaries and higher in grain interiors. Residuals mostly lie within ±1 T/µ0 without systematic bias, supporting model reliability for identifying weak spots.
- Bulk property proxy: Hysteresis curves constructed from predicted Hn reproduce qualitative demagnetization behavior but overestimate coercivity (e.g., ~2.35 T/µ0) due to neglected interactions between selections.
The study demonstrates that machine learning models trained on micromagnetically computed local nucleation fields can rapidly predict Hn from EBSD-derived microstructural features, addressing the challenge of computationally expensive simulations. The strong performance of physics-informed features (SW and TWIN) confirms that minimum single-grain switching fields and intergranular misalignment dominate local nucleation behavior. Excluding redundant high-dimensional pixel features improves generalization, with GRAIN + SIZE + SW + TWIN offering a compact and effective descriptor set. Generalization to a new EBSD map (EBSD-B) shows that the approach transfers across regions of the same material, enabling fast scanning for weak spots that likely govern magnet performance. While absolute coercivity remains difficult to predict due to modeling simplifications and data limitations, the predicted spatial distribution of Hn enables qualitative assessment and can guide targeted simulations or experimental focus. A simple aggregation of predicted Hn to approximate bulk hysteresis curves illustrates potential for upscaling, though incorporating inter-selection interactions will be necessary for quantitative accuracy.
This work introduces a physics-informed machine learning framework that predicts local nucleation fields in MnAl-C permanent magnets directly from EBSD microstructural features. An automated pipeline generates quasi-3D meshes from EBSD selections, computes Hn via micromagnetic simulations, and trains ensemble tree models and a linear regressor. Key contributions include: (1) identification of compact, physically meaningful features (SW and TWIN) that largely govern Hn; (2) demonstration that a voting regressor using GRAIN, SIZE, SW, and TWIN achieves strong predictive performance and generalizes to new EBSD maps; (3) rapid mapping of weak spots and trends in nucleation fields enabling qualitative assessment of magnet microstructure; and (4) a proof-of-concept construction of bulk hysteresis curves from predicted local Hn. Future work should increase training data diversity, incorporate stray field and exchange coupling between selections, integrate data assimilation combining experimental and simulated data, and extend the approach toward quantitative coercivity prediction and multiscale reduced-order modeling.
- Micromagnetic simulations show systematic offsets from experiments due to size limitations, incomplete phase/defect modeling, and EBSD resolution constraints; absolute values of Hn and coercivity are not quantitatively accurate.
- The simplified construction of bulk hysteresis curves neglects inter-selection stray fields and exchange coupling, leading to overestimated coercivity.
- Prediction errors increase with microstructural complexity (more grains per selection), indicating limited training coverage and the need for more data in complex regions (e.g., boundary junctions).
- Redundant high-dimensional pixel features can hinder training; feature selection is constrained by fixed-length vector requirements and zero-padding.
- Scaling the geometry (1:15) may alter magnetostatic interactions; free boundary conditions can introduce edge effects.
- Affinity to a single material system (MnAl-C) and EBSD-derived features may limit generalizability without retraining for other systems or resolutions.
Related Publications
Explore these studies to deepen your understanding of the subject.

