Small sample magnetic anomaly data enhancement and boundary identification method and system based on stylegan2-ada

By using StyleGAN2-ADA generative adversarial network and physical operator automatic labeling technology, the problem of data scarcity in magnetic exploration is solved, achieving efficient magnetic anomaly boundary identification and improving model generalization ability and label quality.

CN122391665APending Publication Date: 2026-07-14JILIN UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JILIN UNIVERSITY
Filing Date
2026-06-17
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

In magnetic exploration, the scarcity of measured data leads to poor generalization ability of deep learning models, making it difficult to accurately identify the horizontal boundaries of magnetic anomaly sources.

Method used

A StyleGAN2-ADA generative adversarial network is introduced to generate high-fidelity magnetic anomaly images through an adaptive discriminator enhancement mechanism. Physical operators are used to automatically label the images, constructing a semi-supervised learning loop and generating a large-scale labeled dataset for boundary recognition.

Benefits of technology

It effectively expands the training data, improves the model's generalization ability, and the generated data retains the texture style of the measured data while also having the physical rationality of the forward modeling data. The labels are of high quality and automated, reducing the cost of data acquisition and the error of manual annotation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391665A_ABST
    Figure CN122391665A_ABST
Patent Text Reader

Abstract

The application discloses a small sample magnetic anomaly data enhancement and boundary identification method and system based on StyleGAN2-ADA, and relates to the field of geophysical exploration.The method comprises the following steps: establishing an initial small sample set; constructing a generative adversarial network based on adaptive discriminator augmentation (ADA), training a generator by using the initial small sample set, and generating a large amount of high-fidelity magnetic anomaly data; calculating boundary labels for the generated data by using a physical operator fusion strategy, and constructing a large-scale labeled training set; constructing a U-Net boundary identification network, pre-training the U-Net boundary identification network by using the large-scale labeled training set, fine-tuning the U-Net boundary identification network by using measured data, and finally outputting the magnetic anomaly boundary position of a target to-be-measured area.The application solves the problems of a lack of measured samples and high labeling costs in deep learning in magnetic exploration, realizes high-quality expansion of data under small samples, and improves the generalization ability and noise resistance of the boundary identification network to complex geological features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of geophysical exploration technology, and in particular to a method and system for magnetic anomaly boundary identification using generative adversarial networks to augment small sample data and combined with deep learning. Background Technology

[0002] Magnetic exploration is an important tool in geophysical exploration, widely used in mineral resource surveys and geological structure studies. Accurately identifying the horizontal boundaries of magnetic anomaly sources is a crucial step in interpreting magnetic data. Traditional boundary identification methods (such as vertical derivatives, Tilt angles, and Theta diagrams) rely on derivative calculations, are highly susceptible to noise interference, and have limitations in extracting weak signals at depth.

[0003] In recent years, deep learning methods, represented by Convolutional Neural Networks (CNNs), have achieved great success in image segmentation and have also been introduced into field boundary recognition. However, the performance of deep learning models is highly dependent on massive amounts of labeled training data. In geophysics, obtaining realistic underground geological structures (i.e., "labels") often requires expensive drilling verification, resulting in a severe scarcity of high-quality "measured data-label" pairs. Existing research largely relies on forward simulation data of simple geometries (such as spheres and prisms) for training, but the distribution of simulated data differs significantly from complex real geological conditions, leading to poor generalization ability and unsatisfactory recognition results when processing measured data. How to generate a large number of high-quality training samples that conform to geological laws using only a limited amount of measured data is a pressing problem that needs to be solved. Summary of the Invention

[0004] This invention addresses the problems of existing technologies by proposing a method and system for small-sample magnetic anomaly data enhancement and boundary recognition based on StyleGAN2-ADA. The main innovations of this invention are: the introduction of a StyleGAN2-ADA network that supports small-sample training; the generation of massive amounts of realistic magnetic anomaly images with only a small amount of real-world data through an adaptive discriminator enhancement mechanism; and the innovative use of physical operators to automatically label the generated images, constructing a perfect semi-supervised learning loop.

