Ship wake magnetic field detection system, training method, detection method and electronic equipment
Through the ship wake magnetic field detection system, the deep fusion of wave characteristics and frequency domain characteristics, combined with training set training, solved the problem of accurate detection of low signal-to-noise ratio signals, and achieved accurate detection of ship wake magnetic fields and noise differentiation.
Patent Information
- Application Number
- CN202510234770.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-02-28
AI Technical Summary
Existing ship wake magnetic field detection methods have difficulty processing wake magnetic field signals with low signal-to-noise ratio, resulting in the inability to achieve accurate detection.
A ship wake magnetic field detection system is adopted. The first feature extraction module and the second feature extraction module are used to extract the fluctuation characteristics and frequency domain characteristics of the time series signal to be detected respectively. The path fusion module and the feature fusion module are used for deep fusion. The system is trained with the training set. Finally, the classifier is used to achieve accurate detection of the ship wake magnetic field.
It achieves accurate detection of the ship wake magnetic field, improves the accuracy and generalization capability of the detection system, and enhances the ability to distinguish between noise and wake information.
Smart Images

Figure CN120085380B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of marine target detection, and more specifically, relates to a ship wake magnetic field detection system, a training method, a detection method and electronic equipment. Background Art
[0002] Marine target detection has long held a crucial position in marine science and engineering, particularly for maritime safety and coastal defense monitoring. In the past, sonar was the primary means of marine detection. However, due to the complex ocean acoustic environment and high noise interference, the limitations of sonar detection have become increasingly apparent. Against this backdrop, magnetic anomaly detection, as a supplementary tool to sonar detection, has gained increasing attention. Traditional ship magnetic anomaly detection technology relies on the fact that the ferromagnetic material of a ship, under the influence of the Earth's magnetic field, generates an induced magnetic field, which alters the spatial distribution of the field and allows detection. However, this induced magnetic field decays rapidly, inversely proportional to the cube of the distance. Furthermore, advances in ship demagnetization technology have weakened the ferromagnetic properties of ships. Consequently, traditional ship detection technology faces significant challenges.
[0003] In recent years, the magnetic field of ship wakes has gradually come into focus. Because ships generate a regular flow field behind them during motion, and because seawater contains a large number of charged particles, the regularly moving seawater, stimulated by the Earth's magnetic field, produces regular electromagnetic anomalies. By capturing these electromagnetic anomaly signals, ships can be detected.
[0004] Currently, existing ship wake magnetic field detection methods usually first simulate and calculate the induced magnetic field generated by the ship's wake in the sea, and then use methods such as Fourier transform and low-pass filtering to extract features from the calculation results to achieve ship wake magnetic field detection; however, due to the weak wake magnetic field signal and low signal-to-noise ratio, traditional Fourier transform, low-pass filtering and other methods have difficulty processing and detecting the low signal-to-noise ratio wake magnetic field signal, resulting in the inability to achieve accurate detection. Summary of the Invention
[0005] In response to the above-mentioned defects or improvement needs of the existing technology, the present invention provides a ship wake magnetic field detection system, training method, detection method and electronic equipment to solve the technical problem that the existing technology cannot accurately detect the ship wake magnetic field.
[0006] In order to achieve the above objectives, in a first aspect, the present invention provides a ship wake magnetic field detection system, comprising:
[0007] A first feature extraction module is configured to extract the fluctuation characteristics and frequency domain characteristics of the time series signal to be detected, respectively, to obtain a fluctuation characteristic sequence and a time-frequency image; wherein the time series signal to be detected is a time series signal collected by magnetic sensors distributed around the ship's motion trajectory;
[0008] The second feature extraction module is used to extract the features of the time-frequency image to obtain the time-frequency features;
[0009] The path fusion module is used to extract features of the time series signal to be detected and the fluctuation feature sequence on the corresponding feature extraction branches respectively, and fuse the features extracted from the two feature extraction branches and then merge them back into the two feature extraction branches respectively. The features finally extracted by the two feature extraction branches are fused to obtain the path fusion feature;
[0010] Feature fusion module, used to fuse path fusion features and time-frequency features to obtain global fusion features;
[0011] A classifier is used to obtain the detection results of the ship wake magnetic field based on the global fusion features.
[0012] Further preferably, the path fusion module includes: a first feature extraction branch, a second feature extraction branch and n+1 path fusion units; n is a positive integer; the first feature extraction branch includes: n cascaded first feature extraction branch segments; the second feature extraction branch includes: n cascaded second feature extraction branch segments; the first feature extraction branch segment and the second feature extraction branch segment both include: cascaded feature extraction units and pooling layers;
[0013] The input of the first first feature extraction branch section is the time series signal to be detected; the input of the second first feature extraction branch section is the fluctuation feature sequence;
[0014] The i-th path fusion unit adds the features extracted by the feature extraction unit in the i-th first feature extraction branch segment and the features extracted by the feature extraction unit in the i-th second feature extraction branch segment, and performs an average pooling operation to obtain the i-th fused feature, which is then superimposed on the output features of the i-th first feature extraction branch segment and the output features of the i-th second feature extraction branch segment respectively; i = 1, 2, …, n;
[0015] The (n+1)th path fusion unit adds the features output by the (n)th first feature extraction branch segment and the features output by the (n)th second feature extraction branch segment to obtain a path fusion feature.
[0016] Further preferably, the feature fusion module includes:
[0017] The channel fusion unit is used to fuse the path fusion features and the time-frequency features in the channel dimension to obtain the channel fusion features;
[0018] The multi-scale fusion unit is used to perform multi-scale feature extraction on the channel fusion feature to obtain the first feature, the second feature and the third feature with scales from large to small; after respectively performing scale transformation on the first feature and the third feature so that the scales of the two are the same as the scale of the second feature, they are added to the second feature respectively, and the summed results are averaged to obtain the fusion feature.
[0019] Further preferably, the feature fusion module also includes: an attention fusion unit, which is used to respectively extract the spatial attention features and channel attention features of the fusion features output by the multi-scale fusion unit, and add the spatial attention features and the channel attention features to obtain the final fusion features.
[0020] Further preferably, the channel fusion unit is used to perform a flattening operation on the time-frequency features in each channel dimension; interpolate the path fusion features so that the length after interpolation is the same as the length after the flattening operation on each channel of the time-frequency features; and splice the interpolated path fusion features and the time-frequency features after the flattening operation in the channel dimension to obtain the channel fusion features.
[0021] In a second aspect, the present invention provides a training method for the above-mentioned ship wake magnetic field detection system, comprising:
[0022] The time series signals in the training set are input into the ship wake magnetic field detection system to obtain the corresponding ship wake magnetic field detection results; the ship wake magnetic field detection system is trained by minimizing the difference loss between the ship wake magnetic field detection results and the corresponding labels indicating whether there is a ship wake magnetic field;
[0023] The training set includes: noisy time series signals carrying wake magnetic field information and noisy time series signals not carrying wake magnetic field information.
[0024] Further preferably, the above training set is obtained by:
[0025] The wake magnetic field is simulated and calculated under N different ship environmental parameters to obtain N three-component segments of the wake magnetic field; each three-component segment of the wake magnetic field is projected onto the geomagnetic field vector corresponding to the colored noise collection location, and finally N simulated wake magnetic field segments are obtained; N is a positive integer;
[0026] The colored noise signal at the collection location is cut to obtain colored noise segments of the same size as the simulated wake magnetic field segments and the number of which is greater than or equal to 2N, forming a colored noise segment set;
[0027] Randomly select N colored noise segments from the colored noise segment set and superimpose them one-to-one with N simulated wake magnetic field segments to obtain N noisy time series signals carrying wake magnetic field information. The corresponding label is the presence of ship wake magnetic field.
[0028] N colored noise segments are randomly selected from the remaining colored noise segments in the colored noise segment set as noise time series signals, and the corresponding label is no ship wake magnetic field.
[0029] In a third aspect, the present invention provides a method for detecting a ship wake magnetic field, comprising: inputting a time series signal to be detected into the ship wake magnetic field detection system provided by the first aspect of the present invention, and obtaining a detection result of the ship wake magnetic field;
[0030] The time series signals to be detected are time series signals collected by magnetic sensors distributed around the ship's motion trajectory.
[0031] In a fourth aspect, the present invention provides an electronic device comprising: a memory and a processor, wherein the memory stores a computer program, and the processor executes the method provided in the second aspect or the third aspect of the present invention when executing the computer program.
[0032] In a fifth aspect, the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method provided in the second aspect or the third aspect of the present invention.
[0033] In a sixth aspect, the invention further provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the method provided in the second or third aspect of the invention.
[0034] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0035] 1. The present invention provides a ship wake magnetic field detection system, which simultaneously focuses on the original time series signal containing the time series information of the time series signal to be detected, the fluctuation characteristics representing the random information of the noise in the time series information, and the time-frequency characteristics containing the time-frequency information of the time series signal to be detected, and first uses a path fusion module to extract and cross-fuse the time series signal and the fluctuation characteristics on different feature extraction branches to achieve in-depth fusion of the two, and then fuses the path fusion characteristics obtained after the in-depth fusion with the time-frequency characteristics to achieve deep fusion of three different types of information, which can make full use of the different information in the time series signal to be detected and extract the essential characteristics, so as to accurately distinguish between noise and ship wake information and realize accurate detection of the ship wake magnetic field.
[0036] 2. Furthermore, in the ship wake magnetic field detection system provided by the present invention, the n cascaded first feature extraction branch segments of the first feature extraction branch in the path fusion module can perform deep feature extraction on the original time series signal, and the n cascaded second feature extraction branch segments of the second feature extraction branch can perform deep feature extraction on the fluctuation feature. The path fusion unit assigns equal weight to the information of the two branches through an average pooling operation, achieving equal exchange and fusion of time series information and fluctuation information. The diversified information has a positive effect on improving the detection capability of the system, further enhancing the detection accuracy of the ship wake magnetic field.
[0037] 3. Furthermore, in the ship wake magnetic field detection system provided by the present invention, the feature fusion module includes a channel fusion unit and a multi-scale fusion unit; the multi-scale fusion unit extracts features of multiple scales and fuses features of different scales. Large-scale features are mainly detailed information, and small-scale features contain more semantic information. The fusion of information at different scales can complement each other's advantages, further improve the accuracy of feature expression, and enhance the accuracy of the ship wake magnetic field detection system.
[0038] 4. Furthermore, in the ship wake magnetic field detection system provided by the present invention, the feature fusion module also includes an attention fusion unit, which is used to extract the spatial key information and channel key information of the fusion features output by the multi-scale fusion unit for fusion, further focusing on the effective information in the features, filtering out interference information, and further improving the accuracy of feature expression.
[0039] 5. The present invention provides a training method for the above-mentioned ship wake magnetic field detection system. By using a training set to train the ship wake magnetic field detection system, a wake magnetic field detection system with high accuracy and generalization can be obtained.
[0040] 6. Furthermore, the present invention provides a training method for the aforementioned ship wake magnetic field detection system, wherein the training set is a semi-real dataset. The wake magnetic field signals in the semi-real dataset are simulated, but the noise is obtained through real measurements. Compared with the noise obtained through computer simulation (whether white noise or colored noise), the measured noise is closer to the actual engineering situation, which helps to improve the robustness of the model. The ship wake magnetic field detection system trained on the measured noise performs better in real-world scenarios than the ship wake magnetic field detection system trained on the simulated noise, further improving the detection accuracy of the ship wake magnetic field. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a schematic structural diagram of a ship wake magnetic field detection system provided in Example 1 of the present invention;
[0042] Figure 2A schematic diagram of the structure of the path fusion module provided in Example 1 of the present invention;
[0043] Figure 3 A schematic diagram of the structure of a feature fusion module provided in Example 1 of the present invention;
[0044] Figure 4 A schematic diagram of ship motion provided in Example 2 of the present invention;
[0045] Figure 5 Schematic diagram of simulation calculation results of wake magnetic field signals under two different ship environment parameters provided in Example 2 of the present invention;
[0046] Figure 6 A schematic diagram of measured noise sampling provided in Example 2 of the present invention;
[0047] Figure 7 Schematic diagram of the process of constructing a wake magnetic field detection dataset provided in Example 2 of the present invention;
[0048] Figure 8 A comparison chart of the accuracy and loss of MTHA-Net provided by an embodiment of the present invention and other existing networks when performing ship wake magnetic field detection;
[0049] Figure 9 A comparison of ROC curves of the MTHA-Net provided by an embodiment of the present invention and other existing networks when performing ship wake magnetic field detection;
[0050] Figure 10 This is a diagram showing the ablation experiment results of MTHA-Net provided by an embodiment of the present invention;
[0051] Figure 11 This is an experimental verification diagram of MTHA-Net provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
[0053] In order to achieve the above objectives, in a first aspect, the present invention provides a ship wake magnetic field detection system, comprising:
[0054] The first feature extraction module is used to extract the fluctuation characteristics and frequency domain characteristics of the time series signal to be detected, respectively, to obtain a fluctuation feature sequence and a time-frequency image; wherein the time series signal to be detected is a time series signal (i.e., a magnetic field signal) collected by magnetic sensors distributed around the ship's motion trajectory;
[0055] The second feature extraction module is used to extract the features of the time-frequency image to obtain the time-frequency features;
[0056] The path fusion module is used to extract features of the time series signal to be detected and the fluctuation feature sequence on the corresponding feature extraction branches respectively, and fuse the features extracted from the two feature extraction branches and then merge them back into the two feature extraction branches respectively. The features finally extracted by the two feature extraction branches are fused to obtain the path fusion feature;
[0057] Feature fusion module, used to fuse path fusion features and time-frequency features to obtain global fusion features;
[0058] A classifier is used to obtain the detection results of the ship wake magnetic field based on the global fusion features.
[0059] It should be noted that there are many methods to extract the fluctuation characteristics of the time series signal to be detected, such as calculating the Allen variance of the time series signal to be detected, performing minimum entropy filtering on the time series signal to be detected, calculating the rolling standard deviation of the time series signal to be detected, calculating the Hurst exponent of the time series signal to be detected, etc., in order to extract characteristics reflecting the degree of change of the time series signal to be detected.
[0060] There are many methods for extracting frequency domain features of the time series signal to be detected, such as short-time Fourier transform (STFT), wavelet transform, Hilbert-Huang transform, Stockwell transform and other existing time-frequency conversion methods.
[0061] It should be noted that the second feature extraction module can be CNN, RNN, LSTM, etc., which is not limited here. Preferably, in an optional embodiment, the second feature extraction module adopts a residual module; preferably, the residual module includes a cascaded residual block; preferably, the residual block includes: m cascaded convolutional layers, a convolutional layer spanning the input end of the first convolutional layer and the output end of the last convolutional layer, and a pooling layer connected to the output end of the last convolutional layer (the pooling layer can be a maximum pooling layer, an average pooling layer, a random pooling layer, an Lp pooling layer, etc., which is not limited here, and is preferably a maximum pooling layer); wherein m ≥ 1.
[0062] In an optional implementation, the path fusion module includes: a first feature extraction branch, a second feature extraction branch, and n+1 path fusion units; n is a positive integer (preferably, n≥2); the first feature extraction branch includes: n cascaded first feature extraction branch segments; the second feature extraction branch includes: n cascaded second feature extraction branch segments; the first feature extraction branch segment and the second feature extraction branch segment both include: cascaded feature extraction units and a pooling layer (the pooling layer may be a maximum pooling layer, an average pooling layer, a random pooling layer, an Lp pooling layer, etc., which is not limited here, and is preferably a maximum pooling layer);
[0063] The input of the first first feature extraction branch section is the time series signal to be detected; the input of the second first feature extraction branch section is the fluctuation feature sequence;
[0064] The i-th path fusion unit adds the features extracted by the feature extraction unit in the i-th first feature extraction branch segment and the features extracted by the feature extraction unit in the i-th second feature extraction branch segment, and performs an average pooling operation to obtain the i-th fused feature, which is then superimposed on the output features of the i-th first feature extraction branch segment and the output features of the i-th second feature extraction branch segment respectively; i = 1, 2, …, n;
[0065] The (n+1)th path fusion unit adds the features output by the (n)th first feature extraction branch segment and the features output by the (n)th second feature extraction branch segment to obtain a path fusion feature.
[0066] It should be noted that the feature extraction units in the first feature extraction branch segment and the second feature extraction branch segment can be CNN, RNN, LSTM, etc., which are not limited here. Preferably, the feature extraction unit includes: a cascaded convolution module (including one or more cascaded convolution layers, preferably two cascaded convolution layers), a batch normalization layer and an activation layer (preferably: a LeakyReLu activation layer).
[0067] In an optional implementation manner, the feature fusion module includes:
[0068] The channel fusion unit is used to fuse the path fusion features and time-frequency features in the channel dimension to obtain the channel fusion features;
[0069] The multi-scale fusion unit is used to perform multi-scale feature extraction on the channel fusion feature to obtain the first feature, the second feature and the third feature with scales from large to small; after respectively performing scale transformation on the first feature and the third feature so that the scales of the two are the same as the scale of the second feature, they are added to the second feature respectively, and the summed results are averaged to obtain the fusion feature.
[0070] It should be noted that there are many methods for rescaling the first feature, such as interpolation, symmetric padding, and Fourier expansion, which are not limited here. There are many methods for rescaling the third feature, such as maximum pooling, average pooling, random pooling, and Lp pooling, which are not limited here.
[0071] It should be noted that there are many methods for fusing the path fusion features and the time-frequency features in the channel fusion unit in the channel dimension, such as adjusting the two features to the same size and then performing weighted summation, calculating the geometric mean, etc. Preferably, in an optional embodiment, the channel fusion unit is used to perform a flattening operation on the time-frequency features in each channel dimension; interpolate the path fusion features so that the length after interpolation is the same as the length after flattening of the time-frequency features in each channel; and splice the interpolated path fusion features and the flattened time-frequency features in the channel dimension to obtain the channel fusion features. Preferably, the above-mentioned interpolation operation can be a cubic spline interpolation operation, a linear interpolation operation, a polynomial interpolation operation, etc., which is not limited here, and is preferably a cubic spline interpolation operation.
[0072] Preferably, in an optional embodiment, the feature fusion module also includes: an attention fusion unit, which is used to respectively extract the spatial attention features and channel attention features of the fusion features output by the multi-scale fusion unit, and add the spatial attention features and the channel attention features to obtain the final fusion features.
[0073] It should be noted that a spatial attention network is used to extract spatial attention features from the fused features output by the multi-scale fusion unit. The spatial attention network can be a non-local attention network, an STN attention network, etc., and is not limited here. A channel attention network is used to extract channel attention features from the fused features output by the multi-scale fusion unit. The channel attention network can be an SE attention network, an ECA attention network, an SKNet attention network, etc., and is not limited here.
[0074] It should be noted that the above classifier can be a fully connected layer, SVM, cosine classifier, decision tree classifier, etc., which is not limited here.
[0075] In order to further illustrate the ship wake magnetic field detection system provided by the present invention, a detailed description is given below in conjunction with a specific embodiment 1:
[0076] like Figure 1 As shown, this embodiment designs a new wake magnetic field detection system for detecting ship wake signals, which can be recorded as a multi-transformation hierarchical fusion attention network (MTHA-Net).
[0077] The Allen variance calculation and short-time Fourier transform (STFT) are performed on the input time series signal to be detected respectively to obtain a fluctuation feature sequence and a time-frequency image, thereby generating three different types of data features including the time series signal to be detected. Among them, the Allen variance reflects the noise distribution characteristics and signal stability in the time domain signal, and the short-time Fourier transform (STFT) expands the time domain signal into a two-dimensional time-frequency graph, capturing the time-frequency coupling information of the signal. In this embodiment, the Fourier transform window of the STFT is 110 and the number of overlapping points is 101. There are significant differences between the noisy time series signal carrying the wake magnetic field information and the noisy time series signal not carrying the wake magnetic field information after three different processings: no transformation, Allen variance calculation and short-time Fourier transform, which provides rich information for the subsequent network to distinguish between noisy signals and noise.
[0078] The following are the specific steps for calculating the Allen variance and STFT of the time series signal X to be detected:
[0079] a. Allen variance calculation process is as follows:
[0080] Step 1: Calculate the τ list, τ min Defined as τ min =1 / Fs,τ max Defined as τ max =Ns / (2*Fs), the length of the τ list is set to num, then the step length s of the logarithmic space = (log 10 (τ max )-log 10 (τ min )) / num, generate τ=10 according to the logarithmic method [log10(τmin):s:log10(τmax)] ;
[0081] Step 2: For a τ in the τ list i , calculate the number of samples in each group m = τ i *Fs, total number of groups K = floor(Ns / m), where floor(*) represents the floor function; calculate the group mean y j =mean(X[(j-1)*m+1:j*m]), j=1,2,…K; calculate the square difference of adjacent means δ 2 j =(y j +1-y j ) 2 ,j=1,2,…K-1;calculate Allen variance σ 2 (τ i )=(1 / (2*(K-1)))*sum(δ 2 j );
[0082] Step 3: For a τ in the τ list i , repeat the above step 2 to get the Allen variance σ 2 (τ), which is a one-dimensional vector, i.e., the fluctuation characteristic sequence.
[0083] b. Assuming that the window function in the STFT algorithm is window, the window length is L, and the number of overlapping points is D, the STFT process is as follows:
[0084] Step 1: Calculate the step size S = LD, the total number of frames M = floor((NL) / S) + 1, and initialize the matrix STFT = zeros(K,M)
[0085] Step 2: For a certain frame i, i = 0, 1, 2…M-1, extract the current frame frame = X[i*S+1:i*S+L]; add window processing frame_win = frame.*window; calculate the Fourier spectrum Keep the result STFT(:,i)=spec.
[0086] Step 3: Repeat step 2 for each frame i=0,1,2…M-1 to obtain the matrix STFT, i.e., the time-frequency image.
[0087] Since the above-mentioned different processing methods generate different information, and considering that the low-level and high-level layers lack semantic information and position information respectively, a path fusion module (a dual-path cross-layer fusion module, denoted as DPCF module) is proposed. Its structure is as follows: Figure 2 As shown. After entering the DPCF module, the time series signal to be detected and the fluctuation feature sequence enable the module to perform deep cross-layer extraction and fusion of input features from the two paths. Two residual blocks are used to extract features from the time-frequency image, and then the obtained 2D feature map is flattened and connected with the 1D feature map obtained from the DPCF module. Specifically, the time series signal to be detected and the fluctuation feature sequence are respectively passed through a feature extraction unit, which is a CCBL unit in this embodiment, specifically including two convolution operations, a batch normalization operation and a LeakyReLU activation operation. After the signal is processed by the CCBL unit, there are two outputs - one is to perform maximum pooling on this branch to reduce the data size; the other is to add the data of the other branch and then perform average pooling, and the result of the average pooling is returned to the two branches, and this is repeated twice. The deep fusion of the data of the two branches is achieved, and the time domain information represented by the time series signal to be detected and the noise randomness information represented by the fluctuation feature sequence will be deeply fused, and finally the path fusion feature is obtained.
[0088] In the second feature extraction module, the time-frequency image is extracted through two residual blocks to obtain time-frequency features. The main path of each residual block contains three convolutions for feature extraction, and the branch path contains one convolution, which is mainly used to adjust the size of the data. The time-frequency features establish a jump connection with the main path through the branch path, which can effectively prevent network degradation.
[0089] In order to obtain more discriminative features and emphasize task-related information, this embodiment introduces a feature fusion module (a cross-scale fusion attention module, denoted as CSFA module), whose structure is as follows Figure 3 As shown. This module uses three layers of progressive convolution to discard feature detail information while retaining semantic information. By adopting interpolation and pooling methods, it promotes information exchange between layers of different sizes. Subsequently, feature extraction and fusion are completed through the spatial attention network (Non-Local attention network in this embodiment) and the channel attention network (SE attention network in this embodiment). Specifically, in the CSFA module, after the time-frequency features obtained by the residual step and the path fusion features output by the DPCF module are merged on the channel, three depth convolutions are first performed. Each depth convolution contains three convolution operations, a batch normalization operation, a LeakyReLU activation operation and a maximum pooling operation. The three depth convolutions successively obtain the first feature, the second feature and the third feature with scales from large to small. The first feature and the third feature are respectively subjected to a maximum pooling and a cubic spline interpolation, and the data size is adjusted to the same as the second feature, and then summed with the second feature to obtain feature B1 and feature B2. Feature B1 and feature B2 are then summed and averaged to obtain the multi-scale fusion feature C. As convolutions deepen, the results of deeper layers contain more semantic information and excel at classification tasks, while shallower layers primarily focus on detailed information and excel at localization tasks. Information fusion at different levels can complement each other and enhance network performance. The multi-scale fused feature C is processed by the Non-Local Attention Network and the Separate Attention Network to produce the spatial attention feature D1 and the channel attention feature D2, respectively. These features are then summed and fused to produce the final fused feature E. The Non-Local Attention Module and the Separate Attention Module, respectively, extract key spatial and channel information from the data, positively impacting subsequent classification tasks.
[0090] The classifier in this embodiment uses a fully connected network, flattens the fusion feature E and sends it to the fully connected layer; the fully connected layer includes an input layer, two hidden layers and an output layer, and each neuron in each layer receives input from all neurons in the previous layer and outputs the result to all neurons in the next layer. The final output is the probability of classification as 0 and the probability of classification as 1 in the binary classification (0 means noise, that is, there is no wake magnetic field signal, and 1 means there is a wake magnetic field signal). The fully connected network in this embodiment includes four linear layers, and the number of neurons in each layer is 1536, 1024, 256, 32 and 2 respectively.
[0091] It should be noted that the training method for the above-mentioned ship wake magnetic field detection system can adopt a conventional training method, such as an end-to-end training method. Based on this, preferably, in a second aspect, the present invention provides a training method for the above-mentioned ship wake magnetic field detection system, comprising:
[0092] The time series signals in the training set are input into the ship wake magnetic field detection system to obtain the corresponding ship wake magnetic field detection results; the ship wake magnetic field detection system is trained by minimizing the difference loss between the ship wake magnetic field detection results and the corresponding labels indicating whether there is a ship wake magnetic field;
[0093] The training set includes: noisy time series signals carrying wake magnetic field information and noisy time series signals without wake magnetic field information. It should be noted that the time series signals here are all magnetic field signals.
[0094] The relevant technical solution is the same as the ship wake magnetic field detection system provided in the first aspect of the present invention, and will not be described in detail here.
[0095] In an optional implementation manner, the above training set is obtained by:
[0096] The wake magnetic field is simulated and calculated under N different ship environmental parameters to obtain N three-component segments of the wake magnetic field; each three-component segment of the wake magnetic field is projected onto the geomagnetic field vector corresponding to the colored noise collection location, and finally N simulated wake magnetic field segments are obtained; N is a positive integer;
[0097] The colored noise signal at the collection location is cut to obtain colored noise segments of the same size as the simulated wake magnetic field segments and the number of which is greater than or equal to 2N, forming a colored noise segment set;
[0098] Randomly select N colored noise segments from the colored noise segment set and superimpose them one-to-one with N simulated wake magnetic field segments to obtain N noisy time series signals carrying wake magnetic field information. The corresponding label is the presence of ship wake magnetic field.
[0099] N colored noise segments are randomly selected from the remaining colored noise segments in the colored noise segment set as noise time series signals, and the corresponding label is no ship wake magnetic field.
[0100] In order to further illustrate the training method of the ship wake magnetic field detection system provided by the present invention, a detailed description is given below in conjunction with a specific embodiment 2:
[0101] This example uses the ship wake magnetic field detection system described in Example 1 as the training target. First, a dedicated wake magnetic field detection dataset is constructed, and then the dataset is used to train the parameters of the ship wake magnetic field detection system. In this example, data from the dataset is fed into the ship wake magnetic field detection system in batches, and training is performed using a specific training strategy to minimize the loss function. During training, a suitable network initialization method, such as random initialization, Xavier initialization, or He initialization, is first selected to initialize the ship wake magnetic field detection system. For the binary classification problem described in this invention, the cross-entropy function is a suitable loss function. There are many optimization options, such as Adam and SGD optimizers, and different optimizers correspond to different gradient descent algorithms. During training, considerations such as the size of the training batch, the learning rate schedule, the number of iterations, and the conditions for exiting the iteration need to be considered. Generally speaking, the batch size should be neither too large nor too small, specifically considering the GPU memory and the amount of dataset. The learning rate should be large initially and then small later, ensuring that the gradient descent rate is fast enough in the early stages to quickly approach the minimum value, and then slows down in the later stages to find the precise optimal solution. During training, the performance of the ship wake magnetic field detection system needs to be monitored. By calculating metrics such as accuracy and loss on the training and validation sets, it is determined whether the system is overfitting or underfitting, and timely adjustments can be made. If the loss of both the training and validation sets remains high, it indicates that the ship wake magnetic field detection system is underfitting. If the loss of the training set decreases but the loss of the validation set gradually increases, it indicates that the model is overfitting. If the loss of the current ship wake magnetic field detection system on the validation set is lower than the loss of the current optimal ship wake magnetic field detection system on the validation set, it is updated to the current optimal ship wake magnetic field detection system and saved.
[0102] The dataset constructed in this embodiment is a semi-real dataset. It is necessary to obtain the simulated wake magnetic field based on the analytical expression and the measured colored noise through the scalar magnetic sensor. The two are fused to obtain a dataset with a certain signal-to-noise ratio range that can be used for subsequent deep learning. The specific dataset can be constructed through the following process:
[0103] Determine the data length: Before constructing the data set, it is necessary to determine the number of data points Ns for each segment of data. Considering that the wake electromagnetic field is an extremely low-frequency signal with a frequency range of approximately 0.2 Hz to 0.8 Hz, the sampling rate does not need to be very high.
[0104] Steps to obtain the geomagnetic field: Check the relevant website to determine the geomagnetic field B of the experimental location e The three components B ex ,B ey ,B ez .
[0105] Construct a wake magnetic field dataset: Based on the existing calculation model, select appropriate calculation parameters and calculate N wake magnetic fields of length Ns, each of which includes three components: x, y, and z. Then, project the three components of the wake magnetic field onto the direction of the Earth's magnetic field to simulate the results measured by the scalar magnetic sensor, ultimately forming the wake magnetic field dataset.
[0106] Ambient noise measurement: Place multiple scalar magnetic sensors at the test site and sample at a sampling rate Fs for a sufficient period of time to collect sufficient colored noise at the test site. Slice the collected noise into non-overlapping noise segments of length Ns. The number of noise segments should be greater than or equal to twice the number of wake magnetic field datasets (2N).
[0107] Data processing steps: N noise segments are randomly selected and added to the wake magnetic field segment to obtain N noisy wake magnetic field data, forming a noisy signal set. The labels of the noisy signal set are all marked as 1, indicating the presence of a wake magnetic field. Furthermore, N random segments are selected from the remaining noise segments to form a noise data set. The labels of the noise data set are all marked as 0, indicating the absence of a wake magnetic field. The data in both the noisy signal set and the noise data set are then passed through a bandpass filter with a bandwidth of 0.1Hz to 5Hz. This filter removes high-frequency noise, the geomagnetic background signal, and signal drift during the acquisition process, while preventing distortion of the wake magnetic field signal.
[0108] Test set and validation set classification steps: The noisy signal set and the noise data set processed in the data processing step are collected, and 20% of each is taken out to form the validation set; the remaining 80% forms the training set.
[0109] In the above process, the specific calculation process of the three-component segments of the wake magnetic field is as follows:
[0110] like Figure 4 As shown, a ship with a length of L and a draft of D is traveling on the sea at a uniform speed U. With the center of the ship as the coordinate origin O, the direction opposite to the speed U is the positive x-axis, vertically downward is the positive z-axis, and the positive y-axis and the positive xz-axis satisfy the right-hand screw rule. The dielectric constant and magnetic permeability of air are ε0 and μ0, while the dielectric constant, magnetic permeability, and electrical conductivity of seawater are ε, μ, and σ. The expression for the wake magnetic field can be obtained by solving the Bernoulli equation and Euler equations in fluid mechanics in combination with Maxwell's equations, and the result is shown below:
[0111]
[0112] ω=kU cosθ
[0113] Where g is the acceleration due to gravity, g = 9.8 m / s 2 , S(θ) is a function related to the ship type and is determined only by the shape and geometric dimensions of the ship itself. The above calculation formula shows that the distribution characteristics of the wake magnetic field in the x and y directions are oscillatory and attenuated, and the distribution law in the z direction is independent of x and y. Further giving S(θ) and The expression of sum:
[0114]
[0115]
[0116] δ=k 2 -εμω 2 -iσμω,β=k 2 -ε0μ0ω 2
[0117]
[0118] In the above formula, The unit vectors of the x, y, and z axes are selected. By selecting appropriate calculation parameters such as the ship length L and the draft depth D, a series of simulation data of the three-component segments of the wake magnetic field can be obtained.
[0119] More specifically, Table 1 lists the relevant parameters for simulating the wake magnetic field (parameters of the environment in which different ships are located). Considering the diversity of the data set, during the simulation calculation process, each parameter is randomly selected within a range for calculation (except for the sampling rate). Figure 5 The simulation results for two sets of wake magnetic field signals are presented for demonstration. It can be seen that different calculation parameters lead to different signal characteristics, such as frequency, amplitude, and duty cycle, in the simulated wake magnetic field signals. In this case, the signal length selected was 600 sampling points (Ns = 600). A total of 15,000 unique segments (N = 15,000) of the three components of the wake magnetic field were calculated.
[0120] Table 1 Wake magnetic field simulation calculation parameters
[0121]
[0122] Figure 6A schematic diagram of the measured noise sampling is provided. In this case, a seaside location was selected as the noise collection site. The geomagnetic field at this location in the northeast-east coordinate system (north corresponds to the x-direction, east corresponds to the y-direction, and ground corresponds to the z-direction) is (30803.3, -3741.3, 41814.6) nT. The 15,000 three-component wake magnetic field segments calculated above were projected onto the magnetic field vector corresponding to the location, resulting in 15,000 simulated wake magnetic field segments, which constitute the wake magnetic field dataset. Simultaneously, a sensor was placed on each of the shore's rock piers. The default sampling rate of the sensor was 1000 Hz, and sufficient colored noise was obtained after sampling for a sufficient period of time.
[0123] Figure 7 The process of constructing a wake magnetic field detection dataset is demonstrated. First, the noise is downsampled to 5Hz. The entire noise sequence is then cut into 30,000 noise segments without overlap, with each segment consisting of 600 sampling points. 15,000 randomly selected noise data points are superimposed one-to-one with the 15,000 simulated wake magnetic field segments obtained above to form the noisy signal set, labeled 1 to indicate the presence of a wake magnetic field. The remaining 15,000 noise data points remain unchanged to form the noise dataset, labeled 0 to indicate the absence of a wake magnetic field. These data points are then passed through a bandpass filter with a bandwidth of 0.1Hz to 5Hz to remove extremely low-frequency background geomagnetic fields, sampling drift, and high-frequency noise. Finally, the noisy signal set and the noise dataset are split into two groups, with a 4:1 ratio, forming the training and validation sets, respectively. Ultimately, the training set contains 24,000 data points, and the validation set contains 6,000 data points, with a 1:1 ratio between data labeled 0 and 1. The dataset is now constructed.
[0124] When training the ship wake magnetic field detection system, the training set and validation set have 24,000 and 6,000 data respectively. Each batch of data is selected to be 100, and the training set and validation set are divided into 2,400 and 600 training batches respectively. In this embodiment, the ship wake magnetic field detection system uses Xavier for weight initialization; the cross entropy function is selected as the loss function; the Adam function is used as the optimizer; the initial learning rate is 3×10 -6 The number of iterations is 100 generations. The learning rate adjustment strategy is to linearly decrease the learning rate from the initial learning rate to 1×10 -6 The model was trained to 100 generations and then stopped naturally. The error of the validation set did not increase significantly in the later stages of training.
[0125] In order to verify the performance of the ship wake magnetic field detection system (MTHA-Net) provided by the present invention, five network structures, namely Encoder-Net, Res-Net, HD-Net, 2D-CNN and WT-LSTM, were selected to analyze the ship wake magnetic field detection performance on the aforementioned dataset. Figure 8 The iterative process of accuracy and loss of six networks was demonstrated. Within 100 iterations, all networks converged quickly, and the proposed MTHA-Net was able to achieve the highest accuracy and the lowest loss. The accuracy of the proposed MTHA-Net reached 98.1%, which is higher than the 95.3% and 95.7% of Encoder-Net and Res-Net, respectively, and significantly outperformed the multi-feature fusion networks HD-Net, 2D-CNN, and WT-LSTM. In addition, the proposed MTHA-Net showed the smallest loss (about 0.09), indicating that it has the best ability to distinguish noisy signals from colored noise.
[0126] Figure 9 The receiver operating characteristic (ROC) curves of the six networks are shown, among which the area under the curve (AUC) of the MTHA-Net proposed in the present invention is the largest, AUC = 0.9972, which means that the MTHA-Net proposed in the present invention has almost perfect discrimination ability and can almost perfectly distinguish samples with wake magnetic fields and those without wake magnetic fields.
[0127] In order to further verify the effectiveness of the MTHA-Net provided by the present invention, the present invention conducted an ablation experiment. The modules involved in the ablation study include the DPCF module, the CSFA module and the STFT path. The results are shown in Table 2 and Figure 10 As shown in the figure, “w / o” means “without”. In Table 2, the first column shows the complete MTHA-Net, MTHA-Net without the DPCF module, MTHA-Net without the CSFA module, and MTHA-Net without the STFT path. The first row shows the detection metrics: accuracy, precision, recall, F1 score, and cross-entropy loss.
[0128] Table 2
[0129]
[0130] From Table 2 Figure 10It is clear from the figure that the DPCF module, CSFA module, and STFT path included in MTHA-Net contribute to varying degrees of improvement in detection performance. The modules with the greatest impact on network performance, in descending order, are the DPCF module, STFT path, and CSFA module. The DPCF module is particularly crucial; when MTHA-Net is stripped of the DPCF module, all performance metrics of the network degrade significantly, with accuracy dropping to 91.1% and cross-entropy loss increasing to 0.2792. Ablation studies show that the DPCF module and STFT path have the most significant impact on improving network performance. The DPCF module combines the temporal and error characteristics of the signal, and cross-layer information exchange promotes the complementary advantages of high-level semantic information and low-level details. Simultaneously, the STFT path provides the network with joint time-frequency information, enriching the representation of the input signal. Due to their significant advantages, these two modules significantly enhance the network's detection capabilities. In comparison, the CSFA module contributes less to the network's performance improvement, but its impact is still significant.
[0131] In order to verify the MTHA-Net proposed in this invention, we selected a section of experimental data from the aforementioned seaside experiment. After processing, we applied the trained MTHA-Net to the data. The results are as follows: Figure 11 As shown in the figure, the wake signal occurs between 5000 and 6500 sampling points, lasting for approximately 1500 sampling points. The MTHA-Net designed in this invention is able to effectively identify the wake signal at this location. While some low-probability positive predictions occur at other locations, these are negligible compared to the high-probability predictions at the center.
[0132] In a third aspect, the present invention provides a method for detecting a ship wake magnetic field, comprising: inputting a time series signal to be detected into the ship wake magnetic field detection system provided by the first aspect of the present invention, and obtaining a detection result of the ship wake magnetic field;
[0133] The time series signals to be detected are time series signals collected by magnetic sensors distributed around the ship's motion trajectory.
[0134] The relevant technical solution is the same as the ship wake magnetic field detection system provided in the first aspect of the present invention, and will not be described in detail here.
[0135] In a fourth aspect, the present invention provides an electronic device comprising: a memory and a processor, wherein the memory stores a computer program, and the processor executes the method provided in the second aspect or the third aspect of the present invention when executing the computer program.
[0136] The relevant technical solutions are the same as the methods provided in the second or third aspects and will not be described in detail here.
[0137] In a fifth aspect, the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method provided in the second aspect or the third aspect of the present invention.
[0138] The relevant technical solutions are the same as the methods provided in the second or third aspects and will not be described in detail here.
[0139] In a sixth aspect, the invention further provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the method provided in the second or third aspect of the invention.
[0140] The relevant technical solutions are the same as the methods provided in the second or third aspects and will not be described in detail here.
[0141] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A ship wake magnetic field detection system, characterized in that: include: a first feature extraction module for respectively extracting the fluctuation characteristics and frequency domain characteristics of the time series signal to be detected, thereby obtaining a fluctuation characteristic sequence and a time-frequency image; wherein the time series signal to be detected is a time series signal collected by magnetic sensors distributed around the ship's motion trajectory; A second feature extraction module is used to extract features of the time-frequency image to obtain time-frequency features; A path fusion module is used to extract features from the time series signal to be detected and the fluctuation feature sequence on the corresponding feature extraction branches, fuse the features extracted from the two feature extraction branches, and then merge them back into the two feature extraction branches respectively, and fuse the features finally extracted by the two feature extraction branches to obtain path fusion features; A feature fusion module, configured to fuse the path fusion feature and the time-frequency feature to obtain a global fusion feature; A classifier, configured to obtain a ship wake magnetic field detection result based on the global fusion feature; The path fusion module includes: a first feature extraction branch, a second feature extraction branch and n+1 path fusion units; n is a positive integer; the first feature extraction branch includes: n cascaded first feature extraction branch segments; the second feature extraction branch includes: n cascaded second feature extraction branch segments; the first feature extraction branch segment and the second feature extraction branch segment both include: cascaded feature extraction units and pooling layers; The input of the first first feature extraction branch section is the time series signal to be detected; the input of the first second feature extraction branch section is the fluctuation feature sequence; No. i The path fusion unit is used to i The features extracted by the feature extraction unit in the first feature extraction branch segment are i The features extracted by the feature extraction units in the second feature extraction branch are added together and then average pooled to obtain the first i Fusion features; i The fusion features are superimposed on the i The output features of the first feature extraction branch segment and the i The output features of the second feature extraction branch segment; ; The (n+1)th path fusion unit adds the features output by the (n)th first feature extraction branch segment and the features output by the (n)th second feature extraction branch segment to obtain a path fusion feature.
2. The ship wake magnetic field detection system according to claim 1, characterized in that: The feature fusion module includes: a channel fusion unit, configured to fuse the path fusion feature and the time-frequency feature in a channel dimension to obtain a channel fusion feature; The multi-scale fusion unit is used to perform multi-scale feature extraction on the channel fusion feature to obtain a first feature, a second feature, and a third feature with scales from large to small; after respectively performing scale transformation on the first feature and the third feature so that the scales of the first feature and the third feature are the same as the scale of the second feature, the first feature and the third feature are respectively added to the second feature, and the summed results are averaged to obtain a fusion feature.
3. The ship wake magnetic field detection system according to claim 2, characterized in that: The channel fusion unit is used to perform a flattening operation on the time-frequency features in each channel dimension; interpolate the path fusion features so that the length after interpolation is the same as the length after the flattening operation on each channel of the time-frequency features; and splice the interpolated path fusion features and the time-frequency features after the flattening operation in the channel dimension to obtain the channel fusion features.
4. The training method for a ship wake magnetic field detection system according to any one of claims 1 to 3, characterized in that: include: Inputting the time series signals in the training set into the ship wake magnetic field detection system to obtain corresponding ship wake magnetic field detection results; The ship wake magnetic field detection system is trained by minimizing the difference loss between the ship wake magnetic field detection result of each time series signal in the training set and the corresponding label indicating whether there is a ship wake magnetic field; The training set includes: noisy time series signals carrying wake magnetic field information and noisy time series signals not carrying wake magnetic field information.
5. The training method according to claim 4, characterized in that The training set is obtained in the following way: The wake magnetic field is simulated and calculated under N different ship environmental parameters, and N three-component segments of the wake magnetic field are obtained; Project the three-component segments of each wake magnetic field onto the geomagnetic field vector corresponding to the colored noise collection location, and finally obtain N simulated wake magnetic field segments; N is a positive integer; The colored noise signal at the collection location is cut to obtain colored noise segments of the same size as the simulated wake magnetic field segments and the number of which is greater than or equal to 2N, forming a colored noise segment set; Randomly selecting N colored noise segments from the colored noise segment set and superimposing them one-to-one with N simulated wake magnetic field segments to obtain N noisy time series signals carrying wake magnetic field information, and the corresponding label is that there is a ship wake magnetic field; N colored noise segments are randomly selected from the remaining colored noise segments in the colored noise segment set as noise time series signals, and the corresponding label is no ship wake magnetic field.
6. A method for detecting a ship's wake magnetic field, characterized in that: include: Inputting the time series signal to be detected into the ship wake magnetic field detection system according to any one of claims 1 to 3 to obtain a detection result of the ship wake magnetic field; The time series signals to be detected are time series signals collected by magnetic sensors distributed around the ship's motion trajectory.
7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor executes the method according to any one of claims 4 to 6 when executing the computer program.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method according to any one of claims 4 to 6.
9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 4 to 6 is implemented.
Citation Information
Patent Citations
Ship acoustic wake flow detection method based on convolutional neural network
CN115510898A
Method and device for signal processing, computer device, and storage medium
WO2021189642A1