## 1 LMA approach:  
The general problem, solved by LMA [34], can be formulated as  
\[\min_{\mathbf{x}}\sum_{i=1}^{m}(f_{i}(\mathbf{x}))^{2} \tag{2}\]  
where \(f_{i}(\mathbf{x})\) are the residuals, \(\mathbf{x}\) is the vector of parameters to be optimized, and \(m\) is the size of the data. At each iteration, the LMA updates the current parameter estimate \(\mathbf{x}_{k}\) in \(\mathbf{x}\). The update rule essentially minimizes a regularized least squares objective, where a damping parameter controls the trade-off between the Gauss-Newton and Gradient Descent methods.  
The LMA is a local scheme that solves the inverse problem of the magnetic field generated by a given source using the data recorded at the sensors. For a current loop, the magnetic moment \(\mathbf{m}\) is related to the current \(I\) and the area \(A\) of the loop. Specifically, the magnetic moment is given by \(\mathbf{m}=I\mathbf{A}\). For a circular loop with radius \(r_{\text{loop}}\), the area \(A\) is \(A=\pi r_{\text{loop}}^{2}\), and the magnetic moment becomes \(m=I\pi r_{\text{loop}}^{2}\). The magnetic field at a point located at a distance \(r\) from the current loop (in the far-field or dipole approximation) is  
\[B=\frac{\mu_{0}}{4\pi}\frac{m}{r^{3}} \tag{3}\]  
Substituting the expression for \(m\), we obtain  
\[B=\frac{\mu_{0}}{4\pi}\frac{I\pi r_{\text{loop}}^{2}}{r^{3}} \tag{4}\]  
where  
* \(B\) is the magnetic field at the sensor in Tesla;
* \(I\) is the current in the loop (in amperes);
* \(r_{\text{loop}}\) is the radius of the current loop;
* \(r=\sqrt{x_{s}^{2}+y_{s}^{2}}\) is the distance from the loop to the sensor located at \((x_{s},y_{s})\);
* \(\mu_{0}\) is the permeability of free space (\(\mu_{0}=4\pi\times 10^{-7}\,\text{T}\cdot\text{m}/\text{A}\)).  
Thus, the magnetic field at the sensor is  
\[B=\frac{\mu_{0}Ir_{\text{loop}}^{2}}{4r^{3}} \tag{5}\]  
where \(r=\sqrt{(x-x_{s})^{2}+(y-y_{s})^{2}}\) is the distance from the current loop to the sensor. In our case, we solve a system of nine equations (nine sensors) with three unknowns: the position of the source (x,y) and the current I. This is an overdetermined system of equations that is ready for LMA treatment. Its solution is not a map but a single point. In order to obtain a two-dimensional solution, we develop a three-step strategy:  
* We divide the cylindrical source into 15 equal sub-sources (see Figure 4);
* We solve by LMA for each segment separately and obtain 15 positions and current values;
* We build a magnetic heat map by interpolating the field computed at the LMA solution and the recorded field of the 9 senors, using Equation (4) to convert from current to magnetic intensity.  
2. **FCNN model training:** We use a machine learning (ML) methodology for several compelling factors. First, the simulation process allows us to generate a substantial amount of labeled data required by the learning algorithm. Second, the ML approach is inherently powerful due to its ability to train the model without relying on assumptions about the physical model of the problem. This property enables almost any modifications of the problem type and the retraining of the model without compromising its accuracy. Finally, once the model has been trained offline, the real-time predictions are significantly faster compared to any heuristic approaches. We chose the FCNN due to its straightforwardness and practicality. The localization problem, i.e., determining the 2D coordinates of the anomaly, may be addressed as a straightforward regression problem. This can be effectively solved using an FCNN, yielding a high level of accuracy.