# Vector Magnetic Anomaly Detection via an Attention Mechanism Deep-Learning Model
## 1 Introduction  
Magnetic anomaly detection (MAD) is a passive method for detecting ferromagnetic objects. If the geomagnetic field is taken as the normal field, the magnetic anomaly is the relative magnetic field change produced by the appearance of ferromagnetic material, - and the anomaly can be detected by the magnetometer. The MAD method is used to detect the appearance of ferromagnetic targets in the continuous magnetic records measured by the remote magnetometer [1]. Compared to magnetic anomalies caused by the ferromagnetic materials, factors such as biology, water, and almost soils are nearly transparent in the geomagnetic field. Moreover, the long-range passive observation device is easier to conceal from the target side. Therefore, MAD has advantages in intrusion alert and hidden target detection [2]. When the distance to the target body is relatively far compared to its size, the magnetic anomaly field, b, can be considered as a magnetic dipole field [3]:  
Here, \(\overrightarrow{m}\) is the target magnetic moment, and \(\overrightarrow{r}\) denotes the vector from the target to magnetometer. \(\mu_{0}\) is the space's permeability. \[\overrightarrow{B}\left(\overrightarrow{m},\overrightarrow{r}\right)=\frac{\mu _{0}}{4\pi}\left[\frac{3\left(\overrightarrow{m}\cdot\overrightarrow{r} \right)\overrightarrow{r}}{\left|\overrightarrow{r}\right|^{5}}-\frac{ \overrightarrow{m}}{\left|\overrightarrow{r}\right|^{3}}\right] \tag{1}\]  
There are two challenges in the MAD task: (i) the target signal is generally much weaker compared to the background noise. The target's magnetic signal decreases with the cube of distance, which makes MAD a method to extract weak signals. (ii) The backgroundnoise is complex. The geomagnetic field as background noise is variable, colored, and similar to the target magnetic field. Its power spectral density is \(1/f^{\alpha}\) (\(0<\alpha<2\), and \(\alpha\) varies with time and position) [4]. There were two major categories in MAD, including the target-based approach and noise-based approach, until now [5]. The orthogonal basis function (OBF) is the most representative target-based method [6]. The signal-to-noise ratio (SNR) is improved by matching multiple orthogonal basis functions with measured signals to the energy function. Several studies suggest that OBF is very efficient in Gaussian white noise, but it needs to be preprocessed in practical experiments, which undoubtedly increases the computation cost [7]. The noise-based methods, such as minimum entropy filtering [8], the high-order crossing magnetic anomaly method [9], and wavelet transform [10] suggested that the background field obeys certain distributions and is changed mainly due to the presence of ferromagnetic targets. Although these methods do not need prior information on targets, their performance is limited under low SNR. Recently, many researchers have tried to use machine learning, particularly deep learning, to solve the MAD problem. For example, [PERSON] extracted the target signal from the OBF energy function through support vector machines [11] and identified the target signal from the two-dimensional temporal frequency spectrum by using convolutional neural networks (CNN) [12]. The problems of high computational cost and reliance on Gaussian white noise remain to be solved. A researcher proposed a deep-learning model called DeepMAD that offers some new insights [13]. It is an end-to-end framework, which provides the possibility for real-time detection. However, it uses actual geomagnetic noise as the dataset to train a five-layer CNN model, which lacks generalization. Moreover, the CNN model cannot handle the relationship between local and global, and it can easily lose the information of long periods. Such approaches, however, have additional requirements for the signal when dealing with a static magnetometer and a moving target.