[0005] According to one aspect of the present invention, a method for small-sample magnetic anomaly data augmentation and boundary recognition based on StyleGAN2-ADA is provided, comprising: collecting measured magnetic anomaly data smaller than a preset size; generating forward simulation data based on the magnetic anomaly forward modeling formula; and constructing an initial small-sample dataset after preprocessing; constructing a generative adversarial network model StyleGAN2-ADA based on an adaptive discriminator enhancement mechanism, wherein StyleGAN2-ADA includes a generator and a discriminator, and an adaptive enhancement mechanism is introduced at the input of the discriminator, wherein the adaptive enhancement mechanism dynamically adjusts the enhancement probability according to the degree of overfitting of the discriminator, performs data augmentation operations on the real image and the generated image input to the discriminator, and expands the input space of the discriminator; and inputting the initial small-sample dataset into the... The StyleGAN2-ADA model is subjected to adversarial training until the generator outputs a high-fidelity magnetic anomaly image that meets preset conditions. The trained generator is used to generate a magnetic anomaly augmentation dataset larger than a preset size, and corresponding boundary label maps are generated through joint constraints of the tilt angle and the total horizontal derivative, forming a large-scale labeled dataset. A boundary recognition network based on the U-Net architecture is constructed, and the large-scale labeled dataset is input into the boundary recognition network for supervised learning pre-training. The pre-trained boundary recognition network is then fine-tuned using the measured magnetic anomaly data and its manually labeled parameters. After model training, the trained boundary recognition network is used for boundary recognition. Based on the input magnetic anomaly data of the test area, the model outputs a corresponding magnetic anomaly boundary position prediction map.

[0006] Optionally, the forward modeling formula for the magnetic anomaly is: ; In the formula, The calculated magnetic anomaly data; It is the magnetic permeability in vacuum; It is magnetic susceptibility; It is the magnetic field strength of the magnetized medium; , , These are the coordinates of the ground observation point; , , The coordinates of the underground field source location; , , , , , These are the coordinates of the endpoints of the underground cube in the X, Y, and Z directions, respectively. This represents the distance from the ground observation point to the field source.

[0007] Optionally, in the generative adversarial network model, the generator adopts a pattern-modulation-based convolutional network structure, which modulates and demodulates the weights of each convolutional layer by introducing a mapping network from latent variables to the intermediate latent space; the discriminator adopts a deep convolutional neural network structure based on residual connections, which extracts and discriminates the input magnetic anomaly image step by step through multiple residual blocks; the enhancement probability p is initially set to 0, and is adjusted according to the overfitting heuristic index of the discriminator on the training samples. The value increases as it approaches 1. The overfitting heuristic is used to characterize the discriminator's memorization of training samples. In the formula, This represents the output of the discriminator on real magnetic anomaly samples in the training set. Represents a symbolic function. This indicates that the mean value is being calculated.

[0008] Optionally, the StyleGAN2-ADA model employs an adaptively enhanced GAN objective function, as shown in the following formula: In the formula, This represents the total value function of the generative adversarial network; This represents a generator, with random noise as input. The output is the generated image; This represents a discriminator, whose output is the probability that the input image is real. Indicates data from actual test datasets Real magnetic anomaly data; Indicates that it follows a normal distribution A random noise vector; This refers to a differentiable augmentation operator, which is used to perform data augmentation operations on an image. This indicates the enhancement probability, controlling the intensity of the transformation applied to the image; This indicates that the mean of a sample drawn from the actual measured dataset is calculated. This indicates that the mean of a randomly generated noise sample is calculated.

[0009] Optionally, the step of generating a corresponding boundary label map by jointly constraining the tilt angle and the total horizontal derivative includes: for each generated magnetic anomaly image, calculating the total horizontal derivative and tilt angle at each pixel, and normalizing the total horizontal derivative of each pixel; determining pixels whose normalized total horizontal derivative value is greater than a preset threshold and whose tilt angle is within a preset bandwidth of zero as boundary pixels, otherwise determining them as background pixels; assigning a value of 1 to boundary pixels and a value of 0 to background pixels to generate a binarized boundary label map as a supervision label for the corresponding generated image.

[0010] Optionally, the formula for calculating the total horizontal derivative is: ; In the formula, Representing coordinates The total horizontal derivative at that point; , Indicates magnetic anomaly The first-order partial derivatives in the x and y directions.

[0011] Optionally, the formula for calculating the tilt angle is: ; In the formula, Indicates the angle of inclination; Represents the total horizontal derivative; Indicates magnetic anomaly The first-order partial derivative in the z-direction.

[0012] Optionally, the boundary recognition network includes an encoder, a decoder, and skip connections; the input and output channels are set to 1; the loss function is a weighted combination of binary cross-entropy loss and Dice loss; the optimizer is Adam; and the learning rate is set to 1×10⁻⁶. -4 .

