# Vector Magnetic Anomaly Detection via an Attention Mechanism Deep-Learning Model
## 3 Experiment  
### Simulation Experiment  
We completed the simulation experiment with the test set. For a given \(\alpha\), \(1000\) testing instances were synthesized to obtain the average probability of each \(0.5\) SNR (\(-10\)-\(10\) dB). We compared the predicted probability of each sampling point with the corresponding  
Figure 3: Simulated temporal plot background noises and PSD of \(1/f^{1.5}\). Figure 2: Simulated magnetic anomaly signal using dipole model. ground truth. A typical test example is shown in Figure 4, with an SNR = 0 dB, and \(\alpha\) = 1.5. The SNR is defined as:  
\[Power_{signal}=\frac{1}{N}\sum_{i=1}^{N}x[n]^{2} \tag{2}\]  
\[SNR=10 log_{10}\frac{P_{target}}{P_{noise}}dB \tag{3}\]  
where \(Power_{signal}\) is defined by \(N\) and \(x[n]\), which are the length of the target signal and amplitude of each sampling point, respectively. Because we used only one magnetometer to measure the geomagnetic field, we calculated the deviation between observational and minimum geomagnetic data as the power of background noise. To better describe the model performance of each sampling point, we define the following two parameters: Precision (\(P\)) and Recall (\(R\)):  
\[P=\frac{TP}{TP+FP} \tag{4}\]  
\[R=\frac{TP}{TP+FN} \tag{5}\]  
where \(TP\) is the number of true-positive points, which means correctly detected target numbers. \(FP\) is the number of false-positive points, which represents the falsely alarmed target numbers. \(FN\) is the number of false-negative points, which denotes the missing target numbers. The precision is the number of true positive results divided by the number of all positive results, including those not identified correctly, and the recall is the number of true-positive results divided by the number of all samples that should have been identified as positive. Precision is also known as positive predictive value, and recall is also known  
Figure 4: Typical test experiment. Three-axis simulation magnetic signals (the black lines) and the target signals (the blue lines). The probabilities are predicted by the model and the ground truth. We follow this rule to count the sampling points with probability greater than 0.5 represent true in each test experiment. Figure 5a shows excellent performance under the Gaussian white noise (\(\alpha=0\)). It is apparent from this figure that the recall and precision are still up to 70% when the SNR is down to \(-5\) dB. Figure 5b-e show the cases of several Gaussian colored noises (\(\alpha=0.5\), \(\alpha=1\), \(\alpha=1.5\) and \(\alpha=2.0\), respectively). The model has consistent results when the SNR is higher than 0 dB. However, model performance decreases slightly as the colored noise becomes stronger. A higher Precision means that the false alarm rate of magnetic anomaly detection is lower, and the results are more reliable. A higher Recall means that fewer magnetic anomalies are missed. Overall, it is a satisfactory result to maintain a good precision rate based on a high recall rate. To further evaluate the network performance, we introduced another parameter _F-score_, which is calculated from the _Precision_ and _Recall_ of the test:  
\[F-score=2\times\frac{Precision\times Recall}{Precision+Recall} \tag{6}\]  
In statistical analysis of binary classification, the _F-score_ is a measure of a test's accuracy. The highest possible value of an _F-score_ is 1.0, indicating perfect _Precision_ and _Recall_, and the lowest possible value is 0 if either the _Precision_ or the _Recall_ is zero. We calculate the _F-score_ based on the classification in Table 2. Each row is a different alpha, and each column represents a different SNR interval. The _F-score_ in each bin is calculated from 5000 samples. From the table, each alpha has an SNR interval as a watershed. When the SNR is greater than this interval, the _F-score_ increases rapidly to above 0.7. This certainly gives the confidence interval for the model. As the composition of colored noise becomes more and more (alpha), the model's reliance on SNR becomes stronger.