Magnetic detection method for ocean swaying platform based on sequence implicit deep representation learning

By combining global constraint optimization of particle swarm optimization and multi-head self-attention mechanism, the problem of weak model generalization ability in marine magnetic surveys is solved, and high signal-to-noise ratio magnetic anomaly signals can be extracted in complex marine environments, thus improving the real-time performance and accuracy of marine magnetic detection.

CN122860565BActive Publication Date: 2026-11-10NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611372984.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-11-10
Estimated Expiration
2046-09-07

AI Technical Summary

Technical Problem

Existing methods for denoising marine magnetic anomalies suffer from weak model-driven generalization capabilities and insufficient physical constraints and network long-sequence modeling capabilities, making it difficult to rapidly extract magnetic anomaly signals with high signal-to-noise ratios in complex marine environments.

Method used

An error correction method based on global constraint optimization of particle swarm optimization is used to solve and compensate for parameters of noisy magnetic field data sequences. Combined with the swing noise suppression rule, a training paired dataset is constructed, and a physical-inspired temporal denoising network model with multi-head self-attention mechanism is trained to achieve end-to-end denoising of real-time noisy magnetic field data.

Benefits of technology

It significantly improves the generalization ability and real-time performance of marine magnetic detection, effectively captures global dependencies in long-term magnetic field data, overcomes the shortcomings of traditional local filtering methods in eliminating low-frequency oscillation noise, and meets the real-time requirements of marine magnetic detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122860565B_ABST
    Figure CN122860565B_ABST
Patent Text Reader

Abstract

The application discloses a marine swing platform magnetic detection method based on sequence implicit deep representation learning, relates to the field of data processing, and performs pretreatment on original noisy magnetic field data through a global constraint particle swarm optimization algorithm to obtain noise reduction data with physical meaning constraints as true value labels of a deep learning network; a multi-head self-attention mechanism is used to capture long-distance time sequence dependence and extract deep mapping relationship of noise distribution features and magnetic anomaly signals in a complex marine environment; and a trained magnetic field prediction model is used to perform sliding window overlapping reasoning on real-time collected magnetic field data, so that the problems that the existing marine magnetic survey noise reduction method has weak model driving generalization ability, insufficient physical constraints and network long sequence modeling capacity, and that rapid high signal-to-noise ratio extraction of magnetic anomaly signals is difficult to adapt to complex marine environments are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a magnetic detection method for marine oscillating platforms based on sequential implicit deep representation learning. Background Technology

[0002] Objects containing ferromagnetic materials can be magnetized by the effects of permanent magnetism and the Earth's magnetic field, causing distortion of the surrounding geomagnetic field and forming stable magnetic anomaly signals. Marine magnetic detection technology refers to the detection and positioning achieved by capturing magnetic anomaly signals caused by ferromagnetic targets. Because it is unaffected by light, hydrology, and topography, it plays an irreplaceable role in marine monitoring and defense.

[0003] However, in real-world marine environments, especially in magnetic measurement systems based on rocking platforms (such as buoys and ships), the magnetic field signals acquired by sensors are often severely contaminated by complex background noise. This noise includes not only the measurement errors of the sensors themselves, but more importantly, the low-frequency non-stationary interference generated by the platform's rocking motion caused by wave undulation. This type of rocking noise highly overlaps with weak target magnetic anomaly signals, making it difficult to effectively remove it using traditional filtering methods.

[0004] With the rapid development of artificial intelligence, new approaches have been provided for magnetic signal recognition. Some researchers have proposed applying deep learning techniques such as neural networks and long short-term memory networks to the recognition of magnetic signal features. However, due to the uncertain global dependencies in long sequences of ocean magnetic fields and the unique characteristics of low-frequency drift capture, these networks cannot be effectively applied due to limitations in timeliness and training methods. Transformer networks, with their unique self-attention mechanism, offer new possibilities for magnetic measurement. However, data-driven deep learning lacks the constraints of physical laws, and the model is prone to learning spurious noise features during the learning process, leading to denoising results that violate physical principles. Furthermore, obtaining absolutely pure magnetic field signals in real ocean environments as labels for supervised learning is extremely difficult. This results in the network struggling to converge to its optimal state due to a lack of high-quality training targets, often leading to significantly reduced generalization performance in actual deployments.

[0005] In summary, existing methods for denoising marine magnetic anomalies suffer from weak model-driven generalization capabilities and insufficient physical constraints and network long-sequence modeling capabilities, making it difficult to rapidly extract magnetic anomaly signals with high signal-to-noise ratios in complex marine environments. Summary of the Invention

[0006] This application provides a method for magnetic detection of marine oscillating platforms based on sequential implicit deep representation learning, which addresses the problem that existing marine magnetic noise reduction methods suffer from weak model-driven generalization ability, insufficient physical constraints and network long sequence modeling capabilities, resulting in difficulties in rapidly extracting magnetic anomaly signals with high signal-to-noise ratios in complex marine environments.