[0013] Optionally, during the fine-tuning of the pre-trained boundary recognition network, the learning rate is reduced to 1×10. -5 The weights of the first three layers of the encoder are frozen, and only the decoder and output layer are trained to preserve the general texture features learned from the augmented dataset.

[0014] According to another aspect of the present invention, a small-sample magnetic anomaly data augmentation and boundary recognition system based on StyleGAN2-ADA is provided, comprising: a data acquisition module for establishing an initial small-sample dataset containing measured data and forward modeling data; a generative adversarial training module for constructing and training a generative adversarial network model StyleGAN2-ADA based on an adaptive discriminator enhancement mechanism, generating high-fidelity magnetic anomaly data that meets preset conditions under small-sample conditions through an adaptive enhancement mechanism; an automatic label generation module for automatically generating corresponding boundary labels by calculating the tilt angle and total horizontal derivative of the generated data and using a physical operator fusion strategy; a boundary recognition training module for pre-training a boundary recognition network based on a generated large-scale labeled dataset and fine-tuning it using measured data; and a prediction output module for receiving magnetic anomaly data of the area to be measured and outputting a prediction map with geological body boundary information.

[0015] The beneficial effects of this invention are: 1. Solved the problem of data scarcity: By leveraging the powerful generation capabilities of StyleGAN2-ADA, dozens of experimental images were expanded into thousands of high-quality samples, greatly reducing the cost of data acquisition.

[0016] 2. Improved model generalization: The generated data retains the texture style (noise distribution, superposition pattern) of the measured data and has the physical rationality of the forward modeling data. The trained recognition network has a stronger generalization ability than the network trained with only a simple model.

[0017] 3. High-quality and automated labeling: Taking advantage of the "noise-free" nature of the generated data, the labels calculated by physical operators are very accurate, avoiding subjective errors and heavy workload when manually labeling measured data. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart of a small-sample magnetic anomaly data enhancement and boundary identification method based on StyleGAN2-ADA according to an embodiment of the present invention; Figure 2 Illustration of an underground cube; Figure 3 This is a schematic diagram of the StyleGAN2-ADA network architecture and adaptive enhancement of the present invention; Figure 4 This is a schematic diagram of the process of generating pseudo-tags by fusing physical operators according to the present invention; Figure 5 This is a diagram showing the boundary recognition effect of the small sample magnetic anomaly data augmentation and boundary recognition method based on StyleGAN2-ADA of the present invention on the validation set data. Detailed Implementation

[0019] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present application can be combined with each other.

[0020] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0021] The terms “comprising” and “having”, and any variations thereof, in the specification and claims of this application are intended to cover non-exclusive inclusion, for example, a process, method, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.

[0022] Example 1: This invention provides a method for small-sample magnetic anomaly data augmentation and boundary identification based on StyleGAN2-ADA. (Refer to...) Figure 1 The method includes the following steps: S1, Establish the initial small sample dataset; The initial small sample dataset consists of a small amount of measured magnetic anomaly data and simulated magnetic anomaly data calculated based on the forward modeling formula for magnetic anomalies.

[0023] The measured magnetic anomaly data refers to real data, and "small amount" means that the sample size is insufficient to support the data scale for overfit-free training of conventional generative adversarial networks (such as traditional GANs and DCGANs). Specifically, the total amount of the initial small sample dataset is less than a preset size, for example, less than 1,000 images, preferably 50 to 500 images.

[0024] The simulated magnetic anomaly data is forward modeling data calculated based on the forward modeling formula for magnetic anomalies.

[0025] The forward modeling formula for the magnetic anomaly is: ; This formula is used to calculate the final magnetic anomaly response at the observation point. In the formula, For the calculated magnetic anomaly data, It is the permeability in vacuum. It is magnetic susceptibility. It is the magnetic field strength of the magnetized medium. The distance between the ground observation point and the field source. , , , , , These are the coordinates of the endpoints of the underground cube in the X, Y, and Z directions, respectively. Further, refer to... Figure 2 , Figure 2 The figure shows a diagram of a subsurface cube, i.e., a single magnetic anomaly unit (multiple magnetic anomaly units constitute a subsurface model). , Let be the coordinates of the two endpoints of the cube in the X direction. , Let these be the coordinates of the two endpoints of the cube in the Y direction. , Let be the coordinates of the two endpoints of the cube in the Z direction.

