Introduction

Soft magnetic materials have important applications in the cores of transforms, generators, and motors, among others1,2,3. With the advantage of reducing global warming, electric cars have become a popular topic in the automotive industry. The desired properties of soft magnetic materials for achieving high energy efficiency are high saturation magnetisation, low coercivity, and low loss. A crucial aspect that limits the efficiency of motors is energy loss. The loss at each cycle corresponds to the work performed by the external field4. Therefore, to develop better motors, maximum suppression of this loss is necessary. Among the losses, hysteresis loss is primarily caused by the pinning of the domain wall, which limits the free motion under an external field4. Domain walls have been extensively researched5, and the correlation between hysteresis and microstructures has been addressed for hard magnetic materials6, and in a few works, for soft magnetic materials7,8. The microstructure in soft magnetic materials has an important influence on the loss owing to the Barkhausen effect9.

Visualising the energy for magnetic materials has practical and fundamental applications. Balakrishna and James recently described a theoretical framework to elucidate the coercivity in Permalloy (Py) using magnetoelastic and anisotropic energies10. Toga et al. have described the energy landscape for the Neodymium (Nd) magnet to reveal the thermodynamic activation energy of the system11. The calculation of the energy in real materials is arduous owing to defects, roughness, crystal sizes, etc. The description of physics in inhomogeneous polycrystalline systems considering the metallography structure is necessary for advanced material applications, particularly in non-equilibrium conditions such as the magnetisation reversal process. Thus, an understanding of the function of real materials in a heterogeneous system, such as the magnetic domain and metallographic structure, has been an outstanding issue in materials science.

Currently, however, this problem may be solved using material informatics12,13. In the last decade, with the evolution of hardware and the creation of material databases14,15, machine-learning techniques have broken into material science with outstanding results16,17,18. Magnetic properties have recently been investigated using machine learning. Kwon et al. developed a technique for extracting the parameters of the magnetic Hamiltonian from spin-polarised low-energy electron microscope (SPLEEM) image data using a combination of neural networks19. Park et al. have used artificial neural network (ANN) and other machine learning algorithms to predicate the coercivity in NdFeB magnets and obtained an accuracy as high as R2 = 0.920. Additionally, the obtainment of system parameters based on the analysis of the Ginzburg–Landau (GL) domain wall equation has been recently reported21. Recently discussions done by our group about the GL theory and its applications and limitations have been published somewhere else22,23.

In this work, we attempt to describe coercivity using the machine learning energy landscape and how system properties can be visualised in feature space using an extension of the standard GL theory. We focused on understanding the coercivity mechanism of real materials. We used a micromagnetics simulation and magneto-optical Kerr effect microscope images combined with principal component analysis (PCA) to develop the energy landscape in the magnetisation reversal process for Py thin film. We could draw the landscape for simulated and experimental magnetic domain structure sets. We discuss how coercivity is represented in a feature space and analysed the relationship between physical parameters, the meaning of the outputted features, and energy cost. Our explainable machine learning method is applied to understand the mechanism of coercivity of both simulated and experimental datasets of magnetisation reversal processes. Here, we compared the effect of an increase in the density of defects in Py thin films using a smart analysis to directly connect the image information of the magnetic domain structure to the analysis of the coercive force mechanism using the GL theory. To elucidate the general idea of this manuscript, Fig. 1 displays the workflow of extracting the physical information and drawing the energy landscape from the magnetic domain images. (I) Magnetisation images were obtained by simulation or experiment or both. (II) Here the images are pre-processed and converted from real space to reciprocal space using fast Fourier transformation (FFT). Fourier transformation has been used in image processing to extract periodic components; also, Fourier transformation has been extensively used to study magnetic domains in diverse imaging and analysis techniques24,25,26,27,28. The reciprocal space maps the magnetic order; thus, we can reduce the dataset by considering only the higher-ordered elements with minimum information loss, which also avoids overfitting. (III) The reciprocal information is vectorised and used as the input for PCA, which is reduced in two dimensions. PCA is a simple and efficient algorithm that can help interpret the trend in the dataset, and it also features explainability. At the end of this step, the energy landscape is drawn, which can be used to extract the hidden factors. (IV) Finally, the GL model was extended to the information space by using variable transformations. The correlation between the principal components and the physical parameters is used to interpret the magnetisation reversal phenomenon.