[0007] This application provides a method for magnetic detection of an ocean oscillating platform based on sequential implicit deep representation learning, comprising: acquiring noisy magnetic field data sequences; performing error parameter solving and compensation on the noisy magnetic field data sequences based on a particle swarm optimization global constraint optimization method; obtaining a corrected magnetic field data sequence by combining oscillation noise suppression rules; aligning the noisy magnetic field data sequences and the corrected magnetic field data sequences using temporal alignment rules to construct a training pair dataset; performing sliding window data segmentation on the standardized training pair dataset based on a fixed window size and step size to obtain multiple fixed-length subsequence samples, and using the multiple subsequence samples as a deep learning training set; training a multi-head self-attention mechanism physically inspired temporal denoising network model using the deep learning training set to obtain a magnetic field prediction model, wherein the multi-head self-attention mechanism physically inspired temporal denoising network model includes an embedding layer, a position encoding layer, a multi-head self-attention encoder layer, and a decoding layer; standardizing the acquired real-time noisy magnetic field data, inputting it into the magnetic field prediction model, and performing sliding window splicing inference prediction to generate magnetic field detection results.

[0008] The beneficial effects of this application are:

[0009] 1. Significantly improved generalization ability: Traditional physical model methods are limited by strict mathematical assumptions and parameter optimization. This application learns the implicit noise distribution and mapping relationship in massive data, which can adapt to unknown swaying noise interference under different sea conditions, thus significantly improving the generalization ability.

[0010] 2. Strong real-time processing capability: The time-consuming iterative optimization process is moved to the offline training stage, and only one forward neural network calculation is required during online inference, which greatly reduces the computational complexity and meets the real-time requirements of marine magnetic detection.

[0011] 3. Superior global feature extraction: By utilizing a multi-head self-attention mechanism, it can effectively capture global dependencies in long-term magnetic field data, overcoming the shortcomings of traditional local filtering methods in eliminating low-frequency oscillation noise. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating the overall implementation scheme provided in this application.

[0014] Figure 2 The diagram shows the structure of the Transformer temporal denoising network provided in the embodiments of this application.

[0015] Figure 3 This is a schematic diagram of the overlapping sliding window inference splicing strategy of this application.

[0016] Figure 4 This is a diagram showing the noise reduction effect of traditional vector correction methods on magnetic field data.

[0017] Figure 5 This is a graph showing the noise reduction effect of the particle swarm optimization method on magnetic field data.

[0018] Figure 6 This is a graph showing the noise reduction effect of the globally constrained particle swarm optimization method on magnetic field data.

[0019] Figure 7 This is a diagram showing the noise reduction effect of the method in this application on magnetic field data. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] Example 1: The core idea of ​​this application is to use the output of the particle swarm optimization algorithm as prior knowledge to construct training labels, and to train the Transformer deep learning network to achieve end-to-end denoising of complex noisy magnetic field data, which significantly improves the generalization ability and real-time performance of data processing.

[0022] The overall technical approach to achieve the purpose of this application is as follows: First, the original noisy magnetic field data is preprocessed using a globally constrained particle swarm optimization algorithm to obtain denoised data with physical constraints as the "ground truth label" for the deep learning network; second, a physically inspired temporal denoising network based on a self-attention mechanism is constructed, using the original noisy data as input and the labeled data as the target for supervised learning, enabling the network to autonomously learn the deep nonlinear mapping features from noisy signals to clean signals; finally, the trained Transformer network is used to perform sliding window overlapping inference on the real-time acquired magnetic field data to achieve high signal-to-noise ratio and strong generalization processing.

[0023] Figure 1A flowchart illustrating the overall implementation scheme provided in this application. This application provides a method for magnetic detection of an ocean swing platform based on sequential implicit deep representation learning, including: Step S100: Collect noisy magnetic field data sequence, perform error parameter solving and compensation on the noisy magnetic field data sequence based on the error correction method of global constraint optimization of particle swarm optimization, and obtain the corrected magnetic field data sequence by combining the swing noise suppression rule.

[0024] Specifically, a triaxial fluxgate sensor installed on an ocean-going rocking platform is used to collect noisy magnetic field data sequences. The Earth's magnetic field is a three-dimensional vector with X, Y, and Z components. A triaxial sensor can simultaneously output the magnetic field strength values ​​in three mutually perpendicular directions.

[0025] The ocean-going oscillating platform continuously sways, pitches, rolls, and rotates with the waves. During this process, the sensors tilt along with the platform, and the measured magnetic field values ​​are interfered with by the platform's attitude, creating attitude noise. In addition, the noise data also includes mechanical noise and electromagnetic interference noise.

[0026] A triaxial sensor can sense all magnetic fields in space and obtain readable values ​​of mixed environmental data such as effective target magnetic field, marine environmental electromagnetic noise, platform mechanical vibration noise, and platform metal magnetization noise. This data, known as noisy magnetic field data sequence, is used as the training basis for subsequent signal separation and noise reduction, as well as for subsequent real-time acquisition and testing data.

[0027] Because the raw data measured by the three-axis fluxgate magnetometer on the marine oscillating platform includes the real geomagnetic field, oscillation noise caused by platform movement, sensor hardware errors, and marine electromagnetic interference, the values ​​are distorted. Moreover, the fluxgate magnetometer itself has inherent errors, such as three-axis orthogonality deviation, calibration coefficient error, zero offset, and magnetization interference coefficient of the metal carrier. These fixed parameters will continuously contaminate the measured values ​​and must be solved.