[0026] The meaning is the weight coefficient in forward modeling; the weight coefficient represents the subsurface ( , , The field source at the location affects the ground ( , , The influence of the magnetic field strength at the observation point. The meaning is the triple integral with respect to the weight coefficients.

[0027] The small amount of measured magnetic anomaly data underwent preprocessing, including denoising, continuation, thinning, resampling, and normalization to the [−1,1] interval. The image size was adjusted. (e.g., 64×64) pixels, uniformly converting them into magnetic anomaly data blocks of the same size. Simultaneously, the simulated magnetic anomaly data also uses the same spatial resolution and size specifications, generating data of a size of... Magnetic anomaly data blocks (such as 64×64) are used to achieve uniformity in data format and scale, which facilitates the unified training and processing of subsequent network models and the generation of massive magnetic anomaly data.

[0028] S2, construct a generative adversarial network model (StyleGAN2-ADA) based on the Adaptive Discriminator Augmentation (ADA) mechanism, input the initial small sample dataset into the StyleGAN2-ADA model for adversarial training until the generator can output high-fidelity magnetic anomaly images; like Figure 3 As shown, Figure 3 This invention provides a schematic diagram of the StyleGAN2-ADA network architecture and adaptive enhancement. The StyleGAN2-ADA model includes a generator and a discriminator. The generator is responsible for converting random noise into images that look like real magnetic anomalies. The discriminator acts as a police officer, distinguishing whether the input magnetic anomaly image is real measured data or a fake image created by the generator. An adaptive enhancement module is introduced at the input of the discriminator to perform data augmentation operations on the real and generated images input to the discriminator with a predetermined enhancement probability p, thereby expanding the discriminator's input space. The probability p is dynamically adjusted according to the discriminator's overfitting degree to prevent overfitting of the discriminator under small sample training.

[0029] (1) Generator: The generator (G) adopts a pattern-modulated convolutional network structure. By introducing a mapping network from latent variables to the intermediate latent space, it performs pattern modulation and demodulation processing on the weights of each level of convolutional layer, thereby achieving fine control over the structural and texture features of magnetic anomaly images at different spatial scales. This improves the realism and diversity of the generated magnetic anomaly data in terms of overall morphological continuity and local anomaly boundary representation.

[0030] (2) Discriminator: The discriminator (D) employs a deep convolutional neural network structure based on residual connections. It extracts and discriminates features from the input magnetic anomaly image through multiple residual blocks, effectively improving the network's ability to identify subtle differences between the distribution features of real magnetic anomalies and generated samples. At the same time, it enhances the stability and convergence speed of the model training process.

[0031] (3) Adaptive Enhancement (ADA) mechanism: An adaptive enhancement mechanism is introduced at the input of the discriminator to alleviate the overfitting problem of the discriminator under small sample conditions.

[0032] Specifically, an augmentation probability *p* is defined to control the probability of applying data augmentation operations to the data input to the discriminator. Its initial value is set to 0, and it is dynamically adjusted during training based on the discriminator's judgment results on the training samples. An overfitting heuristic index of the discriminator on the training samples is calculated. When the indicator When the probability p gradually approaches 1, it indicates that the discriminator has developed a significant tendency to overfit the training samples. At this point, the system automatically increases the augmentation probability p, applying data augmentation operations to the magnetic anomaly image input to the discriminator, including but not limited to pixel translation, rotation, scaling, mirroring, and color perturbation (furthermore, non-rigid transformations such as scaling, affine transformations, and transmission can also be included). This increases the apparent diversity of the training samples, suppresses the discriminator's memory behavior, and forces it to focus on the essential features of the image rather than specific details, thereby preventing overfitting. Through this mechanism, even with only a few hundred images, GAN (Generative Adversarial Network) can converge stably without mode collapse.

[0033] Among them, indicators ; This represents the output of the discriminator on real magnetic anomaly samples in the training set. Represents a symbolic function. Used to characterize the degree to which the discriminator remembers the training samples. This is the standard notation for mathematical expectation, and in this context, its actual physical meaning is to find the mean.

[0034] It should be further clarified that the increase in the augmentation probability p is neither strictly proportional nor a simple stepwise increase, but rather a "dynamic iterative adjustment based on a threshold." Specifically, the algorithm sets an overfitting target threshold (usually 0.6). During training, heuristic metrics are calculated on a batch basis. ,if If the value is >0.6 (indicating that the discriminator has begun to overfit the true data), then increase p by a fixed, small step size (e.g., p = p + Δp). If the value is less than 0.6 (indicating no overfitting), then p is decreased by the same step size (e.g., p = p − Δp). This control logic is similar to that of an integral controller in engineering.

[0035] Through the aforementioned adaptive adjustment mechanism, the training stability of the generative adversarial network can still be effectively maintained even with only a few hundred magnetic anomaly samples. This allows the generator to continuously learn the statistical distribution characteristics of real magnetic anomaly data, avoid pattern collapse, and generate simulated magnetic anomaly data with physical rationality and structural consistency.

[0036] The adaptive enhancement module includes an adaptively enhanced GAN objective function: ; in, This represents the total value function of the generative adversarial network, and the training objective is to minimize it. And maximize ; This represents a generator, with random noise as input. The output is the generated image; This represents a discriminator, whose output is the probability that the input image is real. Indicates data from actual test datasets Real magnetic anomaly data; This represents a predefined random noise distribution (such as a standard normal distribution). Indicates that it follows a normal distribution The latent space vector (i.e., the random noise vector); This refers to a differentiable enhancement operator, which involves performing a series of data enhancements on an image (such as rotation, translation, and color dithering). This indicates the enhancement probability, controlling the intensity of the transformation applied to the image; This indicates that the mean of a sample drawn from the actual measured dataset is calculated. This indicates that the mean of a randomly generated noise sample is calculated.

[0037] The generator is trained using an initial small sample dataset until it can generate high-fidelity magnetic anomaly images with realistic textures. "High fidelity" here can be reflected in objective metrics, such as calculating the FID (Fréchet Inception Distance) between the generated magnetic anomaly image and the feature distribution of the real data. Training stops when the FID value is less than a preset threshold (e.g., FID < 30), or when the loss curves of the generator and discriminator tend to stabilize and oscillate (within a preset range).

[0038] S3 uses a trained generator to generate a large-scale magnetic anomaly augmentation dataset, and generates corresponding boundary label maps by jointly constraining the tilt angle and the total horizontal derivative, forming a large-scale labeled dataset. The dataset is divided into training set, validation set and test set. This invention uses physical operators to fuse calculations and generate pseudo-labels. For example... Figure 4 As shown, Figure 4 A flowchart illustrating the process of generating pseudo-labels for physical operator fusion, including: S31, Generation of large-scale magnetic anomaly augmentation dataset: Using the trained StyleGAN2-ADA generator, 5000 magnetic anomaly images were generated. These images have complex backgrounds and superimposed anomalies that are extremely similar to the measured data, and do not contain high-frequency measurement noise.

[0039] S32, Physical operator fusion tag generation: S321, for each generated magnetic anomaly image Calculate the normalized plot of total horizontal derivative (THD) and the zero-value plot of tilt angle (Tilt Angle) respectively; The formula for calculating the total horizontal derivative (THD) for each pixel is as follows: ; in, Representing coordinates The total horizontal derivative at that point; , Indicates magnetic anomaly The first-order partial derivatives in the x and y directions.

[0040] The formula for calculating the tilt angle (Tilt Angle) per pixel is: ; in, This represents the tilt angle, with a value range of (-π / 2, π / 2); Indicates magnetic anomaly The vertical (i.e., z-direction) first-order partial derivative.

[0041] S322, Define fusion rules: A pixel is considered a boundary only if its (normalized) THD value is greater than a preset threshold and its Tilt Angle value is within a preset bandwidth near zero. A value of 1 is assigned to the boundary pixel, and 0 is assigned to the background pixel, generating a binarized boundary label map.

[0042] The formula for this rule is expressed as follows: ; in, This indicates the generated binarized boundary label map in pixels. The value at this location is 1, which represents the boundary, and 0, which represents the background. This represents the total horizontal derivative after normalization (normalization can be achieved through min-max normalization, z-score normalization, etc.). A threshold representing the gradient magnitude is used to remove minor fluctuations caused by noise (it can be set to 1.5 times the mean of the total horizontal derivative image to highlight high-confidence areas where magnetic anomaly gradient changes are significant; further, it can be set to 0.2). This represents the bandwidth threshold of the zero-value line of the tilt angle, used to lock the position of the zero-value line (e.g., it can be 0.05 radians). Indicates the location of the magnetic anomaly image. The corresponding tilt angle value at that location, This represents the normalized total horizontal derivative at that location.

[0043] S323 outputs a binarized boundary label map, which serves as the supervision label for the corresponding generated image.

[0044] Based on the binarized labels of each pixel mentioned above, a binary label image (Label) for the magnetic anomaly boundary is constructed. Each image... Each image has a corresponding binary labeled image, thus forming a "generated image-pseudo-label" pair.

[0045] The above construction method fully utilizes the physical mechanisms in magnetic anomaly interpretation: the zero-value line or near-zero region of the dip angle usually corresponds to the lateral boundary of the underground geological body, while the high-value region of THD reflects the abrupt change characteristics of the magnetic anomaly gradient, which can characterize the confidence and stability of the boundary existence. By jointly constraining the dip angle condition and the total horizontal derivative condition, misjudgment and noise interference caused by a single method can be effectively suppressed.

[0046] Therefore, this step combines the near-zero dip angle with the high THD value to automatically determine the magnetic anomaly boundary, generating a binary boundary label with high physical consistency and spatial continuity. This label, serving as a pseudo-label during the deep learning model training phase, provides high-precision supervision information for the subsequent magnetic anomaly boundary identification network without relying on manual interpretation or expert annotation, significantly reducing manual costs and improving the overall automation and scalability of the method.

[0047] S4. Construct a boundary recognition network based on the U-Net architecture, and input the large-scale labeled dataset into the network for supervised learning pre-training so that the network can learn complex magnetic anomaly morphological features. The boundary recognition network adopts a U-Net architecture, including an encoder, a decoder, and a skip connection. It has one input channel (magnetic anomaly) and one output channel (boundary probability). 5000 pairs obtained using S3 Training is performed. The loss function uses a weighted combination of binary cross-entropy loss (BCE Loss) and Dice loss to address the class imbalance problem between boundary pixels and background pixels.

[0048] The loss function formula is expressed as: ; In the formula, For the total loss, This is the balance coefficient (for example, a value of 0.5).

[0049] The binary cross-entropy loss measures the numerical difference between the predicted and actual values. The formula for binary cross-entropy loss is: ; In the formula, Indicates the first The ground truth label for each magnetic anomaly image sample, when the sample is a real, measured magnetic anomaly image. =1; when the sample is a pseudo-magnetic anomaly image generated by the generator. =0; The model (discriminator) represents the first... The probability value of a magnetic anomaly image sample being predicted as a real image, with a value range of (0,1); This represents the total number of magnetic anomaly image samples input to the discriminator in the current training batch. The Dice loss is used to evaluate the consistency between the predicted and ground truth regions. The formula for the Dice loss is: =1- ; The Dice coefficient is given by the following formula: ; In the formula, This is the overall forecast value. For the overall true value, For the predicted value of a single data point, This represents the actual value of a single data point.

[0050] The optimizer uses Adam with a learning rate of 1×10⁻⁶. -4 .

[0051] S5 uses the measured magnetic anomaly data from S1 and its manually labeled data to fine-tune the pre-trained boundary recognition network (Transfer Learning). The fine-tuning step uses a smaller learning rate (the learning rate is reduced to 1×10). -5 The parameters of the boundary recognition network are updated, and the weights of the first three layers of the encoder are frozen. Only the decoder and output layer are trained to adapt the network to weak noise in the real environment, so as to retain the general texture features learned from the augmented dataset.

[0052] S6 inputs the magnetic anomaly data of the area to be tested into the trained boundary recognition network and outputs the final magnetic anomaly boundary location prediction map.

[0053] The trained boundary recognition network was applied to the validation set data, and the results are as follows: Figure 5 As shown, Figure a is the data model diagram in the validation set, Figure b is the corresponding magnetic anomaly data diagram, and Figure c is the boundary recognition diagram obtained by this invention. The boundary recognition effect diagram of the method provided by this invention on the validation set data shows that the output result not only gives the precise location of the boundary, but also effectively suppresses background interference. Compared with traditional operators and deep learning models without GAN enhancement, the F1 score is improved by about 15%.

[0054] Example 2: Based on the general concept of Embodiment 1, this embodiment provides a small-sample magnetic anomaly data enhancement and boundary recognition system based on StyleGAN2-ADA to implement the above embodiments and preferred embodiments. Details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the system described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0055] The system includes: The data acquisition module is used to create an initial small sample dataset containing both measured data and forward modeling data. The Generative Adversarial Training Module is used to build and train the StyleGAN2-ADA generative adversarial network model based on the adaptive discriminator enhancement mechanism. It generates high-fidelity magnetic anomaly data that meets preset conditions under small sample sizes through the adaptive enhancement mechanism. The automatic label generation module is used to automatically generate corresponding boundary labels by calculating the tilt angle and total horizontal derivative of the generated data and using a physical operator fusion strategy. The boundary recognition training module is used to pre-train the U-Net architecture boundary recognition network based on the generated large-scale labeled dataset and fine-tune it using real test data. The prediction output module is used to receive magnetic anomaly data of the area to be measured and output a prediction map with geological body boundary information.

[0056] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0057] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when it is run.

