An online learning method for detecting magnetic anomalies in ocean noise

By using Transformer denoising network with self-attention mechanism and online learning training technology, the accuracy and real-time problems of marine noise magnetic anomaly detection in complex noise environments are solved, and more efficient and flexible magnetic anomaly detection is achieved.

CN119882077BActive Publication Date: 2025-05-23NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510376563.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-05-23
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

The existing marine noise magnetic anomaly detection methods have poor accuracy in complex noise environments, and are also weak in real-time and dynamic adaptability.

Method used

The Transformer denoising network with self-attention mechanism is used to detect marine noise magnetic anomalies, and the geomagnetic field reconstruction model is dynamically optimized through online learning training.

Benefits of technology

It improves the accuracy of magnetic anomaly detection in complex noise environments, enhances the real-time and dynamic adaptability of detection, and can adapt to the dynamic changes of magnetic noise in marine environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119882077B_ABST
    Figure CN119882077B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for detecting magnetic anomalies by online learning of ocean noise, which relates to the field of signal processing technology and includes the following steps: constructing a Transformer denoising network with a self-attention mechanism; training the Transformer denoising network; testing the geomagnetic field reconstruction model and determining the detection threshold according to the reconstruction error; collecting measured ocean magnetic field data for magnetic anomaly detection; using the measured ocean magnetic field data to perform online learning training on the geomagnetic field reconstruction model; and repeating the steps of testing to online learning training. The present application improves the accuracy of magnetic anomaly detection in complex noise environments by training a Transformer denoising network with a self-attention mechanism and performing magnetic anomaly detection according to the reconstruction error; and improves the real-time and dynamic adaptability of magnetic anomaly detection by introducing online learning training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of signal processing technology, and in particular to a method for detecting magnetic anomalies by online learning of ocean noise. Background Art

[0002] Magnetic anomaly signals refer to magnetic field signals with abnormal characteristics compared to the geomagnetic field, usually caused by magnetic materials of target objects (such as submarines, ships, mineral deposits, etc.). These anomalies will show different changes in magnetic field strength or direction in the background geomagnetic field, which can be used as a basis for detecting and identifying targets. The advantage of using magnetic anomalies for target detection is that magnetic field signals can penetrate water and are not affected by conditions such as light and weather, and are suitable for all-weather detection of marine targets. In addition, magnetic anomaly signals are highly sensitive to magnetic metal targets and can detect the presence and spatial location information of targets. However, magnetic anomaly detection is seriously interfered by ocean noise. Noise may come from natural fluctuations in the geomagnetic field, electronic equipment in the surrounding environment, etc. In the ocean, the characteristics of these noises will fluctuate with changes in position, time and environment, which brings challenges to target magnetic anomaly detection. Therefore, it is necessary to study the detection method of marine noise magnetic anomaly.

[0003] The existing magnetic anomaly detection methods can be mainly divided into four categories. The first is the magnetic anomaly detection method based on filtering. The filtering method aims to eliminate the noise component of a specific frequency band in the geomagnetic field while retaining the energy of the target signal frequency band. For example, bandpass filters and wavelet transforms can extract magnetic anomaly signals within a specific frequency range to detect potential targets from a noisy background. The filtering method is simple and efficient, but has poor adaptability to strong noise and complex backgrounds. The second is the magnetic anomaly detection method based on statistical analysis. This type of method uses statistical features to identify abnormal signals, and common methods include mean and variance analysis. In addition, methods such as chi-square detection and power spectrum analysis are also used to evaluate the statistical characteristics of signals. Statistical analysis methods are suitable for environments with relatively stable background noise characteristics, but they are often limited in complex environments. The third is the magnetic anomaly detection method based on machine learning. With the increase in data volume and the improvement of computing power, machine learning methods are widely used in magnetic anomaly detection, including support vector machines, random forests, convolutional neural networks, etc. These methods can automatically extract signal recognition features and perform more accurate target detection. They are suitable for scenes with complex noise and weak signals, but the training process relies on a large amount of labeled data. Fourth, the magnetic anomaly detection method based on deep learning. Deep learning can further improve the ability of magnetic anomaly detection, especially in dealing with complex noise backgrounds. Methods such as deep neural networks, autoencoders and generative adversarial networks can capture tiny abnormal signals. However, deep learning methods have high requirements for computing resources and are easily affected by dynamic time-varying noise interference, especially when there is a lack of sufficient data samples.

[0004] In summary, among the existing methods for detecting magnetic anomalies in ocean noise, filtering and statistical analysis methods screen signals through preset frequency bands or statistical characteristics, but have poor adaptability to complex noise environments, and thus the accuracy of magnetic anomaly detection in complex noise environments is poor; machine learning and deep learning methods extract features through model training and are suitable for more complex detection tasks, but have weak adaptability to new noise environments, and thus the real-time and dynamic adaptability of magnetic anomaly detection are poor; in addition, the recently emerged sparse representation method performs magnetic anomaly detection under the assumption of signal sparsity, but the real-time and dynamic adaptability of its model are also insufficient. Summary of the invention