[0028] Particle swarm optimization (PSO) is a global optimization algorithm that searches for the optimal solution like a swarm of particles. Compared to traditional least squares optimization, it is less prone to getting stuck on local errors and can find a globally constrained set of the most accurate error parameters. Therefore, PSO global constraint optimization can be used to mathematically constrain and optimize the parameters in the error model of noisy magnetic field data sequences. The non-orthogonality error, sensitivity error, and bias error in the magnetic fluxgate are solved and compensated for. Preferably, a complete error equation for the fluxgate is first established, and various errors are written as unknown parameters to be solved. The goal is to find a set of parameters that makes the corrected magnetic field amplitude conform to the actual magnitude of the Earth's magnetic field. All the error parameters to be solved are used as the particle search dimension. Then, global constraints are set to limit the particle search range and avoid meaningless solutions.

[0029] The added global constraints refer to physical rules and limitations, such as the geomagnetic intensity range, the triaxial orthogonality range, and the reasonable threshold for zero bias. A penalty function is introduced to constrain the parameters, ensuring stable geomagnetic field modulus, reasonable platform attitude angles, and magnetic field variation ranges conforming to oceanic geomagnetic laws. This prevents the particles from calculating invalid parameters that violate physical principles, thereby reducing accuracy degradation caused by parameter issues and improving the signal-to-noise ratio of noisy magnetic field data. The particle swarm continuously iterates and searches globally for the optimal set of error parameters.

[0030] During compensation, the error parameters obtained from the solution are substituted into the correction formula, and the original noisy magnetic field sequence is calculated point by point to offset the fixed deviation inherent in the sensor hardware, thus initially eliminating static system errors. The correction formula can be set according to the specific circumstances.

[0031] In addition, a sway noise suppression rule is set up, which is a filtering / attitude compensation rule specifically designed for dynamic noise introduced by wave swaying and platform pitch, roll and rotation. It can eliminate dynamic magnetic field disturbances caused by swaying. It can correct the magnetic field coordinate system according to the platform tilt angle to eliminate attitude projection errors; separate the alternating noise caused by wave swaying through time-series filtering and dynamic threshold rules; and eliminate dynamic interference components introduced by swaying.

[0032] After completing the above steps, a corrected high signal-to-noise ratio magnetic field data sequence can be obtained. This means that static system error compensation and dynamic sway noise suppression are completed simultaneously, resulting in a three-dimensional magnetic field time series with low distortion, low noise, and close conformity to the real geomagnetic field, i.e., a corrected magnetic field data series, which can be used for subsequent magnetic detection and platform attitude calculation.

[0033] Step S200: Align the noisy magnetic field data sequence and the corrected magnetic field data sequence using time alignment rules to construct a training pair dataset.

[0034] In order to move the time-consuming iterative optimization process to the offline training stage, so that only one feedforward neural network calculation is needed during online inference and thus significantly reduce computational complexity, a sufficiently complete training data set and a set of truth-based pure data capable of performing deep implicit relationship analysis need to be constructed in the pre-training process for subsequent network model training.

[0035] At this time, and Alignment is used to construct the "noisy-clean" paired dataset required for deep learning. Previously, the original noisy data and the corrected magnetic field data were two independent time-series streams: hardware sampling delays and algorithm processing time caused time shifts, making it impossible for the data points of the two sequences to correspond one-to-one. If directly paired, the input and ground truth values ​​in the same row would not belong to the same wave swaying moment, rendering the training data completely invalid. Therefore, matching and correction can be performed using timestamps, sampling frequencies, and attitude synchronization signals to ensure a one-to-one correspondence between the original noisy data and the clean corrected data at the same moment.

[0036] Specific alignment rules could include: removing invalid data points with missing frames or abnormal jumps; performing interpolation / truncation operations to ensure uniform length between the two sequences; and precisely matching by timestamp to ensure that each moment has an original noisy 3D magnetic field and a corresponding clean 3D magnetic field. After alignment, grouping and pairing can be performed to form a training pairing dataset.

[0037] Meanwhile, in typical processing, the X-axis magnetic field value might be several hundred nT, while the Z-axis value is only tens of nT. This difference in units can lead to model training imbalance. Therefore, the paired datasets are standardized to limit the magnetic field data to a fixed range above and below the magnetic field size, unify the data numerical scale, and eliminate the numerical differences caused by the physical units of the three-axis magnetic fields (X / Y / Z), thus facilitating model training convergence. In other words, poor-quality data is removed to eliminate the influence of units.

[0038] The unit for the three-axis magnetic field is unified as nT, but the numerical fluctuations of the X, Y, and Z components are different. After standardization, the numerical range of each dimension is consistent, and neural networks and optimization algorithms will not be dominated by the components with large values. Min-Max standardization / Z-score standardization is commonly used to map the three-axis magnetic field components to a unified numerical range, such as [-1,1] and [0,1].

[0039] The standardized training pair dataset eliminates the difference in magnitude between the magnetic field values ​​of different axes, resulting in a clean and standardized training dataset that can be directly used for training subsequent models.

[0040] Step S300: Based on a fixed window size and step size, perform sliding window data segmentation on the standardized training pair dataset to obtain multiple fixed-length sub-sequence samples, and use the multiple sub-sequence samples as the deep learning training set.

