Magnetic anomalous body detection method and device

By using the PINN model with data constraints and physical constraints, the challenges of magnetic field reconstruction and anomaly detection under data sparsity and noise interference are solved, and high-precision magnetic anomaly detection is achieved with a very small amount of labeled data.

CN121559613APending Publication Date: 2026-02-24QINGDAO RES INST OF BEIHANG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511573959.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing technologies cannot achieve high-precision magnetic field reconstruction and anomaly detection under conditions of sparse data and severe noise interference.

Method used

A Physical Information Neural Network (PINN) model based on data constraints and physical constraints is adopted. By acquiring real magnetic field data of the area to be measured, data preprocessing and gridding are performed. The pre-trained PINN model is used to predict magnetic anomalies, and magnetic anomalies are identified through residual field analysis.

Benefits of technology

Even with a very small amount of labeled data, it can identify weak magnetic anomaly signals from complex airborne magnetic measurement data, achieving high-precision magnetic field reconstruction and anomaly detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121559613A_ABST
    Figure CN121559613A_ABST
Patent Text Reader

Abstract

The invention discloses a magnetic anomalous body detection method and device, and belongs to the technical field of magnetic detection. The method comprises the following steps: acquiring real magnetic field data of a plurality of sampling points of a to-be-detected area; performing data preprocessing on the real magnetic field data of the plurality of sampling points of the to-be-measured area to obtain first grid data of the to-be-measured area, wherein the first grid data comprises space coordinates of first grid points of the to-be-measured area and corresponding real magnetic anomaly values; inputting the space coordinates of the first grid point into a pre-trained PINN model based on data constraint and physical constraint to obtain a predicted magnetic anomaly value corresponding to the first grid point; obtaining a residual field magnetic anomaly value corresponding to the first grid point according to the real magnetic anomaly value and the predicted magnetic anomaly value corresponding to the first grid point; and performing abnormal area marking according to the residual field magnetic abnormal value corresponding to the first grid point to obtain a candidate abnormal area, performing clustering analysis on the candidate abnormal area to obtain a magnetic abnormal body, and obtaining an abnormal attribute of the magnetic abnormal body.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of magnetic detection technology, and in particular to a method and apparatus for detecting magnetic anomalies. Background Technology

[0002] Magnetic anomaly detection is an important geophysical exploration and target detection technology, widely used in mineral resource exploration, unexploded ordnance detection, geological structure research, and military target reconnaissance. Its core is to identify minute magnetic anomaly signals caused by the target body from a complex geomagnetic field background.

[0003] Currently, in traditional magnetic anomaly detection methods, the processing of magnetic field information leads to the loss of the physical meaning of the magnetic field data. The features in magnetic field images are fundamentally different from the object features in natural images. Although the recognition accuracy is improved, it relies on a large amount of labeled datasets, which makes it impossible to achieve high-precision magnetic field reconstruction and anomaly detection when the data is sparse and there is severe noise interference. Summary of the Invention

[0004] This application provides a method and apparatus for detecting magnetic anomalies, which can solve the problem of not being able to achieve high-precision magnetic field reconstruction and anomaly detection under conditions of sparse data and severe noise interference.

[0005] To solve the above-mentioned technical problems, this application is implemented as follows: Firstly, a method for detecting magnetic anomalies is provided, including: Acquire real magnetic field data from multiple sampling points in the area to be tested, wherein the real magnetic field data of the sampling points includes at least: the spatial coordinates and magnetic field information of the sampling points; Data preprocessing is performed on the real magnetic field data of multiple sampling points in the area to be tested to obtain the first grid data of the area to be tested. The first grid data includes: the spatial coordinates of the first grid point in the area to be tested and the real magnetic anomaly value corresponding to the first grid point. The spatial coordinates of the first grid point are input into a pre-trained physical information neural network PINN model based on data constraints and physical constraints to obtain the predicted magnetic anomaly value corresponding to the first grid point. The residual field magnetic anomaly value corresponding to the first grid point is obtained based on the actual magnetic anomaly value corresponding to the first grid point and the predicted magnetic anomaly value corresponding to the first grid point. Based on the residual field magnetic anomaly value corresponding to the first grid point, anomaly regions are marked to obtain candidate anomaly regions. Cluster analysis is performed on the candidate anomaly regions to obtain magnetic anomaly bodies, and the anomaly attributes of the magnetic anomaly bodies are obtained.

[0006] Secondly, a magnetic anomaly detection device is provided, comprising: The acquisition module is used to acquire real magnetic field data of multiple sampling points in the area to be tested, wherein the real magnetic field data of the sampling points includes at least: the spatial coordinates and magnetic field information of the sampling points; The data processing module is used to preprocess the real magnetic field data of multiple sampling points in the area to be tested to obtain the first grid data of the area to be tested. The first grid data includes: the spatial coordinates of the first grid point in the area to be tested and the real magnetic anomaly value corresponding to the first grid point. The PINN model module is used to input the spatial coordinates of the first grid point into a pre-trained physical information neural network PINN model based on data constraints and physical constraints to obtain the predicted magnetic anomaly value corresponding to the first grid point. The magnetic anomaly identification module is used to obtain the residual field magnetic anomaly value corresponding to the first grid point based on the actual magnetic anomaly value and the predicted magnetic anomaly value corresponding to the first grid point; to mark the anomaly region based on the residual field magnetic anomaly value corresponding to the first grid point to obtain candidate anomaly regions; to perform cluster analysis on the candidate anomaly regions to obtain magnetic anomalies; and to obtain the anomaly attributes of the magnetic anomalies.

[0007] The magnetic anomaly detection method and apparatus provided in this application are capable of identifying weak magnetic anomaly signals from complex airborne magnetic measurement data even with a very small amount of labeled data, based on the PINN model constrained by data and physical constraints, thereby achieving high-precision magnetic field reconstruction and anomaly detection.

[0008] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0009] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0010] Figure 1 A flowchart of a magnetic anomaly detection method provided in an exemplary embodiment of this application is shown; Figure 2 This invention illustrates a flowchart of a data preprocessing procedure for real magnetic field data provided in an exemplary embodiment of this application. Figure 3 A flowchart illustrating the training of a PINN model provided in an exemplary embodiment of this application is shown; Figure 4 This application illustrates a flowchart of a data preprocessing procedure for test magnetic field data provided in an exemplary embodiment. Figure 5This invention provides a flowchart illustrating the training of the PINN model based on a model training dataset and a loss function, as shown in an exemplary embodiment of this application. Figure 6 A schematic diagram of the structure of a magnetic anomaly detection device provided in an exemplary embodiment of this application is shown. Detailed Implementation