[0005] The present application provides an ocean noise online learning magnetic anomaly detection method to solve the problems of poor accuracy of magnetic anomaly detection in complex noise environments, poor real-time performance and dynamic adaptability of magnetic anomaly detection in existing ocean noise magnetic anomaly detection technologies.

[0006] On the one hand, the present application provides a method for detecting magnetic anomalies by online learning of ocean noise, comprising the following steps:

[0007] Step 1: Build a Transformer denoising network with self-attention mechanism.

[0008] Step 2: Use the ocean noise magnetic field data training set to train the Transformer denoising network to obtain a geomagnetic field reconstruction model; the ocean noise magnetic field data training set includes pure ocean noise magnetic field data.

[0009] Step three, using a test data set to test the geomagnetic field reconstruction model, and determining a detection threshold based on the reconstruction error of the test data set; the test data set includes superimposed noise magnetic anomaly data and pure ocean noise magnetic field data.

[0010] Step 4: collect measured ocean magnetic field data, and perform magnetic anomaly detection on the measured ocean magnetic field data based on the geomagnetic field reconstruction model and the detection threshold.

[0011] Step 5: If the detection result of the measured ocean magnetic field data is pure noise data, the measured ocean magnetic field data is used to perform online learning and training on the geomagnetic field reconstruction model.

[0012] Step six, repeating steps three to five to achieve dynamic optimization and update of the geomagnetic field reconstruction model.

[0013] In a possible implementation, in step one, the Transformer denoising network includes: an input dimension conversion layer, an input linear transformation layer, a position encoding layer, a Transformer encoder layer, a Transformer decoder layer, and an output linear transformation layer.

[0014] The input dimension conversion layer is used to perform dimension conversion processing on the input data.

[0015] The input linear transformation layer is used to perform linear transformation processing on the data output by the input dimension conversion layer.

[0016] The position encoding layer is used to supplement the position encoding of the data output by the input linear transformation layer.

[0017] The Transformer encoder layer is used to process the data output by the position encoding layer; the Transformer encoder layer has a plurality of encoder sublayers, each of which includes a self-attention mechanism and a feedforward neural network.

[0018] The Transformer decoder layer is used to process the data output by the Transformer encoder layer; the Transformer decoder layer includes a cross-attention mechanism and a self-attention mechanism.

[0019] The output linear transformation layer is used to perform linear transformation on the data output by the Transformer decoder layer, and output reconstructed denoised data.

[0020] In a possible implementation, in step 2, the loss function of the Transformer denoising network adopts a mean square error loss function.

[0021] In a possible implementation, in step 2, the optimizer of the Transformer denoising network adopts the Adam optimizer.

[0022] In a possible implementation, in step three, a detection threshold is determined using a constant false alarm rate method based on statistical characteristics of a reconstruction error of a test data set.

[0023] In one possible implementation, in step four, the measured ocean magnetic field data is input into the geomagnetic field reconstruction model to obtain the expected value of the measured ocean magnetic field; the reconstruction error between the measured ocean magnetic field data and the expected value of the measured ocean magnetic field is calculated, and if it is greater than the detection threshold, it means that the current measured ocean magnetic field data is magnetic anomaly data, otherwise it is pure noise data.

[0024] In a possible implementation, in step five, the number of measured ocean magnetic field data used in the online learning training is at least one.

[0025] The method for detecting magnetic anomalies by online learning of ocean noise in this application has the following advantages:

[0026] By training the Transformer denoising network with a self-attention mechanism, magnetic anomaly detection is performed based on the reconstruction error, which improves the accuracy of magnetic anomaly detection in complex noise environments. By introducing online learning training, the model can be continuously updated and optimized with the arrival of new data, which improves the real-time and dynamic adaptability of magnetic anomaly detection and can continuously adapt to the dynamic changes of magnetic noise in the marine environment.

[0027] The proposed Transformer denoising network includes: input dimension conversion layer, input linear transformation layer, position encoding layer, Transformer encoder layer, Transformer decoder layer, and output linear transformation layer. It adopts self-supervised learning and does not need to label the ocean noise magnetic field data training set, which significantly reduces the cost of acquiring training data and the labeling cost, and can make full use of massive cheap noise data to improve anomaly detection performance.

[0028] Through the self-attention mechanism of the Transformer denoising network, the long-term temporal distribution characteristics of ocean magnetic noise can be captured, and the distribution characteristics of background noise can be accurately modeled, breaking away from the dependence on traditional noise modeling methods such as filtering and statistical analysis, making the method of this application more robust when dealing with complex and changeable background noise.

[0029] By using the constant false alarm rate method to determine the detection threshold based on the statistical characteristics of the reconstruction error of the test data set, a lower false alarm rate and a higher detection accuracy rate are achieved. Through the efficient modeling and learning of ocean magnetic noise by the Transformer denoising network, it is possible to more accurately distinguish between noise and target signals, greatly reducing the false alarm rate in the detection process. In terms of target detection, due to the good learning ability of the Transformer denoising network for complex noise characteristics, the detection performance of target signals has been significantly improved. Compared with existing methods, the method of the present application shows qualitative performance improvements in low signal-to-noise ratio environments, providing a more reliable and efficient solution for target magnetic anomaly signal detection.