[0041] In a preferred embodiment, the standardized training pair dataset is divided into multiple fixed-length subsequence samples using a sliding window based on a fixed window size and stride. These multiple subsequence samples are then used as a deep learning training set, including: Set the sliding window size to a fixed value. The sliding step size is fixed. ; The noisy magnetic field data sequence in the standardized training pair dataset is split into multiple data segments. A training set of subsequence samples of a certain length; The standardized training pair dataset contains a data segmentation method to obtain multiple corrected magnetic field data sequences. Subsequence sample label dataset of length; Wherein, any subsequence sample in the subsequence sample training set and the subsequence sample label dataset has a temporal relationship with the previous subsequence sample. Overlapping sequences; The time-aligned subsequence sample training set and the subsequence sample label dataset are mapped to each other and used as the deep learning training set.

[0042] Specifically, while Transformer theoretically accepts inputs of variable length, it is limited by a maximum length in practical applications. From a computational complexity perspective, Transformer's core self-attention mechanism requires calculating the relationship between each token in the sequence and all other tokens. This means its computational complexity and memory consumption are proportional to the square of the input sequence length. As the sequence length increases, the computational cost rises sharply, making training and inference extremely slow or even impossible. To efficiently perform batch training and inference, deep learning frameworks typically require all input samples within a batch to have the same dimension. Therefore, in practice, a maximum length is pre-set, such as 512 or 1024. During this process, for shorter inputs, special padding markers are used to pad them to the maximum length, and attention masks are used to allow the model to ignore these padding parts; for longer inputs, the portion exceeding the maximum length is truncated, but this may lead to the loss of crucial information.

[0043] Generally, three methods are used to process extremely long inputs. One is to use a sliding window to segment the long text into multiple overlapping segments, input each segment into the model for processing, and then aggregate the results. This method retains more contextual information but increases computational cost. Another method is to use sparse attention, employing improved architectures such as Longformer, where each token only performs attention calculations with tokens within a local window, thus reducing complexity. Reduce to Alternatively, it can be extended through positional encoding, using techniques such as YaRN and LongRoPE to effectively extend the model's positional awareness of longer sequences without retraining.

[0044] Because this application requires constructing a deep training dataset to deeply mine the correlation mapping relationships under complex and changing environments, the prediction results are highly dependent on the context. Therefore, a sliding window partitioning and subsequent integration approach is adopted for processing time-series data. The training and prediction process is performed upfront, minimizing wasted computation time during actual prediction and meeting real-time requirements.

[0045] Specifically, the size of the sliding window is set to a fixed value. The sliding step size is fixed. , 1024 can be preferred. A value of 128 is preferred. A sliding window refers to a fixed time series length for a single input sample; for example, a window of 1024 represents a single sample containing triaxial magnetic field data for 1024 consecutive time periods. The sliding step size is the number of data points the window moves to the right each time; a step size of 1 indicates point-by-point sliding with high sample overlap. In this application, to eliminate splicing jumps between windows and improve prediction continuity, a sliding step size is set to ensure that adjacent windows have a certain distance between them. The overlapping area.

[0046] Furthermore, the noisy magnetic field data sequence in the standardized training pair dataset is divided into multiple data segments based on a fixed window. A training set of subsequence samples of a certain length. The standardized training paired dataset contains the corrected magnetic field data sequences, which are then divided into multiple subsequences based on a fixed window. A subsequence sample label dataset of a certain length is constructed. During training, a continuous time series of a window length is truncated each time. The subsequence of the noisy magnetic field segment is used as the model input, and a ground truth label subsequence of the same length is simultaneously truncated at the corresponding position, i.e., the clean magnetic field segment. The window is shifted to the right by a set step size, and the truncating is repeated to generate a large number of independent subsequence samples. All subsequence samples are collected and divided into training set and validation set to complete the construction of the deep learning dataset.

[0047] In this process, the temporal information was fully explored, the step size was smaller than the window size to generate overlapping samples to expand the data volume, which improved the generalization ability of the model and maintained a one-to-one correspondence between the input and the ground truth labels in time, ensuring that the supervision pairing relationship was not destroyed.

[0048] Step S400: Train the multi-head self-attention mechanism physical-inspired temporal denoising network model using the deep learning training set to obtain a magnetic field prediction model. The multi-head self-attention mechanism physical-inspired temporal denoising network model includes an embedding layer, a position encoding layer, a multi-head self-attention encoder layer, and a decoding layer.

[0049] Specifically, a physically inspired temporal denoising network model with a multi-head self-attention mechanism for noise reduction is constructed based on the Transformer model framework. This model is then pre-trained and adjusted using subsequences containing both noisy and ground truth data to generate a magnetic field prediction model for extracting the deep mapping relationship between noise distribution characteristics and magnetic anomaly signals in complex marine environments in real time.

[0050] The standard Transformer model framework consists of two stacked modules: an encoder module and a decoder module. The encoder is responsible for understanding the input sequence; it is composed of... L The encoder layer consists of stacked identical layers that transform the input sequence into a series of consecutive context vector representations; the decoder is responsible for generating the output sequence, which is also composed of... L The system uses stacked identical layers, but incorporates a masking mechanism in the self-attention layer to ensure that when generating the t-th token, only the first t-1 tokens are seen, preventing information leakage. The attention mechanism has three main vectors: query Q, index K, and feature V.

[0051] Combination Figure 2 To understand the physical-inspired temporal denoising network model with multi-head self-attention mechanism, Figure 2 The left side of the image shows the encoder module, and the right side shows the decoder module. The encoder module can completely read the entire input timing sequence, extract contextual features bidirectionally and globally, and output global memory features to the decoder. Figure 2 The encoder module in the middle is composed of L The encoder consists of stacked layers. After the data is input, features are extracted. The entire encoder module eventually outputs a global deep feature matrix, which is then used as the K and V inputs for the cross-attention of the decoder module on the right.

