## 2 Theory and Methodology
### Analysis of Simulation Results  
We adopt uniform earth models with different resistivity and abnormal models with different parameters to obtain the magnetic field gradient data through forward calculation. Firstly, we calculated the apparent resistivity through the bisection method by solving Equations (2) and (3), and then corrected its background resistivity to obtain the corresponding apparent resistivity variation as the output variable, and constructed a dataset for training. In this paper, the number of populations in the NGO algorithm is set to 20 and the number of iterations is 50. The iterative convergence curve of the NGO in the prediction model NGO-LSSVM is shown in Figure 4. From the iterative convergence curve, it can be seen that NGO reaches the optimal solution by the second iteration and then remains stable, which proves that the NGO algorithm converges quickly, and the results are stable. After the optimization of the NGO algorithm, the regularization parameter \(\gamma\) is finally determined to be 0.1, and the kernel parameter \(\sigma\) is 800. The two parameters are taken as the corresponding parameter values of LSSVM, that is, the optimization process of LSSVM is completed.  
Figure 5 shows the prediction results of the NGO-LSSVM model. Figure 5a represents the partial prediction results of the training set, and Figure 5b is the prediction results of the test set. In both datasets, a strong consistency is observed between the predicted values and true values.  
Figure 4: Fitness curve of the iterative process.  
To verify the correction of the background apparent resistivity by the NGO-LSSVM model, the predicted apparent resistivity variation of uniform half-space models in Figure 3 is shown in Figure 6. The results of Figure 6 reveal that regardless of whether the resistivity of a homogeneous earth is 10, 100, or 1000 \(\Omega\cdot\)m, as long as it remains uniform without any changes in resistivity, the apparent resistivity variation is zero. In other words, the apparent resistivity variation is not sensitive to the background resistivity and only reflects the change in the resistivity of the medium.  
To compare the data before and after correction more intuitively, the errors of apparent resistivity and apparent resistivity variation are shown in Figure 7. In view of the strong correlation between the error of apparent resistivity and the true value of apparent resistivity, we calculated the relative error of apparent resistivity, as shown in Figure 7a. Due to the weak correlation between the error of apparent resistivity variation and the true value of apparent resistivity variation, the errors of predicted apparent resistivity variation are calculated, as shown in Figure 7b. It can be seen that the proposed prediction method of  
Figure 5: Partial prediction results of (**a**) training set and (**b**) test set.  
Figure 6: Predicted apparent resistivity variations by NGO-LSSVM algorithm from (**a–c**) \(x\)-direction magnetic field gradient \(H_{z}^{\Delta x}\), (**d–f**) \(y\)-direction magnetic field gradient \(H_{z}^{\Delta y}\) of uniform half-space models with different resistivities.  
apparent resistivity variation can significantly reduce the calculation error and improve the calculation accuracy.