[0030] By using measured ocean magnetic field data to conduct online learning and training of the geomagnetic field reconstruction model and dynamically optimizing and updating the geomagnetic field reconstruction model, the method of the present application has the ability to update and expand in real time, and can analyze and process large-scale time series data in real time in practical applications, ensuring real-time monitoring and accurate detection of magnetic anomaly signals of ocean targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 A schematic diagram of a flow chart of a method for detecting magnetic anomalies by online learning of ocean noise provided in an embodiment of the present application;

[0033] Figure 2 A schematic diagram of the structure of the Transformer denoising network provided in an embodiment of the present application;

[0034] Figure 3 A time domain waveform diagram of superimposed noise magnetic anomaly data collected during a certain period of time provided in an embodiment of the present application;

[0035] Figure 4 A time domain waveform diagram of superimposed noise magnetic anomaly data collected in another period of time provided in an embodiment of the present application;

[0036] Figure 5 This is a denoising and reconstruction result diagram of the measured pure ocean noise magnetic field data provided in the embodiment of the present application;

[0037] Figure 6 This is a denoising and reconstruction result diagram of the measured superimposed noise magnetic anomaly data provided in the embodiment of the present application;

[0038] Figure 7 A time domain waveform diagram of a certain section of superimposed noise magnetic anomaly data provided in an embodiment of the present application;

[0039] Figure 8 The orthogonal basis function method provided in the embodiment of the present application is Figure 7 The detection result diagram of superimposed noise magnetic anomaly data;

[0040] Fig. 9 A time domain waveform diagram of a section of pure ocean noise magnetic field data provided in an embodiment of the present application;

[0041] Fig.10 The minimum entropy detector method provided in the embodiment of the present application is Fig. 9 Detection result diagram of pure ocean noise magnetic field data;

[0042] Fig.11 A loss curve diagram for online learning training provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0044] like Figure 1 As shown, the embodiment of the present application provides a method for detecting magnetic anomalies by online learning of ocean noise, comprising the following steps:

[0045] Step 1: Build a Transformer denoising network with self-attention mechanism.

[0046] Step 2: Use the ocean noise magnetic field data training set to train the Transformer denoising network to obtain a geomagnetic field reconstruction model; the ocean noise magnetic field data training set includes pure ocean noise magnetic field data.

[0047] Step three, using a test data set to test the geomagnetic field reconstruction model, and determining a detection threshold based on the reconstruction error of the test data set; the test data set includes superimposed noise magnetic anomaly data and pure ocean noise magnetic field data.

[0048] Step 4: collect measured ocean magnetic field data, and perform magnetic anomaly detection on the measured ocean magnetic field data based on the geomagnetic field reconstruction model and the detection threshold.

[0049] Step 5: If the detection result of the measured ocean magnetic field data is pure noise data, the measured ocean magnetic field data is used to perform online learning and training on the geomagnetic field reconstruction model.

[0050] Step six, repeating steps three to five to achieve dynamic optimization and update of the geomagnetic field reconstruction model.

[0051] like Figure 2 As shown, exemplarily, in step one, the Transformer denoising network includes: an input dimensionality conversion layer, an input linear transformation layer, a position encoding layer, a Transformer encoder layer, a Transformer decoder layer, and an output linear transformation layer.

[0052] The input dimension conversion layer is used to perform dimension conversion processing on the input data.

[0053] The input linear transformation layer is used to perform linear transformation processing on the data output by the input dimension conversion layer.

[0054] The position encoding layer is used to supplement the position encoding of the data output by the input linear transformation layer.

[0055] The Transformer encoder layer is used to process the data output by the position encoding layer; the Transformer encoder layer has a plurality of encoder sublayers, each of which includes a self-attention mechanism and a feedforward neural network.

[0056] The Transformer decoder layer is used to process the data output by the Transformer encoder layer; the Transformer decoder layer includes a cross-attention mechanism and a self-attention mechanism.

[0057] The output linear transformation layer is used to perform linear transformation on the data output by the Transformer decoder layer, and output reconstructed denoised data.

[0058] Specifically, in this implementation, the input dimension conversion layer performs dimension conversion processing on the input data. Assume that the input data is pure ocean noise magnetic field data , where T is the sequence length, is the i-th data point, and the feature dimension of each data point is 1. In order to adapt the input data to the Transformer denoising network, the input data is expanded and its dimension is converted from (25, 200) to (25, 200, 1), where 25 represents the batch training data size and 200 represents the sequence length. The last dimension is added to make it meet the input requirements of the Transformer denoising network. For single-channel signals, the input dimension conversion layer will ensure that each data point can be passed to the Transformer denoising network as a feature without losing the detailed information of the input data.

[0059] Specifically, in this implementation, the input linear transformation layer performs linear transformation processing on the data output by the input dimension conversion layer. After converting the data output by the input dimension conversion layer to a high-dimensional space, it can better represent the complex patterns in the signal and enhance the feature expression ability of the Transformer denoising network. After being projected to a high-dimensional space, the data can provide more spatial structure information, helping the Transformer denoising network to capture more detailed features during the learning process. The input linear transformation layer projects the dimension of the data output by the input dimension conversion layer from 1 to 128 to (25, 200, 128), and obtains the embedded data E, where 128 is the dimension in the Transformer denoising network. The formula for this linear transformation processing is:

[0060] .

[0061] in, is the projection matrix, is the bias term.

[0062] Specifically, in this implementation, the position encoding layer supplements the position encoding of the data output by the input linear transformation layer. In the ocean magnetic field noise data, the order of the time series will also affect the characteristics and prediction results of the signal. The position encoding layer uses the position encoding PE to supplement the data output by the input linear transformation layer, and provides the position information in the sequence data to the Transformer denoising network. The position encoding provides the Transformer denoising network with the order information of the sequence data, helping the Transformer denoising network to correctly consider the dependencies between different positions when calculating attention. The position encoding is a vector with the same length as the input sequence, and the encoding value of each position is initialized and updated by a trainable parameter. Let the position encoding be , then the data output by the position encoding layer for:

[0063] .

[0064] Among them, the size of the position encoding PE is (25, 200, 128).

[0065] Specifically, in this implementation, the Transformer encoder layer processes the data output by the position encoding layer. It is processed through several encoder sublayers, each of which contains a self-attention mechanism and a feedforward neural network. The self-attention mechanism allows each input position to pay attention to the information of other positions during calculation, thereby capturing global dependencies in the input data. This is particularly important for denoising tasks because changes in noisy data may involve multiple time steps rather than relying solely on local information. The calculation formula of the self-attention mechanism is as follows:

[0066] .

[0067] Among them, Q, K and V are query, key and value respectively. is the normalization factor, where is the dimension of the key vector. The activation function normalizes the score into a probability distribution, which is used to represent the weights between different positions. It is calculated by input data and a trainable weight matrix. In the Transformer denoising network, several encoder sublayers are superimposed to enhance the ability to capture long-range dependencies. After multiple self-attention calculations, the data output by the Transformer encoder layer is It can be expressed as:

[0068] .

[0069] The size of is (25, 200, 128), which will be used as the input of the Transformer decoder layer.

[0070] Specifically, in this embodiment, the Transformer decoder layer processes the data output by the Transformer encoder layer. The goal of the Transformer decoder layer is to generate a time series of the same length as the input data. The Transformer decoder layer further processes the input data through cross-attention and self-attention mechanisms, helping the Transformer denoising network to focus on important features in the signal and remove noise through step-by-step reconstruction. The importance of the Transformer decoder layer in this task lies in that it not only relies on the features of the input sequence, but can also refer to the global information extracted by the Transformer encoder layer for more accurate signal recovery. The Transformer decoder layer converts the output of the Transformer encoder layer into As memory, and using the self-attention mechanism and cross-attention mechanism to process the information, the size of the denoised output data D is (25, 200, 128):

[0071] .

[0072] Here, pure ocean noise magnetic field data and the output of the Transformer encoder layer Combine and gradually generate new output sequences .

[0073] Specifically, in this embodiment, the output linear transformation layer performs a linear transformation on the data output by the Transformer decoder layer. The final output of the Transformer denoising network is restored to a form consistent with the initial input signal through linear transformation, so that the Transformer denoising network can make predictions in the dimension of the original data. The function of the output linear transformation layer is to restore the denoised signal to the original space, thereby preparing for the subsequent reconstruction error calculation. The output D of the Transformer encoder layer is mapped back to the original input dimension 1 after the following linear transformation, and then the final reconstructed output is obtained. The size of is (25, 200, 1), which is the denoised data. The formula for this linear transformation is:

[0074] .

[0075] in, and They are the weight matrix and bias term of the output linear transformation layer respectively.

[0076] Exemplarily, in step 2, the loss function of the Transformer denoising network adopts a mean square error loss function.

[0077] Specifically, in this embodiment, when training the Transformer denoising network, the main goal is to enable the network to learn the distribution characteristics of noise by optimizing the loss function, and to make the output close to the geomagnetic field data after removing the ocean environment noise. The core of the training process is to minimize the error between the predicted output and the expected output by gradually adjusting the parameters of the Transformer denoising network.

[0078] The input of the Transformer denoising network is the normalized pure ocean noise magnetic field data, and the output is the expected geomagnetic field data after noise removal. In order to measure the quality of the prediction effect, this embodiment uses the mean square error loss function as the loss function of the Transformer denoising network.

[0079] In this embodiment, during the training process of the Transformer denoising network, the learning goal is to minimize the following mean square error loss function:

[0080] .

[0081] in, is the prediction result of the Transformer denoising network. outputs, is the i-th element of the expected geomagnetic field data, and n is the number of elements in each sample. The mean square error loss function measures the difference between the predicted value and the expected value of the Transformer denoising network. During the learning optimization process, the network parameters will be adjusted to minimize this loss.

[0082] Exemplarily, in step 2, the optimizer of the Transformer denoising network adopts the Adam optimizer.

[0083] Specifically, the Adam optimizer combines the advantages of momentum and adaptive learning rate, and can dynamically adjust the update step size of each parameter during training, thereby accelerating convergence and reducing the impact of local minima. First, for the designed loss function , calculated relative to the network parameters Gradient Perform an exponentially weighted average on the first-order moment of the gradient to get the momentum estimate of the current gradient :