[0052] The decoder module also contains L The encoder layer, composed of stacked layers, is used to generate the corrected target time series, i.e., the clean magnetic field sequence, segment by segment, as the result of magnetic field detection. The embedding layer within the decoder module embeds the ground truth target data sequence, used to update network weights during supervised training. The encoder layer is superimposed with specific data location encodings and a time mask. The time mask ensures that only previously generated time points are read at the current moment, preventing the model from prematurely obtaining subsequent ground truth values. When outputting the corrected result, the decoder layer, also known as a linear layer, maps the decoder feature vectors to the data dimension. Finally, the predicted distribution of the magnetic field components at each time moment is output, which is the denoised output.

[0053] The physical-inspired temporal denoising network model for multi-head self-attention mechanism can also be explained in detail from the perspective of network structure.

[0054] In a preferred embodiment, the embedding layer execution steps of the multi-head self-attention mechanism physically inspired temporal denoising network model include: The noisy subsequence samples segmented by the sliding window are linearly mapped to a high-dimensional hidden feature space, and the embedding matrix is ​​output. The topology mapping formula is: ; Among them, the noisy subsequence samples are , Let L be the entire noisy magnetic field data sequence, and L be the sequence length. To embed the weight matrix, For bias vectors, Hides dimensions in the model and outputs an embedding matrix. .

[0055] Specifically, let the subsequence samples extracted by the sliding window be... Since the original magnetic field data is a one-dimensional scalar, it cannot be directly input into the attention mechanism network model. Therefore, it needs to be projected to a high-dimensional hidden feature space through linear mapping. The topological mapping formula can be used to expand the dimension of the one-dimensional scalar data to obtain a high-dimensional embedding matrix, laying the foundation for the analysis of deep relationships.

[0056] In a preferred embodiment, the position encoding layer execution steps of the multi-head self-attention mechanism physically inspired temporal denoising network model include: Sine-cosine position coding is used to inject absolute position information into the embedding matrix to obtain the position coding matrix. ; The sine-cosine position coding formula is: ; ; Among them, location Dimension index Position encoding matrix ; The location encoding matrix is ​​added element by element to the embedding matrix to output a feature matrix with location information.

[0057] Preferably, the self-attention mechanism denoising network model possesses permutation invariance but lacks the ability to perceive temporal order. That is, shuffling and rearranging the order of a set of input samples does not affect the model's output; it is unaffected by the order of the input elements. Therefore, to preserve the temporal prior of the magnetic field time series, sine-cosine position coding is needed to inject absolute position information. Specifically, the position coding matrix is ​​calculated using the sine-cosine position coding formula. Then, the position coding matrix is ​​element-wise added to the embedding matrix to obtain the input feature matrix with positional information. , .

[0058] In a preferred embodiment, the multi-head self-attention encoder layer includes L The encoder layers are stacked, wherein each layer includes a multi-head self-attention sub-layer and a feedforward network sub-layer connected in sequence, and a splicing regularization layer is interspersed after each multi-head self-attention sub-layer and feedforward network sub-layer. After the feature matrix is ​​input into the multi-head self-attention encoder layer to extract deep features, a deep feature matrix is ​​obtained.

[0059] Ignoring the masking mechanism already described above, the encoder layer in both the encoder and decoder modules can be collectively referred to as the multi-head self-attention encoder layer.

[0060] Specifically, deep feature analysis is performed on the input feature matrix; this step is crucial for subsequent output results. In the multi-head self-attention sub-layer, the attention mechanism calculates the query matrix. AND key matrix Similarity, value matrix Perform a weighted summation. The basic formula is: ;in, A scaling factor is introduced for the dimensions of the query and key vectors. This is to prevent the softmax function from entering the saturation region where gradient vanishing when the dimensionality is large and the dot product result is too large. The softmax function normalizes the similarity score into attention weights, reflecting the dependence of the current time step on other time steps.

[0061] However, a single attention head struggles to capture multi-scale features in ocean magnetic field data, such as high-frequency swaying noise and low-frequency magnetic anomalies. This application employs a multi-head mechanism to... , K , Mapped to respectively Attention is computed in parallel in different subspaces, and then the results are concatenated.

[0062] Set the number of attention heads =4, the dimension of each head For the input of layer 1 Each head is generated through independent linear transformations. : , , .in, , The output of single-head attention is: .Will The outputs of each head are concatenated and then linearly mapped. The final multi-head attention output is obtained: .

[0063] To alleviate the gradient vanishing problem in deep networks and accelerate convergence, residual connections and layer normalization are used after the multi-head self-attention sublayer: In other words, it involves splicing regularization layers.

[0064] In addition, each encoder layer contains a position-wise applied feedforward network, consisting of two linear mapping layers and an intermediate nonlinear activation function, used to enhance the model's nonlinear representation and feature transformation capabilities. The intermediate layer dimension is set to... The calculation formula is: .in, , max The ReLU activation function is used. This sub-layer is then followed by residual connections and layer normalization to obtain the [number of layers]. The final output of the layer encoder: .

