Abstract A difficult problem concerns the determination of magnetic field components within an experimentally inaccessible region when direct field measurements are not feasible. In this paper, we propose a new method of accessing magnetic field components using non-disruptive magnetic field measurements on a surface enclosing the experimental region. Magnetic field components in the experimental region are predicted by solving a set of partial differential equations (Ampere's law and Gauss' law for magnetism) numerically with the aid of physics-informed neural networks (PINNs). Prediction errors due to noisy magnetic field measurements and small number of magnetic field measurements are regularized by the physics information term in the loss function. We benchmark our model by comparing it with an older method. The new method we present will be of broad interest to experiments requiring precise determination of magnetic field components, such as searches for the neutron electric dipole moment.
Introduction
In high-precision physics experiments, such as searches for the neutron electric dipole moment or MRI imaging, accurate knowledge of the magnetic field throughout a volume is essential. However, physical constraints often prevent the placement of sensors within the region of interest. For instance, the region might be inside a vacuum chamber, or the presence of sensors might disrupt the field or the experiment itself.
Traditionally, researchers have relied on "multipole expansion," a mathematical technique that fits boundary data to a series of basis functions. While standard, this approach faces a significant trade-off: low-order expansions may fail to capture complex field geometries, while high-order expansions are prone to overfitting, particularly when data is sparse or contaminated by noise. This study introduces a more robust alternative using Physics-Informed Neural Networks (PINNs).
Methodology: Physics-Informed Neural Networks
Unlike standard neural networks that operate as "black boxes," PINNs integrate fundamental physical laws directly into the learning process. The network is designed to take spatial coordinates $(x, y, z)$ as input and predict the corresponding magnetic field components $(B_x, B_y, B_z)$.
The core innovation lies in the loss function. During training, the network is penalized not only for deviations from the measured sensor data on the boundary but also for violating Maxwell’s equations for static fields in regions without free currents or magnetization:
- Gauss’s Law for Magnetism: $\nabla \cdot \mathbf{B} = 0$
- Ampere’s Law (static): $\nabla \times \mathbf{B} = 0$
By employing automatic differentiation to compute these partial derivatives, the network is constrained to produce physically valid field configurations, effectively using physics as a regularizer.
Experimental Setup and Datasets
To evaluate the PINN approach, the authors utilized simulated datasets generated via the Biot-Savart law. The setup involved a complex, non-uniform magnetic field produced by eight circular current loops.
Virtual triple-axis magnetic sensors were randomly distributed on the surface of a cube. The model's performance was tested across varying sensor densities (18 to 90 sensors) and different levels of Gaussian noise to simulate real-world experimental conditions.
Results and Discussion
The PINN demonstrated significant advantages over traditional multipole expansion, particularly in challenging data regimes.
Superiority in Sparse Data
With only 30 sensors, the PINN achieved a vector norm error rate of approximately $8.2 \times 10^{-3}$. In contrast, an 8th-order multipole expansion failed under these conditions, yielding an error several orders of magnitude higher. The PINN's ability to adapt to field complexity without requiring the user to manually select an expansion "order" makes it a more flexible tool for diverse experimental geometries.
Resilience to Noise
When Gaussian noise ($\sigma = 1.0 \times 10^{-2}$) was introduced, the PINN maintained a low error of $1.5 \times 10^{-2}$, whereas the traditional method's error increased to $4.0 \times 10^{-2}$. The physics-informed loss terms prevent the network from overfitting to noise, as the "learned" field must still satisfy Maxwell's equations.
Scaling and Accuracy
As the number of sensors increased to 90, the PINN's error further decreased to $1.7 \times 10^{-3}$, demonstrating that the model consistently improves with additional data while remaining stable.
Conclusion and Future Work
This study demonstrates that PINNs offer a powerful, noise-resilient method for mapping magnetic fields in inaccessible regions. By embedding physical constraints into the neural network architecture, the model overcomes the limitations of traditional expansion methods, especially when data is sparse.
However, some limitations remain. The current implementation assumes a region free of currents ($\mathbf{J}=0$) and magnetic materials ($\mathbf{M}=0$). Future iterations would need to incorporate these terms if such elements are present within the mapping volume. Additionally, while PINNs offer high accuracy, they require more computational time for training compared to linear regression methods. Future work will focus on validating this approach with physical hardware in real-world experimental environments.
Summary updated