[0084] .

[0085] in, is the attenuation factor of the first-order moment, which is set to 0.9 in this embodiment. The square of the gradient is exponentially weighted averaged to obtain the second-order moment estimate :

[0086] .

[0087] in, is the attenuation factor of the second-order moment, which is set to 0.999 in this embodiment. and In the initial stage, it will be biased towards zero, and the deviation correction needs to be performed as follows:

[0088] .

[0089] The estimated values ​​of the first and second moments are then used to update the parameters of the network:

[0090] .

[0091] in, is the learning rate, is a very small constant (set to ), which is used to prevent the denominator from being zero.

[0092] In this example, the learning rate is set for the optimizer during training. , which controls the step size of each parameter update, using the mean square error loss function To measure the error between the network output and the expected output. At the same time, the Adam optimizer is used to dynamically adjust the learning rate of parameter updates to improve the efficiency of the training process. In each round of training, the loss function is calculated and the parameters of the Transformer denoising network are updated until the loss function value reaches the expected convergence level.

[0093] Through repeated training and parameter updates, the Transformer denoising network gradually learned to remove irrelevant noise components from pure ocean noise magnetic field data and accurately restore the expected geomagnetic field data. As the training process progresses, the prediction error of the Transformer denoising network will gradually decrease, and the parameters of the Transformer denoising network will approach the optimal solution more and more accurately. Ultimately, the Transformer denoising network can accurately predict the geomagnetic field data after removing environmental noise. Through continuous gradient transfer and parameter updates, the loss function of the Transformer denoising network is minimized, thereby optimizing and improving the performance and obtaining a geomagnetic field reconstruction model.

[0094] Exemplarily, in step three, the detection threshold is determined using a constant false alarm rate method based on the statistical characteristics of the reconstruction error of the test data set.

[0095] Specifically, since the training set of ocean noise magnetic field data consisting of pure ocean noise magnetic field data is used in the training process of the Transformer denoising network, the Transformer denoising network learns the distribution characteristics and dependencies of pure ocean noise magnetic field data, but does not learn the distribution characteristics of superimposed noise magnetic anomaly data. Therefore, when the test data set is used to test the geomagnetic field reconstruction model, for the input pure ocean noise magnetic field data, the geomagnetic field reconstruction model can accurately remove the noise and restore the geomagnetic field data, but for the input superimposed noise magnetic anomaly data, the geomagnetic field reconstruction model is difficult to denoise and restore the geomagnetic field, resulting in a relatively large corresponding reconstruction error. The reconstruction error of the geomagnetic field reconstruction model is calculated to quantify the difference between the predicted output and the expected output, and the mean square error is used as a standard to measure the reconstruction error.

[0096] After calculating the reconstruction error of all samples, the denoising effect of the geomagnetic field reconstruction model on different input samples can be quantified. Since the geomagnetic field reconstruction model aims to learn the characteristics of pure ocean noise magnetic field data, but does not learn the characteristics of superimposed noise magnetic anomaly data, its reconstruction error will be significantly greater than the reconstruction error of pure ocean noise magnetic field data when superimposed noise magnetic anomaly data is input. Therefore, by setting an appropriate decision threshold, superimposed noise magnetic anomaly data and pure ocean noise magnetic field data can be well distinguished.

[0097] In this embodiment, the superimposed noise magnetic anomaly data and the pure ocean noise magnetic field data in the test data set are sequentially input into the geomagnetic field reconstruction model. Correspondingly, each test sample in the test data set obtains a reconstruction error. According to the statistical characteristics of the reconstruction error of the test data set, the optimal detection threshold can be determined by the following formula: :

[0098] .

[0099] in, and are the mean and standard deviation of the reconstruction error of the test data set, respectively, and k is a constant adjusted by the false alarm rate and detection requirements.

[0100] By setting an appropriate false alarm rate value (i.e., constant false alarm rate method), it can be ensured that the geomagnetic field reconstruction model can accurately detect the superimposed noise magnetic anomaly data at a reasonable false alarm rate. In order to quickly and accurately find the optimal threshold This embodiment uses a binary search method to perform effective threshold search. This method can quickly converge to the optimal detection threshold by gradually narrowing the search range.

[0101] Exemplarily, in step four, the measured ocean magnetic field data is input into the geomagnetic field reconstruction model to obtain the expected value of the measured ocean magnetic field; the reconstruction error between the measured ocean magnetic field data and the expected value of the measured ocean magnetic field is calculated, and if it is greater than the detection threshold, it means that the current measured ocean magnetic field data is magnetic anomaly data, otherwise it is pure noise data.

[0102] Specifically, after determining the optimal detection threshold After that, the measured ocean magnetic field data can be used to determine whether magnetic anomalies exist. The size of is (200, 1), and the expected value of the measured ocean magnetic field is calculated. The reconstruction error between as follows:

[0103] .

[0104] if Greater than the set detection threshold , then the current measured ocean magnetic field data is judged to be magnetic anomaly data, otherwise it is pure noise data.

[0105] Exemplarily, in step five, the number of measured ocean magnetic field data used in the online learning training is at least one.

