Quantifying the magnetic interactions governing chiral spin textures
  using deep neural networks
The interplay of magnetic interactions in chiral multilayer films gives rise
to nanoscale topological spin textures, which form attractive elements for
next-generation computing. Quantifying these interactions requires several
specialized, time-consuming, and resource-intensive experimental techniques.
Imaging of ambient domain configurations presents a promising avenue for
high-throughput extraction of the parent magnetic interactions. Here we present
a machine learning-based approach to determine the key interactions --
symmetric exchange, chiral exchange, and anisotropy -- governing chiral domain
phenomenology in multilayers. Our convolutional neural network model, trained
and validated on over 10,000 domain images, achieved $R^2 > 0.85$ in predicting
the parameters and independently learned physical interdependencies between
them. When applied to microscopy data acquired across samples, our
model-predicted parameter trends are consistent with independent experimental
measurements. These results establish ML-driven techniques as valuable,
high-throughput complements to conventional determination of magnetic
interactions, and serve to accelerate materials and device development for
nanoscale electronics.
Jian Feng Kong, Yuhua Ren, M. S. Nicholas Tey, Pin Ho, Khoong Hong Khoo, Xiaoye Chen, Anjan Soumyanarayanan
# Quantifying the magnetic interactions governing chiral spin textures

###### Abstract

The interplay of magnetic interactions in chiral multilayer films gives rise to nanoscale topological spin textures, which form attractive elements for next-generation computing. Quantifying these interactions requires several specialized, time-consuming, and resource-intensive experimental techniques. Imaging of ambient domain configurations presents a promising avenue for high-throughput extraction of the parent magnetic interactions. Here we present a machine learning-based approach to determine the key interactions -- symmetric exchange, chiral exchange, and anisotropy -- governing chiral domain phenomenology in multilayers. Our convolutional neural network model, trained and validated on over 10,000 domain images, achieved \(R^{2}>0.85\) in predicting the parameters and independently learned physical interdependencies between them. When applied to microscopy data acquired across samples, our model-predicted parameter trends are consistent with independent experimental measurements. These results establish ML-driven techniques as valuable, high-throughput complements to conventional determination of magnetic interactions, and serve to accelerate materials and device development for nanoscale electronics.

## 1 Introduction

The advent of chirality in magnetic thin films has created a vast zoo of nanometre-scale spin textures, including spin spirals, stripes, skyrmions, and beyond [1, 2, 3, 4]. Their ambient stability, electrical malleability, and material compatibility with established fabrication techniques, has elicited growing technological interest [2, 3, 5], especially as elements for sustainable computing architectures [6, 7, 8]. The formation of these spin textures, as well as their critical static and dynamic attributes are governed by the interplay of three key magnetic interactions [9, 10, 11]. The exchange stiffness, \(A\), characterizes uniform ferromagnetic order, the effective anisotropy \(K_{\rm eff}\), describes its preferred orientation, and the interfacial Dzyaloshinskii-Moriya interaction (DMI, \(D\)), determines the extent of chirality [9]. Quantifying these interactions is imperative both for elucidating the behaviour of spin textures, and for designing functional materials and devices to exploit their properties [5].

The experimental determination of these interactions typically involves several independent measurements. Firstly, \(K_{\rm eff}\) can be obtained by combining magnetometry measurements across in-plane (IP) and out-of-plane (OP) sample orientations [12]. Next, as \(A\) and \(D\) relate to the symmetric and anti-symmetric components of spin-wave dispersion respectively, both can in principle be independently extracted via wavevector-resolved Brillouin light scattering (BLS) spectroscopy [13, 14]. However, this approach is challenging for several reasons: (a) BLS is a specialized, resource-intensive technique; (b) its evaluation has implicit dependencies on two additional techniques; and (c) the measured \(A\) can be ambiguous in films with sizable DMI or dipolar effects [15]. Alternatively, if \(A\) is known, \(D\) can be extracted from the measured asymmetry in domain wall (DW) propagation, driven by external electric or magnetic fields, albeit with several inter-dependencies [13, 16, 17]. However, while \(A\) can be estimated reliably for thicker films using the Bloch \(T^{3/2}\) law for temperature-dependent magnetization [18, 19], this method does not work well for the ultrathin (1 nm) limit relevant to chiral multilayers [15]. Overall, given the considerable challenges and complexities of direct experimental determination, a high throughput technique enabling one-stop-shop estimation of all three parameters would be of immense value.

