## 1 Introduction  
Magnetic imaging with arrays of magnetic sensors is used in various applications. [PERSON] et al. [1] reported the detection of magnetic signals generated by muscle fibers and [PERSON] et al. [2] demonstrated that it is possible to decode neuronal activities of individual neurons. Various types of magnetic sensors are used for magnetic imaging. For example, anisotropic magnetoresistance (AMR) sensors [3, 4] are used to track a capsule robot motion in the human body during medical examinations. Tunnel magnetoresistance (TMR) sensors are used to detect and quantify subsurface defects in eddy current testing (ECT) [5]. [PERSON] et al. [5] investigated a technique that combines modulated excitation with high-sensitivity magnetic field array sensors to uncover and characterize deep embedded defects. The EC-TMR sensor array, with its high-density sensing elements, generates highly detailed and accurate 2D magnetic field images. Another use is detecting the position of a magnet in two-dimensional space [6]. A combination of giant magnetoresistance (GMR) and Hall Effect sensors is used to detect magnetic flux leakage [7]. Fluxgate sensors arrays are extensively used in the detection of unexploded ordnances [8] or the localization and identification of vehicles [9]. Choosing between sensor types for magnetic mapping depends on the specific system requirements such as sensitivity, physical size, voltage supply, and so on. For instance, in a variety of medical applications, a very sensitive sensor is required. In these cases, Superconducting Quantum Interference Device (SQUID) sensors [10] are used. An obvious way to improve the spatial resolution of an array is by increasing the number of sensors [4; 11; 12]. [PERSON] et al. [4] developed a magnetic source imaging system using an array of 16 System-On-a-Chip (SoC) AMR sensors, aiming to simplify system construction. The magnetic field was recorded in a single-pass scan, and the current distribution was calculated within one second through an inverse problem-solving algorithm. On the other hand, it appears that, by improving the data processing, the spatial resolution can be improved significantly as well. [PERSON] et al. [13] developed a Super-Resolution (SR) neural network that improves the spatial resolution of a magnetic sensor array's measurements. They managed to successfully localize several magnetic targets within a three-dimensional vicinity. In order to obtain the precise localization of the magnetic source using a limited number of sensors, it is possible to employ ML algorithms in the data processing. Here, we use a data processing method that consists of three main parts: pre-processing, creating and training an ML model, and calculating the precise coordinates of the external magnetic source within a two-dimensional grid. Prior studies addressing similar problems initially utilized an analytical solution [3; 14]. The analytical solution by [PERSON] et al., shown in [3], enables the accurate localization of a magnetic dipole, such as that in a capsule robot, by linking magnetic field measurements to the dipole's position and orientation. Using the Biot-Savart law and a magnetic dipole model, the magnetic field components are mathematically derived and transformed into spatial coordinates. A compensation method employing least-squares fitting further reduces errors between calculated and actual positions. This approach enhances positioning accuracy and real-time performance, making it suitable for precise applications like capsule robot tracking. [PERSON] et al. investigated the underwater localization of magnetic sensors using heuristic methods such as Genetic Algorithms (GAs) and Particle Swarm Optimization (PSO) [15; 16]. By arranging eight vector magnetometers in a grid and recording the magnetic field induced by a moving ferromagnetic object, the study formulates the localization as an inverse problem.