[0106] Specifically, with the continuous collection of measured ocean magnetic field data, in order to adapt to the changing trend of noise distribution, it is necessary to dynamically update the parameters of the geomagnetic field reconstruction model to adapt to the complex and changeable external magnetic field environment. (pure noise data and at least one), the following two steps need to be performed: the first step is to reconstruct the model based on the current version of the geomagnetic field The newly collected measured ocean magnetic field data are judged by the detection threshold calculated; the second step is to The parameters are taken as initial values, and incremental learning training (i.e. online learning training) is performed on the newly collected measured ocean magnetic field data to update the network parameters and obtain a new geomagnetic field reconstruction model. .

[0107] Specifically, step 5 obtains a new geomagnetic field reconstruction model Finally, return to step 3 and use the test data set to test the new geomagnetic field reconstruction model. According to the statistical characteristics of the reconstruction error of the test data set, a new detection threshold is determined to ensure the optimal detection performance under a specific false alarm rate constraint.

[0108] Repeat steps three to five to achieve dynamic optimization and update of the geomagnetic field reconstruction model, so that it can continuously adapt to changes in the external environment and efficiently perceive the collected magnetic field data.

[0109] In a possible embodiment, in order to verify the effectiveness of an ocean noise online learning magnetic anomaly detection method of the present application, three marine test data conducted in the waters near Sanya were used for performance verification. The test data includes test results from three different time periods in May, September and November, and the sea area location and the target to be tested are consistent for each test. The ship target parameters used in the test are: ship length 54m, ship width 13.2m, tonnage 1200 tons, draft 2.8m. During the test, the ship passed through the bottom fluxgate sensor at different positive and horizontal distances to collect magnetic anomaly signals (corresponding to superimposed noise magnetic anomaly data), and also collected a large amount of marine environmental magnetic noise data in target-free time periods (corresponding to pure ocean noise magnetic field data). Although each test was carried out at a different time, and the geomagnetic field and marine environmental magnetic noise also changed significantly, the sea area location and the ship target to be tested of the three tests were consistent, ensuring the overall comparability and consistency of the data obtained. Figure 3 and Figure 4 Shown is the time domain waveform of superimposed noise magnetic anomaly data collected at different time periods.

[0110] Based on the data collected in the above experiment, this application constructs an ocean magnetic detection dataset, which contains real magnetic noise data (corresponding to pure ocean noise magnetic field data) for training the Transformer denoising network, and real ship target data (corresponding to superimposed noise magnetic anomaly data) for verifying the target magnetic anomaly detection performance. Specifically, the collected real magnetic noise data is used to train the Transformer denoising network in a self-supervised learning manner, and the real ship target magnetic anomaly data is used to verify the detection performance based on the reconstruction loss and threshold segmentation algorithm. The different types of samples and their quantities in the dataset constructed by this application are shown in Table 1. The hardware and software platforms used in the experiment are: Intel i7-13750H CPU, 16GB DDR5 4800 MHz RAM, and the Transformer network model is built based on the PyTorch 2.0.1 framework. The core network learning architecture used in the model designed in this application is Transformer, which can simultaneously adapt to the denoising and abnormal signal detection tasks of ocean magnetic data.

[0111] Table 1 Composition of the ocean magnetic detection dataset constructed in this application

[0112]

[0113] Specifically, the magnetic anomaly detection performance evaluation criteria include: detection rate, false alarm rate, accuracy, and average running time of the detection algorithm.

[0114] Detection rate is defined as follows:

[0115] .

[0116] in, is the number of target samples judged as target samples, is the total number of target samples.

[0117] False alarm rate is defined as follows:

[0118] .

[0119] in, is the number of noise samples judged as target samples, is the total number of noise samples.

[0120] Accuracy is defined as follows:

[0121] .

[0122] in, is the number of correctly classified samples, is the total number of samples.

[0123] The average running time t (ms) of the detection algorithm is the difference between the system's internal timer from the time the data sample is input into the computer memory to the time the data classification result is generated. Under the same computing configuration conditions, the shorter the average running time of the detection algorithm, the higher the efficiency of the corresponding detection algorithm.

[0124] In a possible embodiment, all samples in the test data set are compared with an ocean noise online learning magnetic anomaly detection method (denoted as TOL) using OBF (orthogonal basis function method), MED (minimum entropy detector method), DeepMAD (deep magnetic anomaly detection method), SVM (support vector machine method), 1DCNN (one-dimensional convolutional neural network method), IForest (isolation forest method), SR (stochastic resonance method) and the present application's method of detecting anomalies by ocean noise (denoted as TOL), and the detection rate, false alarm rate, accuracy rate and average running time are calculated respectively. The performance index comparison results are shown in Table 2. Typical denoising results are shown in Table 2. Figure 5 and Figure 6 As shown. Among them, Figure 5 This is the denoising and reconstruction result of the measured pure ocean noise magnetic field data. Figure 5The real noise data in is the measured pure ocean noise magnetic field data. Figure 6 This is the denoising and reconstruction result of the measured superimposed noise magnetic anomaly data. Figure 6 The real target signal in is the measured superimposed noise magnetic anomaly data.

[0125] Table 2 Comparison of performance indicators of different magnetic anomaly detection methods on the test data set

