Lightweight robust underwater acoustic target recognition method based on VGG-GAP and network pruning
By using VGG-GAP and network pruning methods in water acoustic target recognition, the problems of high network complexity, large sample demand and unstable in the prior art are solved, and the lightweight and robust water acoustic target recognition effect is achieved.
Patent Information
- Application Number
- CN202411842242.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-13
AI Technical Summary
In the existing water acoustic target recognition methods, the network model is complex, the parameter calculation is huge, the sample demand is high, and it is unstable in small sample data environments and complex and changeable ocean channels.
A lightweight and robust hydroacoustic target recognition method based on VGG-GAP and network pruning is adopted. By constructing a VGG-GAP recognition network, training and pruning, the lightweight network is obtained, and the pruning threshold is adjusted to obtain the optimal network structure.
It is achieved with a much smaller parameter amount and calculation amount that is much smaller than the original model, and has a certain degree of robustness in small sample data and mismatched water acoustic channels.
Smart Images

Figure CN119760352A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning. Background Art
[0002] Underwater acoustic target recognition is one of the key tasks in underwater acoustic signal processing, and it is of great significance in the fields of marine resource development, marine economy, and marine safety. However, in practical applications, underwater acoustic target recognition still faces huge challenges. The acquisition of underwater acoustic target radiation noise often requires large-scale experiments, the cost of data collection is high, and a large amount of random background noise leads to a decrease in signal purity and scarce effective data. Therefore, there is often a serious lack of multi-category, high-quality data samples in underwater acoustic target recognition, and it is impossible to establish a complete database, usually in a small sample data environment. In addition, the complex and changeable ocean environment makes the underwater acoustic channel a complex time-varying, space-varying, and frequency-varying filter. Signals collected under different times, different locations, and different seasons will be distorted. These mismatched environments and distorted signals greatly increase the difficulty of underwater acoustic target recognition. Therefore, it is of great significance to study an underwater acoustic target recognition method that is adapted to a small sample data environment and has a certain degree of robustness in a mismatched environment.
[0003] With the rapid development of artificial intelligence, deep learning has been widely used in underwater acoustic target recognition. However, in order to improve the feature extraction and recognition performance of the network, the underwater acoustic target recognition network based on deep learning usually uses a network with deeper layers, more channels, larger parameters and more complex calculations, which makes the network more complex, more difficult to train, requires more data, and is more difficult to apply to underwater acoustic target recognition problems with small samples. In addition, the huge number of parameters and calculations of complex networks also put forward higher requirements on the space, resources and energy consumption of model application equipment. Therefore, it is of great significance to study a lightweight underwater acoustic target recognition method. Summary of the invention
[0004] The purpose of the present invention is to solve the problems of high network model complexity, huge parameter calculation amount and high sample demand in the existing practical applications of underwater acoustic target recognition; as well as the problem of instability of underwater acoustic target recognition methods caused by the lack of existing high-quality data samples and complex and changeable ocean channels, and propose a lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning.
[0005] A lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning. The specific process is as follows:
[0006] Step 1: Build VGG-GAP recognition network;
[0007] Step 2: Use the training set in the underwater acoustic dataset to train the VGG-GAP recognition network, obtain the trained VGG-GAP recognition network and save the weights corresponding to the trained VGG-GAP recognition network;
[0008] Step 3: Use the network pruning method to prune the trained VGG-GAP recognition network to obtain the pruned lightweight VGG-GAP recognition network and the corresponding weights;
[0009] Step 4: Adjust the pruning threshold to obtain the pruned lightweight VGG-GAP recognition network corresponding to different pruning thresholds, and select the optimal pruned lightweight VGG-GAP recognition network and corresponding weights;
[0010] Step 5: Use the optimal pruned lightweight VGG-GAP recognition network test data sample to obtain the underwater acoustic target recognition result.
[0011] Preferably, in step 1, a VGG-GAP recognition network is constructed; the specific process is:
[0012] The VGG-GAP recognition network includes:
[0013] Input layer, first convolution block, first maximum pooling layer, second convolution block, second maximum pooling layer, third convolution block, fourth convolution block, third maximum pooling layer, fifth convolution block, sixth convolution block, fourth maximum pooling layer, seventh convolution block, eighth convolution block, fifth maximum pooling layer, global average pooling layer, first fully connected layer, second fully connected layer, softmax activation layer, output layer;
[0014] Each of the first convolution block, the second convolution block, the third convolution block, the fourth convolution block, the fifth convolution block, the sixth convolution block, the seventh convolution block, and the eighth convolution block includes a convolution layer and a Relu activation function layer in sequence;
[0015] The convolution kernel size of each convolution layer is 3×3;
[0016] The number of channels of the first fully connected layer and the second fully connected layer is 512.
[0017] Preferably, the parameter calculation formula for each convolutional layer and each fully connected layer in the VGG-GAP recognition network is as follows:
[0018] params Conv =channels out _a×(kernel w ×kernel h ×channels in _a)+bias_a
[0019] params FC =channels out _b×channels in _b+bias_b
[0020] in,
[0021] params Conv is the number of parameters for each convolutional layer;
[0022] channels out _a is the number of output channels of each convolutional layer; channels in _a is the number of input channels for each convolutional layer;
[0023] kernel h The length of the convolution kernel for each convolution layer; kernel w The width of the convolution kernel for each convolution layer;
[0024] bias_a is the number of biases for each convolutional layer, and bias_a = channels out _a;
[0025] params FC is the number of parameters for each fully connected layer;
[0026] channels in _b is the number of input channels for each fully connected layer; channels out _b is the number of output channels of each fully connected layer;
[0027] bias_b is the number of biases for each fully connected layer, and bias_b = channels out _b.
[0028] Preferably, the floating-point operations of each convolutional layer and each fully connected layer in the VGG-GAP recognition network are calculated as follows:
[0029] FLOPs Conv =feature w ×feature h ×params Conv
[0030] FLOPs FC =params FC
[0031] Among them, FLOPs Conv and FLOPs FC are the floating point operations for each convolutional layer and each fully connected layer respectively;
[0032] feature h and feature w Output the length and width of the feature map of each convolutional layer respectively;
[0033] params Conv is the number of parameters for each convolutional layer;
[0034] params FC is the number of parameters for each fully connected layer.
[0035] Preferably, the parameter quantities of all fully connected layers in the VGG-GAP recognition network are as follows:
[0036] params FC(VGG-GAP) =
[0037] (channels1 out ×channels1 in +bias1)+(channels2 out ×channels2 in +bias2)
[0038] in,
[0039] channels1 out The number of output channels of the first fully connected layer in the VGG-GAP identification network;
[0040] channels1 in The number of input channels of the first fully connected layer in the VGG-GAP identification network;
[0041] bias1 is the number of biases in the first fully connected layer of the VGG-GAP recognition network, and bias1 = channels1 out ;
[0042] channels2 out The number of output channels of the second fully connected layer in the VGG-GAP identification network;
[0043] channels2 in The number of input channels of the second fully connected layer in the VGG-GAP identification network;
[0044] bias2 is the number of biases in the second fully connected layer in the VGG-GAP recognition network, and bias2 = channels2 out .
[0045] Preferably, in step 2, the VGG-GAP recognition network is trained using the underwater acoustic data set training set to obtain the trained VGG-GAP recognition network and save the weights corresponding to the trained VGG-GAP recognition network; the specific process is:
[0046] The training set in the underwater acoustic data set is input into the first convolution block, the first maximum pooling layer, the second convolution block, the second maximum pooling layer, the third convolution block, the fourth convolution block, the third maximum pooling layer, the fifth convolution block, the sixth convolution block, the fourth maximum pooling layer, the seventh convolution block, the eighth convolution block, the fifth maximum pooling layer, the global average pooling layer (GAP), the first fully connected layer, the second fully connected layer, the softmax activation layer, and the output layer through the input layer, and the output layer outputs the underwater acoustic target recognition result;
[0047] Train the VGG-GAP recognition network to obtain the trained VGG-GAP recognition network and save the weights corresponding to the trained VGG-GAP recognition network.
[0048] Preferably, in step 3, a network pruning method is used to prune the trained VGG-GAP recognition network to obtain a pruned lightweight VGG-GAP recognition network and corresponding weights; the specific process is:
[0049] Step 31: Take the average of the feature maps output by each channel of each convolution block in the first convolution block, the second convolution block, the third convolution block, the fourth convolution block, the fifth convolution block, the sixth convolution block, the seventh convolution block, and the eighth convolution block in the trained VGG-GAP recognition network to obtain the average feature map output by each convolution block;
[0050] Step 32: Calculate the Pearson correlation coefficient between each channel feature map output by each convolution block and the average feature map, take the absolute value of the Pearson correlation coefficient, and arrange the absolute values in descending order;
[0051] The Pearson correlation coefficient is calculated as follows:
[0052]
[0053] in,
[0054] s i The vector expansion of the feature map output for the i-th channel of each convolution block, s avg Expand the vector of average feature maps output by each convolutional block;
[0055] is the mean of the vector expansion of the feature map output by the i-th channel of each convolution block, The mean of the vector expansion of the average feature map output by each convolution block;
[0056] Corr i The Pearson correlation coefficient between the feature map output by the i-th channel of each convolution block and the average feature map;
[0057] |Corr i |The result of taking the absolute value of the Pearson correlation coefficient between the feature map output by the i-th channel of each convolution block and the average feature map;
[0058] |Corr i |∈[Corr1|,|Corr2|,...,|Corr N ];
[0059] |Corr1|,|Corr2|,...,|Corr N | is the result of the Pearson correlation coefficient after taking the absolute value and arranged in descending order;
[0060] Step 33: In the correlation coefficient sequence arranged in descending order, calculate the ratio of the sum of the correlations of the feature maps output by the first i channels to the sum of all correlations;
[0061] Step 34: until the feature map output by the kth channel is calculated, the ratio of the sum of the correlations of the feature maps output by the first k channels to the sum of the correlations of the feature maps output by all channels is greater than or equal to the pruning threshold;
[0062] At this time, the feature maps output by the k channels are the main components in the feature maps. The convolution kernel corresponding to each feature map in the feature maps output by the k channels is the convolution kernel retained by the pruning algorithm. The position and number of the retained convolution kernels are recorded.
[0063] The pruning threshold is calculated as follows:
[0064]
[0065] Among them, k is the number of convolution kernels retained, and η is the pruning threshold;
[0066] Step 35: Modify the structure of the trained VGG-GAP recognition network and the corresponding optimal weights according to the position and number of the retained convolution kernels to obtain the pruned lightweight network and the corresponding weights;
[0067] Let the pruned lightweight network load the corresponding weights, take the underwater acoustic data set training set in step 2 as input, and calculate the performance and complexity of the pruned lightweight network;
[0068] Performance refers to recognition accuracy, and complexity refers to the number of parameters and calculations.
[0069] Preferably, in step 4, the pruning threshold is adjusted to obtain pruned lightweight VGG-GAP recognition networks corresponding to different pruning thresholds, and the optimal pruned lightweight VGG-GAP recognition network and corresponding weights are selected; the specific process is:
[0070] Adjust the pruning threshold to obtain the pruned lightweight VGG-GAP recognition network corresponding to different pruning thresholds;
[0071] Calculate the recognition accuracy, network parameters and computational complexity of the pruned lightweight VGG-GAP recognition network corresponding to different pruning thresholds;
[0072] A curve is drawn with the network parameter as the horizontal axis and the recognition accuracy as the vertical axis. The pruning threshold corresponding to the accuracy and parameter when the curve first turns downward is the optimal pruning threshold.
[0073] The network structure corresponding to the optimal pruning threshold is the optimal pruned VGG-GAP, and the optimal pruned lightweight VGG-GAP recognition network and corresponding weights are obtained.
[0074] Preferably, in step 5, the optimal pruned lightweight VGG-GAP recognition network test data sample is used to obtain the underwater acoustic target recognition result; the specific process is:
[0075] The test set of the underwater acoustic dataset in step 2 is input into the optimal pruned VGG-GAP, and the optimal pruned VGG-GAP outputs the underwater acoustic target recognition result.
[0076] Preferably, each sample data in the underwater acoustic data set in step 2 is matrix data corresponding to the LOFAR spectrum in the frequency band of 0 to 500 Hz; the specific process is:
[0077] The original hydroacoustic signal is truncated every 20 seconds to obtain the data corresponding to each sample;
[0078] The data corresponding to each sample is truncated using a time window of 0.5 s to obtain the truncated data corresponding to each sample;
[0079] Perform fast Fourier transform on each truncated data to obtain each truncated data after fast Fourier transform;
[0080] All the truncated data after fast Fourier transformation corresponding to the same sample are spliced in the time dimension to obtain
[0081] Full-band LOFAR spectrum matrix data corresponding to each sample;
[0082] The matrix data in the frequency band of 0 to 500 Hz in the full-band LOFAR spectrum matrix data are intercepted as each sample data in the underwater acoustic data set.
[0083] The beneficial effects of the present invention are:
[0084] Hydroacoustic target recognition is of great significance in the fields of marine resource development, marine economy, and marine safety. However, in practical applications, research data faces the problems of small samples and environmental mismatch; model design faces the problems of high network complexity, huge parameter calculation, and high sample demand. In response to this problem, the present invention proposes a lightweight and robust hydroacoustic target recognition method based on VGG-GAP and network pruning. The method improves VGGNet in combination with global average pooling (GAP) to obtain a lighter VGG-GAP network; network pruning based on feature graph correlation is used to remove redundant convolution kernels in VGG-GAP, and the pruning threshold is adjusted to obtain the optimal network structure. The network structure of the present invention can obtain a recognition accuracy rate that is approximately equal to the original model with a parameter amount and calculation amount far less than the original model, and has a certain degree of robustness in small sample data and mismatched hydroacoustic channels, and is more suitable for complex and changeable small sample hydroacoustic environments.
[0085] (1) The present invention can achieve a recognition accuracy rate not lower than that of the original network by using a lightweight network with much smaller parameters and calculation amount than the original network.
[0086] (2) The present invention can achieve more robust recognition performance in a small sample underwater acoustic data environment.
[0087] (3) The present invention can achieve more robust and better recognition performance in a mismatched underwater acoustic channel environment.
[0088] (4) The present invention does not require retraining or fine-tuning after pruning. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1 This is a structural diagram of the VGG-GAP optimization part in the present invention;
[0090] Figure 2 This is a diagram of the VGG-GAP network structure in the present invention;
[0091] Figure 3 Schematic diagram of network pruning in the present invention;
[0092] Figure 4 This is a curve diagram showing the variation of accuracy with network parameters during the network pruning process of the present invention;
[0093] Figure 5 It is a curve diagram showing the variation of the amount of computation with the amount of network parameters in the network pruning process of the present invention;
[0094] Figure 6 This is a comparison chart of the recognition accuracy of the present invention when the amount of data gradually decreases. DETAILED DESCRIPTION
[0095] Specific implementation method 1: This implementation method is a lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning. The specific process is as follows:
[0096] Step 1: Optimize the VGGNet recognition network by combining global average pooling (GAP) to build the VGG-GAP recognition network;
[0097] Step 2: Use the small sample underwater acoustic data set to train the VGG-GAP recognition network, obtain the trained VGG-GAP recognition network and save the weights corresponding to the trained VGG-GAP recognition network;
[0098] Step 3: Use the network pruning method to prune the trained VGG-GAP recognition network to obtain the pruned lightweight VGG-GAP recognition network and the corresponding weights;
[0099] Step 4: Adjust the pruning threshold to obtain the pruned lightweight VGG-GAP recognition network corresponding to different pruning thresholds, and select the optimal pruned lightweight VGG-GAP recognition network and corresponding weights;
[0100] Step 5: Use the optimal pruned lightweight VGG-GAP recognition network test data sample to obtain the underwater acoustic target recognition result.
[0101] Specific implementation method 2: This implementation method is different from specific implementation method 1 in that in step 1, the VGGNet recognition network is optimized by combining global average pooling (GAP) to construct a VGG-GAP recognition network;
[0102] The specific process is:
[0103] The VGG-GAP recognition network includes:
[0104] Input layer, first convolution block, first maximum pooling layer, second convolution block, second maximum pooling layer, third convolution block, fourth convolution block, third maximum pooling layer, fifth convolution block, sixth convolution block, fourth maximum pooling layer, seventh convolution block, eighth convolution block, fifth maximum pooling layer, global average pooling layer (GAP), first fully connected layer, second fully connected layer, softmax activation layer, output layer;
[0105] Each of the first convolution block, the second convolution block, the third convolution block, the fourth convolution block, the fifth convolution block, the sixth convolution block, the seventh convolution block, and the eighth convolution block includes a convolution layer and a Relu activation function layer in sequence;
[0106] The convolution kernel size of each convolution layer is 3×3;
[0107] The number of channels of the first fully connected layer and the second fully connected layer is 512.
[0108] The other steps and parameters are the same as those in the first embodiment.
[0109] Specific implementation method three: This implementation method is different from specific implementation method one or two in that the parameter calculation formula for each convolutional layer and each fully connected layer in the VGG-GAP recognition network is as follows:
[0110] In order to quantitatively describe the lightweight degree of the network, the network parameters and floating point operations (FLOPs) are used to describe the complexity of the network. Here is the calculation method of the parameters;
[0111] params Conv =channels out _a×(kernel w ×kernel h ×channels in _a)+bias_a
[0112] params FC =channels out _b×channels in _b+bias_b
[0113] in,
[0114] params Conv is the number of parameters for each convolutional layer;
[0115] channels out _a is the number of output channels of each convolutional layer; channels in _a is the number of input channels for each convolutional layer;
[0116] kernel h The length of the convolution kernel for each convolution layer; kernel w The width of the convolution kernel for each convolution layer;
[0117] bias_a is the number of biases for each convolutional layer, and bias_a = channels out _a;
[0118] params FC is the number of parameters for each fully connected layer;
[0119] channels in _b is the number of input channels for each fully connected layer; channels out_b is the number of output channels of each fully connected layer;
[0120] bias_b is the number of biases for each fully connected layer, and bias_b = channels out _b.
[0121] The other steps and parameters are the same as those in the first or second embodiment.
[0122] Specific implementation method 4: This implementation method is different from one of the specific implementation methods 1 to 3 in that the floating point operations (FLOPs) of each convolutional layer and each fully connected layer in the VGG-GAP recognition network are calculated as follows:
[0123] In order to quantitatively describe the lightweight degree of the network, the network parameters and floating-point operations (FLOPs) are used to describe the complexity of the network. Here is the calculation method of floating-point operations (FLOPs);
[0124] FLOPs Conv =feature w ×feature h ×params Conv
[0125] FLOPs FC =params FC
[0126] Among them, FLOPs Conv and FLOPs FC are the floating point operations for each convolutional layer and each fully connected layer respectively;
[0127] feature h and feature w The length and width of the feature map output for each convolution layer (convolution kernel of the convolution layer) are respectively;
[0128] params Conv is the number of parameters for each convolutional layer;
[0129] params FC is the number of parameters for each fully connected layer.
[0130] In order to quantitatively analyze the degree of lightweightness of parameters in VGG-GAP, according to params FC =channels out _b×channels in _b+bias_b is the parameter calculation method shown;
[0131] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.
[0132] Specific implementation method 5: This implementation method is different from the specific implementation methods 1 to 4 in that the parameter quantities of all fully connected layers in the VGG-GAP recognition network (the modified VGG-GAP has two fully connected layers) are as follows:
[0133] params FC(VGG-GAP) =
[0134] (channels1 out ×channels1 in +bias1)+(channels2 out ×channels2 in +bias2)
[0135] in,
[0136] channels1 out The number of output channels of the first fully connected layer in the VGG-GAP identification network;
[0137] channels1 in The number of input channels of the first fully connected layer in the VGG-GAP identification network;
[0138] bias1 is the number of biases in the first fully connected layer of the VGG-GAP recognition network, and bias1 = channels1 out ;
[0139] channels2 out The number of output channels of the second fully connected layer in the VGG-GAP identification network;
[0140] channels2 in The number of input channels of the second fully connected layer in the VGG-GAP identification network;
[0141] bias2 is the number of biases in the second fully connected layer in the VGG-GAP recognition network, and bias2 = channels2 out ;
[0142] params FC(VGG-GAP) =(512×512+512)+(512×4+4)=264708≈0.3×10 6
[0143] According to params FC =channels out _b×channels inThe parameter calculation method shown in _b+bias_b calculates the parameter amounts of all fully connected layers in VGGNet (VGGNet has three fully connected layers) as follows
[0144] params FC(VGG) =((h×w×channels)×channels out _1+bias_1)+
[0145] (channels in _2×channels out _2+bias_2)+
[0146] (channels in _3×channels out _3+bias_3)
[0147] in,
[0148] h is the length of the output feature map of the convolutional layer in the eighth convolutional block, and w is the width of the output feature map of the convolutional layer in the eighth convolutional block;
[0149] channels is the number of channels of the convolutional layer output in the eighth convolutional block;
[0150] (h×w×channels) is the number of input channels of the first fully connected layer in the VGGNet network;
[0151] channels out _1 is the number of output channels of the first fully connected layer in the VGGNet network;
[0152] bias_1 is the number of biases in the first fully connected layer in the VGGNet network;
[0153] channels in _2 is the number of input channels of the second fully connected layer in the VGGNet network;
[0154] channels out _2 is the number of output channels of the second fully connected layer in the VGGNet network;
[0155] bias_2 is the number of biases in the second fully connected layer in the VGGNet network;
[0156] channels in _3 is the number of input channels of the third fully connected layer in the VGGNet network;
[0157] channels out _3 is the number of output channels of the third fully connected layer in the VGGNet network;
[0158] bias_3 is the number of biases in the third fully connected layer in the VGGNet network;
[0159] params FC(VGG) =((7×6×512)×4096+4096)+(4096×4096+4096)+(4096×4+4)
[0160] =104882180≈104.9×10 6
[0161] Therefore, the parameters of the lightweight VGG-GAP obtained by step 1 optimization and the comparison with the unimproved VGGNet are shown in Table 1. Compared with VGGNet, the parameters of the convolution layer in VGG-GAP remain unchanged, while the parameters of the fully connected layer and the entire network are greatly reduced, and the total parameters are only 8.3% of VGGNet. Therefore, VGG-GAP effectively achieves the lightweight of the network while maintaining the feature extraction capability of the convolution layer.
[0162] Table 1 Comparison of parameters between VGG-GAP and VGGNet
[0163]
[0164] The specific optimization process of VGG-GAP network compared with VGGNet is:
[0165] (1) Keep the convolutional layer of VGGNet unchanged, that is, keep the feature extraction capability of the network structure unchanged, and make changes to the fully connected layer.
[0166] (2) The first fully connected layer of VGGNet is changed to a GAP layer to achieve feature compression, thereby reducing the dimension of subsequent input.
[0167] (3) The second and third fully connected layers in VGGNet are retained, and their number of channels is changed to 512, ensuring that the number of channels in the fully connected layer is the same as the number of feature maps output by the convolutional layer. Therefore, when pruning the feature maps and the corresponding convolution kernels, the fully connected layer only needs to prune the corresponding weights without retraining or fine-tuning the parameters.
[0168] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.
[0169] Specific implementation method 6: This implementation method is different from the specific implementation methods 1 to 5 in that in step 2, a small sample underwater acoustic data set is used to train the VGG-GAP recognition network, obtain the trained VGG-GAP recognition network and save the weights corresponding to the trained VGG-GAP recognition network; the specific process is:
[0170] The training set of the small sample underwater acoustic data set is input into the first convolution block, the first maximum pooling layer, the second convolution block, the second maximum pooling layer, the third convolution block, the fourth convolution block, the third maximum pooling layer, the fifth convolution block, the sixth convolution block, the fourth maximum pooling layer, the seventh convolution block, the eighth convolution block, the fifth maximum pooling layer, the global average pooling layer (GAP), the first fully connected layer, the second fully connected layer, the softmax activation layer, and the output layer through the input layer, and the output layer outputs the underwater acoustic target recognition result;
[0171] The VGG-GAP recognition network is trained until convergence, the trained VGG-GAP recognition network is obtained, and the weights corresponding to the trained VGG-GAP recognition network are saved.
[0172] The other steps and parameters are the same as those in Specific Implementation Methods 1 to 5.
[0173] Specific implementation method 7: This implementation method is different from any one of specific implementation methods 1 to 6 in that in step 3, a network pruning method is used to prune the trained VGG-GAP recognition network to obtain a pruned lightweight VGG-GAP recognition network and corresponding weights; the specific process is:
[0174] Step 31: Take the average of the feature maps output by each channel of each convolution block in the first convolution block, the second convolution block, the third convolution block, the fourth convolution block, the fifth convolution block, the sixth convolution block, the seventh convolution block, and the eighth convolution block in the trained VGG-GAP recognition network, so as to achieve dimensionality reduction of the feature map and obtain the average feature map output by each convolution block;
[0175] An example is as follows: For example, the 28×28×512 marked above the fifth convolutional block means that 512 channels are output, each of which has a size of 28×28. The 512 feature maps of size 28×28 are averaged to obtain an average feature map; then each of the 512 feature maps is compared with the average feature map to calculate the Pearson correlation coefficient described below;
[0176] Step 32: Calculate the Pearson correlation coefficient between each channel feature map output by each convolution block and the average feature map, take the absolute value of the Pearson correlation coefficient, and arrange the absolute values in descending order;
[0177] The Pearson correlation coefficient is calculated as follows:
[0178]
[0179] in,
[0180] s i The vector expansion of the feature map output for the i-th channel of each convolution block, savg Expand the vector of average feature maps output by each convolutional block;
[0181] is the mean of the vector expansion of the feature map output by the i-th channel of each convolution block, The mean of the vector expansion of the average feature map output by each convolution block;
[0182] Corr i The Pearson correlation coefficient between the feature map output by the i-th channel of each convolution block and the average feature map;
[0183] |Corr i |The result of taking the absolute value of the Pearson correlation coefficient between the feature map output by the i-th channel of each convolution block and the average feature map;
[0184] |Corr i |∈[Corr1|,|Corr2|,...,|Corr N ];
[0185] |Corr1|,|Corr2|,...,|Corr N | is the result of the Pearson correlation coefficient after taking the absolute value and arranged in descending order;
[0186] Step 33: In the correlation coefficient sequence arranged in descending order, calculate the ratio of the sum of the correlations of the feature maps output by the first i channels to the sum of all correlations;
[0187] Step 34: until the feature map output by the kth channel is calculated, the ratio of the sum of the correlations of the feature maps output by the first k channels to the sum of the correlations of the feature maps output by all channels is greater than or equal to the pruning threshold;
[0188] At this time, the feature maps output by the k channels are the main components of the feature maps. The convolution kernel corresponding to each feature map in the feature maps output by the k channels is the convolution kernel retained by the pruning algorithm. The position and number of the retained convolution kernels are recorded.
[0189] The pruning threshold is calculated as follows:
[0190]
[0191] Among them, k is the number of convolution kernels retained, and η is the pruning threshold;
[0192] The position of the convolution kernel is illustrated as follows: one output channel corresponds to one convolution kernel, for example, 28×28×512, 512 channels, then there are 512 convolution kernels, and the position of the convolution kernel is the corresponding number, for example, convolution kernel No. 1, convolution kernel No. 2, and so on to convolution kernel No. 512. When retaining according to the threshold, the convolution kernel number can be recorded to record the position of the convolution kernel.
[0193] The pruning threshold is illustrated as follows: Taking η = 99% as an example, after all correlations are sorted in descending order, the feature maps whose cumulative sum of the first k correlations accounts for 99% or more of the cumulative sum of all correlations are retained by the pruning algorithm, and they contain 99% of the feature information of all feature maps. The remaining feature maps contain only 1% of valid information, but occupy a large amount of parameters and calculations. These redundant feature maps are removed by the pruning algorithm.
[0194] Step 35: Modify the structure of the trained VGG-GAP recognition network according to the position and number of the retained convolution kernels (the structure of the convolution block in the structure of the trained VGG-GAP recognition network is modified according to the retained convolution kernel number, and the rest are deleted) and the corresponding optimal weights to obtain the pruned lightweight network and the corresponding weights;
[0195] Let the pruned lightweight network load the corresponding weights, take the small sample underwater acoustic data set training set in step 2 as input, and calculate the performance and complexity of the pruned lightweight network;
[0196] Performance refers to recognition accuracy, and complexity refers to the number of parameters and calculations.
[0197] The other steps and parameters are the same as those in Specific Embodiments 1 to 6.
[0198] Specific implementation eight: This implementation differs from any one of specific implementations one to seven in that, in step four, the pruning threshold is adjusted to obtain pruned lightweight VGG-GAP recognition networks corresponding to different pruning thresholds, and the optimal pruned lightweight VGG-GAP recognition network and corresponding weights are selected;
[0199] The specific process is:
[0200] Adjust the pruning threshold to obtain the pruned lightweight VGG-GAP recognition network corresponding to different pruning thresholds;
[0201] Calculate the recognition accuracy, network parameters and computational complexity of the pruned lightweight VGG-GAP recognition network corresponding to different pruning thresholds;
[0202] A curve is drawn with the network parameter as the horizontal axis and the recognition accuracy as the vertical axis. The pruning threshold corresponding to the accuracy and parameter when the curve first turns downward is the optimal pruning threshold.
[0203] The network structure corresponding to the optimal pruning threshold is the optimal pruned VGG-GAP, and the optimal pruned lightweight VGG-GAP recognition network and corresponding weights are obtained.
[0204] The optimal pruning threshold selection is illustrated as follows: Each pruning threshold corresponds to a parameter amount, a calculation amount, and a recognition accuracy rate. For example, if there are 10 pruning thresholds, then there are 10 parameter amounts, 10 calculation amounts, and 10 recognition accuracy rates.
[0205] If the pruning threshold is used as the horizontal axis, we can plot the parameters, calculations, and recognition accuracy. Figure 4 The axis of pruning threshold is hidden, and 10 parameter quantities and 10 recognition accuracy rates are directly used as the horizontal and vertical axes to draw the graph. Each point in the figure corresponds to a pruning threshold that is not marked in the figure. Therefore, the turning point in this figure is the balance point between recognition accuracy and parameter quantity, and the pruning threshold corresponding to the turning point is the optimal pruning threshold required.
[0206] The other steps and parameters are the same as those in Specific Embodiments 1 to 7.
[0207] Specific implementation method 9: This implementation method is different from any one of specific implementation methods 1 to 8 in that the optimal pruned lightweight VGG-GAP recognition network test data sample is used in step 5 to obtain the underwater acoustic target recognition result; the specific process is:
[0208] The test set of the underwater acoustic dataset in step 2 is input into the optimal pruned VGG-GAP without repeated training or fine-tuning. The optimal pruned VGG-GAP outputs the underwater acoustic target recognition result.
[0209] The other steps and parameters are the same as those in Specific Embodiments 1 to 8.
[0210] Specific implementation ten: This implementation is different from any one of specific implementations one to nine in that each sample data in the underwater acoustic data set in step two is the matrix data corresponding to the LOFAR spectrum in the frequency band of 0 to 500 Hz; the specific process is:
[0211] The original hydroacoustic signal is truncated every 20 seconds to obtain the data corresponding to each sample;
[0212] The data corresponding to each sample is truncated using a time window of 0.5 s to obtain the truncated data corresponding to each sample;
[0213] Perform fast Fourier transform on each truncated data to obtain each truncated data after fast Fourier transform;
[0214] All the truncated data after fast Fourier transformation corresponding to the same sample are spliced in the time dimension to obtain the full-band LOFAR spectrum matrix data corresponding to each sample;
[0215] The matrix data in the frequency band of 0 to 500 Hz (greater than or equal to 0 and less than or equal to 500 Hz) in the full-band LOFAR spectrum matrix data are intercepted as each sample data in the underwater acoustic data set.
[0216] The other steps and parameters are the same as those in Specific Embodiments 1 to 9.
[0217] Implementation example:
[0218] The experimental data set uses the ShipsEar data set. About 4% of the low-quality samples with clipping problems in the data set are discarded, and the retained data is transformed by FFT to obtain the LOFAR matrix as the input feature. The length of each sample data is 20s, the time window length of FFT is 0.5s, and the forward time step of each FFT is 0.1s. The LOFAR matrix of the sample within 0-500Hz is drawn as input, and the input matrix dimension is 250×196. Due to the small number of samples in the data set, in order to reduce randomness, a five-fold cross validation is used. The number of input data samples is shown in Table 2.
[0219] Table 2 Input sample quantity
[0220]
[0221] In the experiment, the Adam optimization algorithm with cross entropy cost loss was used. The VGG-GAP network was trained 50 times with a batch size of 16 and a learning rate of 0.00008. The recognition performance is shown in Table 3.
[0222] It can be seen from Table 3 that VGG-GAP has achieved good recognition performance in small sample underwater acoustic target recognition. At this time, the network parameter volume is only 9.5×10 6 , which is much smaller than 114.1×10 in VGGNet. 6 The number of parameters.
[0223] Table 3 VGG-GAP recognition results
[0224]
[0225] In order to obtain the optimal network structure after pruning, the pruning threshold is gradually reduced, the pruning intensity is increased, and the curves of accuracy and parameter quantity and parameter quantity and calculation quantity are plotted, such as Figure 4 and Figure 5 shown.
[0226] Figure 4The vertical axis is the recognition accuracy, and the horizontal axis is the percentage of the network parameters after pruning relative to the unpruned state. When the network is pruned at a small rate, the recognition performance of the network remains stable, and even slightly increases compared to the unpruned state. As the pruning ratio gradually increases, a turning point appears in the curve, and the recognition performance of the network begins to decline. This turning point is the optimal structure of the network. At this time, η=99.0%, the network recognition accuracy is 93.9%, and the network parameters are reduced to 71.3% of the unpruned state. If the pruning ratio continues to increase, the recognition performance of the network will gradually decrease. When η=93.0%, the recognition accuracy of the network is less than 60%, and it is no longer able to effectively identify the target.
[0227] Figure 5 The horizontal axis is the percentage of network parameters after pruning relative to the unpruned state, and the vertical axis is the percentage of network floating point operations (FLOPs) relative to the unpruned state. As can be seen from the figure, the network parameters and computational complexity are approximately linear. As the network parameters decrease, the computational complexity of the network also decreases, and the complexity of the network decreases.
[0228] The structure of the underwater acoustic target recognition network designed by the present invention is shown in Table 4. As can be seen from Table 4, the network structure of the optimal pruned VGG-GAP obtained is more concise, the recognition performance is better, and the network complexity is lower.
[0229] Table 4 Optimal pruned VGG-GAP network structure and comparison
[0230]
[0231] The lightweight VGG-GAP proposed in the present invention is comprehensively compared with VGG-GAP and VGGNet, and the results are shown in Table 5. Table 5 shows the various performance indicators of the network and the performance changes of the lightweight VGG-GAP compared with VGGNet. Compared with VGGNet, the lightweight algorithm proposed in the present invention greatly reduces the network parameters and calculation amount while keeping the recognition accuracy approximately unchanged, effectively realizing the lightweight of the network.
[0232] Table 5 Recognition performance and complexity of VGGNet, VGG-GAP and pruned lightweight VGG-GAP
[0233]
[0234] The network performance obtained by the present invention is tested using a data set with a gradually decreasing number of samples. The recognition accuracy is shown in the attached figure. Figure 6 As shown in the figure, it can be seen that the network obtained by the present invention has higher inclusiveness and robustness in the case of small samples.
[0235] The network performance obtained by the present invention is tested using data in a mismatched underwater acoustic channel environment, and the recognition performance is shown in Table 6. As can be seen from the table, the present invention has better robustness in a mismatched underwater acoustic channel.
[0236] Table 6 Recognition performance and comparison of the network obtained by the present invention in the mismatched underwater acoustic channel
[0237]
[0238] The present invention may also have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.
Claims
1. A lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning, characterized by: The specific process of the method is: Step 1: Build VGG-GAP recognition network; Step 2: Use the training set in the underwater acoustic dataset to train the VGG-GAP recognition network, obtain the trained VGG-GAP recognition network and save the weights corresponding to the trained VGG-GAP recognition network; Step 3: Use the network pruning method to prune the trained VGG-GAP recognition network to obtain the pruned lightweight VGG-GAP recognition network and the corresponding weights; Step 4: Adjust the pruning threshold to obtain the pruned lightweight VGG-GAP recognition network corresponding to different pruning thresholds, and select the optimal pruned lightweight VGG-GAP recognition network and corresponding weights; Step 5: Use the optimal pruned lightweight VGG-GAP recognition network test data sample to obtain the underwater acoustic target recognition result.
2. According to claim 1, a lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning is characterized by: In the step 1, a VGG-GAP recognition network is constructed; The specific process is: The VGG-GAP recognition network includes: Input layer, first convolution block, first maximum pooling layer, second convolution block, second maximum pooling layer, third convolution block, fourth convolution block, third maximum pooling layer, fifth convolution block, sixth convolution block, fourth maximum pooling layer, seventh convolution block, eighth convolution block, fifth maximum pooling layer, global average pooling layer, first fully connected layer, second fully connected layer, softmax activation layer, output layer; Each of the first convolution block, the second convolution block, the third convolution block, the fourth convolution block, the fifth convolution block, the sixth convolution block, the seventh convolution block, and the eighth convolution block includes a convolution layer and a Relu activation function layer in sequence; The convolution kernel size of each convolution layer is 3×3; The number of channels of the first fully connected layer and the second fully connected layer is 512.
3. According to claim 2, a lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning is characterized by: The parameter calculation formula for each convolutional layer and each fully connected layer in the VGG-GAP recognition network is as follows: params Conv =channels out _a×(kernel w ×kernel h ×channels in _a)+bias_a params FC =channels out _b×channels in _b+bias_b in, params Conv is the number of parameters for each convolutional layer; channels out _a is the number of output channels of each convolutional layer; channels in _a is the number of input channels for each convolutional layer; kernel h The length of the convolution kernel for each convolution layer; kernel w The width of the convolution kernel for each convolution layer; bias_a is the number of biases for each convolutional layer, and bias_a = channels out _a; params FC is the number of parameters for each fully connected layer; channels in _b is the number of input channels for each fully connected layer; channels out _b is the number of output channels of each fully connected layer; bias_b is the number of biases for each fully connected layer, and bias_b = channels out _b.
4. The lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning according to claim 3 is characterized by: The calculation method of the floating-point operation number of each convolutional layer and each fully connected layer in the VGG-GAP recognition network is as follows: FLOPs Conv =feature w ×feature h ×params Conv FLOPs FC =params FC Among them, FLOPs Conv and FLOPs FC are the floating point operations for each convolutional layer and each fully connected layer respectively; feature h and feature w Output the length and width of the feature map of each convolutional layer respectively; params Conv is the number of parameters for each convolutional layer; params FC is the number of parameters for each fully connected layer.
5. The lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning according to claim 4 is characterized in that: The parameters of all fully connected layers in the VGG-GAP recognition network are as follows: params FC(VGG-GAP) = (channels1 out ×channels1 in +bias1)+(channels2 out ×channels2 in +bias2) in, channels1 out The number of output channels of the first fully connected layer in the VGG-GAP identification network; channels1 in The number of input channels of the first fully connected layer in the VGG-GAP identification network; bias1 is the number of biases in the first fully connected layer of the VGG-GAP recognition network, and bias1 = channels1 out ; channels2 out The number of output channels of the second fully connected layer in the VGG-GAP identification network; channels2 in The number of input channels of the second fully connected layer in the VGG-GAP identification network; bias2 is the number of biases in the second fully connected layer in the VGG-GAP recognition network, and bias2 = channels2 out .
6. The lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning according to claim 5 is characterized by: In the step 2, the VGG-GAP recognition network is trained using the underwater acoustic data set training set to obtain the trained VGG-GAP recognition network and save the weights corresponding to the trained VGG-GAP recognition network; the specific process is: The training set in the underwater acoustic data set is input into the first convolution block, the first maximum pooling layer, the second convolution block, the second maximum pooling layer, the third convolution block, the fourth convolution block, the third maximum pooling layer, the fifth convolution block, the sixth convolution block, the fourth maximum pooling layer, the seventh convolution block, the eighth convolution block, the fifth maximum pooling layer, the global average pooling layer (GAP), the first fully connected layer, the second fully connected layer, the softmax activation layer, and the output layer through the input layer, and the output layer outputs the underwater acoustic target recognition result; Train the VGG-GAP recognition network to obtain the trained VGG-GAP recognition network and save the weights corresponding to the trained VGG-GAP recognition network.
7. The lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning according to claim 6 is characterized by: In the step 3, a network pruning method is used to prune the trained VGG-GAP recognition network to obtain a pruned lightweight VGG-GAP recognition network and corresponding weights; the specific process is: Step 31: Take the average of the feature maps output by each channel of each convolution block in the first convolution block, the second convolution block, the third convolution block, the fourth convolution block, the fifth convolution block, the sixth convolution block, the seventh convolution block, and the eighth convolution block in the trained VGG-GAP recognition network to obtain the average feature map output by each convolution block; Step 32: Calculate the Pearson correlation coefficient between each channel feature map output by each convolution block and the average feature map, take the absolute value of the Pearson correlation coefficient, and arrange the absolute values in descending order; The Pearson correlation coefficient is calculated as follows: in, s i The vector expansion of the feature map output for the i-th channel of each convolution block, s avg Expand the vector of average feature maps output by each convolutional block; is the mean of the vector expansion of the feature map output by the i-th channel of each convolution block, The mean of the vector expansion of the average feature map output by each convolution block; Corr i The Pearson correlation coefficient between the feature map output by the i-th channel of each convolution block and the average feature map; |Corr i |The result of taking the absolute value of the Pearson correlation coefficient between the feature map output by the i-th channel of each convolution block and the average feature map; |Corr i |∈[Corr1|,|Corr2|,...,|Corr N ]; |Corr1|,|Corr2|,...,|Corr N | is the result of the Pearson correlation coefficient after taking the absolute value and arranged in descending order; Step 33: In the correlation coefficient sequence arranged in descending order, calculate the ratio of the sum of the correlations of the feature maps output by the first i channels to the sum of all correlations; Step 34: until the feature map output by the kth channel is calculated, the ratio of the sum of the correlations of the feature maps output by the first k channels to the sum of the correlations of the feature maps output by all channels is greater than or equal to the pruning threshold; At this time, the feature maps output by the k channels are the main components in the feature maps. The convolution kernel corresponding to each feature map in the feature maps output by the k channels is the convolution kernel retained by the pruning algorithm. The position and number of the retained convolution kernels are recorded. The pruning threshold is calculated as follows: Among them, k is the number of convolution kernels retained, and η is the pruning threshold; Step 35: Modify the structure of the trained VGG-GAP recognition network and the corresponding optimal weights according to the position and number of the retained convolution kernels to obtain the pruned lightweight network and the corresponding weights; Let the pruned lightweight network load the corresponding weights, take the underwater acoustic data set training set in step 2 as input, and calculate the performance and complexity of the pruned lightweight network; Performance refers to recognition accuracy, and complexity refers to the number of parameters and calculations.
8. The lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning according to claim 7 is characterized by: In the step 4, the pruning threshold is adjusted to obtain pruned lightweight VGG-GAP recognition networks corresponding to different pruning thresholds, and the optimal pruned lightweight VGG-GAP recognition network and corresponding weights are selected; the specific process is: Adjust the pruning threshold to obtain the pruned lightweight VGG-GAP recognition network corresponding to different pruning thresholds; Calculate the recognition accuracy, network parameters and computational complexity of the pruned lightweight VGG-GAP recognition network corresponding to different pruning thresholds; A curve is drawn with the network parameter as the horizontal axis and the recognition accuracy as the vertical axis. The pruning threshold corresponding to the accuracy and parameter when the curve first turns downward is the optimal pruning threshold. The network structure corresponding to the optimal pruning threshold is the optimal pruned VGG-GAP, and the optimal pruned lightweight VGG-GAP recognition network and corresponding weights are obtained.
9. The lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning according to claim 8 is characterized by: In step 5, the optimal pruned lightweight VGG-GAP recognition network test data sample is used to obtain the underwater acoustic target recognition result; the specific process is: The test set of the underwater acoustic dataset in step 2 is input into the optimal pruned VGG-GAP, and the optimal pruned VGG-GAP outputs the underwater acoustic target recognition result.
10. The lightweight and robust underwater acoustic target recognition method based on VGG-GAP and network pruning according to claim 9 is characterized in that: In the step 2, each sample data in the underwater acoustic data set is the matrix data corresponding to the LOFAR spectrum in the frequency band of 0 to 500 Hz; the specific process is: The original hydroacoustic signal is truncated every 20 seconds to obtain the data corresponding to each sample; The data corresponding to each sample is truncated using a time window of 0.5 s to obtain the truncated data corresponding to each sample; Perform fast Fourier transform on each truncated data to obtain each truncated data after fast Fourier transform; All the truncated data after fast Fourier transformation corresponding to the same sample are spliced in the time dimension to obtain the full-band LOFAR spectrum matrix data corresponding to each sample; The matrix data in the frequency band of 0 to 500 Hz in the full-band LOFAR spectrum matrix data are intercepted as each sample data in the underwater acoustic data set.
Citation Information
Patent Citations
Sonar target detection method based on attention perception and scaling factor pruning
CN114594461A
Compression method and device of underwater acoustic communication leading signal detection model
CN116405127A
Underwater acoustic network node identity authentication method based on voiceprint information
CN116647376A
Underwater sound target identification method based on multi-target comparative learning
CN117935849A
Edge end underwater target intelligent identification model training method and device and identification method
CN117992788A