[0011] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0012] To address the problem that existing technologies cannot achieve high-precision magnetic field reconstruction and anomaly detection under conditions of sparse data and severe noise interference, this application provides a method and apparatus for detecting magnetic anomalies.

[0013] The following will combine Figures 1 to 5 The magnetic anomaly detection method provided in the embodiments of this application will be explained and described in detail. These embodiments are only used to explain this application and do not constitute a limitation thereof.

[0014] Figure 1 A flowchart illustrating a magnetic anomaly detection method according to an exemplary embodiment of this application is shown. Figure 1 As shown, the method for detecting magnetic anomalies mainly includes the following steps (S101-S105): S101. Obtain the real magnetic field data of multiple sampling points in the area to be tested, wherein the real magnetic field data of the sampling points shall include at least: the spatial coordinates and magnetic field information of the sampling points; In this embodiment, vector magnetic signals and detection coordinates are collected in the area to be measured using airborne magnetic surveying. For example, the data acquisition platform is a fixed-wing UAV, flying at an altitude of approximately 150 meters above the ground, with the survey lines oriented east-west, a spacing of 50 meters between lines, and a sampling frequency of 10 Hz. The aircraft is equipped with a scalar magnetometer and a fluxgate magnetometer, and flies along a fixed route over the area to be measured. Whether the aircraft's flight path passes over an anomalous target (i.e., a marked value) is determined by the magnetic dipole magnetic signal intensity equation, which states that the magnetic signal intensity decreases with the cube of the distance. When the distance is sufficiently far, the aircraft is almost unaffected by the magnetic field values ​​of anomalous targets. The original data file format of the real magnetic field data is binary or a specific text format.

[0015] The spatial coordinates of each sampling point are latitude, longitude, and altitude. For example, the spatial coordinates are latitude 30.002°N, longitude 120.003°E, and altitude 152m. For instance, the spatial coordinates of each sampling point can be obtained through a high-precision Global Navigation Satellite System / Inertial Measurement Unit (GNSS / IMU) integrated navigation system.

[0016] The magnetic field information for each sampling point includes: the scalar value of the total magnetic field strength F_total (unit: nT) detected by the scalar magnetometer, and the three components Bx, By, and Bz of the magnetic signal vector detected by the fluxgate, for example, F_total=50198.3nT, Bx=200.5nT, By=-150.2nT, Bz=49800.1nT.

[0017] In addition, real magnetic field data can also include the sampling time, i.e., the timestamp, in UTC time, for example, 2023-10-01 08:30:01.234 UTC, for data synchronization and diurnal variation correction.

[0018] S102. The real magnetic field data of multiple sampling points in the area to be measured are preprocessed to obtain the first grid data of the area to be measured. The first grid data includes: the spatial coordinates of the first grid point in the area to be measured and the real magnetic anomaly value corresponding to the first grid point. In some embodiments, a data parsing script is written using Python or MATLAB to read the original file of the real magnetic field data of each sampling point, parse the original file and store it as a structured data table, and generate a sequence of total magnetic field strength scalar values ​​F_total, with each row representing the data of one sampling point.

[0019] In this embodiment, it is necessary to first perform data preprocessing on the real magnetic field data to eliminate various interferences and obtain magnetic data that reflects the real abnormal signal. Figure 2 A flowchart illustrating data preprocessing of real magnetic field data is shown in an exemplary embodiment of this application. Figure 2 As shown, the process of obtaining the first grid data of the test area by preprocessing the real magnetic field data of multiple sampling points in the test area mainly includes the following steps (S201-S204): S201. Mark the data that exceeds the preset value in the real magnetic field data of multiple sampling points as the first outlier, and replace the first outlier with the adjacent data before and after the first outlier by linear interpolation to obtain the first outlier removal magnetic field sequence. In this embodiment, the preprocessing system first removes outliers. Outliers (i.e., abnormal values) are data that deviate from the normal range due to momentary instrument malfunctions, electromagnetic interference, etc., which will seriously affect subsequent analysis and need to be removed first.

[0020] In some embodiments, statistical analysis is performed on the total magnetic field strength scalar value F_total sequence to calculate the mean μ and standard deviation σ. Points exceeding the range of [μ-3σ, μ+3σ] are marked as first outliers and replaced with linear interpolation of adjacent points to obtain the first outlier removal magnetic field sequence.

[0021] S202. The first diurnal variation correction sequence is obtained by performing diurnal variation correction on the magnetic field sequence after removing the first field value. The Earth's magnetic field undergoes periodic, minute changes over time (such as diurnal variations, or "diurnal variations"). As a result, magnetic field measurements at the same location at different times will differ and require correction.

[0022] In some embodiments, continuous observation data from geomagnetic reference stations located near the area to be measured are acquired within the same time period. This data records the diurnal variation of the geomagnetic field, i.e., the change of the Earth's magnetic field over time. The reference station data is interpolated to the timestamp of each sampling point to obtain the diurnal correction value F_diurnal for that sampling point. Finally, the corrected first outlier magnetic field is calculated using the following formula. : .

[0023] For example, if a sampling point measures F_total = 50005nT at 10:00, and the reference station data shows that the diurnal variation at 10:00 is F_diurnal = 3nT, meaning that the geomagnetic field is 3 nT higher than the average level at this time, then after correction, F_corrected1 = 50005 - 3 = 50002nT, thus eliminating the influence of time fluctuations.

[0024] S203. Perform geomagnetic field IGRF correction on the first diurnal variation correction sequence to obtain the first total magnetic anomaly sequence; The Earth's main magnetic field is a background field generated by the Earth's core, with an intensity of approximately 50,000 nT. This application focuses on the weak anomalies generated by underground magnetic targets, which require the use of the IGRF model to calculate and subtract the background field.

[0025] In some embodiments, the International Geomagnetic Reference Field (IGRF) model is invoked based on the latitude, longitude, altitude, and measurement time of each sampling point. This model calculates the theoretical value of the Earth's main magnetic field, F_igrf, and after normal field correction, the first total magnetic anomaly value ΔT is obtained using the following formula: ,in, This is the target signal, mainly caused by the magnetism of rock masses within the Earth's crust or man-made targets.

[0026] S204. The area to be tested is given a first regular grid according to the preset grid spacing in the X and Y directions. The data in the first total magnetic anomaly sequence is interpolated to the first grid point of the regular grid to obtain the first grid data of the area to be tested.

[0027] The raw data is distributed along the survey line, such as an east-west survey line with a spacing of 50 meters. The sampling points are spatially uneven, which is not conducive to visualization and neural network input. Therefore, the data preprocessing system converts the first total magnetic anomaly sequence into regular grid data. In some embodiments, the following processing flow is included: (1) Plane coordinate transformation: convert latitude and longitude (e.g., 30°N, 120°E) into plane rectangular coordinates (X, Y, in meters) through UTM projection to facilitate distance calculation; the altitude coordinate Z is taken as the average altitude.