[0126]

[0127] It can be seen from Table 2 that the ocean noise online learning magnetic anomaly detection method (TOL) of the present application is better than OBF (orthogonal basis function method), MED (minimum entropy detector method) and various machine learning and deep learning methods proposed in recent years in terms of detection rate, false alarm rate, accuracy and processing time. For example, DeepMAD (deep magnetic anomaly detection method), 1DCNN (one-dimensional convolutional neural network method) and IForest (isolation forest method). Specifically, compared with the traditional OBF (orthogonal basis function method) and MED (minimum entropy detector method), the ocean noise online learning magnetic anomaly detection method (TOL) of the present application not only significantly improves the detection rate (from 84.00% and 86.67% to 100%), but also greatly reduces the false alarm rate (only 5.38%), indicating that it has stronger anti-interference ability under complex ocean background noise.

[0128] Figure 7 It is a time domain waveform diagram of a certain section of superimposed noise magnetic anomaly data. Figure 8 is the OBF (orthogonal basis function method) pair Figure 7 The detection result diagram of superimposed noise magnetic anomaly data; Fig. 9 This is the time domain waveform of a section of pure ocean noise magnetic field data; Fig.10 The MED (minimum entropy detector) method is Fig. 9 The detection results of pure ocean noise magnetic field data are shown in Figure 2. It can be seen that under the influence of real ocean noise, these two methods cannot correctly distinguish the target signal from the background noise. At the same time, compared with deep learning-based detection methods such as DeepMAD and 1DCNN, TOL maintains a faster running time among similar methods (average running time is 5.77 ms) and performs better in accuracy, reaching 94.67%.

[0129] In addition, compared with SR and SVM methods, TOL fully captures the dynamic characteristics of magnetic noise in the marine environment through a self-supervised online learning mechanism, achieving more accurate target anomaly feature identification. The above results verify the robustness and adaptability of TOL in complex noise environments, significantly improving the performance and efficiency of weak magnetic anomaly signal detection, and providing an efficient and reliable solution for marine target magnetic anomaly detection.

[0130] In order to verify the impact of online learning training on detection performance, an ablation analysis experiment was conducted on an ocean noise online learning magnetic anomaly detection method (TOL) of the present application, and the detection rate, false alarm rate, accuracy and average running time indicators were compared with those of the Transformer batch learning method (TBL) on the test data set. TOL is trained by receiving data samples or small batches of data one by one, and updates the network parameters in real time without waiting for all data to be collected. TBL is a traditional training method. After all training data is collected at one time, the network parameters are learned with the entire batch of data. After the training is completed, the model is fixed and used for subsequent predictions. Compared with TBL, TOL can continuously adjust network parameters to adapt to the dynamically changing ocean environment, and fully explore the complex noise statistical distribution laws contained in historical spatiotemporal big data, and has stronger model learning ability and environmental adaptability. The ablation experiment results of an ocean noise online learning magnetic anomaly detection method of the present application on the test data set are shown in Table 3.

[0131] Table 3 Ablation experiment results of an online learning method for detecting magnetic anomalies in ocean noise on the test dataset

[0132]

[0133] By comparing online learning and batch learning through ablation experiments, it can be seen that the overall performance of the online learning method is better than that of batch learning in a dynamic ocean noise environment. Specifically, online learning can adapt to the dynamic changes of ocean magnetic noise in a timely manner by gradually updating the parameters of the geomagnetic field reconstruction model, thereby helping the model to capture weak magnetic anomaly signals more accurately. The experimental results show that compared with batch learning, online learning significantly reduces the false alarm rate of detection, proving its reliability and adaptability in a dynamic noise environment.

[0134] Fig.11 A loss curve diagram for online learning training provided in an embodiment of the present application. Fig.11 The loss curve in can intuitively reflect the model's adaptability to new data and training efficiency. Since online learning is based on incremental updates of the trained model, its initial loss is low and decreases rapidly in the early stages of training, and then stabilizes, indicating that the model effectively learns the features of the new data and maintains its memory of the old data.

[0135] In summary, this application continuously optimizes the parameters of the geomagnetic field reconstruction model through online learning training, which not only enhances the network's adaptability to complex noise scenes, but also significantly improves the detection performance of magnetic anomaly signals. The reduction in false alarm rate further verifies the advantages of online learning in the real-time detection of magnetic targets, and provides a more efficient technical means to solve the problem of ocean magnetic field perception in dynamic environments. The real-time learning characteristics of the method of the present invention are of great significance to promoting the development of marine target detection technology, and are expected to further improve the intelligence level and overall technical indicators of marine equipment.

[0136] The embodiment of the present application trains a Transformer denoising network with a self-attention mechanism and performs magnetic anomaly detection based on reconstruction errors, thereby improving the accuracy of magnetic anomaly detection in complex noise environments; by introducing online learning training, the model can be continuously updated and optimized with the arrival of new data, thereby improving the real-time and dynamic adaptability of magnetic anomaly detection and being able to continuously adapt to the dynamic changes of magnetic noise in the marine environment.

