A ship noise recognition method based on paired coding network and contrastive learning
By combining a method based on paired coding networks and contrastive learning with convolutional neural networks and long short-term memory networks, the problem of low accuracy in ship noise recognition is solved, and efficient ship target recognition and noise suppression are achieved.
Patent Information
- Application Number
- CN202211087510.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-09-07
AI Technical Summary
In existing technologies, the accuracy of ship noise recognition is low and noise reduction methods need to be manually tuned. Underwater data collection is costly and data is scarce. Traditional machine learning methods find it difficult to achieve good results in the field of underwater target recognition.
A method based on paired coding network and contrastive learning is adopted to extract ship noise features through convolutional neural network and long short-term memory network. The model is optimized with cross entropy loss function to achieve end-to-end ship noise recognition.
The accuracy and robustness of ship noise recognition are improved, the limitations of traditional spectrum analysis are avoided, and efficient ship target recognition is achieved.
Smart Images

Figure CN115329821B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of underwater acoustic signal processing, and in particular to a ship noise recognition method based on a paired coding network and contrastive learning. Background Art
[0002] The rapid development of deep learning in fields such as computer vision, pattern recognition, and acoustic signal processing has provided new research avenues for target recognition in passive sonar signals, making it a significant research topic. However, as the number of classification targets increases, model accuracy inevitably declines. Furthermore, deep learning models require a large number of training samples, while underwater signal data suffers from a low signal-to-noise ratio, a scarcity of high-quality samples, and the difficulty of transferring data from different waters. Addressing this challenging data shortage in this field has sparked the interest of many researchers, leading to the development of small-shot learning and zero-shot learning.
[0003] Underwater target recognition is the process of generating effective audio signals based on sonar signals, processed, and then used to identify them. Research and development of underwater target individual recognition technology is extremely important in the military. However, due to the complex and variable underwater environment (such as acoustic medium constraints and heterogeneity) and the cost of underwater signal acquisition, transmission, and processing, available underwater data is often inaccurate. Therefore, improving the accuracy and speed of underwater target detection and recognition while reducing computing and communication costs has become an urgent problem.
[0004] Transfer learning uses knowledge learned in a source task to aid learning of new task targets, achieving relatively good training results even with limited training data. Building on transfer learning, few-shot learning addresses data insufficiency and is suitable for learning scenarios where samples are scarce due to objective reasons. Zero-shot learning involves training a model using samples from the training set, where some categories in the test set are not present in the training set. When applied to the test set, a model can correctly identify labels not present in the training set. Both few-shot and zero-shot learning are essential for addressing the recognition of new targets and the repeated appearance of the same target within a short period of time, and have become a current research hotspot. The technology for designing underwater acoustic object recognition architectures involves three main steps. The first step is to train a neural network using a large number of samples, overcoming the difficulties of intelligent recognition in changing hydrological environments and with limited training samples. The second step is to extract time-frequency information to discover multidimensional features with rich individual differences. The third step is to use deep learning networks to learn individual features for classification and recognition. However, in the field of underwater object recognition, underwater data collection requires significant financial investment, and most existing datasets are highly confidential and geographically specific. In this case, traditional machine learning methods driven by big data are unlikely to achieve good results. Therefore, small-sample learning is needed to build unsupervised, end-to-end classification models based on these scarce image data and improve the accuracy of model recognition. Summary of the Invention
[0005] Aiming at the problems in the prior art of low accuracy in identifying ship radiated noise and the need for manual tuning of noise reduction measures, the present invention provides a ship noise identification method based on paired coding network and contrastive learning.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is:
[0007] A ship noise recognition method based on paired coding network and contrastive learning includes the following steps:
[0008] Step 1: Divide the long-term ship noise signal received by the hydrophone into signal samples of fixed duration, map the signal samples to the feature space through a convolutional neural network, and obtain the first feature tensor of each signal sample;
[0009] Step 2: Construct a recurrent neural network consisting of a long short-term memory layer, and input the first feature tensor obtained in step 1 into the recurrent neural network in sequence according to the time sequence of the signal samples to obtain the corresponding second feature tensor; wherein the second feature tensor at the previous moment is stored in the long short-term memory layer and fused into the second feature tensor at the next moment;
[0010] Step 3: Construct a loss function in the form of cross entropy and calculate the loss value based on the first feature tensor and the second feature tensor;
[0011] Step 4: Construct a first optimizer and a second optimizer. The first optimizer optimizes the convolutional neural network, and the second optimizer optimizes the combination of the convolutional neural network and the recurrent neural network. Each optimizer uses the loss value calculated in step 3 to update the network parameters of the corresponding neural network through the gradient back propagation method to obtain a trained convolutional neural network and recurrent neural network.
[0012] Step 5: Input the ship noise signal to be identified into the trained convolutional neural network to obtain the corresponding first feature tensor, flatten it into a vector, and then pass it through the fully connected layer and the softmax classifier to obtain the classification result, thus completing the identification of the ship noise signal.
[0013] Furthermore, the specific method of step 1 is:
[0014] Step 101: Divide the long-term ship noise signal received by the hydrophone into 3.2768 seconds, i.e., 16,384 signal samples. Adjust the dimension of the signal samples from 1*16,384 to 128*128, and read the signal samples into the convolutional neural network in batches of 64.
[0015] Step 102: The signal sample is mapped to a dimensional space of 256 feature points through an 8*8 convolution kernel with a stride of 4, and then passed through a nonlinear activation function ReLU and a maximum pooling layer of size 2 to obtain a feature matrix of size 256*15*15;
[0016] In step 103, the feature matrix obtained in step 102 is passed through a 4*4 convolution kernel with a stride of 2, a ReLU layer, and a maximum pooling layer to obtain a 256*3*3 feature tensor.
[0017] Furthermore, the specific method of step 3 is:
[0018] (1) constructing a diagonal tensor of corresponding dimensions based on the first eigentensor and the second eigentensor;
[0019] (2) Reconstruct the diagonal tensor into a matrix that is right-shifted by one bit and replicated according to the number of samples to obtain a time series label array;
[0020] (3) Perform matrix multiplication on the first feature tensor and the second feature tensor, while keeping the number of samples unchanged, to obtain a unified sample feature;
[0021] (4) Calculate the batch cross entropy logarithmic loss for the unified sample features and time series label arrays.
[0022] The beneficial effects of the present invention are:
[0023] 1. This paper combines the concept of contrastive learning with paired coding networks to propose a novel method for identifying ship noise. By building an improved feature extraction module, it achieves the goal of learning the high-dimensional information behind ship radiated noise.
[0024] 2. The present invention constructs a long short-term memory layer (GRU), which can extract the previous information of the data and nonlinearly map the samples again, effectively solving the temporal correlation problem of acoustic data.
[0025] 3. The proposed method constructs a cross-entropy loss function, which optimizes both recognition and noise reduction in a unified manner. Through two nonlinear mappings, the model is forced to discard the original acoustic useless information and noise of the sample and learn the high-level features that distinguish different targets. As a result, the network's ability to separate noise is enhanced while maintaining its recognition capabilities.
[0026] In summary, the present invention avoids the limitations of traditional spectrum analysis through an end-to-end approach and achieves higher accuracy and stronger robustness for the passive ship identification task based on radiated noise through a variety of optimization techniques. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 Schematic diagram of the overall framework of an embodiment of the present invention;
[0028] Figure 2 Schematic diagram of the structure of the feature extraction module and the time series information fusion module in an embodiment of the present invention;
[0029] Figure 3 Schematic diagram of the calculation of the loss function based on contrastive learning in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below in conjunction with the implementation methods and drawings.
[0031] A ship noise recognition method based on paired coding network and contrastive learning includes the following steps:
[0032] S1, feature extraction: the signal is mapped for the first time through the feature extraction module;
[0033] S2, time series information fusion: the output of step S1 is passed through the time series information fusion module to fuse the previous moment information;
[0034] S3, calculate the loss function: calculate the loss based on the features obtained after processing in steps S1 and S2;
[0035] S4, model training optimization: After passing the gradient back through SGD, update the parameters of the feature extraction module and the time series information fusion module to obtain the trained feature extraction module;
[0036] S5, model application: The trained feature extraction module is combined with the softmax classifier to classify the ship noise and complete the recognition.
[0037] Among them, the feature extraction module is a CNN network (convolutional neural network), and the time series information fusion module is an RNN network (recurrent neural network) composed of a layer of GRU (long short-term memory layer).
[0038] Wherein, step S4 includes the following steps:
[0039] S41: Construct the first SGD optimizer and pass the loss calculated in step S3 back to the time series information fusion module through the gradient back propagation algorithm;
[0040] S42: Construct a second SGD optimizer, pass the loss calculated in step S3 back to the feature extraction module through the gradient backpropagation algorithm, and mix it with the loss returned by the first SGD optimizer, so as to optimize the combination of the feature extraction module and the time series information fusion module.
[0041] Here's a more specific example:
[0042] See also Figure 1 , a ship noise recognition method based on paired coding network and contrastive learning, comprising the following steps:
[0043] Step S1, feature extraction:
[0044] In the embodiment, in order to learn the high-dimensional information behind the ship's radiated noise (such as the tail propeller and the engine generating different noises), a system is built as follows: Figure 2 The feature extraction module shown.
[0045] The specific method of feature extraction is as follows:
[0046] S11: The long-term ship noise signal with a sampling frequency of 5000 Hz received by the hydrophone is divided into signal samples of 3.2768 seconds (16384 points), and then mapped to the feature space through a convolutional neural network (CNN).
[0047] Adjust the sample dimension from 1*16384 to 128*128 to facilitate two-dimensional convolution processing, and read the dataset into the model in batches of 64;
[0048] S12: The 128*128 sample is mapped to a dimensional space of 256 feature points through an 8*8 convolution kernel with a stride of 4, and then passed through a nonlinear activation function ReLU and a maximum pooling layer of size 2;
[0049] Among them, the two-dimensional convolution formula is as follows:
[0050]
[0051] Where w m,n is the convolution kernel, x i+m,j+n is the current value of the sample feature, a i,j is the mapped value, w b is the preset bias value of the convolutional layer;
[0052] The ReLU formula is as follows:
[0053] f(x)=max(0,x)
[0054] Where x is the current sample feature, and f(x) is the new sample feature obtained by comparing x and 0 and taking the maximum value.
[0055] The maximum pooling layer is used to maximize the value in the 2*2 matrix. The formula is as follows:
[0056]
[0057] Where N i is the horizontal axis, C j is the vertical coordinate, stride[0]×h+m and stride[1]×w+n represent each region after the original sample is split into different regions. By taking the maximum value in the horizontal direction and the maximum value in the vertical direction of each region, the maximum value of the entire region is obtained, which is used as the representation of the current region and the input of the next layer.
[0058] S13: The feature matrix of size 256*15*15 obtained in S12 is passed through a 4*4 convolution kernel with a stride of 2, a ReLU and a maximum pooling layer to obtain a 256*3*3 feature tensor.
[0059] Step S2, time series information fusion:
[0060] Considering the temporal correlation of acoustic data, the present invention constructs Figure 2 The long short-term memory layer (GRU) shown in the figure is used to extract the previous information of the data and nonlinearly map the samples again; the specific method is as follows:
[0061] S21: Adjust the dimension of the feature tensor obtained in S13 to 9*256, and initialize one for each time series;
[0062] S22: Input the feature tensor obtained in S13 into the 256*256 GRU layer, combine it with the previous information extracted at the previous moment, output a 9*256 feature tensor, and save the current moment information in the GRU layer for the next calculation. The relevant formula is as follows:
[0063] r t =σ(W ir x t +b ir +W hr h (t-1) +b hr )
[0064] z t =σ(W iz x t +b iz +W hz h (t-1) +b hz )
[0065] n t =tanh(W in x t +b in +r t *(W hn h (t-1) +b hn ))
[0066] h t =(1-z t )*n t +z t *h (t-1)
[0067] Where W ir 、W hr 、W iz 、W hz 、W in 、W hn 、b ir 、b hr 、b iz 、b hz 、b in 、b hn is the weight of the hidden layer of GRU, x t is the current sample, r t is the weight of the information at the previous moment, z t is the total amount of data that can be transmitted by the information at the previous moment, n t is the output after calculating the current moment information, h (t-1) is the output of the previous layer of the entire GRU layer, h t is the actual output of the entire GRU layer.
[0068] Step S3, calculate the loss function:
[0069] Considering how to identify targets directly from ship radiation noise, we need to find a suitable mapping method to map the original samples to the latent space so that the distance between positive samples is close and the distance between positive and negative samples is short, while ensuring the network's recognition ability and improving the network's ability to separate noise. Figure 3 As shown in the figure, this method constructs a loss function in the form of cross entropy, optimizes the recognition and denoising parts in a unified manner, and through two nonlinear mappings, forces the model to discard the original acoustic useless information and noise of the sample and learn the high-level feature distinctions of different targets. Figure 3 In the equation (1), x1 and x2 represent the current and next samples of the input radiation noise signal, y1 and y2 represent the sample representations of x1 and x2 obtained after the first nonlinear mapping (i.e., feature extraction), and z1 and z2 represent the sample representations of x1 and x2 obtained after the second nonlinear mapping (i.e., time series information fusion).
[0070] The specific method is as follows:
[0071] S31: Initialize a diagonal matrix (9*9) with the same time series dimension as the feature tensor output by S22, transform it to obtain the time series matrix of the current moment and the previous moment, and replicate it 64 (the number of batch samples) times;
[0072] S32: Perform intra-batch matrix dot multiplication on the feature tensor obtained in S13 and the feature tensor obtained in S22;
[0073]
[0074] Where bmat1 is the feature tensor obtained by S13, bmat2 is the feature tensor obtained by S22, and out is obtained as the output by performing dot multiplication on the matrices of corresponding dimensions.
[0075] S33: Calculate the batch logarithmic cross entropy loss function for the tensor and time series matrix of S31:
[0076] l n,c =-w n,c [p c y n,c ·logσ(x n,c )+(1-y n,c )·log(1-σ(x n,c ))]
[0077] Where w n,c is the weight matrix, p c is the penalty factor for correct classification, y n,cis the corresponding label in the time series matrix, x n,c is the corresponding value in the tensor, and σ is the activation function (sigmoid).
[0078] Step S4, model training optimization:
[0079] When calculating the loss function in S33, the gradients of the two modules will be separated due to taking the logarithm, becoming an additive relationship. Therefore, two optimizers are used to optimize the two modules separately.
[0080] The specific method is as follows:
[0081] S41: Build two SGD optimizers and use the loss obtained in step S3 to update the parameters of the time series fusion module and feature extraction module through the gradient backpropagation algorithm. The relevant formula is as follows:
[0082] x t+1 =x t -η t g t
[0083]
[0084] Where x t is the current value of the parameter, x t+1 is the parameter value at the next moment, η t is the learning rate, which is 0.0001 in this example, g t It is the updated value calculated based on the loss; Indicates finding x t The partial differential of the independent variable, E[.] represents the partial differential of g t Find the expected mean.
[0085]
[0086] Where X0 and X1 are the update values returned by the two optimizers, respectively, and λ is the weight, which is 0.5 in this example. The update value is summed up to get
[0087] Step S5, model verification and application:
[0088] After model training is complete, its feature extraction module is applied to actual tasks and further processing is required using the classification module. When testing the model's effectiveness, the K-means clustering algorithm is used to verify the model's classification results. When identifying actual ship radiated noise, supervised training of the classifier is used to fine-tune the model parameters to achieve better recognition results.
[0089] The specific method is as follows:
[0090] S51: During the model testing process, perform 4-means clustering on the feature matrix obtained in step S1. Randomly select 4 samples as the centroids, iteratively determine the Euclidean distance of each sample and assign it to the nearest centroid, and recalculate the centroid until the centroid no longer changes. The calculation method is:
[0091]
[0092] Where x i is the i-th sample, x iu is the u-th eigenvalue of the i-th sample, n is the total number of eigenvalues, and the Euclidean distance dist is obtained ed (x i , x j ), and then iteratively calculate the centroid.
[0093] Through calculation, the accuracy of distinguishing each type of samples is 100%, which verifies the classification and recognition effect of the model;
[0094] S52: Flatten the feature matrix obtained in step (1) into a vector, then pass it through a 2304*4 fully connected layer, and then output the classification result through softmax. In practical applications, the classifier and feature extraction module are first supervised trained with a small amount of data with known labels, and the parameters are fine-tuned to make the model more suitable for the actual task. The formula of the softmax classifier is as follows:
[0095]
[0096] Among them, exp(.) means to find the natural logarithm, f c represents a vector labeled c, where C represents the number of categories. The softmax function maps the input vector to real numbers between 0 and 1 and normalizes it to ensure that the sum is 1, making the sum of the probabilities of multiple categories also exactly 1. Therefore, the output of the softmax function is the probability of each category being taken.
[0097] In summary, the present invention addresses the camouflage problem of target radiation noise in the spectrum graph by utilizing the concept of contrast-based unsupervised learning. While ensuring the real-time effectiveness of the model, it builds a convolutional neural network and a long short-term memory network and performs two mappings. Furthermore, the present invention uses a time series matrix and a cross-entropy function to force the model to discard the original acoustic useless information and noise of the sample and learn the high-level feature differences between different targets, thereby improving the accuracy of target recognition. By reconstructing the loss function through contrastive learning, the present invention achieves a high real-time recognition accuracy while maintaining a simple model structure. It also effectively solves the problem of ship targets camouflaging their own spectrum graphs and interfering with existing recognition systems.
[0098] It should be noted that the above is only a specific embodiment of the present invention. Any feature disclosed in this specification, unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes; all disclosed features, or all methods or steps in the process, except for mutually exclusive features and / or steps, can be combined in any way.
Claims
1. A ship noise recognition method based on paired coding network and contrastive learning, characterized in that: The following steps are involved: Step 1: Divide the long-term ship noise signal received by the hydrophone into signal samples of fixed duration, map the signal samples to the feature space through a convolutional neural network, and obtain the first feature tensor of each signal sample; Step 2: Construct a recurrent neural network consisting of a long short-term memory layer, and input the first feature tensor obtained in step 1 into the recurrent neural network in sequence according to the time sequence of the signal samples to obtain the corresponding second feature tensor; wherein the second feature tensor at the previous moment is stored in the long short-term memory layer and fused into the second feature tensor at the next moment; Step 3: Construct a loss function in the form of cross entropy and calculate the loss value based on the first feature tensor and the second feature tensor; Step 4: Construct a first optimizer and a second optimizer. The first optimizer optimizes the convolutional neural network, and the second optimizer optimizes the combination of the convolutional neural network and the recurrent neural network. Each optimizer uses the loss value calculated in step 3 to update the network parameters of the corresponding neural network through the gradient back propagation method to obtain a trained convolutional neural network and recurrent neural network. Step 5: Input the ship noise signal to be identified into the trained convolutional neural network to obtain the corresponding first feature tensor, flatten it into a vector, and then pass it through the fully connected layer and the softmax classifier to obtain the classification result, thus completing the identification of the ship noise signal.
2. The ship noise recognition method based on paired coding network and contrastive learning according to claim 1 is characterized in that: The specific method of step 1 is: Step 101: Divide the long-term ship noise signal received by the hydrophone into 3.2768 seconds, i.e., 16,384 signal samples. Adjust the dimension of the signal samples from 1*16,384 to 128*128, and read the signal samples into the convolutional neural network in batches of 64. Step 102: The signal sample is mapped to a dimensional space of 256 feature points through an 8*8 convolution kernel with a stride of 4, and then passed through a nonlinear activation function ReLU and a maximum pooling layer of size 2 to obtain a feature matrix of size 256*15*15; In step 103, the feature matrix obtained in step 102 is passed through a 4*4 convolution kernel with a stride of 2, a ReLU layer, and a maximum pooling layer to obtain a 256*3*3 feature tensor.
3. The ship noise recognition method based on paired coding network and contrastive learning according to claim 1 is characterized in that: The specific method of step 3 is: (1) Construct a diagonal tensor of corresponding dimensions based on the first eigentensor and the second eigentensor; (2) Reconstruct the diagonal tensor into a matrix that is right-shifted by one bit and replicated according to the number of samples to obtain a time series label array; (3) Perform matrix multiplication on the first feature tensor and the second feature tensor, while keeping the number of samples unchanged, to obtain a unified sample feature; (4) Calculate the batch cross entropy logarithmic loss on the unified sample feature and time series label array.
Citation Information
Patent Citations
Text classification method and system
CN109871444A
Underwater target recognition method based on GRU and one-dimensional CNN neural network fusion
CN110807365A
