Underwater unexploded bombs are extremely harmful,and aerial magnetic detection is often used for underwater unexploded bombs due to its high detection efficiency. The existence of interfering magnetic field of an airplane limits the development of aeromagnetic detection. The traditional T-L model has strong complex collinearity between the parameters to be solved,which is difficult to meet the requirements of high-precision magnetic compensation. Neural network algorithm has the characteristics of high error tolerance rate and high solution accuracy. In this paper,the BP neural network is used to establish a mathematical model of the interfering magnetic field. Subsequently,the algorithm is verified by generating the interference magnetic field and the magnetic field signal of the unexploded bomb target by simulation. Finally,the target detection test is carried out using the quadrotor UAV platform,and the compensation improvement ratio exceeds 20. The test results indicate that the algorithm can be used to improve the accuracy of underwater target detection on the platform.