[0137] The proposed Transformer denoising network includes: input dimension conversion layer, input linear transformation layer, position encoding layer, Transformer encoder layer, Transformer decoder layer, and output linear transformation layer. It adopts self-supervised learning and does not need to label the ocean noise magnetic field data training set, which significantly reduces the cost of acquiring training data and the labeling cost, and can make full use of massive cheap noise data to improve anomaly detection performance.

[0138] Through the self-attention mechanism of the Transformer denoising network, the long-term temporal distribution characteristics of ocean magnetic noise can be captured, and the distribution characteristics of background noise can be accurately modeled, breaking away from the dependence on traditional noise modeling methods such as filtering and statistical analysis, making the method of this application more robust when dealing with complex and changeable background noise.

[0139] By using the constant false alarm rate method to determine the detection threshold based on the statistical characteristics of the reconstruction error of the test data set, a lower false alarm rate and a higher detection accuracy rate are achieved. Through the efficient modeling and learning of ocean magnetic noise by the Transformer denoising network, it is possible to more accurately distinguish between noise and target signals, greatly reducing the false alarm rate in the detection process. In terms of target detection, due to the good learning ability of the Transformer denoising network for complex noise characteristics, the detection performance of target signals has been significantly improved. Compared with existing methods, the method of the present application shows qualitative performance improvements in low signal-to-noise ratio environments, providing a more reliable and efficient solution for target magnetic anomaly signal detection.

[0140] By using measured ocean magnetic field data to conduct online learning and training of the geomagnetic field reconstruction model and dynamically optimizing and updating the geomagnetic field reconstruction model, the method of the present application has the ability to update and expand in real time, and can analyze and process large-scale time series data in real time in practical applications, ensuring real-time monitoring and accurate detection of magnetic anomaly signals of ocean targets.

[0141] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0142] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for detecting magnetic anomalies using online learning of ocean noise, characterized in that: The following steps are involved: Step 1: Build a Transformer denoising network with self-attention mechanism; Step 2: using a training set of ocean noise magnetic field data to train the Transformer denoising network to obtain a geomagnetic field reconstruction model; the training set of ocean noise magnetic field data includes pure ocean noise magnetic field data; Step 3, using a test data set to test the geomagnetic field reconstruction model, and determining a detection threshold according to a reconstruction error of the test data set; the test data set includes superimposed noise magnetic anomaly data and pure ocean noise magnetic field data; Step 4: collecting measured ocean magnetic field data, and performing magnetic anomaly detection on the measured ocean magnetic field data based on the geomagnetic field reconstruction model and the detection threshold; Step 5: If the detection result of the measured ocean magnetic field data is pure noise data, the measured ocean magnetic field data is used to perform online learning training on the geomagnetic field reconstruction model; Step six, repeating steps three to five to achieve dynamic optimization and update of the geomagnetic field reconstruction model.

2. The method for detecting magnetic anomalies by online learning of ocean noise according to claim 1, characterized in that: In step 1, the Transformer denoising network includes: an input dimension conversion layer, an input linear transformation layer, a position encoding layer, a Transformer encoder layer, a Transformer decoder layer, and an output linear transformation layer; The input dimension conversion layer is used to perform dimension conversion processing on the input data; The input linear transformation layer is used to perform linear transformation processing on the data output by the input dimension conversion layer; The position coding layer is used to supplement the position coding of the data output by the input linear transformation layer; The Transformer encoder layer is used to process the data output by the position encoding layer; the Transformer encoder layer has a plurality of encoder sublayers, each of which includes a self-attention mechanism and a feedforward neural network; The Transformer decoder layer is used to process the data output by the Transformer encoder layer; the Transformer decoder layer includes a cross-attention mechanism and a self-attention mechanism; The output linear transformation layer is used to perform linear transformation on the data output by the Transformer decoder layer, and output reconstructed denoised data.

3. The method for detecting magnetic anomalies by online learning of ocean noise according to claim 1, characterized in that: In step 2, the loss function of the Transformer denoising network adopts the mean square error loss function.

4. The method for detecting magnetic anomalies by online learning of ocean noise according to claim 1, characterized in that: In step 2, the optimizer of the Transformer denoising network adopts the Adam optimizer.

5. The method for detecting magnetic anomalies by online learning of ocean noise according to claim 1, characterized in that: In step three, the detection threshold is determined by using the constant false alarm rate method based on the statistical characteristics of the reconstruction error of the test data set.

6. The method for detecting magnetic anomalies by online learning of ocean noise according to claim 1, characterized in that: In step four, the measured ocean magnetic field data is input into the geomagnetic field reconstruction model to obtain the expected value of the measured ocean magnetic field; the reconstruction error between the measured ocean magnetic field data and the expected value of the measured ocean magnetic field is calculated. If it is greater than the detection threshold, it means that the current measured ocean magnetic field data is magnetic anomaly data, otherwise it is pure noise data.

7. The method for detecting magnetic anomalies by online learning of ocean noise according to claim 1, characterized in that: In step five, the number of measured ocean magnetic field data used in the online learning training is at least one.

Citation Information

Patent Citations

  • A noise-resistant on-line multi-classification kernel learning algorithm

    CN109359677A

  • Intelligent fault diagnosis and reconstruction method for ship area distribution power system

    CN112733962A