A Passive Target Line Spectral Feature Extraction Method Based on Distributed Attention Mechanism Network Architecture
By constructing a distributed attention mechanism network architecture, the problem of weak line spectrum extraction by passive sonar in complex environments is solved, achieving stronger nonlinear mapping and better line spectrum extraction results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2026-03-10
AI Technical Summary
Existing passive sonar target recognition methods struggle to effectively extract weak line spectra in complex environments, leading to a decrease in target recognition accuracy.
A distributed attention mechanism-based network architecture is adopted. By constructing a LOFAR spectrogram training sample set, a distributed attention mechanism network model is designed and trained in multiple stages. The attention mechanism network model is then used to extract features from the LOFAR spectrogram.
It improves the ability to extract weak line spectra and enhances the ability to map nonlinear relationships, resulting in better line spectrum extraction and compatibility with LOFAR spectrum processing.
Smart Images

Figure CN115587334B_ABST
Abstract
Description
Technical fields:
[0001] This invention belongs to the field of sonar target recognition, specifically relating to a passive target line spectrum feature extraction method based on a distributed attention mechanism network architecture. Background technology:
[0002] Line spectra are among the most commonly used and important features for passive sonar target identification. However, in real-world scenarios, factors such as strong interference from multiple targets, spatiotemporal variations in ocean channels, background and platform noise, and the proliferation of low-radiation noise equipment like UUVs often result in highly complex signals received by sonar. This can lead to weak line spectra, crucial for target identification, being submerged in environmental and background noise. Therefore, research on weak line spectrum extraction methods has become a focus for many researchers. Traditionally, line spectrum extraction methods have relied on signal processing techniques and prior rules. However, due to the inherent performance limitations of these methods, their ability to extract weak line spectra in complex environments often fails to meet practical needs. Summary of the Invention:
[0003] The technical problem to be solved by this invention is to provide a passive target line spectrum feature extraction method based on a distributed attention mechanism network architecture. Compared with existing passive target line spectrum extraction methods, this method has stronger nonlinear relationship mapping capabilities, is more compatible with LOFAR spectrum processing, and has better weak line spectrum extraction results.
[0004] The technical solution of this invention is to provide a passive target line spectrum feature extraction method based on a distributed attention mechanism network architecture. This method includes...
[0005] S1, Construct the LOFAR spectrum training / validation sample set;
[0006] S2. Based on the characteristics of LOFAR spectra and their line spectra, a distributed attention mechanism network model is constructed and a training strategy is designed.
[0007] S3, training the distributed attention mechanism network model;
[0008] S4 extracts features from the unknown LOFAR spectrum based on the trained model and outputs the line spectrum extraction results.
[0009] As a preferred embodiment, the construction process of S1 is as follows:
[0010] S1.1, Design a method for constructing the spectrum training / validation sample set, the steps of which are as follows:
[0011] S1.1.1, Set the line spectrum signal-to-noise ratio range to [S start ,S end ], where H SNR_start H is the lower limit of the signal-to-noise ratio.SNR_end As the upper limit of signal-to-noise ratio, the number, frequency, duration, curvature / shift / fluctuation of line spectra generated based on the underwater acoustic target radiation noise model are randomly distributed, and the signal-to-noise ratio is within [S]. start ,S end The target time-domain waveform within the range;
[0012] S1.1.2, The target time-domain waveform of S1.1.1 is processed using the traditional LOFAR processing method to generate LOFAR spectrum samples with a frequency resolution of 0.1Hz, a number of frequency points of 1024, and a cumulative batch number of 32. The corresponding label is a one-dimensional sequence with a length of 1024, which is the same as the number of frequency points in the LOFAR spectrum. The sequence is assigned values according to the corresponding frequency points and intensities based on the theoretical line spectrum to generate sample labels.
[0013] S1.1.3, Normalize the LOFAR spectral samples and their labels;
[0014] S1.1.4, Tag Encoding. Set the tag to y. Label , will y Label The overall amplitude decreases by 50%, that is, y Label =y Label / 2; Based on the number and frequency of the line spectra set in S1.1.1, calculate the frequency points n corresponding to all line spectra. Line_spc And perform line spectrum enhancement, i.e.
[0015] y Label (n Line_spc )=y Label (n Line_spc )+N enhance (1)
[0016] Where, N enhance To enhance the line spectrum, the range is typically set to [0.4, 0.7].
[0017] S1.2, Set the line spectrum signal-to-noise ratio range of the high signal-to-noise ratio simulated LOFAR spectrum to [H]. SNR_start H SNR_end Repeat step S1.1 to generate a large-scale high signal-to-noise ratio simulated LOFAR spectrum sample set;
[0018] S1.3, Set the line spectrum signal-to-noise ratio range of the low signal-to-noise ratio simulated LOFAR spectrum to [L]. SNR_start ,L SNR_end Repeat step S1.1 to generate a large-scale low signal-to-noise ratio simulated LOFAR spectrum sample set;
[0019] S1.4 Process the small sample of actual sea trial target tracking beam data according to S1.1.2 to S1.1.4 to generate a small sample of actual LOFAR spectrum sample set.
[0020] As a preferred option, the process of S2 is as follows.
[0021] S2.1, Construct a general model for attention mechanism network units;
[0022] S2.2, the general model of the attention mechanism network unit constructed according to S2.1, sets the number of basic attention mechanism modules stacked N=6 to construct a low-complexity attention mechanism network unit;
[0023] S2.3, the general model of the attention mechanism network unit constructed according to S2.1, sets the number of basic attention mechanism modules stacked N=8, and constructs a medium-complexity attention mechanism network unit;
[0024] S2.4, the general model of the attention mechanism network unit constructed according to S2.1, sets the number of basic attention mechanism modules stacked N=10 to construct a high-complexity attention mechanism network unit;
[0025] S2.5, Construct the entire network, the process is as follows:
[0026] S2.5.1, Add a data slicing layer based on the number of frequency points N of the original LOFAR spectrum samples. freq and cumulative batch N Snap Divide the LOFAR spectral samples into a number of int(N) freq / (2N Snap The number of frequency points in each segment is int(N) freq / (2N Snap ))+L overlap Where int represents the integer operation, L overlap Indicates the number of overlapping points between segments;
[0027] S2.5.2, Construct a distributed attention mechanism network module for segment-by-segment feature extraction;
[0028] S2.5.3, construct the network integration layer to sequentially arrange and integrate the features of each LOFAR spectral image segment output by S2.5.2, and extract the integrated features and their line spectrum results;
[0029] S2.6, Construct the model training loss function, and set the model output as R. Model The sample label is y Label Then the model loss function is calculated using the least mean square error method, i.e.
[0030]
[0031] Where, N B This refers to the batch size during training.
[0032] S2.7, Design the model training optimizer and parameter setting strategy, dividing the training process into three stages according to the number of training rounds. The first stage of model training uses the SDG optimizer, with a learning rate of 0.001, impulse of 0.95, and weight decay of 0.000015; the training sample set is a large-scale high SNR simulated LOFAR spectrum sample set, and the batch size for each training round is set to 64. The second stage of model training uses the Adam optimizer, with a learning rate of 0.0001; the training sample set is a large-scale low SNR simulated LOFAR spectrum sample set, and the batch size for each training round is set to 64. The third stage of model training uses the Adam optimizer, with a learning rate of 0.0001; the training sample set is a small sample of actual LOFAR spectrum samples, and the batch size for each training round is set to 32.
[0033] As a preferred embodiment, the steps for constructing the general model of the attention mechanism network unit in S2.1 are as follows:
[0034] S2.1.1, Construct the basic modules of the attention mechanism;
[0035] S2.1.2, Construct a general model for the entire attention mechanism network unit;
[0036] The process of S2.1.1 is as follows:
[0037] S2.1.1.1, Construct basic module 1;
[0038] S2.1.1.2, Construct basic module 2;
[0039] S2.1.1.3 connects Model 1 and Model 2 in series to form the basic module of the attention mechanism.
[0040] As a preferred embodiment, the specific process for constructing basic module 1 in S2.1.1.1 is as follows: Add a three-dimensional matrix dimension transformation layer (a1,a2,a3)->(a1,a3,a2,1), where (a1,a2,a3) and (a1,a2,a3,1) represent the matrix dimensions before and after the transformation, and the numbers in parentheses represent the dimensions of each dimension of the matrix; add two convolutional layers with parameters (1×1,3072,1) and (1×1,1536,1), where the numbers in parentheses represent the kernel size, the number of convolutional output channels, and so on, respectively. Convolution stride; Add a matrix dimension transformation layer (a1,1536,a2,1)->(3,a1,a2,512), where (a1,1536,a2,1) and (3,a1,a2,512) represent the matrix dimensions before and after the transformation, respectively; Add a matrix splitting layer to split the matrix of dimension (3,a1,a2,512) into three submatrices of size (a1,a2,512), denoted as M1, M2, and M3; Add three parallel matrix dimension transformation layers with parameters (a1,a2,...). The transformations (512)->(a1,8,a2,64), (a1,a2,512)->(a1,8,64,a2), and (a1,a2,512)->(a1,8,a2,64) are used for dimensional transformations of M1, M2, and M3, respectively, to obtain matrices M1′, M2′, and M3′. A Dropout layer is added to perform Dropout processing on M1′. A matrix multiplication operation processing layer is added to perform the multiplication operation of M1′ and M2′ to obtain matrix N1. A coefficient weighting layer is added to multiply N1 by a coefficient of 0.125. Add a Softmax layer and a Dropout layer to process N1 sequentially; add a matrix multiplication operation processing layer to perform the multiplication of N1 and M3′ to obtain N2; add a matrix dimension transformation layer (a1,8,a2,64)->(a1,512,a2,1) to process N2 to obtain N3; add a convolutional layer (1×1,a3,1), a Dropout layer, and a matrix dimension transformation layer (a1,512,a2,1)->(a1,a2,a3) to process N3 sequentially, and this module outputs the result.
[0041] As a preferred option, the specific process of constructing basic module 2 in S2.1.1.2 is as follows: add matrix dimension transformation layer (a1,a2,a3)->(a1,a3,a2,1), convolutional layer (1×1,1024,1), dropout layer, convolutional layer (1×1,2048,1), GELU activation function, dropout layer, convolutional layer (1×1,1024,1), dropout layer, convolutional layer (1×1,a3,1) and dropout layer, matrix dimension transformation layer (a1,a3,a2,1)->(a1,a2,a3).
[0042] As a preferred option, the specific process for constructing the general model of the entire attention mechanism network unit in S2.1.2 is as follows:
[0043] S2.1.2.1, Construct the matrix segmentation and dimension transformation module, setting the input model data as a matrix (N batch (x1, x2), where N is the number of elements in the N-axis. batch Let x1 and x2 be the row and column sizes of the input matrix, respectively, and 1 be the number of LOFAR spectrum channels. The size of the segmented submatrix is set to (N...). batch Add a matrix dimension transformation layer to achieve dimension transformation (N, y1, y2); batch ,1,x1,x2)->(N batch ,1,N patch Add a matrix dimension transformation layer to achieve dimension transformation (N, y1, y2); batch ,1,N patch ,y1,y2)->(N batch ,1·y1·y2,N patch ,1); Add convolutional layer (1×1,4096,1); Add convolutional layer (1×1,2048,1); Add convolutional layer (1×1,256,1); Add matrix dimension transformation layer (N batch ,256,N patch ,1)->(N batch N patch ,256), the final output data x Stage1 ;
[0044] S2.1.2.2, Construct the category / sub-unit location information embedding module. Generate the category information embedding matrix (N batch (1,256) and location information embedding matrix (N) batch N patch +1,256), initialize the above matrix with random values; add a matrix merging extension processing layer to embed category information into the matrix and x. Stage1 Merging along dimension 1 yields a size of (N) batch N patch A matrix of size x (+1,256) is given; a matrix addition processing layer is added, which embeds the position information into the matrix and adds it to the previously output matrix, finally outputting the data x. Stage2 ;
[0045] S2.1.2.3, Construct the dropout module for x Stage2 Perform a dropout operation and output data x. Stage3 ;
[0046] S2.1.2.4, repeatedly superimposing N basic attention mechanism modules constructed in S2.1.1, for x Stage3 Process and output x Stage4 ;
[0047] S2.1.2.5, add a mean calculation layer to calculate the mean of the data in matrix dimension 2, for x. Stage4 Process and output x Stage5 ;
[0048] S2.1.2.6 adds a LayerNorm normalization layer and a fully connected layer (256, x2).
[0049] Preferably, the distributed attention mechanism network module for segment-by-segment feature extraction in S2.5.2 includes...
[0050] S2.5.2.1 Construct a LOFAR spectrum image segment complexity evaluation program, setting the number of line spectra to N for a specific LOFAR spectrum image segment and its label. Line_spec Set the thresholds for high signal-to-noise ratio, medium signal-to-noise ratio, low signal-to-noise ratio, and the number of batches of line spectrum interruptions to T, respectively. H T M T L and T B ; The statistical signal-to-noise ratio is higher than T H , in T M and T H Between, below T L The number of line spectra is N H N M and N L The proportion of high signal-to-noise ratio line spectra R H The proportion of the signal-to-noise ratio line spectrum R M and the proportion of low signal-to-noise ratio line spectra R L N H / N Line_spec N M / N Line_spec N L / N Line_spec Analyze the history corresponding to each line spectrum, calculate the number of batches of the spectrum that appear, and when the number of batches is higher than T... B If the musical line is interrupted, then the number of interruptions N can be counted using the method described above. B The percentage of batches with interrupted spectral processes, R B =N B / N Line_spec LOFAR spectral image segment complexity C LOFAR =αR H +βR M +γR L +μRB , where α, β, γ, and μ are weighting coefficients, which can be set according to the actual LOFAR spectrum segment line spectrum;
[0051] S2.5.2.2, Constructing the attention mechanism network unit selection and application, setting high complexity and low complexity thresholds T respectively. HL T LL If C LOFAR Below T LL If C is low complexity, then a low-complexity attention mechanism network unit is selected for processing; LOFAR Higher than T LL And below T HL If C LOFAR Higher than T HL If so, then a high-complexity attention mechanism network unit is selected for processing;
[0052] Section S2.5.2.3 constructs a LOFAR spectral image segment selection and feature extraction program, which implements sequential selection of LOFAR spectral image segments, complexity evaluation based on S2.5.2.1, and selection of network units based on the attention mechanism in S2.5.2.2, as well as the application program.
[0053] As a preferred option, the specific steps of S4 are as follows.
[0054] S4.1, based on the already trained distributed attention mechanism network model, directly process the LOFAR spectral graph to obtain the output result R. model ;
[0055] S4.2, Result Decoding.
[0056] Furthermore, the S4.2 result decoding includes
[0057] S4.2.1, Set the amplitude reduction dual threshold to N. decode1 N decode2 N decode1 N decode2 ∈[0.35,0.65], N enhance >N decode1 >N decode2 Generally, N can be set. decode1 N enhance Small;
[0058] S4.2.2, R model The values in are successively related to N decode2 Compare, if R model (i)>N decode2 i = 1, 2, ..., N LOFAR N LOFARR is the number of frequency points in the LOFAR spectrum. model (i)=R model (i)-N decode2 Similarly, N LOFAR The values in are successively related to N decode1 Compare, if R model (i)>N decode1 Then R model (i)=R model (i)-N decode1 ;
[0059] S4.2.3, for R model An overall increase of 100% in amplitude represents the result of line spectrum feature extraction.
[0060] Compared with the prior art, the present invention has the following advantages after adopting the above solution:
[0061] This invention segments the LOFAR spectrum and processes it using an attention mechanism network model adapted to the segment complexity of the LOFAR spectrum. It simultaneously and accurately mines deep features in both the time and frequency dimensions of the LOFAR spectrum. Furthermore, it enhances weak line spectrum extraction capabilities through line spectrum enhancement encoding and decoding. Compared to existing passive target line spectrum extraction methods, this invention exhibits stronger nonlinear relationship mapping capabilities, is more compatible with LOFAR spectrum processing, and achieves better line spectrum extraction results. Attached image description:
[0062] Figure 1 This is a flowchart of the signal processing procedure.
[0063] Figure 2 A schematic diagram of the construction of a weak line spectrum enhancement tag;
[0064] Figure 3 This is a schematic diagram of the network architecture of the distributed attention mechanism proposed in this invention;
[0065] Figure 4 This is a schematic diagram of the LOFAR spectral image segment complexity calculation method of the present invention;
[0066] Figure 5 A schematic diagram of a network model for the attention mechanism;
[0067] Figure 6 The diagram shown is a framework diagram for model training.
[0068] Figure 7 The results are shown below, based on a distributed attention mechanism network model, for line spectral feature extraction from a simulated LOFAR spectrum. Figure 7 (a) shows the original simulated LOFAR spectrum. Figure 7 (b) is the actual line spectrum sequence in the simulated LOFAR spectrum. Figure 7 (c) shows the line spectrum extraction results;
[0069] Figure 8 The results are shown below, based on the distributed attention mechanism network model, for line spectral feature extraction from the LOFAR spectrum of a real sea trial target. Figure 8 (a) shows the original simulated LOFAR spectrum. Figure 8 (b) shows the line spectrum extraction results. Detailed implementation method:
[0070] The present invention will be further described below with reference to the accompanying drawings and specific embodiments:
[0071] This invention provides a passive target line spectral feature extraction method based on a distributed attention mechanism network architecture, the implementation of which is as follows: Figure 1 As shown:
[0072] S1, Constructing the LOFAR spectral training / validation sample set, the main steps are as follows:
[0073] S1.1, Design a general method for constructing a spectrum training / validation sample set. The basic process is as follows.
[0074] S1.1.1, Set the line spectrum signal-to-noise ratio range to [S start ,S end ], where H SNR_start H is the lower limit of the signal-to-noise ratio. SNR_end This represents the upper limit of the signal-to-noise ratio (SNR), the same applies below. Based on the underwater acoustic target radiation noise model, the number, frequency, duration, curvature / shift / fluctuation of line spectra are randomly distributed, and the SNR is within [S...]. start ,S end The target time-domain waveform within the range.
[0075] S1.1.2, The target time-domain waveform is processed using the traditional LOFAR processing method to generate LOFAR spectrum samples with a frequency resolution of 0.1Hz, a number of frequency points of 1024, and a cumulative batch number of 32. The corresponding label is a one-dimensional sequence with a length of 1024, which is the same as the number of frequency points in the LOFAR spectrum. The sequence is assigned values according to the corresponding frequency points and intensities based on the theoretical line spectrum to generate sample labels.
[0076] S1.1.3, normalize the LOFAR spectral samples and their labels.
[0077] S1.1.4, Tag Encoding. Set the tag to y. Label , will y Label The overall amplitude decreases by 50%, that is, y Label =y Label / 2; Based on the number and frequency of the line spectra set in S1.1.1, calculate the frequency points n corresponding to all line spectra.Line_spc And perform line spectrum enhancement, i.e.
[0078] y Label (n Line_spc )=y Label (n Line_spc )+N enhance (1)
[0079] Where, N enhance The range for enhancing the line spectrum is generally set to [0.4, 0.7].
[0080] See the process. Figure 2 The diagram shown illustrates the construction of weak line spectrum enhancement labels. By weighting the normalized target and background amplitudes, the amplitudes of weak line spectra are enhanced, providing a foundation for improving the training effect of attention mechanism network models.
[0081] S1.2, Set the line spectrum signal-to-noise ratio range of the high signal-to-noise ratio simulated LOFAR spectrum to [H]. SNR_start H SNR_end Repeat S1.1 to generate a large-scale high signal-to-noise ratio simulated LOFAR spectrum sample set.
[0082] S1.3, Set the line spectrum signal-to-noise ratio range of the low signal-to-noise ratio simulated LOFAR spectrum to [L]. SNR_start ,L SNR_end Repeat S1.1 to generate a large-scale low signal-to-noise ratio simulated LOFAR spectrum sample set.
[0083] S1.4 Process the small sample of actual sea trial target tracking beam data according to S1.1.2 to S1.1.4 to generate a small sample of actual LOFAR spectrum sample set.
[0084] S2, Building a distributed attention mechanism network model based on the PyTorch framework and setting the model training parameters, the basic process is as follows:
[0085] S2.1 Construct a general model for attention mechanism network units. The main steps are as follows.
[0086] S2.1.1, Constructing the basic modules of the attention mechanism, mainly includes the following process:
[0087] S2.1.1.1, Construct basic module 1. Add a 3D matrix dimension transformation layer (a1,a2,a3)->(a1,a3,a2,1), where (a1,a2,a3) and (a1,a2,a3,1) represent the matrix dimensions before and after the transformation, respectively, and the numbers in parentheses represent the dimensions of each dimension of the matrix, the same below; add two convolutional layers with parameters (1×1,3072,1) and (1×1,1536,1) respectively, and the numbers in parentheses represent the kernel size, the number of output channels, and the stride of the convolution, respectively, the same below; add a matrix dimension transformation layer (a1 (a1, a2, 1)->(3, a1, a2, 512), where (a1, 1536, a2, 1) and (3, a1, a2, 512) represent the matrix dimensions before and after the transformation, respectively; a matrix splitting layer is added to split the matrix of dimension (3, a1, a2, 512) into three submatrices of size (a1, a2, 512), denoted as M1, M2, and M3; three parallel matrix dimension transformation layers are added, with parameters (a1, a2, 512)->(a1, a2, 512)->(a1, a2, 512) respectively. (a1, a2, 512)->(a1, 8, 64, a2) and (a1, a2, 512)->(a1, 8, a2, 64) are used for dimension transformations of M1, M2, and M3 respectively, resulting in matrices M1′, M2′, and M3′. A Dropout layer is added to perform Dropout processing on M1′. A matrix multiplication operation processing layer is added to perform the multiplication operation of M1′ and M2′, resulting in matrix N1. A coefficient weighting layer is added to multiply N1 by a coefficient of 0.125. A So The ftmax layer and Dropout layer process N1 sequentially; a matrix multiplication layer is added to multiply N1 and M3′ to obtain N2; a matrix dimension transformation layer (a1,8,a2,64)->(a1,512,a2,1) is added to process N2 to obtain N3; a convolutional layer (1×1,a3,1), a Dropout layer, and a matrix dimension transformation layer (a1,512,a2,1)->(a1,a2,a3) are added to process N3 sequentially, and this module outputs the result.
[0088] S2.1.1.2, Construct basic module 2. Add the following layers in sequence: matrix dimension transformation layer (a1,a2,a3)->(a1,a3,a2,1), convolutional layer (1×1,1024,1), dropout layer, convolutional layer (1×1,2048,1), GELU activation function, dropout layer, convolutional layer (1×1,1024,1), dropout layer, convolutional layer (1×1,a3,1) and dropout layer, and matrix dimension transformation layer (a1,a3,a2,1)->(a1,a2,a3).
[0089] S2.1.1.3 connects Model 1 and Model 2 in series to form the basic module of the attention mechanism.
[0090] S2.1.2, Construct a general model for the entire attention mechanism network unit. The main process is as follows:
[0091] S2.1.2.1, Construct the matrix segmentation and dimensionality transformation module. Set the input model data to a matrix (N). batch (x1, x2), where N is the number of elements in the N-axis. batch Let x1 and x2 be the row and column sizes of the input matrix, respectively, and 1 be the number of channels in the LOFAR spectrum (pseudo-color image), and so on. Similarly, set the size of the segmented submatrix to (N... batch Add a matrix dimension transformation layer to achieve dimension transformation (N...). batch ,1,x1,x2)->(N batch ,1,N patch Add a matrix dimension transformation layer to achieve dimension transformation (N, y1, y2); batch ,1,N patch ,y1,y2)->(N batch ,1·y1·y2,N patch ,1); Add convolutional layer (1×1,4096,1); Add convolutional layer (1×1,2048,1); Add convolutional layer (1×1,256,1); Add matrix dimension transformation layer (N batch ,256,N patch ,1)->(N batch N patch ,256), the final output data x Stage1 .
[0092] S2.1.2.2, Construct the category / sub-unit location information embedding module. Generate the category information embedding matrix (N batch (1,256) and location information embedding matrix (N) batch N patch +1,256), initialize the above matrix with random values; add a matrix merging extension processing layer to embed category information into the matrix and x. Stage1 Merging along dimension 1 yields a size of (N) batch N patch A matrix of size x (+1,256) is given; a matrix addition processing layer is added, which embeds the position information into the matrix and adds it to the previously output matrix, finally outputting the data x. Stage2 .
[0093] S2.1.2.3, Construct the dropout module for x Stage2Perform a dropout operation and output data x. Stage3 .
[0094] S2.1.2.4, repeatedly superimpose N basic attention mechanism modules constructed in S2.1.1, for x Stage3 Process and output x Stage4 .
[0095] S2.1.2.5, add a mean calculation layer to calculate the mean of the data in matrix dimension 2, for x. Stage4 Process and output x Stage5 .
[0096] S2.1.2.6 adds a LayerNorm normalization layer and a fully connected layer (256, x2).
[0097] S2.2, the general model of attention mechanism network unit constructed according to S2.1, sets the number of basic attention mechanism modules to be stacked N=6, and constructs a low-complexity attention mechanism network unit.
[0098] S2.3, the general model of attention mechanism network unit constructed according to S2.1, sets the number of basic attention mechanism modules stacked N=8, and constructs medium-complexity attention mechanism network unit.
[0099] S2.4, based on the general model of the attention mechanism network unit constructed according to S2.1, sets the number of basic attention mechanism modules to be stacked N=10, and constructs a high-complexity attention mechanism network unit.
[0100] S2.5, Construct the entire network, the specific construction method is as follows.
[0101] S2.5.1, Add a data slicing layer based on the number of frequency points N of the original LOFAR spectrum samples. freq and cumulative batch N Snap Divide the LOFAR spectral samples into a number of int(N) freq / (2N Snap The number of frequency points in each segment is int(N) freq / (2N Snap ))+L overlap Where int represents the integer operation, L overlap Indicates the number of overlapping points between segments.
[0102] S2.5.2, Construct a distributed attention mechanism network module for segment-by-segment feature extraction, mainly as follows:
[0103] S2.5.2.1 Construct a LOFAR spectrum image segment complexity evaluation program. For a given LOFAR spectrum image segment and its label, set the number of line spectra to N.Line_spec Set the thresholds for high signal-to-noise ratio, medium signal-to-noise ratio, low signal-to-noise ratio, and the number of batches of line spectrum interruptions to T, respectively. H T M T L and T B ; The statistical signal-to-noise ratio is higher than T H , in T M and T H Between, below T L The number of line spectra is N H N M and N L The proportion of high signal-to-noise ratio line spectra R H The proportion of the signal-to-noise ratio line spectrum R M and the proportion of low signal-to-noise ratio line spectra R L N H / N Line_spec N M / N Line_spec N L / N Line_spec Analyze the history corresponding to each line spectrum, calculate the number of batches of the spectrum that appear, and when the number of batches is higher than T... B If the musical line is interrupted, then the number of interruptions N can be counted using the method described above. B The percentage of batches with interrupted spectral processes, R B =N B / N Line_spec LOFAR spectral image segment complexity C LOFAR =αR H +βR M +γR L +μR B α, β, γ, and μ are weighting coefficients, which can be set according to the actual LOFAR spectrum segment line spectrum.
[0104] S2.5.2.2, Constructing the attention mechanism network unit selection and application. Set the high complexity and low complexity thresholds as T respectively. HL T LL If C LOFAR Below T LL If C is low complexity, then a low-complexity attention mechanism network unit is selected for processing; LOFAR Higher than T LL And below T HL If C LOFAR Higher than T HL If so, then a high-complexity attention mechanism network unit is selected for processing.
[0105] Section S2.5.2.3 constructs a LOFAR spectral image segment selection and feature extraction program, which implements sequential selection of LOFAR spectral image segments, complexity evaluation based on S2.5.2.1, and selection of network units based on the attention mechanism in S2.5.2.2, as well as the application program.
[0106] S2.5.3 constructs a network integration layer to sequentially arrange and integrate the features of each LOFAR spectral image segment output by S2.5.2, and extracts the integrated features and their line spectra.
[0107] The process is as follows Figure 5 As shown, by performing sample segmentation and linear dimension transformation on the input LOFAR spectral image segment, the original sample's segmented feature sequence is obtained. At the same time, the segmented position sequence and category information sequence are constructed. The above three are combined to form a unified numerical representation, which is then fed into the attention mechanism encoding unit composed of multiple attention mechanism modules. This achieves feature deep abstraction and nonlinear mapping, which is the core element for realizing line spectrum extraction. Finally, the output features of the attention mechanism encoding unit are reduced in dimension by segment merging and fully connected layers to obtain the line spectrum extraction result.
[0108] S2.6, Construct the model training loss function. Set the model output to R. Model The sample label is y Label Then the model loss function is calculated using the least mean square error method, i.e.
[0109]
[0110] Where, N B This is the batch size during training.
[0111] S2.7, Design the model training optimizer and parameter setting strategy, dividing the training process into three stages according to the number of training rounds. The first stage uses the SDG optimizer, with a learning rate (lr) of 0.001, momentum of 0.95, and weight decay of 0.000015; the training sample set is a large-scale high SNR simulated LOFAR spectrum sample set, and the batch size for each training iteration is set to 64. The second stage uses the Adam optimizer, with a learning rate (lr) of 0.0001; the training sample set is a large-scale low SNR simulated LOFAR spectrum sample set, and the batch size for each training iteration is set to 64. The third stage uses the Adam optimizer, with a learning rate (lr) of 0.0001; the training sample set is a small sample of actual LOFAR spectrum samples, and the batch size for each training iteration is set to 32. See [link to process details]. Figure 6The proposed model training framework divides model training into three stages. Stages one, two, and three are conducted based on large-scale high signal-to-noise ratio simulated LOFAR spectrum samples, large-scale low signal-to-noise ratio simulated LOFAR spectrum samples, and small-sample actual LOFAR spectrum samples, respectively. The optimizer and learning rate for each stage are set based on the model loss function value and the performance of the validation set line spectrum extraction to improve the model training effect.
[0112] S3, based on the constructed LOFAR spectrum training / validation sample set, the designed loss function, the model training optimizer, and the parameter setting strategy, repeatedly trains the constructed distributed attention mechanism network model.
[0113] S4. Line spectrum extraction is performed on the LOFAR spectrum of the unknown underwater acoustic target. The main process is as follows.
[0114] S4.1, based on the already trained distributed attention mechanism network model, directly process the LOFAR spectral graph to obtain the output result R. model .
[0115] S4.2, Result Decoding, the main steps are as follows:
[0116] S4.2.1, Set the amplitude reduction dual threshold to N. decode1 N decode2 N decode1 N decode2 ∈[0.35,0.65], N enhance >N decode1 >N decode2 Generally, N can be set. decode1 N enhance Slightly smaller.
[0117] S4.2.2, R model The values in are successively related to N decode2 Compare, if R model (i)>N decode2 i = 1, 2, ..., N LOFAR N LOFAR R is the number of frequency points in the LOFAR spectrum (the same applies below). model (i)=R model (i)-N decode2 Similarly, N LOFAR The values in are successively related to N decode1 Compare, if R model (i)>N decode1 Then R model (i)=R model (i)-N decode1 .
[0118] S4.2.3, for Rmodel The overall amplitude increases by 100%, that is, R model =2R model This is the result of line spectrum feature extraction.
[0119] In this embodiment, as Figure 3 The proposed distributed attention mechanism network architecture addresses the characteristics of LOFAR spectra, which have high frequency resolution and a significantly larger number of frequency-dimensional points than time-dimensional points. To fully leverage the balanced processing capabilities of deep networks for both time and frequency-dimensional information, the original LOFAR spectra are truncated to construct multi-band LOFAR spectrogram segments, with each segment allowing for a certain degree of temporal overlap. Furthermore, considering the differences in line intensity distribution and other characteristics among the multi-band LOFAR spectrogram segments, resulting in varying degrees of complexity, low-complexity, medium-complexity, and high-complexity attention mechanism network units are constructed to match the network structure complexity with processing requirements. Based on this, the complexity of each LOFAR spectrogram segment is evaluated, and corresponding attention mechanism network units are selected for processing. Finally, the processing results from the attention mechanism network units across multiple segments are integrated to output a line spectrum sequence.
[0120] and through Figure 4 The method for calculating the complexity of LOFAR spectrum image segments shown analyzes the line spectrum labels corresponding to the LOFAR spectrum image segments to obtain results such as the proportion of line spectra with different signal-to-noise ratios and the proportion of batches with interrupted line spectrum processes. These results are then weighted and summed to form the basis for evaluating the complexity of LOFAR spectrum image segments.
[0121] Furthermore, according to Figure 7 The results shown are from line spectral feature extraction of a simulated LOFAR spectrum using a distributed attention mechanism network model. Figure 7 (a) shows the original simulated LOFAR spectrum. Figure 7 (b) shows the actual line spectrum sequence in the simulated LOFAR spectrum. Figure 7 (c) shows the line spectrum extraction results. The distributed attention mechanism network model has been trained based on a large amount of labeled simulated LOFAR spectrum data. It can be seen that the simulated line spectrum can be effectively extracted.
[0122] Figure 8 The image shows the result of line spectral feature extraction from the LOFAR spectrum of a real sea trial target based on this distributed attention mechanism network model. Figure 8 (a) shows the original simulated LOFAR spectrum. Figure 8 (b) shows the line spectrum extraction results. As can be seen, the model has the ability to effectively extract actual line spectra.
[0123] This invention constructs a multi-complexity attention mechanism network model to segment and slice the LOFAR spectrum. The segmented slices are then processed using an attention mechanism network model adapted to the complexity of the LOFAR spectrum segments. This allows for high-precision mining of deep features simultaneously in both the time and frequency dimensions of the LOFAR spectrum. Furthermore, multi-stage model training is conducted using a large-scale high SNR / low SNR simulation sample set enhanced with line spectrum labels, along with a small sample set of actual data, enabling the model to autonomously learn and evolve. Compared to existing passive target line spectrum extraction methods, this invention demonstrates stronger nonlinear relationship mapping capabilities, is more compatible with LOFAR spectrum processing, and achieves better weak line spectrum extraction results.
[0124] The above description only illustrates preferred embodiments of the present invention and should not be construed as limiting the scope of the claims. Any equivalent structural or procedural modifications made using this specification are included within the patent protection scope of the present invention.
Claims
1. A passive target line spectrum feature extraction method based on a distributed attention mechanism network architecture, characterized in that: The method comprises, S1, constructing a LOFAR spectrum training / verification sample set; S2, for the LOFAR spectrum and its line spectrum characteristics, constructing a distributed attention mechanism network model and designing a training strategy, truncating the original LOFAR spectrum, constructing a multi-band LOFAR spectrum image segment, constructing a low-complexity attention mechanism network unit, a medium-complexity attention mechanism network unit and a high-complexity attention mechanism network unit, evaluating the complexity of the LOFAR spectrum image segment and selecting the corresponding attention mechanism network unit for processing, and finally integrating the processing results of the multi-segment attention mechanism network units and outputting the line spectrum sequence; S3, training the distributed attention mechanism network model; S4, based on the trained model, extracting features from unknown LOFAR spectrum and outputting line spectrum extraction results; The construction process of S1 is as follows, S1.1, designing a spectrum training / verification sample set construction method, the steps of which are as follows, S1.1.1, set the line spectrum signal-to-noise ratio range as [S start , S end ], wherein H SNR_start is the lower limit of signal-to-noise ratio, H SNR_end is the upper limit of signal-to-noise ratio, and target time-domain waveforms with a line spectrum number, frequency, duration, bending / offset / undulation random distribution and signal-to-noise ratio in the range [S start , S end ] are generated based on the underwater acoustic target radiation noise model; S1.1.2, using the LOFAR processing method to process the target time domain waveform of S1.1.1 to generate a LOFAR spectrum sample, and its corresponding label is a one-dimensional sequence, which is valued according to the corresponding frequency point and intensity according to the theoretical line spectrum to generate a sample label; S1.1.3, normalizing the LOFAR spectrum sample and its label; S1.1.4, label encoding, set label as y Label , y Label amplitude reduction by 50%; according to the number and frequency of the line spectrum set in S1.1.1, calculate the frequency point n corresponding to all line spectra Line_spc and perform line spectrum enhancement, that is y Label (n Line_spc )=y Label (n Line_spc )+N enhance where N enhance is the line spectrum enhancement amplitude, and the setting interval is [0.4, 0.7]; S1.2, set the line spectrum signal-to-noise ratio range of the high signal-to-noise ratio simulation LOFAR spectrum as [H SNR_start ,H SNR_end ], repeat step S1.1 to generate a large-scale high signal-to-noise ratio simulation LOFAR spectrum sample set; S1.3, set the line spectrum signal-to-noise ratio range of the low signal-to-noise ratio simulation LOFAR spectrum as [L SNR_start ,L SNR_end ], repeat step S1.1 to generate a large-scale low signal-to-noise ratio simulation LOFAR spectrum sample set; S1.4, processing the small sample actual sea trial target tracking beam data according to S1.1.2-S1.1.4 to generate a small sample actual LOFAR spectrum sample set.
2. The passive target line spectrum feature extraction method based on the distributed attention mechanism network architecture according to claim 1: the process of S2 is as follows, S2.1, constructing an attention mechanism network unit general model; S2.2, according to the attention mechanism network unit general model constructed in S2.1, setting the basic attention mechanism module stacking number N=6, and constructing a low-complexity attention mechanism network unit; S2.3, according to the attention mechanism network unit general model constructed in S2.1, setting the basic attention mechanism module stacking number N=8, and constructing a medium-complexity attention mechanism network unit; S2.4, according to the attention mechanism network unit general model constructed in S2.1, setting the basic attention mechanism module stacking number N=10, and constructing a high-complexity attention mechanism network unit; S2.5, constructing the entire network, the process of which is as follows, S2.5.1, add data slice layer, according to the frequency point number N of the original LOFAR spectrogram sample freq and cumulative batch N Snap , the LOFAR spectrogram sample is divided into a number of int(N freq / (2N Snap )) segments, each segment has a frequency point number of int(N freq / (2N Snap ))+L overlap , wherein int represents the rounding operation, and L overlap represents the number of overlapping points between segments S2.5.2, constructing a distributed attention mechanism network module for segment-by-segment feature extraction; S2.5.3, constructing a network integration layer to realize the sequential arrangement and integration of the features of each LOFAR spectrum image segment output by S2.5.2, and the line spectrum extraction results after integration; S2.6, construct model training loss function, set model output as R Model , sample label as y Label , then the model loss function is calculated by the least mean square error method, that is wherein N B is the Batch size for training; S2.7, designing a model training optimizer and parameter setting strategy, and dividing the training process into three stages according to the training round number; The first stage model training adopts the SDG optimizer, wherein the learning rate is set to 0.001, the impulse is set to 0.95, and the weight decay is set to 0.000015; the training sample set is a large-scale high signal-to-noise ratio simulation LOFAR spectrum sample set, and the batchsize size of each training is set to 64; the second stage model training adopts the Adam optimizer, and the learning rate is set to 0.0001; the training sample set is a large-scale low signal-to-noise ratio simulation LOFAR spectrum sample set, and the batchsize size of each training is set to 64; the third stage model training adopts the Adam optimizer, and the learning rate is set to 0.0001; the training sample set is a small sample actual LOFAR spectrum sample set, and the batchsize size of each training is set to 32; The steps of constructing the attention mechanism network unit general model in S2.1 are as follows, S2.1.1, constructing an attention mechanism basic module; S2.1.2, constructing an entire attention mechanism network unit general model; The process of S2.1.1 is as follows, S2.1.1.1, constructing a basic module 1; S2.1.1.2, constructing a basic module 2; S2.1.1.3, serially connecting the model 1 and the model 2 to form an attention mechanism basic module; The specific process of constructing the basic module 1 is as follows: adding a three-dimensional matrix dimension transformation layer (a1, a2, a3) -> (a1, a3, a2, 1), wherein (a1, a2, a3) and (a1, a2, a3, 1) represent the matrix dimensions before and after transformation respectively, and the numbers in the parentheses represent the size of each dimension of the matrix; adding two convolutional layers with parameters (1x1, 3072, 1) and (1x1, 1536, 1) respectively, and the numbers in the parentheses represent the convolution kernel size, the number of convolution output channels and the convolution step in turn; adding a matrix dimension transformation layer (a1, 1536, a2, 1) -> (3, a1, a2, 512), wherein (a1, 1536, a2, 1) and (3, a1, a2, 512) represent the matrix dimensions before and after transformation respectively; adding a matrix splitting processing layer to split the matrix with dimension (3, a1, a2, 512) to generate three sub-matrices with size (a1, a2, 512), denoted as M1, M2 and M3; adding three parallel matrix dimension transformation layers with parameters (a1, a2, 512) -> (a1, 8, a2, 64), (a1, a2, 512) -> (a1, 8, 64, a2) and (a1, a2, 512) -> (a1, 8, a2, 64) respectively, and used for dimension transformation of M1, M2 and M3 respectively to obtain matrices M1', M2' and M3'; adding a Dropout layer to perform Dropout processing on M1'; adding a matrix multiplication operation processing layer to perform multiplication operation on M1' and M2' to obtain matrix N1; adding a coefficient weighting layer to multiply N1 by a coefficient 0.125; adding a Softmax layer and a Dropout layer to process N1 in turn; adding a matrix multiplication operation processing layer to perform multiplication operation on N1 and M3' to obtain N2; adding a matrix dimension transformation layer (a1, 8, a2, 64) -> (a1, 512, a2, 1) to process N2 to obtain N3; adding a convolutional layer (1x1, a3, 1), a Dropout layer and a matrix dimension transformation layer (a1, 512, a2, 1) -> (a1, a2, a3) to process N3 in turn, and the output of this module is; The specific process of constructing the basic module 2 is as follows: sequentially adding a matrix dimension transformation layer (a1, a2, a3) -> (a1, a3, a2, 1), a convolutional layer (1x1, 1024, 1), a Dropout layer, a convolutional layer (1x1, 2048, 1), a GELU activation function, a Dropout layer, a convolutional layer (1x1, 1024, 1), a Dropout layer, a convolutional layer (1x1, a3, 1) and a Dropout layer, and a matrix dimension transformation layer (a1, a3, a2, 1) -> (a1, a2, a3); The specific process of constructing the entire attention mechanism network unit general model is as follows, S2.1.2.1, construct matrix segmentation and dimension transformation module, set the data of the input model as a matrix (N batch , 1, x1, x2), where N batch is the Batch size of the training sample, x1 and x2 are the row and column size of the input matrix respectively, and 1 is the number of LOFAR spectrum channels; set the size of the segmented sub-matrix as (N batch , 1, y1, y2); add a matrix dimension transformation layer to realize dimension conversion (N batch , 1, x1, x2) -> (N batch , 1, N patch , y1, y2); add a matrix dimension transformation layer to realize dimension conversion (N batch , 1, N patch , y1, y2) -> (N batch , 1·y1·y2, N patch , 1); add a convolution layer (1×1, 4096, 1); add a convolution layer (1×1, 2048, 1); add a convolution layer (1×1, 256, 1); add a matrix dimension transformation layer (N batch , 256, N patch , 1) -> (N batch , N patch , 256), and finally output data x Stage1 ; S2.1.2.2, a category / sub-unit position information embedding module is constructed; generate a category information embedding matrix (N batch ,1,256) and a position information embedding matrix (N batch ,N patch +1,256), and initialize the above matrices with random values; add a matrix merging and expansion processing layer, merge the category information embedding matrix and x Stage1 in dimension 1 to obtain a matrix with a size of (N batch ,N patch +1,256); and add a matrix addition processing layer, add the position information embedding matrix and the matrix output previously to finally output data x Stage2 ; S2.1.2.3, construct dropout module, on x Stage2 perform dropout operation, output data x Stage3 ; S2.1.2.4, repeat N times the attention mechanism basic module constructed in S2.1.1 to x Stage3 process and output x Stage4 ; S2.1.2.5, add mean value processing layer, implement data mean value calculation on matrix dimension 2, for x Stage4 processing, output x Stage5 ; S2.1.2.6, add LayerNorm standardization layer and fully connected layer (256, x2).
3. The method of claim 2, wherein the method is based on a distributed attention mechanism network architecture. The construction of the distributed attention mechanism network module of S2.5.2 includes, S2.5.2.1, constructing LOFAR spectrum picture segment complexity evaluation program, setting the number of line spectrum as N for specific LOFAR spectrum picture segment and its label Line_spec , setting the high SNR, medium SNR, low SNR and the number of line spectrum interruption in the course threshold as T H , T M , T L and T B ; counting the number of line spectrum with SNR higher than T H , between T M and T H , and lower than T L as N H , N M and N L , then the proportion of high SNR line spectrum R H , medium SNR line spectrum R M and low SNR line spectrum R L are N H / N Line_spec , N M / N Line_spec , N L / N Line_spec ; analyzing the course of each line spectrum, calculating the number of batches without line spectrum, when the number of batches is higher than T B , the line spectrum is regarded as interruption, according to the above method, the number of line spectrum interruption N B can be counted, then the proportion of line spectrum interruption in the course R B =N B / N Line_spec ; LOFAR spectrum picture segment complexity C LOFAR =αR H +βR M +γR L +μR B , wherein α, β, γ, μ are weighting coefficients, which can be set according to the actual LOFAR spectrum picture segment line spectrum S2.5.2.2, constructing attention mechanism network unit selection and application program, setting high complexity and low complexity threshold respectively as T HL , T LL ; if C LOFAR is lower than T LL , selecting low complexity attention mechanism network unit for processing; if C LOFAR is higher than T LL and lower than T HL , selecting medium complexity attention mechanism network unit for processing; if C LOFAR is higher than T HL , selecting high complexity attention mechanism network unit for processing; S2.5.2.3, construct LOFAR spectrum picture segment selection and feature extraction procedures, realize LOFAR spectrum picture segment selection, complexity evaluation based on S2.5.2.1, and attention mechanism network unit selection and application based on S2.5.2.
2.
4. The method of claim 1, wherein the method is based on a distributed attention mechanism network architecture. The specific steps of S4 are as follows, S4.1, directly processing the LOFAR spectrogram based on the trained distributed attention mechanism network model to obtain an output result R model ; S4.2, result decoding.
5. The method of claim 4, wherein the method is based on a distributed attention mechanism network architecture. S4.2 result decoding includes, S4.2.1, set the amplitude reduction double threshold to N decode1 , N decode2 , N decode1 , N decode2 ∈ [0.35, 0.65], N enhance >N decode1 >N decode2 ; S4.2.2, the values in R model are compared in turn with N decode2 , and if R model (i) > N decode2 , i = 1, 2,..., N LOFAR , N LOFAR being the number of LOFAR spectral bins, then R model (i) = R model (i) - N decode2 ; similarly the values in N LOFAR are compared in turn with N decode1 , and if R model (i) > N decode1 , then R model (i) = R model (i) - N decode1 ; S4.2.3, R model The amplitude is increased by 100% as a whole, that is, the line spectrum feature extraction result.
Citation Information
Patent Citations
Underwater target radiation noise LOFAR spectrogram line spectrum extraction method based on convolutional residual network
CN111931820A
Cable surrounding environment sound recognition method based on time-frequency attention network model
CN114550711A