[0058] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps: S1. Collect a small amount of measured magnetic anomaly data, generate forward modeling data based on the forward modeling formula of magnetic anomaly, and construct an initial small sample dataset after preprocessing. S2, construct a generative adversarial network model StyleGAN2-ADA based on an adaptive discriminator enhancement mechanism. StyleGAN2-ADA includes a generator and a discriminator, and an adaptive enhancement mechanism is introduced at the input of the discriminator. The adaptive enhancement mechanism dynamically adjusts the enhancement probability according to the degree of overfitting of the discriminator, performs data augmentation operations on the real image and the generated image input to the discriminator, and expands the input space of the discriminator. S3, input the initial small sample dataset into the StyleGAN2-ADA model for adversarial training until the generator outputs a high-fidelity magnetic anomaly image; S4. A large-scale magnetic anomaly augmentation dataset is generated using the trained generator, and corresponding boundary label maps are generated by joint constraints of tilt angle and total horizontal derivative, forming a large-scale labeled dataset. The dataset is divided into training set, validation set and test set. S5. Construct a boundary recognition network based on the U-Net architecture, and input the large-scale labeled dataset into the boundary recognition network for supervised learning pre-training; S6, Fine-tune the pre-trained boundary recognition network using the measured magnetic anomaly data and its manually labeled data; S7. After the model training is completed, the trained boundary recognition network is used to perform boundary recognition. Based on the magnetic anomaly data of the input test area, the model outputs the corresponding magnetic anomaly boundary location prediction map.