[0065] In a preferred embodiment, the decoding layer execution steps of the multi-head self-attention mechanism physically inspired temporal denoising network model include: The deep feature matrix is ​​decoded and output through a linear mapping layer to obtain the denoised magnetic field time series predicted by the network. The linear decoding formula is: ; in, For deep feature matrices, To output the weight matrix, For output bias, This is the denoised magnetic field time series predicted by the network.

[0066] Specifically, after L After the layer encoder extracts deep features, it obtains the deep feature matrix. To restore it to a 1-dimensional magnetic field noise-reduced signal, a linear mapping layer is used for decoding output. Specifically, the calculation is performed using a linear decoding formula, and the result obtained is the final magnetic field detection result.

[0067] In a preferred embodiment, optimizing the magnetic field prediction model includes: The mean squared error is used as the loss function to perform error analysis on the corrected magnetic field data sequence and the denoised magnetic field time series. The parameter set of the magnetic field prediction model is iteratively updated by backpropagation based on the gradient of the loss function through the Adam optimizer.

[0068] Specifically, to ensure that the network output closely approximates the prior labels calculated by the particle swarm optimization algorithm, i.e., the corrected magnetic field data sequence, this application inputs the noisy magnetic field data sequence into the model and uses mean squared error as the loss function to evaluate the difference between the predicted value and the label. The specific calculation formula is as follows: .in, For batch size, This is the set of all learnable parameters of the network. It is iteratively updated using the Adam optimizer through backpropagation of gradients based on this loss function. This allows the network to gradually converge, learning an end-to-end nonlinear mapping from noisy to clean signals. Simultaneously, a learning rate decay and early stopping mechanism are introduced to prevent overfitting and preserve the model parameters with the minimum loss on the validation set.

[0069] Step S500: After standardizing the collected real-time noisy magnetic field data, input it into the magnetic field prediction model and perform sliding window splicing inference prediction to generate magnetic field detection results.

[0070] In a preferred embodiment, inputting the magnetic field prediction model to perform sliding window splicing inference prediction includes: An overlapping sliding window inference strategy is adopted, and an inference step size is set. The denoised magnetic field time series predicted by adjacent windows are averaged and spliced ​​together in overlapping areas, and the magnetic field detection results are obtained by inverse standardization.

[0071] Furthermore, the raw magnetic field data acquired in real time is standardized and then input into a pre-trained multi-head self-attention mechanism-inspired temporal denoising network model, i.e., the magnetic field prediction model. An overlapping sliding window inference strategy is employed, such as... Figure 3 As shown, the inference step size is set. The prediction results of adjacent windows are averaged in the overlapping area to eliminate splicing jumps at the window boundaries. Finally, the generalized and denoised magnetic field detection data is obtained by inverse standardization.

[0072] Example 2: Experimental simulations were conducted based on the marine oscillating platform magnetic detection method based on sequential implicit deep representation learning disclosed in Embodiment 1 of this application to further illustrate the method and its effects.

[0073] (1) Experimental simulation conditions The real data used in this experiment were the magnetic field data of ships and marine environment collected in Sanya. The sampling frequency of the fluxgate sensor was 200Hz. During the experiment, a sea surface buoy platform was used, and a three-axis fluxgate sensor was installed to measure the three-axis magnetic field data obtained when the ship passed near the platform. The passing time and the closest distance were recorded in detail.

[0074] Four time periods were selected as sampling samples during the experiment. Data was acquired in each time period. The data sample in each selected time period contained 720,000 magnetic field sampling points. The detailed composition of the marine magnetic field data constructed in the experiment is shown in Table 1.

[0075] Table 1. Detailed composition of the constructed magnetic field sampling data

[0076] The hardware configuration for this experiment was as follows: CPU: AMD Ryzen 5 5600H, GPU: NVIDIA GeForce RTX3050 Ti, RAM: 16GB, and operating system: Windows 11. The simulation experiment was conducted in the PyTorch v2.2.2 environment.

[0077] (2) Experimental steps Deploying a three-axis fluxgate sensor on an ocean-going rocking platform to collect raw, noisy data. Due to the lack of absolute truth values, a magnetic detection method for ocean swing platforms based on particle swarm optimization with global constraints is employed. The process involves: establishing a 9-dimensional error model including non-orthogonal error angles, sensitivity parameters, and bias parameters; applying physical constraints to the parameters using the exterior penalty function method; iteratively solving for the comprehensive error matrix and bias vector using a particle swarm optimization algorithm; and outputting the corrected and denoised magnetic field data. .by For network input, To achieve the learning objective, a pairing dataset is constructed.

[0078] Step 1: Data Preprocessing and Sliding Window Segmentation 1.1) For and Z-score normalization is performed using a normalized scaler, as shown in the formula. , Record the mean of the training set and variance Used for denormalization in the reasoning phase.

[0079] 1.2) Set the size of the sliding window =1024, training step size =256. The length is... Standardized data segmentation There are 1024, 1 sample pairs.

[0080] Step 2: Construct a physics-inspired temporal denoising network based on self-attention mechanism Reference Figure 2 The specific network structure and parameters are as follows: 2.1) Input embedding layer: The 1D temporal features are linearly projected into the 64D hidden space using nn.Linear(1, 64). =64.

[0081] 2.2) Position coding layer: A sine / cosine position coding matrix is ​​used to add the position information to the feature vector element by element.

