## 3 Results
### Mapping Using ML Approach
#### 3.5.3 Performance of the ML Model Against Simulated Measurements  
Until now, we have developed a deep learning network and tested it against one single real-life experimental configuration. Conducting hundreds, if not thousands, of such tests to measure the model's performance is not actually realistic. However, a first estimation of the model performance can be obtained if one replaces the real-life experiment by suitable simulations. For this purpose, we created a new database of 4800 simulations, in which we kept the coil's length and the current intensity constant, to stay as close as possible to the real-life measurement setup. The other two variables, namely, the coil's position and its orientation, were varied in order to cover the full test space without passing through the boundaries of the perimeter. The model was then applied to each of the simulations, providing a prediction that was compared to the true, exact position and orientation of the coil. Let us define \(\Delta r\) by  
\[\Delta r=|\Delta\vec{r}|=|\vec{r}_{prediction}-\vec{r}_{simulation}| \tag{8}\]  
and \(\Delta\theta\) as  
\[\Delta\theta=|\theta_{prediction}-\theta_{simulation}| \tag{9}\]  
where \(\vec{r}_{simulation}\) is equivalent to \(\vec{r}_{measurement}\) in the previous section, \(\theta_{simulation}\) is the calculated orientation in the tests images, and \(\vec{r}_{prediction}\) and \(\theta_{prediction}\) are the vector position and the orientation predicted by the FCNN model. The performance of the model with respect to \(\Delta r\) and \(\Delta\theta\) can be estimated using the Empirical Cumulative Distribution Function (ECDF). This function estimates the probability that, in a reconstructed magnetic field containing a strong source like a coil, the center of mass of this coil will not deviate from its true position by more than \(\Delta r\) and from its true orientation by \(\Delta\theta\). The model tested was trained with the loss functions \(\lambda_{1}=1\), \(\lambda_{2}=0\) and \(\lambda_{1}=0\), \(\lambda_{2}=1\). \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multicolumn{2}{c}{**Loss Function**} & \multicolumn{3}{c}{**Results**} \\ \hline \(\mathbf{\lambda_{1}}\) & \(\mathbf{\lambda_{2}}\) & **MSE Value** & **X Offset (mm)** & **Y Offset (mm)** \\ \hline
1.0 & 0.0 & 2.4615 & **0.5** & **1.02** \\ \hline
0.5 & 0.5 & 2.6621 & 0.162 & 0.9 \\ \hline
0.25 & 0.75 & 2.6484 & 0.157 & 0.051 \\ \hline
0.1 & 0.9 & 2.5768 & 0.145 & 0.045 \\ \hline
0.0 & 1.0 & 2.467 & **0.142** & **0.042** \\ \hlineIn Figure 15a, we mark the median of \(\Delta r\) using a red star at 5.528 mm. Taking into account the length of the coil and the fact that the coil cannot cross the perimeter boundaries, this value can be converted into a localization error of approximately 15.6%. In Figure 15b, the median of \(\Delta r\) is 2.57 mm, resulting in a localization error of approximately 7.2%. As far as the orientation is concerned, we plot the ECDF for \(\Delta\theta\) in Figure 16. Here too, we consider two extreme cases of loss functions with respect to the relative weights of the global and local terms. An important remark should be made here. The second parameter that we used to generate the various scenarios of the database is the angle \(\theta\) made by the rectangular coil with the x-axis. Although the original angle is a well-known value (input), the \"predicted\" angle is not trivially calculated. From the magnetic field picture we need to extract the angle between the long axis of the pattern and the x-axis. This was achieved by running a Radon transform [36] that searches and analyzes ellipse-shaped patterns. The Radon transform is a mathematical operation that transforms a 2D image into a set of projections used for tasks like image reconstruction and pattern recognition. When applied to elliptical shapes, the Radon transform helps to identify the parameters (e.g., the center, axes, and orientation) of the ellipse in the image.