[0059] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0060] Embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0061] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0062] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0063] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0064] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0065] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0066] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0067] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0068] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for small-sample magnetic anomaly data augmentation and boundary identification based on StyleGAN2-ADA, characterized in that, include: Collect measured magnetic anomaly data smaller than the preset size, generate forward modeling data based on the forward modeling formula of magnetic anomaly, and construct an initial small sample dataset after preprocessing; A generative adversarial network model StyleGAN2-ADA based on an adaptive discriminator enhancement mechanism is constructed. StyleGAN2-ADA includes a generator and a discriminator, and an adaptive enhancement mechanism is introduced at the input of the discriminator. The adaptive enhancement mechanism dynamically adjusts the enhancement probability according to the degree of overfitting of the discriminator, performs data augmentation operations on the real image and the generated image input to the discriminator, and expands the input space of the discriminator. The initial small sample dataset is input into the StyleGAN2-ADA model for adversarial training until the generator outputs a high-fidelity magnetic anomaly image that meets the preset conditions. A magnetic anomaly augmentation dataset larger than a preset size is generated using a trained generator, and corresponding boundary label maps are generated by jointly constraining the tilt angle and the total horizontal derivative, forming a large-scale labeled dataset. A boundary recognition network based on the U-Net architecture is constructed. The large-scale labeled dataset is input into the boundary recognition network for supervised learning pre-training. The measured magnetic anomaly data and its manually labeled data are used to fine-tune the pre-trained boundary recognition network. After the model is trained, the trained boundary recognition network is used to identify the boundary. Based on the magnetic anomaly data of the input test area, the model outputs the corresponding magnetic anomaly boundary location prediction map.

