# An Aeromagnetic Compensation Algorithm Based on a Temporal Convolutional Network
## 4 Results and Discussion  
### Simulation Dataset Test Results  
In this section, we compare MagTCN with several typical aeromagnetic compensation methods, including the three-branch neural network method proposed by [PERSON] (hereafter WilliamsNN) [10], the simple backpropagation neural network method without a convolution structure (hereafter BPNN) [19], the convolutional residual neural network method using normal convolution (hereafter ResNet) [16], and the traditional linear regression T-L model method (hereafter T-L model) [6]. During the neural network training phase, we compared the convergence capabilities of several methods based on the data from the first maneuvering circle, as shown in Figure 8 and Table 1. The x-axis (Epochs) represents the number of times the entire training dataset is propagated forward and backward in the neural network. The y-axis (Loss) represents the error between the model's predicted values and the actual target values, as described in Section 2.3. Curves of different colors represent the loss between the predicted and label values of the corresponding neural network during the training process as the number of epochs increases. The faster the loss drops to a flat state, the faster the convergence. In Figure 8, WilliamsNN and BPNN do not fully converge at the 200 th epoch. WilliamsNN has the slowest convergence speed and maintains a stable decline rate throughout the training phase. BPNN has a slightly better convergence speed, maintaining a faster decline rate before the sixth epoch and then maintaining a stable decline rate. ResNet and MagTCN both have faster convergence speeds and can achieve lower losses in the first few epochs, reaching full convergence in the 150 th and 110 th epochs, respectively. However, ResNet's loss fluctuates throughout the training phase and is relatively unstable. In contrast, MagTCN's loss is the fastest to reach a stable state with the same hyperparameters, demonstrating its fast and stable convergence ability. Figure 8: The losses of neural networks using simulation datasets. Next, we compared the compensation accuracy and generalization of several compensation methods based on the data from the second maneuvering circle. Figure 9 shows the residual interference in the bandpass (0.1-0.6 Hz) of the magnetic signal on the route, where the curve named \"origin\" represents the interference before compensation, and the other curves represent the residual interference after compensation by the corresponding method. Large maneuvers during flight can cause large interferences (such as in the interval around the 1000 th sampling point). The purpose of the compensation method is to eliminate these interferences as much as possible. The less residual interference there is after compensation, the better the compensation method. WilliamsNN has the worst compensation effect, and there is still more than 10 nT residual interference in some intervals (such as in the intervals from 4000 to 5000 sampling points and from 1500 to 2000 sampling points). BPNN has a slightly better compensation effect and can keep the residual interference within 1 nT in most intervals. However, in some intervals, residual interference is greater with BPNN than with WilliamsNN (as shown in the local enlarged figure of Figure 9). The T-L model, ResNet, and MagTCN all maintain low residual interference in the entire interval, making them much better than BPNN and WilliamsNN. In order to further compare the performance of several compensation methods, we calculated their STDs and IRs after compensation (as defined in Section 3.3, the lower the STD and the higher the IR, the better the compensation performance). As shown in Table 2, WilliamsNN has the worst STD and IR, which are 1.320 nT and 12.276, respectively. Those of BPNN are slightly better: 0.551 nT and 29.401, respectively.