[0028] (2) Grid Interpolation: Based on the original survey line spacing and sampling rate, the grid spacing in the X and Y directions is set, with a reference value of 25 meters, to obtain the first regular grid. The irregularly distributed first total magnetic anomaly value ΔT is interpolated to the grid points in (X,Y) using the Kriging interpolation method. For each grid point, the Z coordinate is taken as the average height of all sampling points falling within the first regular grid. Finally, a regular three-dimensional data volume [X_grid, Y_grid, Z_avg] and the corresponding anomaly value ΔT_grid are obtained.

[0029] S103. Input the spatial coordinates of the first grid point into the pre-trained PINN model based on data constraints and physical constraints to obtain the predicted magnetic anomaly value corresponding to the first grid point. In this embodiment, full-field prediction is first performed. The spatial coordinates [X_grid, Y_grid, Z_avg] of the first grid point of all sampling points in the test area are input into the trained PINN model. The PINN model will propagate forward quickly and output a prediction field ΔT_model with the same dimension as the input grid. This prediction field can be understood as the smoothed background field that conforms to the Laplace equation and is learned by the PINN model.

[0030] S104. Obtain the residual field magnetic anomaly value corresponding to the first grid point based on the actual magnetic anomaly value and the predicted magnetic anomaly value corresponding to the first grid point. The true magnetic anomaly value ΔT_obs includes the "background field" and the "local target anomaly". After subtracting the background field ΔT_model predicted by the PINN model, the remaining residual field is the anomaly caused by the local target. In this embodiment, the difference between the true magnetic anomaly value ΔT_obs corresponding to the first grid point and the background field ΔT_model predicted by the PINN model is taken to obtain the residual field ΔT_residual, i.e., ΔT_residual = ΔT_obs - ΔT_model; this residual field is the finally identified local magnetic anomaly caused by local targets, such as ore bodies or unexploded ordnance.

[0031] S105. Based on the residual field magnetic anomaly value corresponding to the first grid point, mark the anomaly region to obtain candidate anomaly regions, perform cluster analysis on the candidate anomaly regions to obtain magnetic anomaly bodies, and obtain the anomaly attributes of the magnetic anomaly bodies.

[0032] In some embodiments, anomaly regions are marked based on the residual magnetic anomaly value corresponding to the first grid point to obtain candidate anomaly regions, and cluster analysis is performed on the candidate anomaly regions to obtain magnetic anomaly bodies. This includes: marking the region corresponding to the first grid point whose absolute value of the residual magnetic anomaly value corresponding to the first grid point is greater than a preset residual field threshold as a candidate anomaly region; performing connectivity component analysis on the candidate anomaly regions, and clustering the regions formed by adjacent grid points in the candidate anomaly regions into a magnetic anomaly body to obtain multiple magnetic anomaly bodies.

[0033] In some embodiments, the global mean μ_res and standard deviation σ_res of the residual field are calculated. The preset residual field threshold is set to Threshold=μ_res+3σ_res. For example, if the residual field μ_res=0nT and σ_res=2nT, then Threshold=0+3×2=6nT. The region with an absolute value >6nT in the residual field magnetic anomaly value corresponding to the first grid point is marked as a candidate anomaly.

[0034] In this embodiment, candidate anomaly regions are clustered, and spatially continuous regions (i.e., adjacent grid points all exceed the threshold) are grouped into the same anomaly, which can exclude isolated noise points. For example, in the residual field above the iron ore body, there is a 10×10 grid region with residuals >6nT, which is continuous and is clustered into an anomaly; while a distant isolated grid with a residual of 8nT may be noise and is excluded due to discontinuity.

[0035] In some embodiments, the anomalous properties of a magnetic anomaly include: the center location, area, and maximum anomalous value of the magnetic anomaly.

[0036] In this embodiment, a Physics-Informed Neural Networks (PINN) model needs to be pre-trained. Figure 3A flowchart illustrating the training of a PINN model, as shown in an exemplary embodiment of this application, is illustrated. Figure 3 As shown, before inputting the spatial coordinates of the grid points into the pre-trained physical information neural network PINN model, the method provided in this application embodiment further includes: a process for training the PINN model, specifically including the following steps (S301-S303): S301. Acquire test magnetic field data from multiple sampling points in the test area; perform data preprocessing on the test magnetic field data from multiple sampling points in the test area to obtain the second grid data of the test area. The second grid data includes: the spatial coordinates of the second grid points in the test area and the actual magnetic anomaly value corresponding to the second grid points. In this embodiment, training data for the PINN model needs to be constructed before training the model. In this embodiment, a data acquisition system is used to obtain test magnetic field data from multiple sampling points in the test area. The data acquisition system consists of a simulation data system and a real data collection system. Test magnetic field data from multiple sampling points in the test area can be obtained in the following two ways: Method 1: The simulation data system uses data simulation to generate data. A1. Simulated Flight Trajectory and Position Information: The flight simulator flies along an arbitrary route, recording position (latitude, longitude, and altitude) at a sampling frequency of 10Hz, i.e., generating 10 sampling points per second. For example, a flight path from (30°N, 120°E, 150m) to (30.01°N, 120.01°E, 150m) for 100 seconds generates coordinate data for 1000 sampling points.

[0037] A2. Calculate the geomagnetic background field by using the IGRF model to calculate the geomagnetic field intensity at each sampling point. Since the geomagnetic field intensity is approximately 50,000 nT (a stable background field), it is the main component of the signal. For example, the total geomagnetic field intensity at a certain sampling point calculated using IGRF is 50,200 nT.

[0038] A3. Simulating magnetic anomaly targets, such as using a single dipole model. Assuming the magnetic dipole model is located at a certain position along the flight path, such as a buried magnetic object, the single magnetic dipole model is used to calculate the anomalous magnetic field generated by the magnetic anomaly target at each sampling point. The magnetic dipole model has high accuracy when the distance between the detector and the magnetic anomaly source exceeds a certain value. In reality, the distance between the airborne magnetic detection device and the magnetic anomaly target is often much greater than the threshold, allowing the magnetic dipole model to accurately describe the magnetic field of the anomalous target. The magnetic field of the magnetic dipole is described by the magnetic dipole magnetic field model equation.

[0039] The anomalous magnetic field strength is extremely weak, only tens of pT, 1 pT = 10 -3nT is much smaller than the Earth's magnetic field, therefore, the anomalous features in the original signal are submerged and need to be extracted through subsequent processing; Because magnetic field strength is inversely proportional to the cube of the distance, the peak of the abnormal signal occurs when the aircraft is closest to the target. For example, if the target is located at (30.005°N, 120.005°E, -5m) and 5 meters underground, the abnormal magnetic field will reach its maximum value, such as 50pT, when the aircraft flies directly above that point, and will gradually decay to near zero as it moves away.