[0082] 2.3) Encoder Layer: Three stacked encoder layers. In each layer, the number of multi-head self-attention mechanisms is 4, and each head has a dimension of 16. The feedforward network has a dimension of... =128, this process first increases the dimensionality to 128 and then decreases it to 64, with the Dropout rate set to 0.1. Each sub-layer is followed by residual connections and layer normalization.

[0083] 2.4) Output decoding layer: nn.Linear(64, 1) is used to map high-dimensional features back to 1-dimensional magnetic field values.

[0084] Step 3: Network Model Training and Optimization 3.1) Set training hyperparameters: batch size 32, initial learning rate The loss function is the mean squared error (MSE).

[0085] 3.2) Input the training data into the network and update the parameters using the Adam optimizer.

[0086] 3.3) Introduce the ReduceLROnPlateau learning rate scheduler. When the validation set loss does not decrease for three consecutive epochs, the learning rate is reduced to 0.5 times the original value.

[0087] 3.4) An early stopping mechanism is introduced. Training is terminated when the validation set loss does not improve for 5 consecutive epochs, and the model weights .pth file with the best performance on the validation set is saved.

[0088] Step 4: Real-time inference and denoising based on overlapping sliding windows Reference Figure 3 Online reasoning stage: 4.1) Input real-time data into the network in steps, and output a prediction sequence of length 1024 each time.

[0089] 4.2) For overlapping regions, a mean-averaging stitching strategy is adopted: an accumulation matrix and a counting matrix of the same length as the data are initialized; each prediction result is accumulated to the corresponding position in the accumulation matrix, and the corresponding position in the counting matrix is ​​incremented by 1; finally, the ratio of the two is taken as the final prediction value for that position. This method completely eliminates the truncation effect of the window boundary.

[0090] 4.3) Using the data recorded in step 1 and The prediction results are inversely standardized to obtain noise-reduced magnetic field data in physical dimensions.

[0091] (3) Evaluation criteria for data denoising performance 3.1) The improvement in signal-to-noise ratio before and after data denoising is judged by the decrease in peak-to-peak value (dB). Peak-to-peak value (Vpp) is the difference between the maximum and minimum values ​​of a signal, used to measure the range of signal fluctuation. Its calculation formula is as follows: ; in, It is the maximum value of the magnetic field. It is the minimum value of the magnetic field. The difference between the two values ​​is calculated to reflect the effect of background noise removal after the correction error parameter is applied.

[0092] 3.2) The improvement in signal-to-noise ratio before and after data denoising is judged by the signal-to-noise ratio (dB). Signal-to-noise ratio (SNR) is an important parameter for measuring signal quality. It refers to the ratio of the strength of the received useful signal to the strength of the received interference signal, representing the signal-to-noise ratio, and is usually expressed in decibels (dB). Its calculation formula is as follows: ; It is the signal power, which is usually calculated as the square of the signal peak-to-peak value divided by 2. This is the noise power, usually calculated as the square of the root mean square of the noise. The signal-to-noise ratio (SNR) is used to reflect the detection effectiveness of the magnetic anomaly signal. If the SNR of the magnetic field data improves after algorithm optimization, it indicates that the model's detection accuracy has been improved.

[0093] Example 3: This embodiment is an actual test experiment based on the content disclosed in Embodiments 1 and 2. The collected ocean magnetic field data is used to learn the magnetic field data for the learning period, and then the data from the next period is used as a validation set. The denoising method disclosed in this application is used for denoising, and the generalization performance of the model is verified.

[0094] Furthermore, the denoising performance of the method in this application and other methods on test data is compared and evaluated, combined with... Figure 4 , 5 The peak-to-peak value decrease index was used to evaluate the denoising effect and efficiency, and the specific statistical results are shown in Table 2.

[0095] Table 2. Noise reduction performance of this method on test data.

[0096] As shown in Table 2, when the sea state (rolling frequency) of the test data differs from that of the training data, the denoising effect of the traditional vector correction method is basically unchanged; the denoising effect of the unconstrained particle swarm optimization algorithm and the globally constrained particle swarm optimization algorithm is slightly improved; while the method of this application, due to the deep network learning more generalized noise mapping features, has a significantly improved peak-to-peak value reduction and a significantly improved generalization ability. This method can stably reduce background noise, making the corrected magnetic field data more stable and reducing fluctuations. It is beneficial for removing background noise during measurement and reducing measurement error.

[0097] The method designed in this application is used to detect magnetic anomaly signals in the data, and the generalization performance is tested according to the usage of the above dataset.

[0098] In addition, the magnetic anomaly detection performance of the method of this invention and other methods on test data was compared and evaluated, and the signal-to-noise ratio (SNR) index was obtained to evaluate the detection effect and efficiency. The specific statistical results are shown in Table 3.

[0099] Table 3. Comparison of detection performance of this method with other methods on test data.

[0100] Table 3 compares the generalization performance: when the sea state (rolling frequency) of the test data differs from that of the training data, the signal-to-noise ratio (SNR) of the traditional vector correction method remains essentially unchanged; the unconstrained particle swarm optimization algorithm slightly improves the SNR; the globally constrained particle swarm optimization algorithm can further improve the SNR; while the method in this application, due to the deep network learning more generalized noise mapping features, maintains an SNR improvement of over 5 dB, demonstrating a significant improvement in generalization ability. This method can effectively and stably filter out non-stationary ocean rolling background noise, making hidden magnetic anomaly signals more prominent and improving the generalization ability of magnetic field data processing, verifying the superiority and practical value of this application in the field of magnetic detection in complex marine environments.

