Permanent magnets are of great interest in today’s economy. Especially green energy applications such as in wind turbines and hybrid/electric vehicles demand high performance permanent magnets. The performance of permanent magnets is mainly determined by intrinsic magnetic properties and microstructural features. The intrinsic properties are adjusted by including rare earth (RE) elements which mainly increase the magnetocrystalline anisotropy. Due to economical and environmental considerations there is a high interest in reducing the use of RE elements Skokov and Gutfleisch (2018). MnAl-C contains no RE or other critical raw materials and its intrinsic magnetic properties make it an attractive alternative to certain types of RE-based permanent magnets Coey (2012). The microstructure of MnAl-C magnets is known to contain a range of defects, such as grain boundaries, twins and antiphase boundaries Landuyt et al. (1978); Houseman and Jakubovics (1983); Yanar et al. (2001); Bittner et al. (2015).
Using micromagnetic simulations the influence of such microstructures on the performance of the magnet was analyzed Bance et al. (2017). Recently we developed a workflow to directly compute the coercive field from selections of EBSD data Gusenbauer et al. (2019). The resolution of the microscopic images and the needed scaling for the micromagnetic simulations remain key challenges in analyzing bulk permanent magnets Fischbacher et al. (2018). The acquisition of EBSD data sets encompassing many hundreds of µm is routinely possible, but current micromagnetic simulation methods are still limited to a size range of only a few m.
A promising approach to reduce the computational costs is the use of machine learning to predict the coercivity of permanent magnets Exl et al. (2018). Machine learning has been already used for the characterization of steel microstructures Azimi et al. (2018), for example. In Mg-alloys, Orme and co-workers analyzed the formation and propagation of twinning boundaries using decision trees Orme et al. (2016).
One step further is the direct link of microstructural features to the coercivity of permanent magnets. Kronmüller and Goll discussed microstructural properties of advanced hard magnetic materials and its relation to the quality of permanent magnets Kronmüller and Goll (2009) . By investigating the various boundary types of MnAl-C, their distribution and the effect on the coercivity by micromagnetic simulations, we hope to optimize the overall performance of MnAl-C magnets. In this work we use trained regression trees to map microstructural features with high accuracy to local coercivities of spatially confined areas. The training data is obtained directly from EBSD data of MnAl-C. Using automated geometry construction, discretization of the EBSD map and micromagnetic demagnetization simulations, a large amount of training data can be obtained.We identified the most prominent microstructural feature combinations to accurately predict the coercivity.
2 Methods and Theory
In the following section we show an automated modeling and meshing procedure to generate a large amount of simulation data from real EBSD maps. Micromagnetic simulations are performed to compute the nonreversible switching fields of spatially confined areas. We show the important microstructural attributes of the EBSD maps for machine learning as well es the used regressional decision trees.
2.1 Dataset generation
We are computing the switching fields of MnAl-C selections obtained from EBSD data. The original data is represented as crystallographic orientations on a regular grid. Our EBSD sample in Figure 1 has a size of 180x120 m (600x400 pixels). We randomly pick 10x10 pixels from the original dataset to create finite element meshes for the simulations. In order to avoid a biased dataset and the recomputation of equal pixel frames the uniqueness is checked in advance. Figure 1 shows the grain boundaries of the EBSD map and the random simulation selections (about 1300) colored by its computed coercivity. Due to the uniqueness constraint, the selections are preferentially located at the grain boundaries. Since nucleation usually starts near defects, which for MnAl-C are most often grain or twin boundaries, those locations are the most important determining factors for the bulk coercivity.
The resolution of the EBSD dataset is not high enough to directly compute micromagnetic simulations. Features like grain boundaries which are small compared to the grid resolution are not accurately spatially resolved. Sharp angles need to be smoothed for the simulations in order to reduce numerical instabilities. In previous work we showed an automated meshing procedure for the fast generation of simulation models Gusenbauer et al. (2019). We combine multiple steps of the toolchain into a single meshing tool using the pre- and post-processing software Salome (salome-platform.org, last visited on 29/07/2019). We load the pixelated EBSD data into the software, smooth the grain boundaries and create a high quality finite element mesh (Algorithm 1). The software basically finds all intersection points of the grain boundaries and reconnects them with Bezier curves, replacing the stepped lines of the original pixelated EBSD image. Figure 2 shows an example of an original EBSD selection on the left, the creation of a smoothed 2-dimensional surface in the center and the extruded 3-dimensional mesh on the right.
The mesh is then used by a fast micromagnetic solver, which computes the switching field for the particular selection.
2.2 Micromagnetic simulations
The finite element mesh obtained from the automated meshing routine is used by a fast micromagnetic solver. We are computing magnetization reversal curves using the Landau-Lifshitz-Gilbert (LLG) equation Suess et al. (2002). Simulation parameters listed in Table 1 are obtained from bulk MnAl-C Thielsch et al. (2017) at 300 K. The largest edge length of the tetrahedral finite elements (mesh size) is set to be smaller than the smallest characteristic length of the material (compare findings in Gusenbauer et al. (2019)). Bance et al. downsized the original EBSD dataset to reduce computational costs by 1:500 and 1:50 Bance et al. (2017). Here we use a scaling ratio of 1:15, so that 1 m in the original EBSD dataset corresponds to 67 nm in the simulations.
|uniaxial anisotropy constant||1.5||MJ/m|
The nonreversible switching fields obtained by the micromagnetic simulations are the solutions (labels) for the machine learning dataset. We compute the hysteresis curves with an external field aligned in-plane from +4T to -4T. In Figure 1 we highlight from red (1 T/) to green (3 T/). In some cases is ambiguous. We discuss the problem in Section 3.1.
2.3 Microstructural attributes
From the EBSD data we have the orientation information of each grain of the simulation model. We can use each individual data point (pixel) of an EBSD selection as a feature or we can just use a list of single grains with their respective orientation. From the first we get also location coordinates, which the second does not include. We define the crystallographic orientation as unit vector pointing into the positive field direction y. The smoothing operation creates many more data points than the original image shows. A higher number of data points slows down the learning process, but do not significantly improve the machine learning accuracy. Therefore we stick to the discretization points of the original EBSD data for training. The size of the grains can effect the switching field as well and is therefore added to the list of microstructural features.
By using the Stoner-Wohlfarth (SW) model for single-domain ferromagnets Stoner and Wohlfarth (1948) we analytically calculate a switching field approximation for each individual grain Kronmüller and Goll (2009):
with the misorientation angle between the easy axis of a grain and the external field (unit vector ). The lowest field value of all grains gives the nonreversible switching event of the selection, if other effects like stray field and grain boundary exchange coupling are neglected.
Twin boundaries are known to have a strong influence on the quality of permanent magnets. Especially in MnAl-C true-twins, order-fault-twins and pseudo-twins are frequently found Bittner et al. (2015), which have a clearly defined misorientation angle. In previous work we computed hysteresis curves for selections of MnAl-C and showed a significant effect of twinning boundaries on the coercive field Gusenbauer et al. (2019); Bance et al. (2017). From manual observation of the simulation results and from partial dependency curves in Section 3.2 we observe a negative influence on the coercivity, if the adjacent grains orientations have a large enclosed angle. Therefore we incorporate the twin angles into a feature for machine learning by calculating the minimum dot product of adjacent grains orientation unit vectors. A large angle implicitly means that both of the adjacent grains are disadvantageously orientated to the applied field direction. Whereas the SW model incorporates only the misorientation angle of a single grains orientation with respect to the external field.
From the microstructural attributes and analytical equations we acquire the following features used for machine learning. In brackets the short feature name is given as well as the number of features as seen by the machine.
Crystallographic orientation for each data point as unit vector (“PIXEL”, 300)
Crystallographic orientation for each grain as unit vector (“GRAIN”, 60)
Size of grains (“SIZE”, 20)
Minimum Stoner-Wohlfarth switching field (“SW”, 1)
Minimum dot product of adjacent grains orientation (“TWIN”, 1)
PIXEL’s features are all orientation unit vectors of the data points (10x10 pixels). The maximum possible number of grains for our selections is set to 20. Therefore SIZE has 20 entries and GRAIN 20 times 3 components of the orientation vectors. If there are less than 20 grains in the selection the feature is set to 0. Typical feature correlation or feature elimination methods cannot be used in such a configuration, because each pixel is already a feature, hence cannot be reasonably compared to other features. In machine learning usually feature scaling is necessary. For our selected features the number range is very small, therefore scaling does not beneficially improve the outcome. Feature importance will be discussed in Section 3.2.
2.4 Machine learning methods
With our automated meshing procedure we are able to generate a large number of simulation models. Yet calculating the switching fields for each model comes with a certain computational cost. A single simulation on a single CPU takes a few hours depending on the magnetic configuration. The computation of of all selections in Figure 1
requires about half a year of CPU time. By using a machine learning code we can reduce the time to solution for any new EBSD data to a few seconds. The training and test set contains microstructural features of the selected models and its switching fields (supervised learning). We are using Python with the Scikit-Learn frameworkPedregosa et al. (2011); Géron (2017). Similar to Exl and co-workers Exl et al. (2018)
we are using the two decision trees Random Forest (RF) and Gradient Boosting (GB). We tested convolutional networks with the pixelated EBSD data but could not achieve the same prediction accuracy. For simple comparison of labeling methods in Section3.1 we are using a classification of “good” and “bad” selections, which translates to a high and low switching field respectively. But our main focus is on the use of regression, because we want to predict actual values of the switching fields in a new EBSD dataset. For our machine learning approaches we use 80% of the simulation models for learning and 20% for testing.
We are using the GridSearchCV method from Scikit-Learn to optimize the hyperparameters of our RF and GB regressors. In our case the optimized hyperparameters are
RandomForestRegressor(n_estimators=300, max_features=auto, max_depth=100,min_samples_leaf=1, min_samples_split=2) GradientBoostingRegressor(n_estimators=300, max_features=’auto’, max_depth=4, learning_rate=0.07, min_samples_leaf=5, min_samples_split=8)
A Voting Regressor (VR) is used to average the individual predictions on the whole dataset and to form a final prediction. For quantitative analysis of the predicted values we are using the Mean Absolute Error (MAE).
In the Results section we show the importance of accurate labeling. Nonreversible switching fields are sometimes difficult to determine. Afterwards we analyze the effect of the microstructural attributes as well as its combinations on the machine learning efficiency. The trained machine can be used to predict local coercivities of new microscopic data, even for different microscopic resolutions.
Training the machine requires a well defined set of microstructural features as well as an explicit solution, the nonreversible switching field . Often is sufficiently defined by the field which is needed to reverse the sign of as for example the green line in Figure 3. For such a curve the magnet is clearly in a nonreversible state after the step. Whereas the blue line is much flatter and shows only three small steps, non of which is a clear candidate for .
In order to find the optimum label we created a simple classification problem, which tries to predict the 20% percentile of the “bad” selections, with the lowest switching field. We tested 3 different definitions of the switching field , (a) the first step, (b) the last step and (c) the largest derivative of the curve. The initial step at 4T depends on the magnetic configuration of the selection and is not used to find the best label. We obtained prediction accuracies of 90%, 85% and 86% respectively, therefore we decided to use the first step of the curve as definition of .
3.2 Feature selection
In Section 2.3 we defined 5 features from our microstructural EBSD dataset. We predicted the local coercivity via a single feature and summarized the MAE scores in Table 2 . The lowest error is reached with the feature GRAIN, in which the location information of the crystals is not included. The PIXEL feature, which contains the additional position information, performs worse. Probably the large amount of redundant data is causing the drastic reduction in accuracy. The features SW and TWIN produce an error of about 0.2 T. SIZE can only be used in addition to other features, due to large increase in MAE.
. The lowest error is reached with the feature GRAIN, in which the location information of the crystals is not included. The PIXEL feature, which contains the additional position information, performs worse. Probably the large amount of redundant data is causing the drastic reduction in accuracy. The features SW and TWIN produce an error of about 0.2 T. SIZE can only be used in addition to other features, due to large increase in MAE.
A two-way partial dependency surface of SW and TWIN shows the dependency on the predicted coercivity (Figure 4). The coercivity is definitely reduced by a negative dot product of two adjacent grains orientations (TWIN) even for a large SW. On the contrary SW is much closer to the predicted switching field for a positive dot product. A clear maximum is located at a large SW and a large TWIN. Yet also several maxima can be found even for lower SW. Partial dependency curves for PIXEL, GRAIN and SIZE are not reasonable, as each one of it contains multiple features (data points in PIXEL, maximum number of possible grains in a selection for GRAIN and SIZE).
The combination of several features introduces more possibilities for accurately predicting the coercivity. The best feature combinations are shown in Table 3. Some features perform good when paired, e.g. GRAIN/SIZE and SW/TWIN, whereas others loose accuracy, e.g. PIXEL/GRAIN. Given the fact, that individual feature pairs may perform bad, the best MAE score is still reached with a combination of all features.
3.3 Local coercivity prediction
In Figure 5 we show coercivity predictions of our decision trees using all 5 features (PIXEL, GRAIN, SIZE, SW, TWIN). Local coercivity is nicely reconstructed with lower values at grain boundaries and higher values for bulk as shown in the simulations (Figure 1). With an already trained machine learning model, any new EBSD map from the same material can be predicted in a matter of seconds rather than weeks as needed for micromagnetic simulations. For visual comparison to the previous image we are using only GRAIN and SIZE for predicting the local coercivity of the same EBSD map (Figure 6). The grain boundaries show similar predicted values , whereas two larger grains (a, b) have large deviations. If we imagine the coupling of the local switching fields, it is more likely that Figure 6 is correct as nucleation mostly starts at grain boundaries Fischbacher et al. (2017).
When changing the resolution of an EBSD map we are facing problems using PIXEL for training the model, because the number of data points in the selection is changed. We propose to omit PIXEL and to use the accurately predicting features GRAIN and SIZE to overcome this issue. The physical size of the selection is required to stay about the same, otherwise we cannot be sure that the training data is still valid. Figure 7 shows the predicted for a new EBSD map with a coarser resolution of 0.5 m per pixel in contrast to the resolution of 0.3 m per pixel used for training. The same physical size of the selections is used.
4 Summary and Conclusion
We have demonstrated a fast way to predict local coercivities for MnAl-C. An automated script scans a large EBSD dataset, selects hundreds of unique samples and creates finite element meshes accordingly. For each selection the local switching field is computed by a fast Landau-Lifshitz-Gilbert micromagnetic solver. The microstructural features of the EBSD selections and its switching fields are used to train Random Forest and Gradient Boosting regressors. A Voting Regressor combines those two methods for an improved prediction accuracy.
Feature selection for the given micromagnetic problem is not straight forward. We are using features like PIXEL, that are a set of multiple features, the data points of the EBSD map. On one hand, training the machine with PIXEL includes the orientation of the grains, the geometry as well as the location information. On the other hand, quite a lot of redundant information is in the dataset. The GRAIN feature includes only the orientation of the single grains and has no geometrical nor location information. This might be the reason that non of the single or combined features reach a MAE value lower than 0.1. The trained machine can be used to predict local switching fields of new microscopic EBSD data without the need of running new simulations. The time to solution is drastically reduced to seconds instead of days. Even for differing resolutions of the EBSD datasets the training data can be used, because the geometrical information is not absolutely necessary. A list of the orientations of included grains are enough to predict the local switching fields in good agreement with the simulation results.
Finally we can take all local switching fields from an EBSD map to imitate a demagnetization process and construct a hysteresis curve. We take an increasing external field and as soon as the field value is greater than a locally predicted switching field, the particular selection is magnetically reversed. The ratio from switched to unswitched selections versus the external field gives the simplified demagnetization curve (Figure 8). But we neglect stray field and exchange coupling between the selections.
In the future we hope to first include the missing interaction contributions between the selections and extend this approach to compute coercivity for bulk MnAl-C.
Acknowledgment The authors gratefully acknowledge the financial support of the Austrian Science Fund (FWF), Project: I 3288-N36 and the German Research Foundation (DFG), Project: 326646134.
Data Availability All data generated or analyzed during this study are available from the corresponding author upon request.
Advanced steel microstructural classification by deep learning methods. Scientific reports 8 (1), pp. 2128. Cited by: §1.
- Role of twin and anti-phase defects in MnAl permanent magnets. Acta Materialia 131, pp. 48–56. Cited by: §1, §2.2, §2.3.
- Twin-like defects in L10 ordered -MnAl-C studied by EBSD. Acta Materialia 101, pp. 48–54. Cited by: §1, §2.3.
- Permanent magnets: plugging the gap. Scripta Materialia 67 (6), pp. 524–529. Cited by: §1.
- Magnetic microstructure machine learning analysis. Journal of Physics: Materials 2 (1), pp. 014001. Cited by: §1, §2.4.
- On the limits of coercivity in permanent magnets. Applied Physics Letters 111 (7), pp. 072404. Cited by: §3.3.
- Micromagnetics of rare-earth efficient permanent magnets. Journal of Physics D: Applied Physics 51 (19), pp. 193002. Cited by: §1.
Hands-on machine learning with scikit-learn and tensorflow: concepts, tools, and techniques to build intelligent systems. ” O’Reilly Media, Inc.”. Cited by: §2.4.
- Automated meshing of electron backscatter diffraction data and application to finite element micromagnetics. Journal of Magnetism and Magnetic Materials 486, pp. 165256. Cited by: §1, §2.1, §2.2, §2.3.
- Domain structure and magnetization processes in mnal and mnalc alloys. Journal of magnetism and magnetic materials 31, pp. 1005–1006. Cited by: §1.
- Micromagnetism of advanced hard magnetic materials. International Journal of Materials Research 100 (5), pp. 640–651. Cited by: §1, §2.3.
- Defect structure and magnetic properties of mnal permanent magnet materials. IEEE Transactions on Magnetics 14 (5), pp. 679–681. Cited by: §1.
- Insights into twinning in mg az31: a combined ebsd and machine learning study. Computational Materials Science 124, pp. 353–363. Cited by: §1.
- Scikit-learn: machine learning in Python. Journal of Machine Learning Research 12, pp. 2825–2830. Cited by: §2.4.
- Heavy rare earth free, free rare earth and rare earth free magnets-vision and reality. Scripta Materialia 154, pp. 289–294. Cited by: §1.
- A mechanism of magnetic hysteresis in heterogeneous alloys. Phil. Trans. R. Soc. Lond. A 240 (826), pp. 599–642. Cited by: §2.3.
- Time resolved micromagnetics using a preconditioned time integration method. Journal of Magnetism and Magnetic Materials 248 (2), pp. 298–311. Cited by: §2.2.
- Magnetization reversal processes in hot-extruded τ-MnAl-C. Journal of Magnetism and Magnetic Materials 426, pp. 25 – 31. External Links: Cited by: §2.2, Table 1.
- Evolution of microstructure and defect structure in l10-ordered manganese aluminide permanent magnet alloys. Intermetallics 9 (10-11), pp. 949–954. Cited by: §1.