# An Aeromagnetic Compensation Algorithm Based on a Temporal Convolutional Network
## 4 Results and Discussion
### Daf-MIT AIA Open Flight Data Test Results for Flight 1002.20  
In this section, we compare MagTCN with several typical aeromagnetic compensation methods, including WilliamsNN, BPNN, and ResNet.  
During the neural network training phase, we compared the convergence capabilities of several methods based on flight 1002.02 of the DAF-MIT AIA Open Flight Data mentioned in Section 3.1.2, as shown in Figure 10 and Table 3. 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 10, 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 100 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.  
Next, we compared the compensation accuracy and generalization of several compensation methods based on flight 1002.20 of the DAF-MIT AIA Open Flight Data. Figure 11 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 interference (such as 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 5 nT residual interference in some intervals (such as in the intervals  
Figure 9: Compensation results within the bandpass from simulation datasets.  
from 5000 to 5500 sampling points, from 7500 to 8000 sampling points, and from 12000 to 12500 sampling points). BPNN has a slightly better compensation effect and can keep the residual interference within 5 nT in most intervals. However, in some intervals, residual interference is greater with BPNN than with WilliamsNN (as shown in the local enlarged figure in Figure 11). 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 4, WilliamsNN has the worst STD and IR, which are 1.399 nT and 8.342, respectively. Those of BPNN are slightly better: 1.098 nT and 10.629, respectively. ResNet and MagTCN are better than WilliamsNN and BPNN in compensation performance due to their convolutional structures and residual connections. The STD and IR of ResNet are 0.028 nT and 402.786, respectively, and those of MagTCN are 0.025 nT and 455.920, respectively. The above results show that MagTCN has achieved the best compensation performance and generalization ability among the above compensation methods.