Fig. 1: Energy landscape analysis workflow.
figure 1

The classic Ginzburg–Landau (GL) model has issues with analysing the coercivity of inhomogeneous real materials, such as grain boundaries and defects. Our extended GL model exploits the information of inhomogeneities in the magnetic domain structure and uses a physical descriptor to draw the energy landscape in a feature space. The data acquisition starts with obtaining magnetic domain images from the initial image set by solving the Landau–Lifshitz–Gilbert (LLG) equation or experimental setup. Next, the features are extracted using fast Fourier transformation (FFT) and then vectorised. The FFT vectors of the magnetisation image dataset images were reduced to a 2-dimensional space using principal component analysis (PCA). The dimensionally reduced data sets can finally be stacked together. The interpretation of the coercivity can be done by observing the distance and gradient of the landscape. Summarily, using supervised machine learning, the prediction of the energy can be achieved.

Results

Development of energy landscape model

Machine learning methods

Machine learning algorithms are mainly separated into two main groups: unsupervised and supervised learning. The former aims to detect patterns and correlations between the data29 and the latter is trained using data labels to perform predictions. In this work, we used PCA (unsupervised learning) to reduce the dimension of the datasets and ANN and polynomial regression (supervised learning) to perform the predictions.

Principal component analysis

PCA is a traditional technique applied for dimension reduction, feature extraction, and data visualisation29,30. Due to the versatility of the method, PCA and other PCA-based algorithms have been successfully employed in pattern recognition and signal processing31,32,33,34.

PCA is formally defined as the orthogonal projection of data points onto a lower-dimensional linear space that the variance of the data in the lower space is maximised. The goal is to extract important information from the data set as well as order both the indices and principal components (PCs) based on the “explainability” (explained variance) of the data set. In a two dimensional decomposition, the first principal component (PC1) has the maximum variance. Orthogonal to PC1, the second principal component (PC2) presents the remaining variance.

Polynomial regression

Polynomial regression is a regression method that represents the relationship between two variables using a nth degree polynomial29.

$$y={\beta }_{0}+{\beta }_{1}x+{\beta }_{2}{x}^{2}+\cdots +{\beta }_{n}{x}^{n}+\epsilon ,$$
(1)

where ϵ is the error and β0, βn are the unknown parameters. The fitting is often done using the least-square method.

Artificial neural network

ANN is inspired by the biological neural network to perform predictions35,36. Based on the biological concept, an ANN algorithm can be composed of one or more layers and each layer has one or more nodes, also called neurons. The connection between the nodes in an ANN is weighted based on their prediction ability35.

Each node is trained based on the previous layers and so on. The layers between the input and output layers are called “hidden layers”. The training is based on minimisation of the error function by the gradient descend35.

Extended GL model

GL is a simple model to describe the magnetic reversal process based on statistical mechanics. Due to the simplistic formulation of the system energy, taking account of defects is rather complicated37. In the GL theory framework, the free energy of the system is given as a function of the order parameter. In the case of magnetic materials, the projection of total magnetic moment in the direction of external magnetic field, here written as m, plays the role of an order parameter. Therefore, the magnetically stable state of the magnetic material is obtained using the following free energy density38:

$$F(m)={U}_{i}+{U}_{z}-\frac{TS}{V}$$
(2)

where the first and second terms on the right-hand side are the internal energy densities, Uz is the Zeeman energy density owing to the external magnetic field hz, and Ui is the internal energy density term owing to the exchange, magnetic anisotropy energy densities, among others, excluding Uz. In Eq. (2), Uz is a linear function of m, which is given by Uz = −hzm. In the third term, T, S, and V are the temperature, entropy, and volume respectively.

In this model the magnetisation reversal process is explained by the stability of the system. For example, the reversal of the magnetisation state from positive (m > 0) to negative (m < 0), generated by hz becoming more negative, corresponds to a monotonous increase of the functional F(m), as observed in Eq. (2). The magnetisation reversal process occurs when hz is strong enough to overcome the internal energy barrier. The non-equilibrium condition is obtained using the following:

