A deep network line spectrum detection method embedded with attention mechanism
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2026-08-11
AI Technical Summary
但是由于传播时受水声传播特性、海洋环境噪声等因素的影响,目标辐射噪声信号具有非平稳特性,这使得LOFAR谱图上线谱轨迹出现复杂的随机波动现象
Smart Images

Figure CN118568459B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of signal detection, and in particular to a deep network line spectrum detection method with an embedded attention mechanism. Background Technology
[0002] In the field of passive underwater acoustic target detection, the line spectrum component of the target radiated noise signal has high energy intensity and carries information about the target's operational status, making it a key characteristic parameter for detecting, identifying, and tracking underwater acoustic targets. However, due to the influence of underwater acoustic propagation characteristics and marine environmental noise, the target radiated noise signal exhibits non-stationary characteristics, resulting in complex random fluctuations in the line spectrum trajectory on the LOFAR spectrum. Furthermore, the sharp decrease in the signal-to-noise ratio of the target radiated noise signal received by passive sonar due to interference from various marine environmental noises is also a challenge for line spectrum detection tasks. Summary of the Invention
[0003] The purpose of this invention is to address the shortcomings of traditional methods by proposing a deep network-based line spectrum detection method with an embedded attention mechanism. Deep learning is applied to the line spectrum detection problem, using a deep network to detect line spectra in a time-frequency plot. This invention does not require prior information about the signal, and its line spectrum detection performance is superior to other detection methods, maintaining good detection performance even at signal-to-noise ratios as low as -28 dB.
[0004] Technical Solution: To achieve the above-mentioned objectives, this invention proposes a deep network line spectrum detection method embedding an attention mechanism, which includes the following steps:
[0005] Step 1: Construct a deep encoder-decoder network model;
[0006] Step 2: Generate the simulation training sample dataset;
[0007] Step 3: Design a composite loss function based on the continuity of the line spectrum trajectory;
[0008] Step 4: Train the network using the generated simulation dataset;
[0009] Step 5: Obtain real time-frequency graph data and detect the line spectrum using a trained network.
[0010] Furthermore, in step 1, a deep encoder-decoder network model is constructed, including an encoding part, a deep connection part, a decoding part, and a skip connection part, as detailed below:
[0011] 1-1, The deep encoder-decoder network model consists of three encoders, one deep connector, and three decoders. The encoders filter out noise from the time-frequency image and extract semantic features from the line spectrum. The deep connector transmits the time-frequency image features extracted by the encoders to the decoders. The decoders refine the features of the time-frequency image. The three encoders are composed of progressively increasing numbers of residual modules, and they gradually reduce the image size and extract features through pooling downsampling. The first encoder consists of an initial module, a residual module, and max pooling; the second encoder consists of four residual modules... The first decoder consists of a residual module and max pooling; the second decoder consists of a transposed convolutional layer and 3 residual modules; the third decoder consists of a transposed convolutional layer and 2 residual modules; the fourth decoder consists of a transposed convolutional layer, 2 residual modules, and a 1×1 convolutional layer. A sigmoid activation function is used after the third decoder to calculate the line spectrum detection results.
[0012] The residual module includes a main branch and an identity mapping branch. The main branch of the residual module uses a 1×1 convolutional layer to reduce the dimensionality of the feature map channels, uses a 3×3 convolutional layer for feature learning, and uses a 1×1 convolutional layer to restore the channel dimension of the feature map. After each convolutional layer, normalization (BatchNorm) and ReLU activation function are applied. The identity mapping branch of the residual module directly adds the input feature map of the residual module to the output feature of the main branch, and calculates the output of the residual module through the ReLU activation function.
[0013] 1-2, The skip connection part of the deep encoder-decoder network model adopts a feature fusion module with an embedded attention mechanism. The attention mechanism is used to enhance the shallow feature map from the encoder and fuse it with the deep feature map from the decoder.
[0014] The input to the Feature Fusion Module (AFF) with the embedded attention mechanism includes the semantic feature map output from the deconvolution of the decoder front end. and the corresponding shallow feature map output by the l encoder After performing a 1×1 convolution operation to transform the feature maps of the two inputs into similar feature spaces, the intermediate result I is obtained by pixel-by-pixel summation. Then, spatial attention A is extracted through spatial attention branch and channel attention branch respectively. s and channel attention A cIn the spatial attention branch, the intermediate result I is first passed through a ReLU activation function, then compressed into one dimension through a 1×1 convolution operation, and finally the spatial attention A is obtained through a Sigmoid activation function. s A s =Sigmoid(conv) s (ReLu(I))), where conv s For a single 1×1 convolution operation, in the channel attention branch, the intermediate result I is first processed using global average pooling (AvgPool()) and global max pooling (MaxPool()) to obtain the pooling features for each channel, which are then concatenated. Finally, the attention coefficients A are obtained through a multilayer perceptron and a sigmoid activation function. c A c =Sigmoid(Concat(AvgPool(I),MaxPool(I))·W1·W2), where W1 and W2 are two fully connected layers in a multilayer perceptron, representing spatial attention A. s and channel attention A c The global attention A is calculated by performing pixel-by-pixel multiplication, and then the global attention A is used to process the shallow feature map. The enhancement process yields an enhanced feature map X′. The AFF module then combines the enhanced feature map X′ with the semantic feature map. After concatenating along the feature channels, a 1×1 convolution operation is used to fuse and compress the two feature maps to obtain the result. Input to the l-th decoder.
[0015] Furthermore, in step 2, the Monte Carlo simulation method is used to generate simulated time-frequency maps under different signal-to-noise ratio conditions. The data augmentation method of random pruning and random flipping is used to divide the data-augmented simulated time-frequency maps into training and test sets at a ratio of 9:1.
[0016] Furthermore, Monte Carlo simulation is used to generate simulated time-frequency graph datasets with different signal-to-noise ratios. First, a multi-line spectrum signal s is generated. m (t), which is generated by the superposition of multiple sinusoidal signals with random amplitudes, frequencies, and initial phases and white noise, i.e. Where K represents the number of line spectra in the time-frequency graph, and T represents the number of time-domain samples per frame. Let n(t) be the phase of the k-th line spectrum, and let n(t) be a spectrum with zero mean and variance σ. 2 Distributed Gaussian white noise, a m,k f m,k Let be the amplitude and frequency of the k-th line spectrum within the m-th time frame, respectively. The appearance and disappearance of the line spectrum are simulated by randomly setting the amplitude of the line spectrum to 0 for a consecutive time frame. After simulating the multi-line spectrum signal, the amplitude of the line spectrum is then further analyzed by...m (t) A short-time Fourier transform is performed to generate an analog time-frequency graph. Line spectrum tag files for the time-frequency graph are generated based on the line spectrum features in the multi-line spectrum signal. The time-frequency graph and its corresponding line spectrum tags constitute a line spectrum detection dataset. The signal-to-noise ratio (SNR) of the line spectrum signal is defined using the wideband SNR method, i.e. By changing the signal amplitude with a fixed variance of Gaussian white noise, time-frequency maps with different signal-to-noise ratios were generated. Finally, four sets of line spectrum detection datasets with signal-to-noise ratios of -22dB, -24dB, -26dB, and -28dB were generated. Each dataset consists of 2000 time-frequency maps at that signal-to-noise ratio and the corresponding label file. 90% of them were selected as the training set and 10% as the test set. The training set and the test set do not overlap.
[0017] Furthermore, in step 3, taking advantage of the continuity of the line spectrum trajectory in the time-frequency graph, the variance of the predicted probability between different line spectrum points is calculated as the connection loss in the prediction result, the variance of the predicted probability between the line spectrum point and the noise point is calculated as the edge loss, and combined with the cross-entropy loss function to form a composite loss function.
[0018] Furthermore, the composite loss function is as follows:
[0019] Given input time-frequency graph With the true label graph Y∈{0,1} H×W The deep network detection results are The formula for calculating cross-entropy loss is as follows:
[0020]
[0021] In the formula, H and W represent the number of time frames and the number of frequency points in the LOFAR spectrum, respectively; y i,j and Representing the true label image Y and the detection result, respectively. Data for each pixel in the image;
[0022] Based on the true label map Y, a sliding window of size r×r is used to plot the line spectrum probability map output by the network. Extract the center point labels of N windows as line spectra y m,n =1 line block Ω m,n Because the spectral trajectory has time-frequency continuity, within each spectral block, there are time-frequency points belonging to the same spectral line as the center point within adjacent time frames. The formula for calculating the spectral connectivity loss is as follows:
[0023]
[0024] In the formula, Indicates the number of staves contained in the stave block;
[0025] The edge loss of the line spectrum is defined as:
[0026]
[0027] The composite loss function, which combines cross-entropy loss, line connectivity loss, and line edge loss, is as follows:
[0028]
[0029] In the formula, α is used to adjust the balance coefficient between different losses, and r is a positive integer.
[0030] Furthermore, in step 4, the network is trained using a training strategy that gradually reduces the signal-to-noise ratio, i.e., it is trained using a dataset with a signal-to-noise ratio that gradually decreases from -22dB to -28dB.
[0031] Furthermore, in step 5, the dynamic range of the obtained real time-frequency image is adjusted by logarithmic transformation and Z-score normalization, and then input into the trained detection network to obtain the line spectrum detection result.
[0032] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
[0033] This invention proposes a deep network line spectrum detection method with embedded attention mechanism. The constructed encoder-decoder network can detect multiple line spectrum trajectories in time-frequency graphs, thereby improving the efficiency of line spectrum detection. The proposed deep network line spectrum detection method has end-to-end multi-line spectrum trajectory detection capability and is more suitable for complex line spectrum detection tasks with low signal-to-noise ratio compared to other line spectrum detection methods. Attached Figure Description
[0034] Figure 1 This is a diagram of the deep network model for line spectrum detection described in this invention;
[0035] Figure 2 This is a flowchart of the method of the present invention. Detailed Implementation
[0036] like Figure 2 As shown, this invention proposes a deep network line spectrum detection method with an embedded attention mechanism, which includes the following steps:
[0037] Step 1: Construct a deep encoder-decoder network model;
[0038] Step 2: Generate the simulation training sample dataset;
[0039] Step 3: Design a composite loss function based on the continuity of the line spectrum trajectory;
[0040] Step 4: Train the network using the generated simulation dataset;
[0041] Step 5: Obtain real time-frequency graph data and detect the line spectrum using a trained network.
[0042] Furthermore, in step 1, a deep encoder-decoder network model is constructed, including an encoding part, a deep connection part, a decoding part, and a skip connection part, as detailed below:
[0043] 1-1, The deep encoder-decoder network model consists of three encoders, one deep connector, and three decoders. The encoders filter out noise from the time-frequency image and extract semantic features from the line spectrum. The deep connector transmits the time-frequency image features extracted by the encoders to the decoders. The decoders refine the features of the time-frequency image. The three encoders are composed of progressively increasing numbers of residual modules, and they gradually reduce the image size and extract features through pooling downsampling. The first encoder consists of an initial module, a residual module, and max pooling; the second encoder consists of four residual modules... The first decoder consists of a residual module and max pooling; the second decoder consists of a transposed convolutional layer and 3 residual modules; the third decoder consists of a transposed convolutional layer and 2 residual modules; the fourth decoder consists of a transposed convolutional layer, 2 residual modules, and a 1×1 convolutional layer. A sigmoid activation function is used after the third decoder to calculate the line spectrum detection results.
[0044] The residual module includes a main branch and an identity mapping branch. The main branch of the residual module uses a 1×1 convolutional layer to reduce the dimensionality of the feature map channels, uses a 3×3 convolutional layer for feature learning, and uses a 1×1 convolutional layer to restore the channel dimension of the feature map. After each convolutional layer, normalization (BatchNorm) and ReLU activation function are applied. The identity mapping branch of the residual module directly adds the input feature map of the residual module to the output feature of the main branch, and calculates the output of the residual module through the ReLU activation function.
[0045] 1-2, The skip connection part of the deep encoder-decoder network model adopts a feature fusion module with an embedded attention mechanism. The attention mechanism is used to enhance the shallow feature map from the encoder and fuse it with the deep feature map from the decoder.
[0046] The input to the Feature Fusion Module (AFF) with the embedded attention mechanism includes the semantic feature map output from the deconvolution of the decoder front end. and the corresponding shallow feature map output by the l encoder After performing a 1×1 convolution operation to transform the feature maps of the two inputs into similar feature spaces, the intermediate result I is obtained by pixel-by-pixel summation. Then, spatial attention A is extracted through spatial attention branch and channel attention branch respectively. s and channel attention A c In the spatial attention branch, the intermediate result I is first passed through a ReLU activation function, then compressed into one dimension through a 1×1 convolution operation, and finally the spatial attention A is obtained through a Sigmoid activation function. s A s =Sigmoid(conv) s (ReLu(I))), where conv s For a single 1×1 convolution operation, in the channel attention branch, the intermediate result I is first processed using global average pooling (AvgPool()) and global max pooling (MaxPool()) to obtain the pooling features for each channel, which are then concatenated. Finally, the attention coefficients A are obtained through a multilayer perceptron and a sigmoid activation function. c A c =Sigmoid(Concat(AvgPool(I),MaxPool(I))·W1·W2), where W1 and W2 are two fully connected layers in a multilayer perceptron, representing spatial attention A. s and channel attention A c The global attention A is calculated by performing pixel-by-pixel multiplication, and then the global attention A is used to process the shallow feature map. The enhancement process yields an enhanced feature map X′. The AFF module then combines the enhanced feature map X′ with the semantic feature map. After concatenating along the feature channels, a 1×1 convolution operation is used to fuse and compress the two feature maps to obtain the result. Input to the l-th decoder.
[0047] Furthermore, in step 2, the Monte Carlo simulation method is used to generate simulated time-frequency maps under different signal-to-noise ratio conditions. The data augmentation method of random pruning and random flipping is used to divide the data-augmented simulated time-frequency maps into training and test sets at a ratio of 9:1.
[0048] Furthermore, Monte Carlo simulation is used to generate simulated time-frequency graph datasets with different signal-to-noise ratios. First, a multi-line spectrum signal s is generated. m (t), which is generated by the superposition of multiple sinusoidal signals with random amplitudes, frequencies, and initial phases and white noise, i.e. Where K represents the number of line spectra in the time-frequency graph, and T represents the number of time-domain samples per frame. Let n(t) be the phase of the k-th line spectrum, and let n(t) be a spectrum with zero mean and variance σ. 2 Distributed Gaussian white noise, am,k f m,k Let be the amplitude and frequency of the k-th line spectrum within the m-th time frame, respectively. The appearance and disappearance of the line spectrum are simulated by randomly setting the amplitude of the line spectrum to 0 for a consecutive time frame. After simulating the multi-line spectrum signal, the amplitude of the line spectrum is then further analyzed by... m (t) A short-time Fourier transform is performed to generate an analog time-frequency graph. Line spectrum tag files for the time-frequency graph are generated based on the line spectrum features in the multi-line spectrum signal. The time-frequency graph and its corresponding line spectrum tags constitute a line spectrum detection dataset. The signal-to-noise ratio (SNR) of the line spectrum signal is defined using the wideband SNR method, i.e. By changing the signal amplitude with a fixed variance of Gaussian white noise, time-frequency maps with different signal-to-noise ratios were generated. Finally, four sets of line spectrum detection datasets with signal-to-noise ratios of -22dB, -24dB, -26dB, and -28dB were generated. Each dataset consists of 2000 time-frequency maps at that signal-to-noise ratio and the corresponding label file. 90% of them were selected as the training set and 10% as the test set. The training set and the test set do not overlap.
[0049] Furthermore, in step 3, taking advantage of the continuity of the line spectrum trajectory in the time-frequency graph, the variance of the predicted probability between different line spectrum points is calculated as the connection loss in the prediction result, the variance of the predicted probability between the line spectrum point and the noise point is calculated as the edge loss, and combined with the cross-entropy loss function to form a composite loss function.
[0050] Furthermore, the composite loss function is as follows:
[0051] Given input time-frequency graph With the true label graph Y∈{0,1} H×W The deep network detection results are The formula for calculating cross-entropy loss is as follows:
[0052]
[0053] In the formula, H and W represent the number of time frames and the number of frequency points in the LOFAR spectrum, respectively; y i,j and Representing the true label image Y and the detection result, respectively. Data for each pixel in the image;
[0054] Based on the true label map Y, a sliding window of size r×r is used to plot the line spectrum probability map output by the network. Extract the center point labels of N windows as line spectra y m,n =1 line block Ω m,n Because the spectral trajectory has time-frequency continuity, within each spectral block, there are time-frequency points belonging to the same spectral line as the center point within adjacent time frames. The formula for calculating the spectral connectivity loss is as follows:
[0055]
[0056] In the formula, Indicates the number of staves contained in the stave block;
[0057] The edge loss of the line spectrum is defined as:
[0058]
[0059] The composite loss function, which combines cross-entropy loss, line connectivity loss, and line edge loss, is as follows:
[0060]
[0061] In the formula, α is used to adjust the balance coefficient between different losses, and r is a positive integer.
[0062] Furthermore, in step 4, the network is trained using a training strategy that gradually reduces the signal-to-noise ratio, i.e., it is trained using a dataset with a signal-to-noise ratio that gradually decreases from -22dB to -28dB.
[0063] Furthermore, in step 5, the dynamic range of the obtained real time-frequency image is adjusted by logarithmic transformation and Z-score normalization, and then input into the trained detection network to obtain the line spectrum detection result.
Claims
1. A deep network line spectrum detection method with embedded attention mechanism, characterized in that, The method includes the following steps: Step 1: Construct a deep encoder-decoder network model; Step 2: Generate the simulation training sample dataset; Step 3: Design a composite loss function based on the continuity of the line spectrum trajectory; Step 4: Train the network using the generated simulation dataset; Step 5: Obtain real time-frequency plot data and detect the line spectrum using the trained network; In step 1, a deep encoder-decoder network model is constructed, including an encoding part, a deep connection part, a decoding part, and a skip connection part, as detailed below: 1-1, The deep encoder-decoder network model consists of three encoders, one deep connector, and three decoders. The encoders filter out noise from the time-frequency image and extract semantic features from the line spectrum. The deep connector transmits the time-frequency image features extracted by the encoders to the decoders. The decoders refine the features of the time-frequency image. The three encoders are composed of progressively increasing numbers of residual modules, and they gradually reduce the image size and extract features through pooling downsampling. The first encoder consists of an initial module, a residual module, and max pooling; the second encoder consists of four residual modules... The first decoder consists of a residual module and max pooling; the second decoder consists of a transposed convolutional layer and 3 residual modules; the third decoder consists of a transposed convolutional layer and 2 residual modules; the fourth decoder consists of a transposed convolutional layer, 2 residual modules, and a 1×1 convolutional layer. A sigmoid activation function is used after the third decoder to calculate the line spectrum detection results. The residual module includes a main branch and an identity mapping branch. The main branch of the residual module uses a 1×1 convolutional layer to reduce the dimensionality of the feature map channels, uses a 3×3 convolutional layer for feature learning, and uses a 1×1 convolutional layer to restore the channel dimension of the feature map. After each convolutional layer, normalization (BatchNorm) and ReLU activation function are applied. The identity mapping branch of the residual module directly adds the input feature map of the residual module to the output feature of the main branch, and calculates the output of the residual module through the ReLU activation function. 1-2, The skip connection part of the deep encoder-decoder network model adopts a feature fusion module with an embedded attention mechanism. The attention mechanism is used to enhance the shallow feature map from the encoder and fuse it with the deep feature map from the decoder. The input to the Feature Fusion Module (AFF) with the embedded attention mechanism includes semantic feature map output by the front-end deconvolution of the decoder and corresponding Shallow feature map output by the encoder After performing a 1×1 convolution operation to transform the feature maps of the two inputs into similar feature spaces, the intermediate result is obtained by adding them pixel by pixel. Spatial attention is then extracted through spatial attention branch and channel attention branch respectively. and channel attention In the spatial attention branch, the intermediate results are first... First pass After the activation function, a 1×1 convolution operation is used to compress the feature channels into one dimension, and then a... Spatial attention is obtained through activation functions. ,Right now ,in, For a single 1×1 convolution operation, in the channel attention branch, the intermediate results are first processed... Use global average pooling and global max pooling The pooling features of each channel are obtained separately and concatenated, then processed by a multilayer perceptron and... Attention coefficients are obtained from activation functions ,Right now ,in , These are two fully connected layers in a multilayer perceptron, for spatial attention. and channel attention Global attention is calculated by performing pixel-by-pixel multiplication. Then use global attention shallow feature map Enhancement is performed to obtain enhanced feature maps. The AFF module will enhance the feature map. and semantic feature maps After concatenating along the feature channels, a 1×1 convolution operation is used to fuse and compress the two feature maps to obtain the result. Enter the number One decoder; In step 3, taking advantage of the continuity of the line spectrum trajectory in the time-frequency graph, the variance of the prediction probability between different line spectrum points is calculated as the connection loss in the prediction result, the variance of the prediction probability between the line spectrum point and the noise point is calculated as the edge loss, and the composite loss function is formed by combining the cross-entropy loss function. The composite loss function is as follows: Given input time-frequency graph Compared with real label images The deep network detection results are The formula for calculating cross-entropy loss is as follows: ; In the formula, and These represent the time frame number and frequency point number of the LOFAR spectrum, respectively. and These represent the actual label images. and test results Data for each pixel in the image; Based on the actual label image Use size The sliding window displays the line spectrum probability map output by the network. Extract The center point of each window is labeled with a musical line. line blocks Because the spectral trajectory has time-frequency continuity, within each spectral block, there are time-frequency points belonging to the same spectral line as the center point in adjacent time frames. The formula for calculating the spectral connectivity loss is as follows: ; In the formula, Indicates the number of staves contained in the stave block; The edge loss of the line spectrum is defined as: ; The composite loss function, which combines cross-entropy loss, line connectivity loss, and line edge loss, is as follows: ; In the formula, The balance coefficient used to adjust the balance between different losses, where r is a positive integer.
2. The deep network line spectrum detection method with embedded attention mechanism according to claim 1, characterized in that, In step 2, the Monte Carlo simulation method is used to generate simulated time-frequency maps under different signal-to-noise ratio conditions. The data augmentation method of random pruning and random flipping is used to divide the data-augmented simulated time-frequency maps into training and test sets at a ratio of 9:
1.
3. The deep network line spectrum detection method with embedded attention mechanism according to claim 2, characterized in that, Monte Carlo simulation was used to generate simulated time-frequency plot datasets with different signal-to-noise ratios. First, multi-line spectrum signals were generated. It is generated by the superposition of multiple sinusoidal signals with random amplitudes, frequencies, and initial phases and white noise, i.e. ,in, This indicates the number of line spectra in the time-frequency graph. This represents the number of temporal samples per frame. For the first Phase of the root spectrum, To follow the pattern of zero mean and variance , Distributed Gaussian white noise, , The first The first time frame within the [number] time frame The amplitude and frequency of the root spectrum are simulated by randomly setting the amplitude of the root spectrum to 0 for a continuous time frame to simulate the appearance and disappearance of the root spectrum. After simulating the multi-line spectrum signal, the amplitude and frequency are then further simulated by... A short-time Fourier transform is performed to generate an analog time-frequency plot. Line spectrum features from the multi-line spectrum signal are used to generate line spectrum tag files for the time-frequency plot. The time-frequency plot and its corresponding line spectrum tags constitute a line spectrum detection dataset. The signal-to-noise ratio (SNR) of the line spectrum signal is defined using the wideband SNR method. By changing the signal amplitude with a fixed variance of Gaussian white noise, time-frequency maps with different signal-to-noise ratios were generated. Finally, four sets of line spectrum detection datasets with signal-to-noise ratios of -22dB, -24dB, -26dB, and -28dB were generated. Each dataset consists of 2000 time-frequency maps at that signal-to-noise ratio and the corresponding label file. 90% of them were selected as the training set and 10% as the test set. The training set and the test set do not overlap.
4. The deep network line spectrum detection method with embedded attention mechanism according to claim 1, characterized in that, In step 4, the network is trained using a training strategy that gradually reduces the signal-to-noise ratio, i.e., using a dataset with a signal-to-noise ratio gradually decreasing from -22dB to -28dB.
5. The deep network line spectrum detection method with embedded attention mechanism according to claim 1, characterized in that, In step 5, the real time-frequency image is obtained, and the dynamic range of the image is adjusted by logarithmic transformation and Z-score normalization. The image is then input into the trained detection network to obtain the line spectrum detection result.