[0040] A4. Synthesize the total magnetic field signal. The total magnetic field at each sampling point = geomagnetic field (IGRF) + anomalous magnetic field (dipole).

[0041] Method 2: The real data collection system uses raw data acquired from the optically pumped magnetometer. The specific implementation method for obtaining the test magnetic field data of multiple sampling points in the test area in Method 2 is the same as the method for obtaining the real magnetic field data of multiple sampling points in the test area in step S101, and will not be repeated here.

[0042] In this embodiment, a training dataset is constructed through a dual-path approach of simulation data and real data to provide input data for the subsequent PINN model that utilizes physical constraints (such as Gauss's law of magnetism).

[0043] In this embodiment, the test magnetic field data needs to be preprocessed to eliminate various interferences and obtain magnetic data that reflects abnormal test signals. Figure 4 A flowchart illustrating data preprocessing of test magnetic field data is shown in an exemplary embodiment of this application. Figure 4 As shown, the process of preprocessing the test magnetic field data from multiple sampling points in the test area to obtain the second grid data of the test area mainly includes the following steps (S401-S404): S401. Mark the data in the test magnetic field data of multiple sampling points in the test area that exceed the preset value as the second outlier, and use the adjacent data before and after the outlier to perform linear interpolation to replace the outlier, so as to obtain the second outlier removal magnetic field sequence. S402. The second diurnal variation correction sequence is obtained by performing diurnal variation correction on the magnetic field sequence after removing the second field value. S403. Perform geomagnetic field IGRF correction on the second diurnal variation correction sequence to obtain the second total magnetic anomaly sequence; S404. Obtain a second regular grid for the test area according to the preset grid spacing in the X and Y directions, and interpolate the data in the second total magnetic anomaly sequence to the second grid points of the second regular grid to obtain the second grid data of the test area.

[0044] In this embodiment, the specific implementation method for obtaining the second grid data of the test area by preprocessing the test magnetic field data of multiple sampling points in the test area is as follows: Figure 2 The specific implementation method for data preprocessing of real magnetic field data shown is the same. For details, please refer to the description above, which will not be repeated here.

[0045] S302. The second grid data is labeled based on the mask to generate a model training dataset. The model training dataset includes: training data for data constraints and training data for physical constraints. The training data includes: the spatial coordinates of the second grid points, the actual magnetic anomaly values ​​corresponding to the second grid points, and the corresponding mask values. In some embodiments, the mask value includes: a first mask value and a second mask value; for example, the first mask value is 1 and the second mask value is 0. In some embodiments, labeling the second grid data based on the mask to generate a model training dataset includes: selecting second grid data containing boundary grid points and satisfying a preset ratio from the second grid data in the test area and labeling it as training data for data constraints, wherein the mask value of the training data for data constraints is the first mask value; labeling the remaining data in the second grid data in the test area as training data for physical constraints, wherein the mask value of the training data for physical constraints is the second mask value.

[0046] The PINN model is characterized by its integration of data constraints and physical constraints (such as Gauss's law of magnetism). (B=0), therefore, the training dataset not only needs to provide input features and output labels, but also needs to use masks to control which data is used to fit the labels and calculate the data loss, and which data is used to constrain the physical equations and calculate the physical loss. The goal of constructing the training dataset is: while simulating small sample scenarios, this training dataset retains key boundary information, allowing the PINN model to both learn data patterns and follow physical laws.

[0047] For example, the input feature X_input of the training dataset consists of the three-dimensional spatial coordinates of all grid points, describing the position of each sampling point, and is the basic input for the PINN model to predict the magnetic anomaly ΔT. Specifically, the spatial coordinates (X, Y, Z) of all grid points are combined into an N×3 matrix, where N is the total number of grid points, and each row is the coordinate vector of a sampling point.

[0048] The output label Y_label of the training dataset is the magnetic anomaly value ΔT corresponding to each grid point, used to train the PINN model's ability to fit the data. The output label Y_label, corresponding to the ΔT value of each grid point, is an N×1 vector.

[0049] The mask is crucial for PINN training. By marking which labels are visible (Mask=1) and which are invisible (Mask=0), it enables few-shot learning and the application of physical constraints. Visible labels (Mask=1) are used to calculate the data loss, i.e., the error between the PINN model's prediction and the true ΔT, to train the network to fit the data. Invisible labels (Mask=0) do not participate in the data loss calculation, but the network needs to predict ΔT based on these labels and use them to verify physical constraints (such as...). (B=0), calculate physical loss.

[0050] In some embodiments, a few-shot learning scenario is simulated by intentionally discarding labels from most of the data. For example, a preset proportion of 5% is used, and only 5% of the grid points are randomly selected with Mask=1, retaining the ΔT value as the label. For the remaining 95% of the grid points, Mask=0, and the ΔT label is treated as "unknown" by the system during training, only used for physical constraint calculations. Furthermore, the labels of all points on the four boundaries of the region are forcibly retained because boundary conditions are crucial in solving partial differential equations, and providing boundary data greatly helps the network converge to the correct solution. Through the above processing, the training dataset required for PINN training is obtained: {X_input, Y_label, mask}.

[0051] S303. Construct the PINN model and determine the loss function of the PINN model. Train the PINN model based on the model training dataset and the loss function. The loss function consists of a data loss function and a physical loss function.

[0052] In this embodiment, the PINN model employs a fully connected deep neural network FC-DNN, also known as a multilayer perceptron (MLP). Its advantage lies in its ability to approximate any complex continuous function, making it suitable for learning the mapping from spatial coordinates to physical fields. Inputting the three-dimensional spatial coordinates of a sampling point and outputting the magnetic anomaly value of that sampling point, this simple mapping from low-dimensional input to scalar output does not require complex structures such as convolution, and MLP is sufficient for this task.

[0053] In some embodiments, the PINN model sequentially includes: a data input layer, a hidden layer, and an output layer; wherein: The data input layer receives training data and consists of three neurons, each corresponding to the spatial coordinates (x, y, z) of a second grid point. The coordinate data is standardized by subtracting the mean and dividing by the standard deviation, for example, x_norm = (x - μ_x) / σ_x, where μ_x is the mean of x and σ_x is the standard deviation of x. This accelerates model training convergence, avoids gradient imbalance caused by differences in coordinate value ranges, and ensures a more balanced impact of features across dimensions on the network.

[0054] A deep learning framework is used to construct hidden layers, which include fully connected layers. Each layer consists of a linear transformation and a nonlinear activation function that supports automatic differentiation. For example, the hidden layer contains 8 fully connected layers, each with 128 neurons, consisting of a linear transformation and a nonlinear activation function. The activation function is chosen from Tanh, Swish, or ReLU. The choice of activation function has a significant impact on the training stability and convergence of the network. Tanh or Swish performs best in PINN because Tanh and Swish are nonlinear functions and have good smoothness near 0, which is beneficial for subsequent automatic differentiation calculations. The PINN model is implemented using deep learning frameworks such as PyTorch or TensorFlow. Automatic differentiation techniques can be applied to efficiently and accurately calculate the gradient of the PINN model's output with respect to the input coordinates. The first derivative is obtained by taking the first derivative of the magnetic field component with respect to the magnetic scalar potential. For the Laplace operator, the second derivative is calculated. The differentiation operation is automatically completed during the forward and backward propagation of the network, eliminating the need to write complex derivative formulas.

[0055] The output layer consists of one neuron, which outputs the predicted magnetic anomaly value ΔT_pred corresponding to the spatial coordinates (x, y, z) of the second grid point. The output layer also includes one neuron, used to output the predicted magnetic anomaly value corresponding to the spatial coordinates of the second grid point, which corresponds to the preprocessed data label ΔT, and is used to calculate the data loss, i.e., the error between the predicted and actual values.

[0056] In this embodiment, the loss function is the core of the PINN model, determining its optimization objective. The loss function of the PINN model consists of a data loss function and a physical loss function. In some embodiments, determining the loss function of the PINN model includes: The loss function of the PINN model is calculated using the following formula. :

[0057] in, Represents the data loss function. The weights represent the weights of the data loss function. This represents the physical loss function, which follows Gauss's magnetic law. The weights represent the physical loss function.

[0058] Data loss function The optimization aims to make the predicted magnetic field values ​​output by the PINN model match the measured data as closely as possible. The data loss function is calculated using the following formula. :

[0059] in, This indicates the amount of training data used for data constraints. This represents the predicted magnetic anomaly value corresponding to the i-th second grid point in the PINN model output. This represents the actual magnetic anomaly value corresponding to the i-th second grid point; Physical loss The optimization direction is to make the Laplace value predicted by the PINN model close to 0. The physical loss function is calculated using the following formula. :

[0060] in, This represents the amount of training data used for physical constraints. This represents the predicted magnetic anomaly value corresponding to the j-th second grid point in the PINN model output. , , This represents the predicted magnetic anomaly value calculated using automatic differentiation. The partial derivatives with respect to coordinates, and subject to the physical constraint that the divergence of the magnetic field is zero. .

[0061] In passive magnetic detection scenarios without time-varying currents, the magnetic field is dominated by a passive magnetic dipole model, and its physical laws follow the magnetostatic form of Maxwell's equations. The core physical constraint is Gauss's law of magnetism, which states that the divergence of the magnetic field is zero. Specifically, the divergence of the magnetic field induction intensity is always zero under the assumption of a non-magnetic monopole:

[0062] in, , , They are respectively the magnetic field in The components in the three directions constitute the core physical constraints of this method.

[0063] The balance of weights is a key parameter affecting the training performance of the PINN model. In actual testing, it is determined based on the amount of test data. If the amount of test data is very small, the weight of the physical loss term should be appropriately increased. This allows physical laws to play a dominant role in network training; if the data quality is high and the quantity is sufficient, the weight of the physical loss term can be appropriately reduced. .

[0064] The optimizer uses standard gradient-based optimizers, such as Adam or AdamW, which have a fast convergence speed and are suitable for handling large-scale network parameters. Alternatively, a second-order optimizer, such as L-BFGS, can be used, which can find local optima faster but has higher memory requirements. When the number of parameters is not particularly large, L-BFGS is a good choice.

[0065] Figure 5 This document illustrates a flowchart of an exemplary embodiment of the training of the PINN model based on a model training dataset and a loss function. Figure 5 As shown, the process of training the PINN model based on the model training dataset and loss function mainly includes the following steps (S501-S502): S501. Initialize the network parameters of the PINN model, where the network parameters include the weights and biases of the PINN model; For example, initialization methods include Xavier initialization or He initialization. The weights and biases of the PINN model are set to reasonable initial values ​​to maintain the variance of the signal during forward propagation and the variance of the gradient during back propagation, preventing gradient vanishing or gradient explosion and improving training stability.

[0066] S502. In each training cycle, complete the training by following these steps: S5021. Randomly select a batch of data constraint points for data constraints and a batch of physical constraint points for physical constraints from the model training dataset. During training, the loss function Ltotal is iteratively minimized. In each training epoch, the PINN model traverses all training data once. Each epoch contains multiple training batches, each containing a data point batch and a physical point batch. The PINN model first randomly selects a batch of data constraint points and a batch of physical constraint points from the dataset. The data constraint points are the 5% of the inner second grid points and the boundary second grid points of the mask Mask=1, which are used to calculate the data loss. The physical constraint points include all second grid points, which are used to calculate the physical loss.

[0067] S5022. Input the spatial coordinates of the data constraint points and the spatial coordinates of the physical constraint points into the PINN model for forward propagation to obtain the predicted magnetic anomaly values ​​of the data constraint points and the physical constraint points; and calculate the total loss of the PINN model based on the predicted magnetic anomaly values ​​of the data constraint points and the physical constraint points according to the loss function. Specifically, the coordinates (x, y, z) of all constraint points are input into the PINN model, and the predicted magnetic anomaly value ΔT_pred for each constraint point is obtained through forward computation of fully connected layers and activation functions.

[0068] For data-constrained batches, calculate the predicted magnetic anomaly values ​​output by the PINN model. Compared with the actual magnetic anomaly value Mean squared error (MSE), i.e., data loss .

[0069] For each batch of physical constraints, calculate the Laplace value for each physical constraint point, and then calculate the mean square error of all Laplace values, i.e., the physical loss. The total loss is obtained by weighted summation of data loss and physical loss. .

[0070] S5023. Calculate the gradient of the total loss with respect to the network parameters, and use the optimizer to perform backpropagation to update the network parameters; The total loss is gradually reduced by using an optimizer (such as Adam) to calculate the gradient of the total loss with respect to the network parameters (weights and biases) and then backpropagating to update the parameters.

[0071] For example, the formula for updating network parameters is: , among which, among which This is the learning rate, such as 0.001. It is the momentum term of the gradient, adjusted by the adaptive gradient of the Adam optimizer.

[0072] Repeat the training cycle operation in step S502 until the change in total loss for a preset number of consecutive epochs is less than a preset value or the preset number of training cycles is reached. For example, the change in total loss for 10 consecutive epochs is less than... Alternatively, training the PINN model can be terminated after reaching the preset number of training cycles (1000).

[0073] During training, the changes in training epochs are obtained by periodically monitoring the data loss, physical loss, and total loss. Ideally, all three curves should continuously decrease and eventually plateau. If loss oscillates or fails to decrease, the learning rate, batch size, or network weights are adjusted.

[0074] In some embodiments, the performance of the PINN model largely depends on the selection of hyperparameters. This application focuses on hyperparameters and their tuning strategies. In some embodiments, training the PINN model based on the model training dataset and a loss function further includes: calculating the data loss of the PINN model based on data constraint points using the data loss function; calculating the physical loss of the PINN model based on physical constraint points using the physical loss function; and weighting the data loss function based on the numerical comparison between the data loss and the physical loss. and the weights of the data loss function Adjustments were made: when the data loss was greater than the preset data loss value, the number of hidden layers and the number of neurons per layer of the PINN model were increased; when the data loss was less than the preset data loss value but the physical loss was greater than the preset physical loss value, the number of hidden layers and the number of neurons per layer of the PINN model were reduced, and the overfitting of the PINN model was limited by the regularization effect of the physical loss.

[0075] In network weight training, and To balance the importance of data loss and physical loss, the initial setting starts from... 1 or Starting with 1, adaptive weighting is performed, and the dynamic weights are adjusted by comparing the numerical values ​​of data loss and physical loss to ensure that they are on the same order of magnitude during training.

[0076] In actual training, if the network is underfitting, the number of hidden layers and the number of neurons per layer are increased to increase the network capacity; conversely, the network capacity is reduced. Regularization techniques are used. In the PINN model, the physical loss term itself is a form of regularization, which can effectively prevent overfitting.

[0077] Regarding batch size, in the PINN model, since the number of physical constraint points is much greater than the number of data constraint points, the batch size of physical points is set to be much larger than the batch size of data points.

[0078] In some embodiments, to quantify the effectiveness of the PINN model in magnetic anomaly identification, the following metrics are used for verification in this application: a. Signal-to-noise ratio (SNR): The signal-to-noise ratio of the original data and the residual data after processing by the new method is calculated. The improvement factor of SNR measures the denoising ability of the method.

[0079] b. Anomaly Contrast: The intensity contrast between the identified anomaly and the surrounding background is calculated. Due to the addition of physical constraints, the PINN method is significantly higher than traditional neural network methods.

[0080] By using the above two indicators, from the two dimensions of denoising capability and anomaly recognition clarity, it is verified that the PINN model can still identify weak magnetic anomaly signals from complex airborne magnetic measurement data even with a very small amount of labeled data, proving its effectiveness and practicality.

[0081] The magnetic anomaly detection method provided in this application, based on the PINN model with data and physical constraints, can still identify weak magnetic anomaly signals from complex airborne magnetic measurement data even with a very small amount of labeled data, thereby achieving high-precision magnetic field reconstruction and anomaly detection.

[0082] An exemplary embodiment of this application provides a magnetic anomaly detection device 100. Figure 6 A structural block diagram of a magnetic anomaly detection device 100 provided in an exemplary embodiment of this application is shown. The magnetic anomaly detection device 100 described above can achieve the following: Figures 1 to 5 All or part of the contents of any of the embodiments shown. The following is only a brief description of the structure and function of the magnetic anomaly detection device 100. For other matters not covered, please refer to the relevant descriptions in the above-described magnetic anomaly detection method. The embodiments of the magnetic anomaly detection device 100 correspond to the embodiments of the above-described magnetic anomaly detection method. All implementation processes and methods of the above-described method embodiments can be applied to the embodiments of the magnetic anomaly detection device 100 and can achieve the same technical effects.

[0083] like Figure 6 As shown, the magnetic anomaly detection device 100 includes: an acquisition module 101, a data processing module 102, a PINN model module 103, and a magnetic anomaly identification module 104, wherein: The acquisition module 101 is used to acquire the real magnetic field data of multiple sampling points in the area to be tested, wherein the real magnetic field data of the sampling points includes at least the spatial coordinates and magnetic field information of the sampling points; Data processing module 102 is used to perform data preprocessing on the real magnetic field data of multiple sampling points in the area to be tested to obtain the first grid data of the area to be tested. The first grid data includes: the spatial coordinates of the first grid point in the area to be tested and the real magnetic anomaly value corresponding to the first grid point. The PINN model module 103 is used to input the spatial coordinates of the first grid point into a pre-trained physical information neural network PINN model based on data constraints and physical constraints to obtain the predicted magnetic anomaly value corresponding to the first grid point. The magnetic anomaly identification module 104 is used to obtain the residual field magnetic anomaly value corresponding to the first grid point based on the actual magnetic anomaly value and the predicted magnetic anomaly value corresponding to the first grid point; to mark the anomaly region based on the residual field magnetic anomaly value corresponding to the first grid point to obtain candidate anomaly regions; to perform cluster analysis on the candidate anomaly regions to obtain magnetic anomalies; and to obtain the anomaly attributes of the magnetic anomalies.

[0084] In some embodiments, the data processing module 102 preprocesses the real magnetic field data of multiple sampling points in the area to be measured to obtain the first grid data of the area to be measured in the following manner: marking data exceeding a preset value in the real magnetic field data of multiple sampling points as first outliers, and replacing the first outliers with linear interpolation of adjacent data before and after the first outliers to obtain a first outlier removal magnetic field sequence; performing diurnal variation correction on the first outlier removal magnetic field sequence to obtain a first diurnal variation correction sequence; performing geomagnetic field IGRF correction on the first diurnal variation correction sequence to obtain a first total magnetic anomaly sequence; obtaining a first regular grid in the area to be measured according to a preset grid spacing in the X and Y directions, and interpolating the data in the first total magnetic anomaly sequence to the first grid point of the regular grid to obtain the first grid data of the area to be measured.

[0085] In some embodiments, the acquisition module 101 is further configured to acquire test magnetic field data of multiple sampling points in the test area; the data processing module 102 is further configured to perform data preprocessing on the test magnetic field data of multiple sampling points in the test area to obtain second grid data of the test area, the second grid data including: the spatial coordinates of the second grid points in the test area and the true magnetic anomaly value corresponding to the second grid points; the second grid data is labeled based on a mask to generate a model training dataset, the model training dataset including: training data for data constraints and training data for physical constraints, wherein the training data includes: the spatial coordinates of the second grid points, the true magnetic anomaly value corresponding to the second grid points and the corresponding mask value; the PINN model module 103 is further configured to construct a PINN model and determine the loss function of the PINN model, and train the PINN model based on the model training dataset and the loss function, wherein the loss function consists of a data loss function and a physical loss function.

[0086] In some embodiments, the data processing module 102 preprocesses the test magnetic field data of multiple sampling points in the test area to obtain the second grid data of the test area in the following manner: marking data exceeding a preset value in the test magnetic field data of multiple sampling points in the test area as second outliers, and replacing the outliers by linear interpolation of adjacent data before and after the outliers to obtain a second outlier removal magnetic field sequence; performing diurnal variation correction on the second outlier removal magnetic field sequence to obtain a second diurnal variation correction sequence; performing geomagnetic field IGRF correction on the second diurnal variation correction sequence to obtain a second total magnetic anomaly sequence; obtaining a second regular grid in the test area according to a preset grid spacing in the X and Y directions, and interpolating the data in the second total magnetic anomaly sequence to the second grid points of the second regular grid to obtain the second grid data of the test area.

[0087] In some embodiments, the mask value includes: a first mask value and a second mask value; the data processing module 102 generates a model training dataset by labeling the second grid data based on the mask in the following manner: selecting second grid data containing boundary grid points and satisfying a preset ratio from the second grid data in the test area and labeling it as training data for data constraints, wherein the mask value of the training data for data constraints is the first mask value; and labeling the remaining data in the second grid data in the test area as training data for physical constraints, wherein the mask value of the training data for physical constraints is the second mask value.

[0088] In some embodiments, the PINN model module 103 determines the loss function of the PINN model in the following manner: The loss function of the PINN model is calculated using the following formula. :

[0089] in, Represents the data loss function. The weights represent the weights of the data loss function. This represents the physical loss function, which follows Gauss's magnetic law. The weights represent the physical loss function.

[0090] The data loss function is calculated using the following formula. :

[0091] in, This indicates the amount of training data used for data constraints. This represents the predicted magnetic anomaly value corresponding to the i-th second grid point in the PINN model output. This represents the actual magnetic anomaly value corresponding to the i-th second grid point; The physical loss function is calculated using the following formula. :

[0092] in, This represents the amount of training data used for physical constraints. This represents the predicted magnetic anomaly value corresponding to the j-th second grid point in the PINN model output. , , This represents the predicted magnetic anomaly value calculated using automatic differentiation. The partial derivatives with respect to coordinates, and the physical constraint that the divergence of the magnetic field is zero.

[0093] In some embodiments, the PINN model module 103 trains the PINN model based on the model training dataset and the loss function in the following manner: The network parameters of the PINN model are initialized, including the weights and biases of the PINN model. To complete the training in each training cycle, follow these steps: Randomly select a batch of data constraint points for data constraints and a batch of physical constraint points for physical constraints from the model training dataset. The spatial coordinates of the data constraint points and the spatial coordinates of the physical constraint points are respectively input into the PINN model for forward propagation to obtain the predicted magnetic anomaly values ​​of the data constraint points and the physical constraint points; and the total loss of the PINN model is calculated based on the predicted magnetic anomaly values ​​of the data constraint points and the physical constraint points according to the loss function. Calculate the gradient of the total loss with respect to the network parameters, and use the optimizer to perform backpropagation to update the network parameters; Repeat the training cycle until the change in total loss for a preset number of consecutive cycles is less than a preset value or the preset number of training cycles is reached, then end the training of the PINN model.

[0094] In some embodiments, the PINN model module 103 further trains the PINN model based on the model training dataset and the loss function by: calculating the data loss of the PINN model based on data constraint points according to the data loss function; calculating the physical loss of the PINN model based on physical constraint points according to the physical loss function; and weighting the data loss function based on the numerical comparison between the data loss and the physical loss. and the weights of the data loss function Adjustments were made: when the data loss was greater than the preset data loss value, the number of hidden layers and the number of neurons per layer of the PINN model were increased; when the data loss was less than the preset data loss value but the physical loss was greater than the preset physical loss value, the number of hidden layers and the number of neurons per layer of the PINN model were reduced, and the overfitting of the PINN model was limited by the regularization effect of the physical loss.

[0095] In some embodiments, the magnetic anomaly identification module 104 obtains candidate anomaly regions by marking anomaly regions based on the residual field magnetic anomaly value corresponding to the first grid point, and performs cluster analysis on the candidate anomaly regions to obtain magnetic anomalies: marking the region corresponding to the first grid point whose absolute value of the residual field magnetic anomaly value corresponding to the first grid point is greater than a preset residual field threshold as a candidate anomaly region; performing connectivity component analysis on the candidate anomaly regions, and clustering the regions formed by adjacent grid points in the candidate anomaly regions into a magnetic anomaly, thereby obtaining multiple magnetic anomalies.

[0096] The magnetic anomaly detection device provided in this application, based on the PINN model with data and physical constraints, can still identify weak magnetic anomaly signals from complex airborne magnetic measurement data even with a very small amount of labeled data, thereby achieving high-precision magnetic field reconstruction and anomaly detection.

[0097] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.

[0098] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for detecting magnetic anomalies, characterized in that, include: Acquire real magnetic field data from multiple sampling points in the area to be tested, wherein the real magnetic field data of the sampling points includes at least: the spatial coordinates and magnetic field information of the sampling points; Data preprocessing is performed on the real magnetic field data of multiple sampling points in the area to be tested to obtain the first grid data of the area to be tested. The first grid data includes: the spatial coordinates of the first grid point in the area to be tested and the real magnetic anomaly value corresponding to the first grid point. The spatial coordinates of the first grid point are input into a pre-trained physical information neural network PINN model based on data constraints and physical constraints to obtain the predicted magnetic anomaly value corresponding to the first grid point. The residual field magnetic anomaly value corresponding to the first grid point is obtained based on the actual magnetic anomaly value corresponding to the first grid point and the predicted magnetic anomaly value corresponding to the first grid point. Based on the residual field magnetic anomaly value corresponding to the first grid point, anomaly regions are marked to obtain candidate anomaly regions. Cluster analysis is performed on the candidate anomaly regions to obtain magnetic anomaly bodies, and the anomaly attributes of the magnetic anomaly bodies are obtained.

2. The method according to claim 1, characterized in that, The process of preprocessing the real magnetic field data from multiple sampling points in the area to be tested to obtain the first grid data of the area to be tested includes: Data exceeding a preset value in the real magnetic field data of the multiple sampling points are marked as first outliers, and the first outliers are replaced by linear interpolation of the adjacent data before and after the first outliers to obtain the first outlier removal magnetic field sequence. The first diurnal variation correction sequence is obtained by performing diurnal variation correction on the first outlier removal magnetic field sequence. The first diurnal variation correction sequence is subjected to geomagnetic field IGRF correction to obtain the first total magnetic anomaly sequence; A first regular grid is obtained for the area to be tested according to a preset grid spacing in the X and Y directions. The data in the first total magnetic anomaly sequence is interpolated to the first grid point of the regular grid to obtain the first grid data of the area to be tested.

3. The method according to claim 1, characterized in that, Before inputting the spatial coordinates of the grid points into a pre-trained PINN (Physical Information Neural Network) model based on data constraints and physical constraints, the method includes: Acquire test magnetic field data from multiple sampling points in the test area; perform data preprocessing on the test magnetic field data from multiple sampling points in the test area to obtain second grid data of the test area, the second grid data including: the spatial coordinates of the second grid points in the test area and the actual magnetic anomaly value corresponding to the second grid points; The second grid data is labeled based on the mask to generate a model training dataset. The model training dataset includes: training data for data constraints and training data for physical constraints. The training data includes: the spatial coordinates of the second grid points, the actual magnetic anomaly values ​​corresponding to the second grid points, and the corresponding mask values. The PINN model is constructed, and the loss function of the PINN model is determined. The PINN model is trained based on the model training dataset and the loss function, wherein the loss function consists of a data loss function and a physical loss function.

4. The method according to claim 3, characterized in that, The process of preprocessing the test magnetic field data from multiple sampling points in the test area to obtain the second grid data of the test area includes: Data exceeding a preset value in the test magnetic field data of multiple sampling points in the test area are marked as second outliers, and the outliers are replaced by linear interpolation of adjacent data before and after the outliers to obtain the second outlier removal magnetic field sequence. The second diurnal variation correction sequence is obtained by performing diurnal variation correction on the second field value removal magnetic field sequence. The second diurnal variation correction sequence was subjected to geomagnetic field IGRF correction to obtain the second total magnetic anomaly sequence; A second regular grid is obtained for the test area according to the preset grid spacing in the X and Y directions. The data in the second total magnetic anomaly sequence is interpolated to the second grid points of the second regular grid to obtain the second grid data of the test area.

5. The method according to claim 3, characterized in that, The mask values ​​include: a first mask value and a second mask value; The process of labeling the second grid data based on a mask to generate the model training dataset includes: Select second grid data containing boundary grid points and satisfying a preset ratio from the second grid data of the test area and mark it as the training data for data constraints. The mask value of the training data for data constraints is the first mask value. The remaining data in the second grid data of the test area are marked as the training data for physical constraints, and the mask value of the training data for physical constraints is the second mask value.

6. The method according to claim 3, characterized in that, Determining the loss function of the PINN model includes: The loss function of the PINN model is calculated using the following formula. : in, This represents the data loss function. The weights represent the weights of the data loss function. This represents the physical loss function, which follows Gauss's magnetic law. The weights represent the physical loss function; The data loss function is calculated using the following formula. : in, This indicates the amount of training data used for data constraints. This represents the predicted magnetic anomaly value corresponding to the i-th second grid point output by the PINN model. This represents the actual magnetic anomaly value corresponding to the i-th second grid point; The physical loss function is calculated using the following formula. : in, This represents the amount of training data used for physical constraints. This represents the predicted magnetic anomaly value corresponding to the j-th second grid point output by the PINN model. , , This represents the predicted magnetic anomaly value calculated using automatic differentiation. The partial derivatives with respect to the coordinates, and the physical constraint that the divergence of the magnetic field is zero.

7. The method according to claim 6, characterized in that, Training the PINN model based on the model training dataset and the loss function includes: The network parameters of the PINN model are initialized, wherein the network parameters include the weights and biases of the PINN model; To complete the training in each training cycle, follow these steps: Randomly select a batch of data constraint points for data constraints and a batch of physical constraint points for physical constraints from the model training dataset. The spatial coordinates of the data constraint points and the spatial coordinates of the physical constraint points are respectively input into the PINN model for forward propagation to obtain the predicted magnetic anomaly values ​​of the data constraint points and the physical constraint points; and the total loss of the PINN model is calculated based on the predicted magnetic anomaly values ​​of the data constraint points and the physical constraint points according to the loss function. Calculate the gradient of the total loss with respect to the network parameters, and use the optimizer to perform backpropagation to update the network parameters; Repeat the operation of the training cycle until the change in the total loss is less than a preset value for a preset number of consecutive cycles or the preset number of training cycles is reached, then end the training of the PINN model.

8. The method according to claim 7, characterized in that, The training of the PINN model based on the model training dataset and the loss function further includes: The data loss of the PINN model is calculated based on the data constraint points according to the data loss function. The physical loss of the PINN model is calculated based on the physical constraint points according to the physical loss function. The weights of the data loss function are determined by comparing the numerical values ​​of the data loss and the physical loss. and the weights of the data loss function Make adjustments; If the data loss is greater than a preset data loss value, increase the number of hidden layers and the number of neurons per layer of the PINN model; if the data loss is less than the preset data loss value but the physical loss is greater than the preset physical loss value, decrease the number of hidden layers and the number of neurons per layer of the PINN model, and rely on the regularization effect of the physical loss to limit the overfitting of the PINN model.

9. The method according to claim 4, characterized in that, The step of marking candidate anomalous regions based on the residual field magnetic anomaly values ​​corresponding to the first grid points, and performing cluster analysis on the candidate anomalous regions to obtain magnetic anomalies, includes: The region corresponding to the first grid point whose absolute value of the residual magnetic anomaly value is greater than the preset residual field threshold is marked as the candidate anomaly region; Connectivity component analysis is performed on the candidate anomaly regions, and the regions formed by adjacent grid points in the candidate anomaly regions are clustered into a magnetic anomaly body, resulting in multiple magnetic anomalies.

10. A magnetic anomaly detection device, characterized in that, include: The acquisition module is used to acquire real magnetic field data of multiple sampling points in the area to be tested, wherein the real magnetic field data of the sampling points includes at least: the spatial coordinates and magnetic field information of the sampling points; The data processing module is used to preprocess the real magnetic field data of multiple sampling points in the area to be tested to obtain the first grid data of the area to be tested. The first grid data includes: the spatial coordinates of the first grid point in the area to be tested and the real magnetic anomaly value corresponding to the first grid point. The PINN model module is used to input the spatial coordinates of the first grid point into a pre-trained physical information neural network PINN model based on data constraints and physical constraints to obtain the predicted magnetic anomaly value corresponding to the first grid point. The magnetic anomaly identification module is used to obtain the residual field magnetic anomaly value corresponding to the first grid point based on the actual magnetic anomaly value and the predicted magnetic anomaly value corresponding to the first grid point; to mark the anomaly region based on the residual field magnetic anomaly value corresponding to the first grid point to obtain candidate anomaly regions; to perform cluster analysis on the candidate anomaly regions to obtain magnetic anomalies; and to obtain the anomaly attributes of the magnetic anomalies.