$$\frac{\partial F(m)}{\partial m}=\frac{\partial {U}_{i}}{\partial m}-{h}_{z}\ge 0,\qquad (m > 0)$$
(3)

where the derivative of the third term in Eq. (2) can be neglected. This is because, when the temperature T is sufficiently lower than the Curie temperature, the change in the total magnetic moment m is caused by a change in the global magnetic domain structure rather than spin fluctuation. Thus, the influence of the change in m on S is negligible. Regarding to the signs in Eq. (3), in the our exemplified case ∂U/∂m and hz are negative. As a result, the magnetisation reversal owing to the external magnetic field is expressed as follows:

$$-{H}_{c}={h}_{z}\le {\left(\frac{\partial {U}_{i}}{\partial m}\right)}_{\min }\qquad (m > 0),$$
(4)

where Hc denotes the coercivity of the magnetic material. Note that hz is negative here and the definition of Hc is a positive number, thus it requires the negative sign. The magnetisation reversal condition is that the external magnetic field is less than the minimum value of the differential term. Because the differentiation of the internal energy by the magnetic moment provides an effective field, it is possible to directly compare the magnetic properties of a material with an external magnetic field.

The calculation of the realistic version of the internal energy density Ui is extremely complicated; thus in this work, we can overcome the difficulty in obtaining the internal energy by investigating the features in the reduced space of the order parameter. To extract the features from the magnetisation data set, FFT was selected because it can capture the periodicity of the magnetic domains39. The magnetisation in the reciprocal space can be written as follows:

$${m}_{{{{{{{{\bf{q}}}}}}}}}=\frac{1}{2\pi V}\int m({{{{{{{\bf{r}}}}}}}}){{{{{\rm{e}}}}}}^{-{{{{{\rm{i}}}}}}{{{{{{{\bf{q}}}}}}}}\cdot {{{{{{{\bf{r}}}}}}}}}{{{{{\rm{d}}}}}}{{{{{{{\bf{r}}}}}}}},$$
(5)

where m(r) is the total magnetic moment inside the local region of the magnetic material, which is given by the position vector r, and V is the volume of the magnetic material.

To connect the image features to the physical property m, we derive a function D based on the principal components (PCs) of the FFT features in principal components. D is given as a function of the extracted features as follows:

$$m=D(PC1({m}_{{{{{{{{\bf{q}}}}}}}}}),PC2({m}_{{{{{{{{\bf{q}}}}}}}}}),\cdots )$$
(6)

The physical descriptor D describes the magnetisation as a function of the output of the machine learning algorithm. This transformation can be used to assign meaning to the PCs. Moreover, to investigate the more complex relationship between PCs and other physicals properties, the visualisation of the energy and PCA space components can be useful. Note here that in Eq. (6) the magnetisation is described as a projection of total magnetic moment, in comparison to the vector description displayed in Eq. (9) (Methods section). One approximation of our model is that we are projecting the magnetisation in the same direction as the external magnetic field, which is the direction that accounts for the coercivity. In this study, we refer to this relationship as an extended energy landscape i.e., extended in the feature space.

Therefore, the effective field, ∂Ui/∂m, using machine learning information is transformed to the following:

$$-{H}_{eff}= \left[\frac{\Delta {U}_{i}(PC1({m}_{{{{{{{{\bf{q}}}}}}}}}),\cdots \,)}{\Delta D(PC1({m}_{{{{{{{{\bf{q}}}}}}}}}),\cdots \,)}\frac{\Delta D(PC1({m}_{{{{{{{{\bf{q}}}}}}}}}),\cdots \,)}{\Delta m}\right] \qquad (D(PC1({m}_{{{{{{{{\bf{q}}}}}}}}}),\cdots \,) \, > \, 0)$$
(7)

Equation (7) describes the effective field as a function of the gradient of the energy landscape in the feature space, and physical descriptor D. The first derivative contains only elements from the extended energy landscape and the second describes the relationship between the real and feature space. In this work, we are interested in the description of the transformation landscape in the feature space, our group has attempted to analyse the shape of the effective field somewhere else40.

Application of energy landscape in feature space

Simulated Permalloy thin film

Data acquisition and pre-processing