Since the magnetic parameters together determine the domain morphology, it should encapsulate material information. However, while the forward problem of determining the equilibrium domain configuration using the input parameters is micromagnetically well-defined [20, 21], the inverse problem of determining parent magnetic interactions from domain morphology is extremely challenging. Unsurprisingly, prior attempts have been largely limited to quantifying a single feature, e.g. domain periodicity, and thereby estimating the ratio \(D/A\) via linear regression [10, 11, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 222, 231, 232, 242, 251, 252, 26, 271, 282, 292, 293, 294, 295, 296, 297, 300, 311, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 328, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 352, 358, 359, 370, 353, 359, 361, 362, 363, 364, 365, 366, 367, 368, 369, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 400, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 99, 111, 12, 13, 14, 15, 16, 17, 18, 19, 19, 19, 12, 14, 16, 18, 19, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 42, 43, 45, 46, 47, 48, 49, 50, 52, 54, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 100, 111, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 4
supervised regression model using convolutional neural networks (CNN), and train it on micromagnetically simulated images that exclude information inaccessible to common microscopy tools. By learning physical features such as domain boundaries, the model performs well on simulated validation data (\(R^{2}>0.85\)). When tested on domain images obtained from a series of chiral multilayers, the model predicts parameter trends consistent with independent experimental estimates. This paves the way for high-throughput characterization of technologically relevant magnetic thin films.

## 2 Methodology & Training

The choice of ML model should optimize the learned relationship between input data features and desired outputs. For our purpose, a CNN model is suitable as it exploits many physical properties relevant to domain configurations [36, 37, 38], such as translation invariance and local correlations arising from short-range exchange interactions. In addition, CNN confers several practical benefits such as enabling variable-sized input images, and providing the potential for physical interpretability. The schematic in Fig. 1(a) outlines the ML workflow used in this work. First, a large set of ground-state domain images of OP magnetization was generated by performing micromagnetic simulations with varying input parameters. Next, these images were used to train our ML model, following post-processing to remove experimentally-inaccessible information. Finally, the model performance was evaluated by testing on an independent set of simulated images, and on experimental images acquired using a commercial magnetic force microscope (MFM).

An ML model requires a large volume of high-quality training data to reliably and effectively learn input-output correlations. In line with previous works, which used \(\gtrsim 10^{4}\) domain configurations for training [32, 29, 35], our CNN model was trained on a large dataset generated by micromagnetic simulations using \(\text{mumax}^{3}\)[21]. Each of the input parameters, \(A_{0}\), \(K_{\text{u},0}\) (\(K_{\text{u}}=K_{\text{eff}}+\mu_{0}M_{\text{s}}^{2}/2\), where \(M_{\text{s}}\) is the saturation magnetization), and \(D_{0}\) was varied over a wide range for a multilayer comprising four repetitions of a chiral stack under the effective medium approximation [10]. The propensity for chiral domain formation can be characterized by the stability parameter, \(\kappa\), defined as [11, 9, 24]:

\[\kappa=\pi D/\,4\sqrt{AK_{\text{eff}}}. \tag{1}\]

Within our simulations, multi-domain states form for \(\kappa\gtrsim 0.1\), and proliferate with increasing \(\kappa\)[24]. Meanwhile, the stripe width increases with \(A\), \(K_{\text{eff}}\), and \(D^{-1}\). Thus generated equilibrium magnetization configurations exhibiting multi-domain states were used for the training dataset.

To reliably predict outputs using commonly available magnetic microscopy techniques (e.g., MFM, Kerr microscopy), the ML model was trained only on the OP component, \(m_{z}\), of normalized spatial magnetization, as exemplified in Fig. 2(a). The training data were augmented by performing rotations on input domain images, consistent with the underlying symmetries of the problem [39]. Our model is configured to predict three independent parameters - \(A^{\prime}\), \(K^{\prime}_{\text{eff}}\), and \(D^{\prime}\) - and one dependent parameter, \(\kappa^{\prime}\). Note that \(K^{\prime}_{\text{eff}}\) is used as the output parameter (instead of \(K_{\text{u}}\)) to enable direct comparison with experiments. Meanwhile, \(\kappa^{\prime}\) is included due to its physical significance [11, 24], and to check whether the model is able to uncover the underlying constraints between the input parameters. The CNN architecture employed in our work, shown in Fig. 1(b), uses ReLU and leaky ReLU as non-linear activation functions for all intermediate layers, and includes dropout layers to reduce overfitting [40]. The four max-pooling layers downsize the input by retaining the most relevant features in each patch, and are known to be effective in training CNN models [41].

## 3 Model Performance

Allowing the model to train on as-simulated \(m_{z}\) images produced unbelievably good initial validation results (\(R^{2}\geq 0.98\), SM SSS2), albeit with poor general

Figure 1: **Workflow and Model Architecture.****(a)** Schematic of the training and prediction workflow. Left: the model is trained using domain images generated by micromagnetic simulations (input parameters: \(A_{0},K_{\text{u},0},D_{0}\)), post-processed to remove experimentally inaccessible information. Right: The trained model is used to predict four magnetic parameters \((A^{\prime},K_{\text{eff}},D^{\prime},\kappa^{\prime})\) on MFM-measured domain images. **(b)** Schematic of the CNN model architecture, consisting of 10 convolutional layers, followed by 4 fully connected layers. The final layer is fully connected, with 4 neurons corresponding to the output parameters. See Methods for full details of the final model, including convolutional filters, max pooling layers, kernels, neurons etc.
ization to experimental data. This discrepancy arises from key differences in the short lengthscale (\(<10\,\)nm) information encoded in the simulated images c.f. experimental images. First, the DW width (\(\sim 5\,\)nm speckles), which relates to \(\sqrt{A/K_{\rm{s}}}\)[42, 43], is accessible within simulated images, but cannot be resolved in experiments (resolution \(\sim 30\,\)nm). Second, the thermal noise in mumax3-simulated images (\(\sim 5-10\,\)nm), found to vary monotonically with \(K_{\rm{eff}}\), may also leak experimentally-inaccessible information on the magnetic parameters (SM SS2). Meanwhile, the short lengthscale noise present in typical experimental images (Fig. 5) is unrelated to magnetic properties. To enable accurate prediction for experimental images, we remove experimentally inaccessible data by judiciously pre-processing the simulated images, via median filtering and thresholding procedures (Fig. 2(b-c)).

The post-processed dataset of 12,000 simulated images was divided into 3 subsets for training (80%), validation (10%), and testing (10%). Models with different hyperparameters (e.g., number of layers, filters, loss function, etc.) were individually trained, and subsequently, their performance was compared based on their predictions on the validation dataset (SM SS1). The best-performing model thus identified was then evaluated using the testing dataset (Fig. 3). In general, the models were found to learn more effectively with diminishing learning rates. Fig. 3(a) shows the evolution of the training and validation losses for the chosen model during the training process. Both losses are found to decrease with the number of epochs trained, and the mean absolute error (MAE) asymptotes to a small, finite value after \(\sim 400\) epochs. Crucially, the monotonic decrease of the validation loss indicates that the chosen model did not overfit the training data.

Fig. 3(b-e) summarizes the performance evaluation of chosen model on the testing dataset. The parity plots compare the predicted values for each of the output parameters, \((A^{\prime},K^{\prime}_{\rm{eff}},D^{\prime},\kappa^{\prime})\), with the respective input values, \((A_{0},K_{\rm{eff,0}},D_{0},\kappa_{0})\), provided for the simulations. The consistently high \(R^{2}\) for all determined parameters suggests that the ML model has successfully learned the intricate relationship between the domain configurations and input parameters. As an additional test to examine the model's ability to learn implicit micromagnetic physics, we compare in Fig. 3(f) the predicted kappa, \(\kappa^{\prime}\), with that resulting from Eq. 1 via the predicted values of the other three parameters, \(\kappa^{*}=\pi D^{\prime}/4\sqrt{A^{\prime}K^{\prime}_{\rm{eff}}}\). The excellent correlation between \(\kappa^{\prime}\) and \(\kappa^{*}\) (\(R^{2}>0.98\)) suggests that while the

Figure 3: **Model Validation and Performance Testing.****(a)** Model loss during training and validation, quantified via mean absolute error (MAE) across training epochs. **(b-e)** Parity plots for the trained model on the test dataset that compare input (\(x\)-axis) and predicted (\(y\)-axis) values for (b) \(A\), (c) \(K_{\rm{eff}}\), (d) \(D\), and (e) \(\kappa\). The parity line (\(y=x\) line) is shown for reference. (D) Parity plot for the predicted \(\kappa^{\prime}\) against \(\kappa^{*}=\pi D^{\prime}/4\sqrt{A^{\prime}K^{\prime}_{\rm{eff}}}\) (Eq. 1) calculated from individually predicted parameters.

Figure 2: **Simulated Images and Processing.****(a)** Sample images (grayscale: \(m_{x}\in[-1,1]\)) generated by micromagnetic simulations with varying input parameters (\(A_{0}\) in pJ/m, \(D_{0}\) in MJ/m\({}^{3}\), \(K_{\rm{eff}}\) in mJ/m\({}^{2}\)). **(b)** Post-processing of simulated images for model training. Left image: as-simulated from micromagnetics, including experimentally inaccessible domain wall (DW) and thermal field (fuzziness) information related to magnetic parameters. Middle image: output of median filtering, which removes fuzziness within domains. Right image: output of Otsu thresholding, wherein DW width information is removed. **(c)** Comparison of a representative line cut (dashed yellow line) across the three images in (b), showing the effects of the post-processing steps.
model does not receive Eq. 1 as an explicit input, it is nevertheless able to accurately learn this implicit constraint during training, and implement it across predicted parameters.

To visualize the functioning of the CNN, we examine the intermediate outputs of the convolutional filters - known as feature maps (Fig. 4(a)) - as applied to the input. In practice, the CNN uses 1664 filters, and we display in Fig. 4(b-d) a few representative feature maps that exemplify the pattern evolution across the neural network. While the outputs of the initial layers preserve the low-level spatial configurations from the input image, the deeper layers get progressively more abstract. For example, the feature map for the 2nd layer (Fig. 4(b)) clearly shows the DWs delineating regions of opposite magnetization. Moving to the 5th layer, the domains are still visible, but the orientation of magnetization is less clearly distinguished. Finally, by the 8th layer, individual domains cannot be visually identified, and the observed speckles are abstract features used by the model to reach its final decision. Such behavior is consistent with the known progression of feature abstraction in deep neural networks [38].

## Appendix D Experimental Predictions

Having comprehensively tested the trained model with simulated data, we proceed to evaluate its performance on experimentally acquired microscopic images from chiral multilayer films. We use an established multilayer stack - Ir(1)/Fe(\(a\))/Co(\(b\))/Pt (Fig. 5(a)) - wherein key magnetic parameters can be tuned by varying the Fe(\(a\))/Co(\(b\)) thicknesses, while keeping their total thickness constant (1 nm) [11, 24]. The three samples studied in this work comprise four repetitions of stacks with varying Fe(\(a\))/Co(\(b\)) compositions. The phenomenology and energetics of nanoscale equilibrium domain configurations (\(\sim 100-300\) nm, Fig. 5(b)) in such DMI-dominated stacks (\(D>1\) mJ/m\({}^{2}\)) is qualitatively distinct from micron-scale domain configurations examined in prior ML works [32, 33, 35]. To image their domain morphology, we employ MFM, a commonly accessible, ambient, high-spatial-resolution (\(\sim 30\) nm) imaging technique, wherein measured contrast is proportional to the domain stray field gradient. Close examination of a representative MFM image (Fig. 5(c): left) reveals speckle noise and markedly reduced contrast c.f. simulated images. Therefore, MFM images are pre-processed following similar median filtering and thresholding procedures as used for the simulated images (Fig. 2(b)). Post-processed MFM images (Fig. 5(c): right) exhibit domain configurations similar to simulated images, which is further confirmed by corresponding MFM simulations (SI SS3)

Fig. 6 compares the parameters predicted by the ML model using experimentally acquired MFM images (black) on the samples with independently measured values (red). The latter set of values is obtained using a combination of magnetometry, BLS spectroscopy, and microscopy experiments, and are consistent with published results on these Fe(\(a\))/Co(\(b\)) sample compositions [11, 15, 24, 44]. The error bars for the values predicted by the ML model represent the variance of five identical models trained using different initialization seeds (five-fold cross validation). Overall, the ML

Figure 4: **Feature Maps.** **(a)** Schematic of the convolution operation of CNN, and its correspondence to a feature map. **(b-d)** Representative feature maps for the (b) 2nd (right inset: zoom-in), (c) 5th, and (d) 8th convolutional layers, with chosen filter numbers indicated. Color represents activation strength.

Figure 5: **Imaged Multilayer Samples.** **(a)** Stack structure of Ir/Fe(\(x\))/Co(\(y\))/Pt samples. Varying Fe(\(x\))/Co(\(y\)) thickness tunes the magnetic parameters. **(b)** MFM-measured zero field domain image of Ir/Fe(2)/Co(8)/Pt sample. **(c)** Processing of MFM-measured domain images for ML model testing. Left: measured MFM image (from (b): highlighted rectangle); centre: after median filtering; and right: after Otsu thresholding (see Methods).
predicted and measured parameters exhibit qualitatively consistent trends. With increasing Fe(\(a\))/Co(\(b\)) ratio (left to right), both measured and predicted values of \(A\) and \(K_{\text{eff}}\) decrease, \(D\) remains relatively constant, and the resulting \(\kappa\) increases. On the quantitative aspect, we observe excellent agreement for \(A\). However, the measured and predicted values for \(K_{\text{eff}}\), \(D\), and \(\kappa\) exhibit varying extents of discrepancy.

Such quantitative discrepancy may arise from predictive limitations of the model, or due to differences between the training and testing datasets used in the work. To distinguish these sources, we tested the model on images simulated using experimentally measured sample parameters (Fig. 6: red) as inputs. As seen in Fig. 6 (blue c.f. red), all model-predicted parameters from these images exhibit excellent quantitative correspondence with the measured parameters, confirming the self-consistency of the model and reliability of the training procedure. This suggests that the likely source of the discrepancy is limitations inherent to the simulated dataset, which, while visually similar to experimental MFM images, exhibit several observable differences (SM SS4). Such differences are expected to arise from a combination of several factors unaccounted within simulations, including (a) extrinsic factors, such as polycrystalline grain structures of the sputtered films, which result in granularity of magnetic interactions, as well as defects and pinning; (b) intrinsic factors, e.g., interlayer coupling, proximity-induced effects, higher-order anisotropy etc.; as well as (c) differences in recipes between simulations and measurements.

Overall, these results establish the feasibility of ML-driven characterization of the key parameters in chiral magnetic films using microscopic images. The key bottleneck to full quantitative consistency between ML-predicted and experimentally measured magnetic parameters is a high-fidelity, large volume training dataset of simulated domain images sufficiently representative of experimental images. Future simulated datasets generated for training can incorporate granularity to mimic spatial variations in magnetic properties [45, 46], interlayer exchange coupling effects [47], and field recipes [24] to better emulate experimentally measured images. Meanwhile, ML-based techniques can serve as able complements to experimental measurements, especially in circumventing highly resource-intensive determination of magnetic parameters [15].

## Appendix E E. Conclusion

In conclusion, we have built an ML model to estimate the key magnetic parameters governing nanoscale chiral domain phenomenology in multilayers using zero field MFM images. The CNN-based model was trained and optimized using micromagnetically simulated domain images, processed to remove experimentally inaccessible information. It achieved prediction \(R^{2}>0.85\) for all parameters of interest - \(A\), \(K_{\text{eff}}\), \(D\), and \(\kappa\) - without overfitting the data, and accurately deduced the relationship connecting \(\kappa\) to the other three parameters. When used on MFM-measured domain images, the trained model gives reasonable predictions for the evolution of parameters across studied samples. Full quantitative consistency for all magnetic parameters can be achieved by enhancing the simulated training dataset to additionally incorporate extrinsic and intrinsic factors affecting imaged domain configurations, to achieve rapid all-ML characterization of chiral multilayers.

Our work advances ML-based parameter prediction for multilayer films from individual determination on microscale domain configurations [32, 33, 34, 35] to collective, or "all-in-one" parameter determination in the chirality-dominated regime of functional nanoscale spin textures. The demonstrated quantitative consistency in predicting \(A\) is particularly remarkable given its large variability across used techniques, and resource-intensive needs of reliable BLS characterization [15]. Therefore, our built model can already be used as a valuable complement to experiments for quantifying \(A\), as well as a quick, inexpensive "first-pass" estimation technique for all parameters. Our workflow can be straightforwardly extended to complementary magnetic imaging techniques from the micron-scale (Kerr) to the atomic-scale (electrons, X-rays). With appropriate incorporation of complementary data, it can also be generalized to extract other relevant parameters of interest, such as interlayer coupling, damping, spin Hall angle etc. By providing the ability to unlock information stored in domain configurations, our work paves the way for sustainable, high-throughout development of ultrathin magnetic films and devices for next-generation electronics.

## Appendix F. Methods

**Micromagnetic Simulations** of a four-repeat stack were performed using the GPU-based package mumax\({}^{3}\)[21] un

Figure 6: **Measured & Predicted Parameter Trends.** Comparison of magnetic parameters – (a) \(A\) (b) \(K_{\text{eff}}\), (c) \(D\), and (d) \(\kappa\) – for three Ir/Fe(\(x\))/Co(\(y\))/Pt samples. Plots show parameters obtained from experimental measurements (red), ML model prediction on measured MFM images (black), and ML model prediction on simulated images using measured parameters as inputs (blue).
der grain-free conditions to generate a large set of realistic domain images to train, validate, and test the CNN model. The effective medium approximation, which treats all layers within each stack repetition as a single effective magnetic layer [10], was used to reduce the overall simulation time. Simulations were carried out on a finite-difference lattice of \(1024\times 1024\times 4\) cells, which for a cell size of \(2\times 2\times 3\,\mathrm{nm}^{3}\), corresponds to a physical sample size of \(\sim 2\,\mathrm{\SIUnitSymbolMicro m}\times 2\,\mathrm{\SIUnitSymbolMicro m}\times 1 2\,\mathrm{nm}\). The ranges of simulation parameters were chosen to cover the ranges of values of experimentally accessible stacks [11; 24], and are given in Tbl. I. Within these bounds, the simulation parameters were uniformly sampled using a grid. Note that when \(A\) or \(K_{\mathrm{eff}}\) are too large, or \(D\) is too small, the equilibrium domain configuration is a uniform magnetized state. Such parameter combinations that do not produce multi-domain magnetization configurations at ZF were excluded from the image dataset. Finally, for each set of parameters, the magnetization image used for analysis was extracted from the second layer out of the four simulated layers after verifying that the magnetization is approximately layer-independent across the used parameters.

**Image Processing.** Standard routines from the CV2 and Scikit-Image Python libraries were used to pre-process our domain images before training the model. First, a median filter with a large kernel (radius: 8 pixels) was used to remove isolated salt and pepper noise. Next, the smoothness of the domain boundary was considered, which, for MFM-measured images, is sensitive to the imaging conditions. Since the smoothness is largely insensitive to the intrinsic magnetic properties, one would not expect it to measurably affect the parameter predictions. However, during training, the ML models were found to be sensitive to the domain boundary curvature. Therefore, the image-processing was used to ensure that the domain boundaries were consistently smooth across both simulation and experimental images. Successive median filters with a small kernel (radius: 3 pixels) were applied to gradually smoothen the domain boundaries along their length. For the last step, the image was filtered using a binary threshold, converting it from grayscale into black-white, eliminating any speckle noise and DW information. The resulting DWs are sharp, and the magnetization within a domain is effectively uniform. The MFM-measured images were found to be more sensitive to the choice of threshold than simulated images. To ensure accurate and reproducible thresholding, the Otsu method [48] was employed to determine the optimal threshold for each image (\(\sim 126-127\) on the \(0-255\) scale).

**Model Architecture & Training.** Our optimized CNN model, determined following several rounds of hyperparameter optimization, consists of 10 convolutional layers followed by 4 fully connected layers. All convolution filters are \(3\times 3\) in size with strides of 1. Max pooling is applied after the \(2^{\mathrm{nd}}\), \(4^{\mathrm{th}}\), \(7^{\mathrm{th}}\), and \(10^{\mathrm{th}}\) convolution layers, with kernels of size \(2\times 2\) and strides of 1. The number of convolutional filters doubles after each pooling layer. The subsequent 3 fully connected (dense) layers all have equal width of 256 neurons, and are enhanced with a small dropout rate. The last layer consists of a fully connected layer with 4 neurons corresponding to the 4 output parameters of interest. The last layer is the output layer, which consists of 4 neurons corresponding to the 4 magnetic parameters of interest. Leaky ReLu with a small slope of 0.2 was used between the fully connected layers. Dropout layers are included to reduce overfitting by randomly removing some nodes (and all their incoming and outgoing connections) during training [40].

The model was trained for 400 epochs, with mean absolute error (MAE) as the loss function. 9,600 images were used for training, while the remaining 2,400 images were used for validation and testing. A learning rate scheduler was used during the training, such that the learning rate started large and decreased gradually as the training progressed. This allows the ML model to learn quickly at the start, while being able to fine-tune its weights as the learning plateaus.

**MFM Imaging** of the multilayer thin films was performed using the Veeco Dimension(tm) 3100 scanning probe microscope. SSS-MFMR(tm) tips with sharp tip profile (diameter: \(30\,\mathrm{nm}\)) and ultra-low magnetization (Co-alloy coating, \(80\,\mathrm{em}\mathrm{cm}/\mathrm{cm}^{3}\)) were used for high-resolution imaging with minimal stray field perturbations. All MFM images were acquired at tip-sample lift heights of \(20\,\mathrm{nm}\), with an image resolution of \(2048\times 2048\) pixels for \(4\times 4\,\mathrm{\SIUnitSymbolMicro m}\) scan dimensions. The multilayers were imaged at zero field, following _ex situ_ out-of-plane saturation at -400 mT.

We acknowledge helpful inputs from Hang Khume Tan, Constantin C. Chirila, and Nathaniel Ng, as well as the support of the National Supercomputing Centre (NSCC), Singapore, for computational resources. This work was supported by the SpOT-LITE program (A*STAR Grant No. A18A6b0057), funded by Singapore's RIE2020 initiatives.