[0101] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0102] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A magnetic detection method for marine oscillating platforms based on sequential implicit deep representation learning, characterized in that, The method includes: Noisy magnetic field data sequences are collected, and the error correction method based on global constraint optimization of particle swarm optimization is used to solve and compensate for the error parameters of the noisy magnetic field data sequences. Combined with the swing noise suppression rule, the corrected magnetic field data sequence is obtained. The noisy magnetic field data sequence and the corrected magnetic field data sequence are aligned using time-series alignment rules to construct a training pair dataset; Based on a fixed window size and step size, the standardized training pair dataset is divided into multiple fixed-length subsequence samples by sliding window, and these multiple subsequence samples are used as the deep learning training set. The magnetic field prediction model is obtained by training the multi-head self-attention mechanism physical-inspired temporal denoising network model on the deep learning training set. The multi-head self-attention mechanism physical-inspired temporal denoising network model includes an embedding layer, a position encoding layer, a multi-head self-attention encoder layer, and a decoding layer. After standardizing the collected real-time noisy magnetic field data, the data is input into the magnetic field prediction model and subjected to sliding window splicing inference prediction to generate magnetic field detection results.

2. The method for magnetic detection of an ocean swing platform based on sequential implicit deep representation learning as described in claim 1, characterized in that, Based on a fixed window size and stride, the standardized training pair dataset is divided into multiple fixed-length sub-sequence samples using a sliding window. These sub-sequence samples are then used as the deep learning training set, including: Set the sliding window size to a fixed value. The sliding step size is fixed. ; The noisy magnetic field data sequence in the standardized training pair dataset is split into multiple data segments. A training set of subsequence samples of a certain length; The standardized training pair dataset contains a data segmentation method to obtain multiple corrected magnetic field data sequences. Subsequence sample label dataset of length; Wherein, any subsequence sample in the subsequence sample training set and the subsequence sample label dataset has a temporal relationship with the previous subsequence sample. Overlapping sequences; The time-aligned subsequence sample training set and the subsequence sample label dataset are mapped to each other and used as the deep learning training set.

3. The method for magnetic detection of an ocean swing platform based on sequential implicit deep representation learning as described in claim 1, characterized in that, The embedding layer execution steps of a physical-inspired temporal denoising network model with a multi-head self-attention mechanism include: The noisy subsequence samples segmented by the sliding window are linearly mapped to a high-dimensional hidden feature space, and the embedding matrix is ​​output. The topology mapping formula is: ; Among them, the noisy subsequence samples are , Let L be the entire noisy magnetic field data sequence, and L be the sequence length. To embed the weight matrix, For bias vectors, Hides dimensions in the model and outputs an embedding matrix. .

4. The method for magnetic detection of an ocean swing platform based on sequential implicit deep representation learning as described in claim 3, characterized in that, The position encoding layer execution steps of a multi-head self-attention mechanism-based physical-inspired temporal denoising network model include: Sine-cosine position coding is used to inject absolute position information into the embedding matrix to obtain the position coding matrix. ; The sine-cosine position coding formula is: ; ; Among them, location Dimension index Position encoding matrix ; The location encoding matrix is ​​added element by element to the embedding matrix to output a feature matrix with location information.

5. The method for magnetic detection of an ocean swing platform based on sequential implicit deep representation learning as described in claim 4, characterized in that, The multi-head self-attention encoder layer includes The encoder layers are stacked, wherein each layer includes a multi-head self-attention sub-layer and a feedforward network sub-layer connected in sequence, and a splicing regularization layer is interspersed after each multi-head self-attention sub-layer and feedforward network sub-layer. After the feature matrix is ​​input into the multi-head self-attention encoder layer to extract deep features, a deep feature matrix is ​​obtained.

6. The method for magnetic detection of an ocean swing platform based on sequential implicit deep representation learning as described in claim 5, characterized in that, The decoding layer execution steps of a multi-head self-attention mechanism-based physical-inspired temporal denoising network model include: The deep feature matrix is ​​decoded and output through a linear mapping layer to obtain the denoised magnetic field time series predicted by the network. The linear decoding formula is: ; in, For deep feature matrices, To output the weight matrix, For output bias, This is the denoised magnetic field time series predicted by the network.

7. The method for magnetic detection of an ocean swing platform based on sequential implicit deep representation learning as described in claim 1, characterized in that, Optimizing the magnetic field prediction model includes: The mean squared error is used as the loss function to perform error analysis on the corrected magnetic field data sequence and the denoised magnetic field time series. The parameter set of the magnetic field prediction model is iteratively updated by backpropagation based on the gradient of the loss function through the Adam optimizer.

8. The method for magnetic detection of an ocean swing platform based on sequential implicit deep representation learning as described in claim 6, characterized in that, Inputting the magnetic field prediction model to perform sliding window splicing inference prediction includes: An overlapping sliding window inference strategy is adopted, and an inference step size is set. The denoised magnetic field time series predicted by adjacent windows are averaged and spliced ​​together in overlapping areas, and the magnetic field detection results are obtained by inverse standardization.

Citation Information

Patent Citations

  • Marine target magnetic anomaly signal denoising and detecting method based on deep transfer learning

    CN116304561A

  • A system and method for reconstruction of magnetic resonance images acquired with partial fourier acquisition

    WO2020142109A1