Py is a Ni–Fe ferromagnetic alloy used in the industry for decades owing to its high permeability, low coercivity, and insignificant magnetostriction4,41,42. The concentration of Ni and Fe is approximately 80% and 20%, respectively. The impurities and defects must be mitigated to achieve the desired properties. Figure 2 shows the conventional magnetisation reversal curves for the simulated Py thin-film considering the various non-magnetic grain defect densities (Supplementary Fig. 1) which is in accordance with the literature43,44. Note that coercivity increases with increasing density of defects42. This relation is valid for micro-size defects because increasing the defects result in the generation of more pinning points, thereby, increasing coercivity45. It is well reported that nanosize defects can reduce the coercivity; however, this is outside of the scope of our study. To avoid thermal-related complications, we consider T = 0 K and for the measured sample, we measured as-grown. The problem with only relying in the magnetisation curve is that it is a physical quantity calculated by averaging the magnetic domain contrast and does not provide sufficient information on the microstructure of the magnetic domain. Thus, we use FFT and a dimension-reduction method to increase the physical information obtained from the magnetisation curve.

Fig. 2: Defect dependence magnetisation reversal curves.
figure 2

Magnetisation as function of the external field for simulated Permalloy films with different density of defects, shown in the legend. The density of defects varied from 1 to 23.6%. The inset images show the normalised x-component of the magnetisation (mx/m) domains images for a specific location on the hysteresis curve. The calculation generates appropriate magnetic structures and magnetic hysteresis loops that will be used hereafter as an example of the application of extended Ginzburg-Landau method.

To transform data into the feature space, we first arrange the magnetisation in an image set and process it using FFT. Next, the images were cropped 1/4 of the original size to avoid overflow. The transformed images are then vectorised, and the real and imaginary parts of the Fourier transformed vectors are stacked together. Third, an unsupervised machine-learning algorithm, PCA, was used to reduce the dimensions of the dataset. PCA is effective in extracting linear features of the dataset and projecting them into a low-dimensional space30. The main idea of PCA is to identify a new set of variables (principal components) that are linear functions of the original dataset and linearly independent of one another. The new set of variables is ordered according to the variance46.

Drawing the energy landscape

Figure 3 a shows the result of drawing the magnetisation curve in the information space using FFT and PCA. We took the FFT of the magnetisation component of mx, extracted the features, and decomposed them in a two-dimensional space using PCA. Each point corresponds to an image from the dataset. The distribution of PCA decomposition is centred at the origin, owing to a feature implemented by default in the PCA algorithm. Cumulative contributions of the first and second principal components (PC1 and PC2) are approximately 80–90% (for more details, see Supplementary Table 1), which means that most of the information from the images can be reduced to two dimensions. Note that the points representing images around the coercivity region (m = 0) are commonly distributed around zero of feature 1 (PC1) and in the maximum/minimum of feature 2 (PC2). In contrast, the points representing the saturation texture images (B = 0.6 T) are commonly distributed in the minimum and maximum of PC1 and nearly zero of PC2. The symmetric disposition of coercivity and saturation shows that PCA can capture information about the hysteresis loop from the magnetisation domain dataset. By overlapping different defect density datasets, we can see a clear increase in point dispersion as the defect density increases, implying that the overall distance between the points increases.

Fig. 3: Principal component analysis output evaluation.
figure 3

a Principal component analysis (PCA) decomposition magnetisation dataset considering various defect densities. b Magnetisation as a function of the first principal component (PC1), c total energy (Etotal) as a function of the second principal component (PC2). Red and black symbols correspond to positive and negative coercivity, respectively. PC1 is a good explanatory variable for the magnetisation, whereas PC2 can be a good explanatory variable for energy. The density of defects varied from 1 to 23.6%.

To investigate the meaning of the feature space components, the correlations between PCA components (Fig. 3a) and physical parameters were analysed. Figure 3b shows the PC1 as a function of magnetisation. Note that PC1 an be approximated as a linear relationship with the magnetisation.