2. The method for small-sample magnetic anomaly data enhancement and boundary identification based on StyleGAN2-ADA according to claim 1, characterized in that, The forward modeling formula for the magnetic anomaly is: ; In the formula, The calculated magnetic anomaly data; It is the magnetic permeability in vacuum; It is magnetic susceptibility; It is the magnetic field strength of the magnetized medium; , , These are the coordinates of the ground observation point; , , The coordinates of the underground field source location; , , , , , These are the coordinates of the endpoints of the underground cube in the X, Y, and Z directions, respectively. This represents the distance from the ground observation point to the field source.

3. The method for small-sample magnetic anomaly data enhancement and boundary identification based on StyleGAN2-ADA according to claim 1, characterized in that, In the generative adversarial network model, the generator adopts a pattern-modulated convolutional network structure. By introducing a mapping network from latent variables to the intermediate latent space, the weights of each level of convolutional layer are subjected to pattern modulation and demodulation processing. The discriminator employs a deep convolutional neural network structure based on residual connections, which performs step-by-step feature extraction and discrimination on the input magnetic anomaly image through multiple residual blocks. The initial value of the augmentation probability p is set to 0, and it is a heuristic metric for the discriminator's overfitting on the training samples. The value increases as it approaches 1. The overfitting heuristic is used to characterize the discriminator's memorization of training samples. In the formula, This represents the output of the discriminator on real magnetic anomaly samples in the training set. Represents a symbolic function. This indicates that the mean value is being calculated.

