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 [1]. 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 [2]. The microstructure of MnAl-C magnets is known to contain a range of defects, such as grain boundaries, twins and antiphase boundaries [3–7].
Using micromagnetic simulations the influence of such microstructures on the performance of the magnet was analyzed [8]. Recently we developed a workflow to directly compute the coercive field from selections of EBSD data [9]. The resolution of the microscopic images and the needed scaling for the micromagnetic simulations remain key challenges in analyzing bulk permanent magnets [10]. 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
A promising approach to reduce the computational costs is the use of machine learning to predict the coercivity of permanent magnets [11]. Machine learning has been already used for the characterization of steel microstructures [12], for example. In Mg-alloys, Orme and co-workers analyzed the formation and propagation of twinning boundaries using decision trees [13].
One step further is the direct link of microstructural features to the coercivity of permanent magnets. Kronm¨uller and Goll discussed microstructural properties of advanced hard magnetic materials and its relation to the quality of permanent magnets [14] . 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.
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
(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 on the bottom shows the grain boundaries of the EBSD map and the random simulation selections (about 1500) 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 (Figure 1 on the top right), those locations are the most important determining factors for the bulk coercivity.
Figure 1: EBSD map of 600x400 pixels with a pixel edge length of 0.3 vided in two halves (top). Inverse pole figure (IPF) map converted with Dream3D (dream3d.bluequartz.net, last visited on 17/12/2019) on the left. Crystallographic twin boundaries on the right: true-twins (red), order-fault-twins (green), pseudo- twins (blue) and others (gray). Each colored square (10x10 pixels) corresponds to the switching field
, computed by micromagnetic simulations (bottom).
The resolution of the EBSD dataset is not high enough to directly com-
pute 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 [9]. We combine multiple steps of the toolchain into a single meshing tool using the preand 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.
Figure 2: Original EBSD data selection (left), smoothed grain boundaries (center) and tetrahedral finite element mesh (right) with arbitrary colors according to the grain id. Simulation parameters are given in Table 1.
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 [15]. Simulation parameters listed in Table 1 are obtained from bulk MnAl-C [16] 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 [9]). Bance et al. downsized the original EBSD dataset to reduce computational costs by 1:500 and 1:50 [8]. 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.
Table 1: Micromagnetic parameters for the simulations. Parameters are obtained from bulk MnAl-C experiments [16]
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 on the bottom we highlight
from red (1 T/
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 does 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 [17] we analytically calculate a switching field approximation for each individual grain [14]:
with the misorientation angle ) between the easy axis of a grain and the external field (unit vector e
). 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 [6], 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 [8, 9]. 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 on the bottom 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 ScikitLearn framework [18, 19]. Similar to Exl and co-workers [11] 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 Section 3.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
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.
3.1. Labeling
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
Figure 3: Exemplary hysteresis curves with clear (green) and uncertain (blue) definition for the nonreversible switching field.
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 step 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 a little worse. Probably, redundant data and the high number of features make the training more difficult. The features SW and TWIN produce a MAE of 0.185 T and 0.17 T respectively. SIZE can only be used in addition to other features, due to the large error.
A two-way partial dependency surface of SW and TWIN shows the dependency on the predicted coercivity (Figure 4). The coercivity is definitely re-
Table 2: Single feature predictions: MAE value obtained by the Voting Regressor (VR).
duced 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).
Figure 4: Two-way partial dependency surface with SW and TWIN.
The combination of several features introduces more possibilities for ac-
curately predicting the coercivity. The best feature combinations are shown in Table 3. Given the fact, that individual features or feature pairs may perform poorly, the best MAE score is still reached with a combination of all features.
Table 3: Best feature combinations (MAE 0.12 T): MAE value obtained by the Voting Regressor (VR).
3.3. Microstructural complexity
Right now we have used all the simulations for training and testing. For better understanding of the MAE values, we can split the data according to the number of grains in the selections. Each dataset with the same number of grains is individually used for training and testing. With increasing number of grains, the error of the prediction is increasing as well, which is shown in Table 4. A large number of grains in the selections increases the systems complexity with many possibilities of magnetization reversal. Here most likely the number of training data has to be extended, in order to improve the prediction accuracy.
Table 4: Prediction accuracy according to the number of grains in the selections. PIXEL, GRAIN, SIZE, SW and TWIN are used as training features.
3.4. Local coercivity prediction
In Figure 5 on the top 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 on the bottom). 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 5 on the bottom). 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 the bottom image is correct as nucleation mostly starts at grain boundaries [20]. Due to the very similar prediction results, a simplified demagnetization curve of the whole EBSD map is showing a similar trend as well (see Figure 8 in Summary and Conclusion).
Figure 5: Switching fields predicted for the EBSD map (600x400 pixels with 0.3
pixel edge length) by using PIXEL, GRAIN, SIZE, SW, TWIN (top) and GRAIN, SIZE (bottom) as training features.
3.5. Different resolution of EBSD maps
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 6 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.
Figure 6: Switching fields predicted for a new EBSD map with different pixel resolution (200x200 pixels with 0.5
m pixel edge length). The features GRAIN and SIZE are used for training.
3.6. Prediction accuracy of new EBSD maps
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. We use a new EBSD map to get the prediction accuracy from the trained trees of the original training data in Figure 1. Firstly, the machine learning model is trained with the data from Figure 1. Afterwards the machine learning model is tested with an entirely new dataset from the same MnAl-C sample as in Figure 1 with a size of 180x81 (600x270 pixels). For this new data we compare micromagnetic simulations with the predictions of the previous machine learning model. This time the selections are picked on a regular grid with a size of 10x10 pixels. Each selection with an odd grid number is used for creating a finite element mesh for the simulations. And again the selections are checked for uniqueness to avoid a biased dataset. Figure 7 on the top shows the computed switching fields
of the new EBSD map from about 400 simulations.
Now we can predict the switching fields on the very same selections by using the trained regression trees from the original EBSD map (Figure 1). We use a combination of all features: PIXEL, GRAIN, SIZE, SW and TWIN. Figure 7 on the bottom highlights those predicted switching fields show less maxima and minima compared to the simulated ones. Consequently the MAE is larger than in previous results with a value of 0.23 T. Here again the microstructural complexity, which is discussed in Section 3.3, is probably causing the worsening. More training data need to be produced to overcome this issue.
Figure 7: Switching fields computed (top) and predicted by using the training data from the EBSD map in Figure 1 with the features PIXEL, GRAIN, SIZE, SW, TWIN (bottom) for the EBSD map (600x270 pixels with 0.3
m pixel edge length).
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 none 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 to run 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. Due to the microstructural complexity the mean absolute error is higher for the prediction of new EBSD datasets. Here a large number of training data from different EBSD maps need to be produced to improve the prediction accuracies.
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.
Figure 8: Hysteresis curves of the EBSD maps in Figure 5 and Figure 6 neglecting stray fields and exchange coupling between 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.
[1] K. Skokov, O. Gutfleisch, Heavy rare earth free, free rare earth and rare earth free magnets-vision and reality, Scripta Materialia 154 (2018) 289–294.
[2] J. Coey, Permanent magnets: Plugging the gap, Scripta Materialia 67 (6) (2012) 524–529.
[3] J. v. Landuyt, G. Tendeloo, J. Broek, H. Donkersloot, H. Zijlstra, Defect structure and magnetic properties of MnAl permanent magnet materials, IEEE Transactions on Magnetics 14 (5) (1978) 679–681.
[4] E. Houseman, J. Jakubovics, Domain structure and magnetization processes in mnal and mnalc alloys, Journal of magnetism and magnetic materials 31 (1983) 1005–1006.
[5] C. Yanar, V. Radmilovic, W. A. Soffa, J. M. Wiezorek, Evolution of microstructure and defect structure in l10-ordered manganese aluminide permanent magnet alloys, Intermetallics 9 (10-11) (2001) 949–954.
[6] F. Bittner, L. Schultz, T. G. Woodcock, Twin-like defects in L10 ordered -MnAl-C studied by EBSD, Acta Materialia 101 (2015) 48–54.
[7] D. Palanisamy, D. Raabe, B. Gault, On the compositional partitioning during phase transformation in a binary ferromagnetic mnal alloy, Acta Materialia 174 (2019) 227–236.
[8] S. Bance, F. Bittner, T. G. Woodcock, L. Schultz, T. Schrefl, Role of twin and anti-phase defects in MnAl permanent magnets, Acta Materialia 131 (2017) 48–56.
[9] M. Gusenbauer, J. Fischbacher, A. Kovacs, H. Oezelt, S. Bance, P. Zhao, T. G. Woodcock, T. Schrefl, Automated meshing of electron backscatter diffraction data and application to finite element micromagnetics, Journal of Magnetism and Magnetic Materials 486 (2019) 165256.
[10] J. Fischbacher, A. Kovacs, M. Gusenbauer, H. Oezelt, L. Exl, S. Bance, T. Schrefl, Micromagnetics of rare-earth efficient permanent magnets, Journal of Physics D: Applied Physics 51 (19) (2018) 193002.
[11] L. Exl, J. Fischbacher, A. Kovacs, H. Oezelt, M. Gusenbauer, K. Yokota, T. Shoji, G. Hrkac, T. Schrefl, Magnetic microstructure machine learning analysis, Journal of Physics: Materials 2 (1) (2018) 014001.
[12] S. M. Azimi, D. Britz, M. Engstler, M. Fritz, F. M¨ucklich, Advanced steel mi- crostructural classification by deep learning methods, Scientific reports 8 (1) (2018) 2128.
[13] A. D. Orme, I. Chelladurai, T. M. Rampton, D. T. Fullwood, A. Khosravani, M. P. Miles, R. K. Mishra, Insights into twinning in mg az31: A combined ebsd and machine learning study, Computational Materials Science 124 (2016) 353–363.
[14] H. Kronm¨uller, D. Goll, Micromagnetism of advanced hard magnetic materi- als, International Journal of Materials Research 100 (5) (2009) 640–651.
[15] D. Suess, V. Tsiantos, T. Schrefl, J. Fidler, W. Scholz, H. Forster, R. Dittrich, J. Miles, Time resolved micromagnetics using a preconditioned time integration method, Journal of Magnetism and Magnetic Materials 248 (2) (2002) 298–311.
[16] J. Thielsch, F. Bittner, T. G. Woodcock, Magnetization reversal processes in hot-extruded -MnAl-C, Journal of Magnetism and Magnetic Materials 426 (2017) 25 – 31.
[17] E. C. Stoner, E. Wohlfarth, A mechanism of magnetic hysteresis in heteroge- neous alloys, Phil. Trans. R. Soc. Lond. A 240 (826) (1948) 599–642.
[18] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, E. Duchesnay, Scikit-learn: Machine learning in Python, Journal of Machine Learning Research 12 (2011) 2825– 2830.
[19] A. G´eron, Hands-on machine learning with Scikit-Learn and TensorFlow: con- cepts, tools, and techniques to build intelligent systems, ” O’Reilly Media, Inc.”, 2017.
[20] J. Fischbacher, A. Kovacs, H. Oezelt, M. Gusenbauer, T. Schrefl, L. Exl, D. Givord, N. M. Dempsey, G. Zimanyi, M. Winklhofer, G. Hrkac, R. Chantrell, N. Sakuma, M. Yano, A. Kato, T. Shoji, A. Manabe, On the limits of coercivity in permanent magnets, Applied Physics Letters 111 (7) (2017) 072404.