For PC2, however, the physical interpretation is difficult, since no linear correlation was observed. Thus, it is important to analyse the correlations between various physical parameters. Near-coercivity images in the magnetisation space are mapped to the local maximum/minimum of PC2 (Fig. 3a), but unlike PC1, PC2 correlates with the magnetic domains. Thus, we can infer that PC2 might be related to the system energy, the total energy as a function of PC2 is displayed in Fig. 3c. The relationship between total energy and PC2 resembles a higher-order polynomial, with the coercivity data images near the maximum. Moreover, the landscape is flattened near the coercivity, which accurately represents the properties of soft magnetic materials.

One simple result that can be obtained from PCA decomposition is the relationship between feature space components and coercivity. Figure 4 shows the relationship between the weighted Euclidean distances from saturation to coercivity in the feature space (d) and coercivity. The weighted distance from the saturation to the coercivity is defined as follows:

$$d (P{C}_{{{{{\rm{sat}}}}}},P{C}_{{{{{\rm{coer}}}}}})=\sqrt{\mathop{\sum}\limits_{i}{\alpha }_{i}^{2}{\left(P{C}_{{{{{{\rm{sat}}}}}},i}-P{C}_{{{{{{\rm{coer}}}}}},i}\right)}^{2}},$$
(8)

where index i corresponds to the PCA components, and α is the explained variance of component i of the PCA decomposition. Here, we truncate the sum in the second element owing to the high explanation rates of PC1 and PC2. Note that d is proportional to coercivity. The second-order polynomial regression of the weighted distance associates a physical property with an element from the feature space. This correlation is explained by understanding how the magnetisation texture is disposed of in the feature space. Similar textures are disposed closer in the feature space; however, in the case of depinning, it is also visualised in the morphology of the magnetic texture which, in turn, increases the distance of points in the feature space. In other words, increasing the density of defects increases the occurrence of depinning, dispersing the data point in the reduced space. Although the distance between the adjacent points is reduced for the highly defective films owing to the smaller depinning, the overall distance is increased by the occurrence frequency.

Fig. 4: Relationship between coercivity and distance.
figure 4

Coercivity as a function of principal components weighted Euclidean distance from saturation to coercivity (d(PCsat, PCcoer)) defined in Eq. (8). Each point corresponds to a different dataset with a distinct defect density, thereby varying coercivity. The dotted red line corresponds to second-order polynomial regression.

The distance in the extended landscape might determine the coercivity mechanism. Thus, the energy of the system can be visualised for an unknown system based on the disposition of points in the feature space. High explanation ratios of PC1 and PC2 demonstrate that both components hold sufficient information on the magnetic ordering to describe coercivity. In the case of a lower explanation ratio, other PCA components can be easily added, which makes this approach versatile and useful. The similarities in the feature space show that the components are correlated with energy and coercivity, and can be used to reveal other properties in more complex systems.

The final step is to predict the energy based on the reduced space variables (PC1 and PC2). Figure 5 displays the estimated energy as a function of the actual value of the energy. The model was trained using a deep neural network and we achieved coefficient of determination R2 = 0.82. It is possible that by increasing the number of data, we could improve the result of the prediction. This implies that the energy can be predicted based on image location in the feature space. The ease with which the inhomogeneities can be added is a significant advantage over the GL theory because the GL theory considers the average of magnetisation.

Fig. 5: Prediction of the demagnetisation energy.
figure 5

Demagnetisation energy (Edemag) as a function of energy prediction using deep learning (r2 = 0.82). Each point corresponds to one magnetisation image and the solid line is the bisector. The shape of the energy landscape can be build and updated based on the training data.

Experimental Permalloy thin film

Experimental data acquisition and pre-processing

We demonstrate that the energy landscape for experimental images can be drawn similarly. Here, the in-plane magnetisation image data were obtained using a Kerr microscope, as described in the methods section. Before drawing the energy landscape, the image set was pre-processed using a Python library for scientific analysis called SciPy to correct for the brightness of the Kerr microscope’s light source47. We treated the magnetisation texture images obtained from the Kerr microscope as matrices, as they are in a 16-bit file format (216 = 65536 values). First, the background was subtracted from the images to increase the contrast; a Gaussian filter (σ = 7) and blur filter were used to reduce the noise. The filters had a negligible influence on the final result. The average intensity variation of the images was then used to normalise and correct the intensity of the whole data set. In contrast to the simulated images, the experimental images are susceptible to noise and drifting, which shifts the brightness intensity requiring additional correction.