4. The method for small-sample magnetic anomaly data enhancement and boundary identification based on StyleGAN2-ADA according to claim 1, characterized in that, The StyleGAN2-ADA model uses an adaptively enhanced GAN objective function, as shown in the following formula: ; In the formula, This represents the total value function of the generative adversarial network; This represents a generator, with random noise as input. The output is the generated image; This represents a discriminator, whose output is the probability that the input image is real. Indicates data from actual test datasets Real magnetic anomaly data; Indicates that it follows a normal distribution A random noise vector; This refers to a differentiable augmentation operator, which is used to perform data augmentation operations on an image. This indicates the enhancement probability, controlling the intensity of the transformation applied to the image; This indicates that the mean of a sample drawn from the actual measured dataset is calculated. This indicates that the mean of a randomly generated noise sample is calculated.

5. The method for small-sample magnetic anomaly data enhancement and boundary identification based on StyleGAN2-ADA according to claim 1, characterized in that, The process of generating a corresponding boundary label map by combining the tilt angle and the total horizontal derivative constraint includes: For each generated magnetic anomaly image, the total horizontal derivative and tilt angle at each pixel are calculated, and the total horizontal derivative of each pixel is normalized. Pixels whose normalized total horizontal derivative is greater than a preset threshold and whose tilt angle is within the preset bandwidth of zero are identified as boundary pixels; otherwise, they are identified as background pixels. Assign a value of 1 to the boundary pixels and a value of 0 to the background pixels to generate a binarized boundary label map, which serves as the supervision label for the corresponding generated image.

6. The method for small-sample magnetic anomaly data enhancement and boundary identification based on StyleGAN2-ADA according to claim 5, characterized in that, The formula for calculating the total horizontal derivative is: ; In the formula, Representing coordinates The total horizontal derivative at that point; , Indicates magnetic anomaly The first-order partial derivatives in the x and y directions.

7. The method for small-sample magnetic anomaly data enhancement and boundary identification based on StyleGAN2-ADA according to claim 5, characterized in that, The formula for calculating the tilt angle is: ; In the formula, Indicates the angle of inclination; Represents the total horizontal derivative; Indicates magnetic anomaly The first-order partial derivative in the z-direction.

8. The method for small-sample magnetic anomaly data enhancement and boundary identification based on StyleGAN2-ADA according to claim 1, characterized in that, The boundary recognition network includes an encoder, a decoder, and skip connections. The input and output channels are set to 1. The loss function is a weighted combination of binary cross-entropy loss and Dice loss. The optimizer is Adam, and the learning rate is set to 1×10⁻⁶. -4 .

9. The method for small-sample magnetic anomaly data enhancement and boundary identification based on StyleGAN2-ADA according to claim 1, characterized in that, During the fine-tuning of the pre-trained boundary recognition network, the learning rate was reduced to 1×10. -5 The weights of the first three layers of the encoder are frozen, and only the decoder and output layer are trained to preserve the general texture features learned from the augmented dataset.

10. A small-sample magnetic anomaly data augmentation and boundary recognition system based on StyleGAN2-ADA, characterized in that, include: The data acquisition module is used to create an initial small sample dataset containing both measured data and forward modeling data. The Generative Adversarial Training Module is used to build and train the StyleGAN2-ADA generative adversarial network model based on the adaptive discriminator enhancement mechanism. It generates high-fidelity magnetic anomaly data that meets preset conditions under small sample sizes through the adaptive enhancement mechanism. The automatic label generation module is used to automatically generate corresponding boundary labels by calculating the tilt angle and total horizontal derivative of the generated data and using a physical operator fusion strategy. The boundary recognition training module is used to pre-train the U-Net architecture boundary recognition network based on the generated large-scale labeled dataset and fine-tune it using real test data. The prediction output module is used to receive magnetic anomaly data of the area to be measured and output a prediction map with geological body boundary information.