After image correction, the estimation of the magnetisation curve for Py (Ni78.5Fe21.5) is displayed in Fig. 6. Here, magnetisation is calculated by obtaining the ratio of bright to dark pixels in the images. Note that, in contrast to the magnetisation curve (Fig. 2), the hysteresis curve for the experimental images is almost completely square owing to the approximation method (superficial pixel counting) and the large steps in the external field. Since we estimated the magnetisation by the in-plane superficial Kerr images, the pixel contrast might not be enough to obtain the detailed magnetisation curve. The usual value for coercivity in Py has been reported as two orders the magnitude lower than our sample42, which is in the same order as a high defect film48.

Fig. 6: Experimental magnetisation reversal curve.
figure 6

Experimental magnetisation curve (mx/m) as a function of the external field (B). The inset Kerr magnetic domain image points to the corresponding position in the magnetisation process. The positive and negative coercivity are denoted by white dots. The magnetisation reversal in the experimental dataset demonstrates that it is appropriate and that the analysis can be conducted.

Drawing experimental energy landscape

Similar to the discussion in the previous section, the domain wall information was extracted from the experiment using FFT. Before applying PCA, the real and imaginary parts were vectorised and stacked together. Figure 7 displays magnetisation as a function of PC1. Note that the relationship between PC1 and magnetisation is similar to that observed in the simulated data, demonstrating the reproducibility of the extended GL model in the experimental data. Coercivity is located near zero in PC1, which is consistent with our previous discussion. Py has a very low coercivity, which imposed certain experimental limitations. In contrast to the simulation, the external conditions could not be controlled precisely, and the steps were not comparably fine. A small difference is observed in Fig. 7 compared to the simulated case near the saturation region (Fig. 2b). The distinct curvature of the data points in the saturation region in these two images might be because of the different boundary conditions of the magnetic thin film. Nevertheless, the dimension reduction could capture similar information regarding the data condition.

Fig. 7: Relationship between magnetisation and the first principal component.
figure 7

Magnetisation (mx/m) as a function of first principal component (PC1). Positive and negative coercivity are denoted by white dots. This image can be used for direct comparison with the simulated result (Fig. 3b).

We used the model shown in Fig. 4 to estimate coercivity as 0.09 T, which is reasonably close to the measured value of approximated 0.07 T. This result supports the robustness of the developed method. Another advantage of using the energy landscape in the reduced space is its sensitivity compared to the usual methods that can be highly affected by the steps of the external field as observed in the magnetisation curve (Fig. 6). In our experiment, the coarser external field steps hinder the reversal process mechanism. The energy barrier to align the spins in the material with the magnetic field is very low owing to the almost non-existence of large pinning point regions.

Discussion

In real materials, morphological and structural defects play an important role in coercivity, and they are difficult to predict the origin of the material function. Here, we attempt to interpret the meaning of the features and deepen our understanding of the analysis results. In our model the FFT extracts features of the periodic structures by extracting multiple principal components in a data-driven manner, it might be possible to extract hidden features while still containing information about heterogeneity. This could be included in the edge of the usual FFT peak, which may contain magnetic ordering information, but has largely been overlooked by conventional analysis. It is noteworthy that we are using most of the information in the FFT pattern by considering the high explanation ratio components of PCA. Moreover, by using PCA to reduce the dimensions, we can narrow down and focus only on the ones with high explanation, which contributes to reducing the amount of data for analysis and study.

In simulations, coercivity can be calculated with high accuracy owing to the access of all variables in real materials; otherwise, there are many unknown parameters correlated with the microstructures. Our approach for describing the energy landscape using machine learning showed good results for both experimental and simulated data. Both shared similar shapes for the energy landscapes, as well as the explanation of variables and correlations between them. Because both systems consist of the same material, the magnetisation process should be similar; thus, the magnetic domain information in the reciprocal space is comparable, and the same considerations hold. Another advantage of using reciprocal space is that the same method to obtain the energy landscape can be applied to other techniques, not only for spatial imaging. Neutron diffraction, which is a powerful technique to investigate the magnetic structure of a material that outputs the data in the reciprocal space49 and can be used to study the magnetic properties using the energy landscape. We recently developed an analysis method for magnetic domains using topological data analysis (TDA)40,50. In the future, we intend to combine the method described herein with TDA to improve the extraction of inhomogeneities in magnetic domain structures.

In conclusion, to obtain the physical parameters from magnetisation images, we draw the energy landscape using material informatics tools. The coercivity for real materials cannot be described using only the usual GL method because morphological defects cannot be added without tuning the theory using ad hoc parameters. Here, we tried to overcome this problem by using the landscape that emerges from the principal components analysis of the magnetisation images. Based on the landscape, we observed the correlation of the distance and the coercivity in the reduced space. Mediated by the landscape, the energy and order parameters could be obtained from the magnetisation texture. Moreover, we demonstrated the importance of the pinning process in the total energy of the system and showed its relationship to the feature space and physical properties. Although we applied it to simple systems, the method can be extended to other systems and considering other properties such as temperature and strain/stress as well the dynamics in a high-speed magnetisation reversal process.

Methods

Micromagnetics simulation

Micromagnetics is a technique that simulates the magnetic behaviour of ferro- or ferrimagnetic materials in sub-micrometre scales. It can reproduce the magnetisation reversal process in inhomogeneous systems in any arbitrary shape45,51. The Landau–Lifshitz–Gilbert (LLG) equation models the effect of the electromagnetic field on ferromagnetic materials by considering the response of the magnetisation M to torques52.

$$\frac{{{{{{{{\rm{d}}}}}}}}{{{{{{{\bf{M}}}}}}}}}{{{{{{{{\rm{dt}}}}}}}}}=-{\gamma }_{0}({{{{{{{\bf{M}}}}}}}}\times {{{{{{{{\bf{H}}}}}}}}}_{{{{{{{{\rm{eff}}}}}}}}})+\alpha \left[{{{{{{{\bf{M}}}}}}}}\times \frac{{{{{{{{\rm{d}}}}}}}}{{{{{{{\bf{M}}}}}}}}}{{{{{{{{\rm{d}}}}}}}}t}\right],$$
(9)

where γ0 is the electron gyromagnetic ratio and α is the dimensionless damping factor. The effective field Heff usually contains the contribution from the exchange, anisotropy, Zeeman, and demagnetisation energy densities.

Micromagnetic modelling was performed using MuMax344. The cell size in all the simulations was set as 10 nm × 10 nm × 50 nm, and the LLG equation was solved using a closed boundary condition. In this model, we selected the following material parameters that are suitable for Py: saturation magnetisation Ms = 8.5 × 105 Am−1, exchange stiffness A = 1.3 × 10−11 Jm−1, dumping constant α = 0.01, and perpendicular uniaxial anisotropy Ku = 0.5 × 103Jm−353,54. This results in an exchange length \({l}_{s}=\sqrt{2A/{\mu }_{0}{M}_{s}^{2}}=5.3\) nm, which is in accordance with the values reported in literature54.

To simulate the defects, an algorithm was used to draw random size defects in the texture of the input images. The dot defects vary from 1 to 50 μm2, and the total number of defects ranges from 1 to 23.6% of the surface of the film. The external magnetic field B swept from −0.6 T to 0.6 T in the x direction, yielding 4400 magnetisation images for each texture.

Magneto-optic Kerr effect observation

The sample used in this study was a 100 nm Py (Ni78.5Fe21.5) sputtering grown on a clean Si surface without removing the oxide layer. The magnetic texture of the sample was observed using Magneto-optic Kerr effect microscope of Evico Magnetics, selecting the longitudinal polarisation. The exposition time was set to 42 ms, and the field of view was 100 μm. The external magnetic field B swept from −0.07 to 0.07 ± 0.005 T in-plane at room temperature.

ANN model construction

The ANN model was built using 3 layers, the first and second layers have 64 nodes and the last layer has 1 node. We set the dropout in the first layer as 5% and used the rectified linear unit (ReLU) as activation function. To avoid overtraining using the ReLU function, we normalised the energy between 0 and 1. The input data are the reduced space landscape and were divided into 150 × 100 bins. We used the position of the bin and the training value for energy for all data sets. The input data were also shuffled and divided into batches of 10 samples.