An underwater target sound automatic classification method based on a lightweight multi-scale convolution attention neural network
Patent Information
- Application Number
- CN202410031610.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2044-01-09
AI Technical Summary
[0004]为了解决上述技术问题,本发明提供一种基于轻量化多尺度卷积注意力神经网络的水下目标声音自动分类方法,以解决现有技术中存在的问题
[0031]本发明通过将每类不同的水下目标信号实行MFCC特征和GFCC特征提取,对提取完的MFCC特征和GFCC特征分别进行二阶差分处理,然后分别拼接原来的特征数据和每次差分的特征数据;对处理后的MFCC特征和GFCC特征沿第1维度拼接,建立训练集和数据集并加载;构建多尺度卷积注意力神经网络模型,训练多尺度卷积注意力神经网络分类模型,完成分类识别;从水下目标声音中提取处理过的MFCC特征和GFCC特征,用于训练多尺度卷积注意力神经网络从而进行分类,对比于使用传统训练分类框架的水下目标声音分类方法,本发明所提方法准确率更高、消耗计算资源更少。
Smart Images

Figure CN117831572B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of underwater target classification technology, specifically a method for automatic underwater target sound classification based on a lightweight multi-scale convolutional attention neural network. Background Technology
[0002] Due to the widespread application of sonar, there has been considerable interest in the sound classification of underwater targets, particularly in identifying ship types by the sound of underwater propellers. Sound analysis of ships offers two main advantages: firstly, it allows for quick identification of passing vessels, improving port management efficiency; secondly, it facilitates improvements in ship design, making them quieter or more efficient, thus mitigating their impact on the marine ecosystem. For example, using smart devices to identify passing ships in the sea can significantly improve the efficiency of marine workers. Therefore, developing high-precision underwater target recognition technology is crucial. Currently, deep learning-based underwater target recognition is a mainstream method, but it faces two major challenges: 1. The complexity of underwater target types and the low distinguishability of original underwater noise signals from different ships, coupled with the significant environmental noise from ocean currents and monsoons in different seasons, complicate subsequent classification and labeling tasks; 2. The large number of parameters in most underwater target classification neural networks, resulting in complex computations, makes them unsuitable for terminal deployment.
[0003] To address the problems raised in the background art, those skilled in the art have proposed an automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides an automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network, thereby resolving the issues existing in the prior art.
[0005] An automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network includes the following steps:
[0006] S1. Audio preprocessing: Convert the multi-channel underwater target signal into a fixed number of channels and perform sampling and normalized length processing to obtain processed audio data;
[0007] S2. Feature Extraction: Perform Mel filtering and cepstral transform on the audio data output from step S1 to output MFCC feature vectors; perform Gammatone filtering on the audio data output from S1 to output GFCC feature vectors; then process the MFCC feature vectors and GFCC feature vectors; finally, build and load the feature dataset.
[0008] S3. Construct four multi-scale convolutional layers with different kernel sizes, batch normalization layers, and convolutional layers: Input the underwater target feature dataset extracted in S2 into the multi-scale convolutional layers for feature extraction, and then process the extracted feature data.
[0009] S4. Construct the ConvNextV2 layer-convolutional layer module and max pooling layer: perform more complex and abstract feature extraction on the ConvNextV2 layer-convolutional layer that inputs the data extracted in S3; construct the max pooling layer to reduce the dimensionality of the extracted feature data and output it to the next layer;
[0010] S5. Construct a multi-scale attention convolution module, and the max pooling layer, average pooling layer and fully connected layer module process the feature data output by S4;
[0011] S6. Training phase: Combine the output of S5 with the label information for training. After iterating to the maximum number of iterations, complete the optimization training of the multi-scale convolutional neural network classifier structure and parameters.
[0012] S7. Testing Phase: The trained multi-scale convolutional neural network classifier is used to classify the underwater acoustic features in the test sample dataset to obtain the test classification results.
[0013] Preferably, the target signal includes underwater target sound, including fishing boats, trawlers, mussel boats, tugboats, dredgers, motorboats, pilot boats, sailboats, passenger ferries, ocean liners, roll-on / roll-off ships, and marine environmental noise, etc.
[0014] Preferably, the audio preprocessing is described in detail below:
[0015] S11. Convert the original underwater target signal into a single-channel signal;
[0016] S12, Set the audio sampling rate to 22050;
[0017] S13. Standardize audio length, extract all audio signals with a duration of 1 second, and pad any excess parts.
[0018] Preferably, in step S2, the processing of the MFCC feature vector and the GFCC feature vector is specifically described as follows: calculate the second-order difference of the obtained MFCC feature vector and the GFCC feature vector respectively and concatenate them; normalize the concatenated MFCC feature vector and the GFCC feature vector; and concatenate the processed MFCC feature vector and the GFCC feature vector along the first dimension.
[0019] Preferably, MFCC uses a linear Mel-scale filter bank, and the extraction process includes:
[0020] 1) Data preprocessing;
[0021] 2) Perform a Fast Fourier Transform on the signal;
[0022] 3) Create a set of triangular Mel filters that uniformly cover the spectrum range, calculate the overlap region between each filter and the spectrum, and obtain a series of energy values;
[0023] 4) Perform a logarithmic transformation on the Mel spectrogram to generate a Mel logarithmic power spectrogram;
[0024] 5) The MFCC characteristics can be obtained by applying Discrete Cosine Transform (DCT) to the energy values of the filter bank after taking the logarithm.
[0025] Preferably, in step S3, the processing steps of the extracted feature data are as follows: merging the extracted feature data, batch normalizing the merged feature data; after batch normalization, the data enters the convolutional layer for feature dimensionality reduction and is output to the next layer.
[0026] Preferably, step S4 is specifically described as follows: by constructing a ConvNextV2 layer-convolutional layer module, the data extracted in S3 is stacked three times to perform more complex and abstract feature extraction, and a max pooling layer is constructed to perform feature dimensionality reduction.
[0027] Preferably, step S5 is specifically described as follows: Construct a multi-scale attention convolution module, a max pooling layer, an average pooling layer, and a fully connected layer module; perform key feature selection, dimensionality reduction, and nonlinear transformation processing on the feature data output from S4.
[0028] Preferably, the multi-scale convolutional neural network classifier structure and parameter optimization in step S6 is trained 300 times.
[0029] Preferably, the loss function for training the network classifier is defined as follows: When the number of training iterations reaches 300, the loss rate and accuracy gradually converge.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] This invention extracts MFCC and GFCC features from different types of underwater target signals, performs second-order difference processing on the extracted MFCC and GFCC features, and then concatenates the original feature data with the feature data from each difference step. The processed MFCC and GFCC features are then concatenated along the first dimension to establish and load the training and datasets. A multi-scale convolutional attention neural network model is constructed and trained to perform classification. The processed MFCC and GFCC features are extracted from underwater target sounds and used to train the multi-scale convolutional attention neural network for classification. Compared to underwater target sound classification methods using traditional training frameworks, the proposed method achieves higher accuracy and consumes fewer computational resources. Attached Figure Description
[0032] Figure 1 This is a system flowchart of an embodiment of the automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network of the present invention.
[0033] Figure 2 Example 1 of the automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network of the present invention presents 5s time-domain waveforms of five different types of underwater target signals.
[0034] Figure 3 Example 1 of the automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network of the present invention presents 5s Mel spectra of five different types of underwater target signals;
[0035] Figure 4 Example 1 of the present invention, which is an automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network, shows the 5sGFCC feature maps of five different types of underwater target signals.
[0036] Figure 5 This is a multi-scale convolutional attention neural network framework diagram, which is an embodiment of the automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network according to the present invention.
[0037] Figure 6 This is a multi-scale convolutional layer framework diagram of an embodiment of the automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network of the present invention.
[0038] Figure 7 This is a schematic diagram of the ConvNextV2 module of an embodiment of the present invention, which is an automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network.
[0039] Figure 8This is a framework diagram of the multi-scale convolutional attention module in Embodiment 1 of the present invention, which is an automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network.
[0040] Figure 9 This is a loss function value variation / convergence graph from an embodiment of the present invention, which describes an automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network.
[0041] Figure 10 This is a graph showing the error rate variation of underwater target classification and recognition in an automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network according to the present invention.
[0042] Figure 11 This invention provides a confusion matrix for various underwater target recognition methods based on a lightweight multi-scale convolutional attention neural network for automatic underwater target sound classification. Detailed Implementation
[0043] The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and should not be construed as limiting the scope of the invention.
[0044] As attached Figure 1 To be continued Figure 11 As shown:
[0045] This invention provides an automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network, comprising the following steps:
[0046] S1. Audio Preprocessing:
[0047] S11. Convert the original underwater target signal into a single-channel signal;
[0048] S12, Set the audio sampling rate to 22050;
[0049] S13. Standardize audio length, extract all audio signals with a duration of 1 second, and pad any excess parts;
[0050] S2, Feature Extraction:
[0051] S21. Calculate the MFCC features of the audio signal processed by S1, and calculate the first and second differences of the MFCC features, maintaining dimensionality consistency by appending rows of all zeros to the calculation results; concatenate the MFCC features, first-order differences, and second-order differences; normalize the concatenated feature data; MFCC uses a linear Mel-scale filter bank, and the extraction process includes: 1) data preprocessing; 2) performing a fast Fourier transform on the signal; 3) creating a set of triangular Mel filters that uniformly cover the spectrum range, calculating the overlap region between each filter and the spectrum, and obtaining a series of energy values; 4) performing a logarithmic transformation on the Mel spectrum to generate a Mel logarithmic power spectrum; 5) applying a discrete cosine transform (DCT) to the logarithmic filter bank energy values yields the MFCC features, i.e.:
[0052]
[0053] Where M is the number of triangular filters, X m (n) is the log-Mel spectrum of the nth frame of the mth channel, where i is the index of the cepstral coefficients;
[0054] S22. Calculate the GFCC features of the audio signal processed by S1, and calculate the first and second differences of the GFCC features, maintaining dimensionality consistency by appending rows of all zeros to the calculation results; concatenate the GFCC features, first-order differences, and second-order differences; normalize the concatenated feature data; where the GFCC Gammatone filter is defined in the time-frequency domain as follows:
[0055]
[0056] Where f is the frequency and a is a constant. is the phase, p is the filter order; the factor b in formula (2) is the filter bandwidth, which is calculated as follows:
[0057]
[0058] in:
[0059] ERB(f) = 24.7 + 0.108f (4)
[0060] Where ERB(f) is the equivalent rectangular bandwidth; the Gammatone filter response of each channel is calculated based on g(f,t) and its absolute value is taken to obtain the time-frequency plot G. c (n); where c represents the channel index and n represents the frame index; performing a discrete cosine transform on this time-frequency graph yields the GFCC, i.e.:
[0061]
[0062] Where C is the number of Gammatone filters, G c (n) is the cochlear spectrogram of the c-th channel in the n-th frame, where i is the index of the cepstral coefficients;
[0063] S23. Merge the processed MFCC features and GFCC features;
[0064] S24. Labeling: The experiment used the ShipsEar public dataset, which originates from different regions along the northwestern Atlantic coast of Spain. Most of the data was collected in or near Vigo (42°14.5'N 008°43.4'W). This port is busy with traffic, featuring a diverse range of ship types and rich environmental noise, making it ideal for collecting sounds from ships and the environment, including fishing boats, ocean-going passenger ships, ferries of various sizes, container ships, roll-on / roll-off ships, tugboats, pilot boats, yachts, and small sailboats. This dataset records 11 types of ship sounds and 1 type of environmental noise, totaling 90 audio files of approximately 3.13 hours in length. The data is categorized into four types based on ship size and environmental noise as follows: 1: Fishing boats, trawlers, mussel boats, tugboats, and dredgers; 2: Motorboats, pilot boats, and sailboats; 3: Passenger ferries; 4: Ocean-going passenger ships and roll-on / roll-off ships; 5: Background noise.
[0065] S25. Dataset partitioning: The dataset contains 11,270 data points, of which 1,871 are from class 1, 1,554 are from class 2, 4,256 are from class 3, 2,453 are from class 4, and 1,139 are from class 5. 80% of the data points are randomly selected as the training set, 10% as the validation set, and 10% as the test set.
[0066] S3. Construct four multi-scale convolutional layers with different kernel sizes, a batch normalization layer, and the convolutional layer module:
[0067] S31. The underwater target signal features extracted in S2 are input into a multi-scale convolutional layer, and then into four convolutional layers with different kernel sizes for feature extraction. The principle of the convolutional layer is as follows:
[0068]
[0069] Where N represents the batch size. b represents the number of output channels, w represents the bias, and w represents the weight.
[0070] Input is x in Its shape is shown below:
[0071] x in =(N,C,H,W) (7)
[0072] Where N represents the batch size, C represents the number of channels, H represents the height, and W represents the width; where: x in Branch 1 is a convolutional layer with kernel size (3,3), padding, and stride of 1, resulting in x1 = (N,4C,H,W); in Branch 2 is a convolutional layer with kernel size (9,9), padding of 4, and stride of 1, resulting in x2 = (N,4C,H,W); in Branch 3 is a convolutional layer with kernel size (15, 15), padding of 7, and stride of 1, resulting in x3 = (N, 4C, H, W); in By branch 4, a convolutional layer with kernel size (21,21), padding of 10, and stride of 1 is formed, x4 = (N,4C,H,W).
[0073] By merging the features of the four branches, we obtain x. 1,2,3,4 = (N, 16C, H, W), and then passed through a batch normalization layer. This normalization layer uses GRN (Global Response Normalization), which can better process key feature information and improve feature recognition. Its principle is as follows:
[0074] GRN(X):=X∈R H×W×C →gx∈R C (8)
[0075] Where X∈R H×W×C Given an input feature, where H, W, and C represent the height, width, and number of channels of the feature map, respectively; using normalized feature aggregation, we can obtain GRN(X) = gx = {||x1||,||x2||,....,||x...} C ||}∈R C Among them, GRN(X) i =||x i || is a scalar that aggregates the statistics of the i-th channel, and using L2-norm in particular will improve the performance of the network model; then the cluster set is normalized by the response normalization function N(·); we use the standard division normalization method, as shown below:
[0076]
[0077] Among them, ||X i || represents the L2-norm of the i-th channel; finally, the calculated feature normalization score is used to calibrate the original input response:
[0078] X i =X i *N(GRN(X) i )∈R H×W(10)
[0079] Then, after passing through a convolutional layer with a kernel size of (1,1), padding, and stride of 1, the output x is obtained. out Go to the next floor;
[0080] S4. Construct the ConvNextV2 layer - convolutional layer module, max pooling layer module:
[0081] S41. By stacking three convolutional layers and a ConvNextV2 layer, the 32-dimensional feature data output from S4 is increased to 512 dimensions. In the first step, the feature data output from S4 is normalized by LN, and then passed through a ConvNextV2 layer. GRN technology is also used in the ConvNextV2 layer to improve the network performance. Then, the data output from the first step is used as the input for the second step. It is passed through a convolutional layer with kernel (3,3), stride 2, and padding (1,1) to increase the feature dimension to 64 dimensions. After passing through an LN layer, it is passed through a ConvNextV2 layer. Finally, the output of the second step is passed through a convolutional layer with kernel (3,3), stride 2, and padding (1,1) to increase the feature dimension to 128 dimensions. After passing through an LN layer, it is passed through a ConvNextV2 layer to obtain the output 128-dimensional feature data.
[0082] S42. The 128-dimensional feature data is passed through a convolutional layer with kernel (3,3), stride 2, and padding (1,1) to increase the feature dimension to 512 dimensions. Then, the feature dimension is reduced by max pooling with kernel (3,3) and stride 2.
[0083] S5. Construct a multi-scale attention convolutional module, a max pooling layer, an average pooling layer, and a fully connected layer module:
[0084] S51. A multi-scale attention module is composed of Inception multi-scale convolutional layers and ECA (Efficient Channel Attention). ECA calculates weights by pooling and one-dimensional convolution of the features of each channel, and then enhances important channel information in the next layer. The update method for each channel weight is defined as follows:
[0085]
[0086] Where, ω i ω represents the weight of channel i. j This represents the parameter used to calculate the weight of each channel, k (1≤k≤C) represents the range of cross-channel interaction during the process, and f i j This represents the feature value associated with channel i, and j is the index; Let k represent the feature set associated with each channel i; where k is determined by adaptively varying the number of channels as follows:
[0087]
[0088] Where C represents the number of input channels, γ,b represent hyperparameters, and |n| odd It is represented as the odd number that is closest to the real number n;
[0089] The depth and complexity of the neural network are expanded by stacking four layers of multi-scale convolutional attention modules, and key feature selection is performed on the input features. First, the feature data output by s4 is processed through two layers of multi-scale attention blocks for more comprehensive and rich feature extraction and key feature selection. Then, it is processed through a max pooling layer with a kernel size of (3,3) and a stride of 2 for feature dimensionality reduction.
[0090] S52. The dimensionality-reduced feature data is then processed through two layers of multi-scale convolutional attention blocks to enhance the model's ability to perceive and understand features at different scales in the feature data, enabling the model to better capture global feature information, thereby improving the accuracy and robustness of target classification. The feature dimensionality is reduced by an average pooling layer with a kernel of (1,1), reducing the number of model parameters and computational cost, preventing overfitting, and improving the computational efficiency of the neural network. Finally, a linear layer is used for nonlinear transformation.
[0091] S6. Training a multi-scale convolutional neural network classification model: Input the processed MFCC and GFCC features of various underwater target signals into the network to train the multi-scale convolutional neural network model with labels, using the Adam optimizer and setting the initial learning rate to 0.1;
[0092] S7. Classification Test: Using the trained multi-scale convolutional neural network structure and parameters, the underwater target features in the test sample dataset are classified to obtain the classification results and identify various types of underwater targets;
[0093] S8. This invention uses accuracy, precision, recall, and F1 score as evaluation metrics and requires the use of the following basic concepts: TP: True Positive Example, predicted to be true and actually true; FP: False Positive Example, predicted to be true but actually false; FN: False Negative Example, predicted to be false but actually true; TN: True Negative Example, predicted to be false and actually false.
[0094] The formulas for Accuracy, Precision, Recall, and F1-score are as follows:
[0095]
[0096]
[0097]
[0098]
[0099] This invention also evaluates the complexity and computational efficiency of the model by comparing the number of parameters and FLOPs (Floating point operations). The calculation principle of each convolutional layer parameter is as follows:
[0100] params = C out ×(κ ω ×κ h ×C in +1) (17)
[0101] Where C out C represents the number of output channels. in κ represents the number of input channels. ω and κ h Indicates the kernel size;
[0102] The principle behind calculating the computational cost (FLOPs) of each layer in convolution is as follows:
[0103] FLOPs = [(κ ω ×k h ×C in )+(κ ω ×k h ×C in -1)+1]×C out ×W×H (18)
[0104] Where W and H represent the width and height of the feature map, respectively;
[0105] In step S2, feature extraction is performed on the underwater target signal from step S1: Mel filtering and cepstral transform are performed on the data to output MFCC feature vectors, and second-order difference of MFCC features is performed and concatenated; Gammatone filtering is performed on the data to output GFCC feature vectors, and second-order difference of GFCC features is performed and concatenated, and then the two features are concatenated along the first dimension.
[0106] In step S3, four multi-scale convolutional layers with different kernel sizes, a batch normalization layer, and a convolutional layer module are constructed. Multi-scale convolution can capture feature information at different scales and enrich the expressive power of features. The normalization layer can normalize each batch of inputs, making the network more stable and the convergence speed faster.
[0107] In step S4, a ConvNextV2 layer-convolutional layer module and a max pooling layer module are constructed. The ConvNextV2 layer-convolutional layer module can increase the depth and complexity of the network, extract more comprehensive and abstract feature data, and prevent the network from overfitting. The max pooling layer reduces the dimensionality of the extracted features, reduces the computational load of the network, and improves computational efficiency.
[0108] The construction of the multi-scale attention convolution module in step S5 can more comprehensively model multi-scale features, which can not only better integrate spatial and channel information and enhance the expressive power of features, but also improve the richness and robustness of feature extraction.
[0109] In step S6, the multi-scale convolutional neural network classification model is trained 300 times, and the experimental parameters are continuously adjusted and optimized to obtain the most suitable experimental parameters. In the experiment, after training sequentially, it was found that the model's loss rate and accuracy gradually converged around 300 times. Therefore, the number of training iterations was adjusted to 300. During each training, the model parameters obtained from the previous epoch are used for the next training, and the framework is retrained. The difference between the loss rate and accuracy is still very small. Therefore, 300 times was chosen.
[0110] When the training times of the multi-scale convolutional neural network classification model are 300 times, the loss rate and accuracy gradually tend to converge. The loss function is defined as: only 0 or 1, and when it is 0, the result is 0, and only when it is 1 will there be a classification result and the underwater target features will be tested and classified.
[0111] Step 1, Audio Preprocessing Stage: The underwater target data downloaded from the dataset provided in the paper "ShipsEar: An underwater vessel noisedatabase" will be processed by channel conversion, sampling, and truncation to construct the underwater target data heard in the real underwater scene;
[0112] Step 2, Feature Extraction and Labeling Stage: Extract MFCC and GFCC features from the preprocessed underwater target data and perform second-order difference transformation. Concatenate the original spectrum, first-order and second-order features respectively. Then, concatenate and label the MFCC and GFCC features extracted from the processed underwater target signal to construct the dataset.
[0113] Step 3, underwater target classification process: The training set from the dataset obtained in Step 2 is input into a multi-scale convolutional neural network classification network for classification. Finally, five different underwater targets are classified, and a classification framework is trained.
[0114] Example 1:
[0115] The following section demonstrates the feasibility and superiority of the algorithm by classifying different underwater targets using the underwater target classification model designed based on this strategy.
[0116] First, we processed the data. The dataset we used was from the paper "ShipsEar: An underwater vessel noise database". The underwater targets included fishing boats, ocean-going passenger ships, ferries of various sizes, container ships, roll-on / roll-off ships, tugboats, pilot boats, yachts, and small sailboats. This dataset recorded the sounds of 11 types of ships and 1 type of environmental noise, totaling 90 audio files of different durations, approximately 3.13 hours. Based on the size of the ships, the data was divided into four categories, and the environmental noise was as follows: 1: Fishing boats, trawlers, mussel boats, tugboats, and dredgers; 2: Motorboats, pilot boats, and sailboats; 3: Passenger ferries; 4: Ocean-going passenger ships and roll-on / roll-off ships; 5: Background noise. We first converted the original underwater target signals into single-channel signals, setting the audio sampling rate to 22050Hz. Then, we normalized the audio length. For audio data of different durations, we extracted all audio signals longer than 1 second, padded the excess portions, and then continued the experiment.
[0117] This experiment continues to use the processed five underwater targets for feature extraction and dataset construction. The main focus of this experiment is on audio collected underwater by sonar and then effectively classified. Identifying underwater vessel targets through sound is highly interfering and challenging. The underwater sound collected by sonar in ports often includes environmental noise such as currents, underwater animal calls, noise from other passing vessels, and sounds from port visitors. Using MFCC or GFCC feature maps alone for underwater target classification is ineffective. Therefore, this invention employs a method combining MFCC and GFCC features, calculating the results after steps... The S1-processed audio signal is used to extract MFCC features, calculate the first and second differences of the MFCC features, and maintain dimensionality consistency by appending rows of all zeros to the calculation results. The MFCC features, first-order differences, and second-order differences are then concatenated. The main idea behind MFCC feature extraction is to develop a feature set that closely adapts to the human hearing scale. Next, the S1-processed audio signal is used to extract GFCC features, calculate the first and second differences of the GFCC features, and maintain dimensionality consistency by appending rows of all zeros to the calculation results. The GFCC features, first-order differences, and second-order differences are then concatenated. Finally, the concatenated feature data is normalized.
[0118] Taking category 2 as an example, a multi-scale convolutional neural network classifier module is constructed. The extracted underwater acoustic signal features of passenger ferries first enter the input layer of the multi-scale convolutional layer, and then enter four convolutional layers with different kernel sizes for feature extraction. Specifically: branch 1 is a convolutional layer with a kernel size of (3,3), padding, and stride of 1; branch 2 is a convolutional layer with a kernel size of (9,9), padding of 4, and stride of 1; branch 3 is a convolutional layer with a kernel size of (15,15), padding of 7, and stride of 1; and branch 4 is a convolutional layer with a kernel size of (21,21), padding of 10, and stride of 1. The features from the four branches are merged, then passed through a batch normalization layer, an activation function, and finally through a convolutional layer with a kernel size of (1,1), padding, and stride of 1 for feature dimensionality reduction before outputting the feature x. out ;
[0119] Let x out After passing through three stacked ConvNextV2 layers—a convolutional layer module and a max pooling layer module—more comprehensive and abstract feature data is extracted, and overfitting of the network is prevented. The max pooling layer reduces the dimensionality of the extracted features, thereby reducing the computational load and improving computational efficiency. The output obtained after passing through this neural network layer is x2.
[0120] Based on the aforementioned passenger ferry audio features x2, a multi-scale attention module is constructed using a combination of Inception multi-scale convolutional layers and ECA attention mechanism. This module expands the depth and complexity of the neural network by stacking four multi-scale convolutional attention layers and performs key feature selection on the input features. First, the feature data output from step S4 is processed through two multi-scale attention blocks for feature extraction and key feature selection, followed by max pooling for feature dimensionality reduction. Next, the dimensionality-reduced feature data is processed through two more multi-scale convolutional attention blocks to enhance the model's perception and understanding of features at different scales, capturing global feature information. Then, average pooling layers are used for feature dimensionality reduction to reduce the number of parameters and computational cost, improving computational efficiency. Finally, a linear layer performs a non-linear transformation.
[0121] Training a multi-scale convolutional neural network classification model: The processed underwater acoustic signal features of the passenger ferry are input into the network for label training of the multi-scale convolutional neural network model. In each iteration, the input is defined as the input minus the average value of the input and divided by the standard deviation of the input. After passing through the model classification layer, the loss function value is calculated (using the cross-entropy loss function). The Adam optimizer is used and the initial learning rate is set to 0.1 to accelerate the gradient descent speed. When the number of iterations reaches 300, the network is considered to have completed the training process for underwater targets.
[0122] This invention evaluates the classification performance of the proposed algorithm against other algorithms for underwater targets using four metrics. Table 1 compares the accuracy of this invention's automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network with the existing method in the paper "Joint learning model for underwater acoustic target recognition". Table 1 shows the results.
[0123] Table 1 shows the comparison results between the proposed model and other current algorithms.
[0124]
[0125] In summary, the automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network has the following advantages:
[0126] 1. The neural network model proposed in this invention can quickly and accurately determine the target type for underwater target audio data classification, providing sonar information processing personnel with objective and accurate vessel type identification, reducing unnecessary inspections, improving work efficiency, and reducing time consumption;
[0127] 2. This invention, through a lightweight design of the underwater target classification model, reduces the number of model parameters and inference time while ensuring the model's classification performance. It effectively improves the accuracy and real-time performance of underwater target identification, and increases the efficiency and robustness of the algorithm, providing an effective classification strategy for sonar-acquired sound classification.
[0128] Any content not described in detail in this specification is prior art known to those skilled in the art.
[0129] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network, characterized in that: Includes the following steps: S1. Audio preprocessing: Convert the multi-channel underwater target signal into a fixed number of channels, and sample and standardize the length of the converted underwater target signal to obtain audio data; S2. Feature Extraction: Mel filtering and cepstral transform are performed on the audio data output from step S1 to obtain the MFCC feature vector; Gammatone filtering is performed on the audio data output from step S1 to obtain the GFCC feature vector; the MFCC feature vector and GFCC feature vector are processed to establish a feature dataset and divide it into a training set, a validation set and a test set. S3. Multi-scale feature extraction: Construct a multi-scale convolutional module including four parallel convolutional branches, a batch normalization layer, and a convolutional layer; input the feature data output from step S2 into the four parallel convolutional branches for feature extraction, merge the feature data output from each convolutional branch, and then input them into the batch normalization layer and the convolutional layer for processing, and output them to step S4. S4. Deep Feature Extraction: Construct a ConvNeXt V2 feature extraction module that includes ConvNeXt V2 layers, convolutional layers, and max pooling layers; The feature data output in step S3 is sequentially input into the ConvNeXt V2 layer and the convolutional layer for feature extraction. Then, the extracted feature data is reduced in dimensionality using a max pooling layer and output to step S5. S5. Construct a multi-scale attention convolutional module, a max pooling layer, an average pooling layer, and a fully connected layer module, and then process the feature data output from S4; the multi-scale attention convolutional module consists of an Inception multi-scale convolutional layer and an efficient channel attention module; S6, Training Phase: The output of S5 is combined with the label information for training. After the maximum number of iterations, the optimization training of the lightweight multi-scale convolutional attention neural network structure and parameters is completed. S7. Testing Phase: The trained lightweight multi-scale convolutional attention neural network is used to classify the sound features of underwater targets in the test set to obtain the classification results.
2. The underwater target sound automatic classification method based on a lightweight multi-scale convolutional attention neural network as described in claim 1, characterized in that, In step S2, the first-order difference and the second-order difference of the MFCC feature vector and the GFCC feature vector are calculated respectively; the MFCC feature vector and its first-order difference and the second-order difference are concatenated, and the GFCC feature vector and its first-order difference and the second-order difference are concatenated; the concatenated MFCC feature vector and the GFCC feature vector are normalized respectively, and then the normalized MFCC feature vector and the GFCC feature vector are concatenated along the first dimension.
3. The underwater target sound automatic classification method based on a lightweight multi-scale convolutional attention neural network as described in claim 1, characterized in that: In step S3, the extracted feature data are merged, and the merged feature data is batch normalized; after batch normalization, it enters the convolutional layer for feature dimensionality reduction and is output to the next layer.
4. The underwater target sound automatic classification method based on a lightweight multi-scale convolutional attention neural network as described in claim 1, characterized in that, In step S4, the feature data output in step S3 is sequentially input into a three-level cascaded ConvNeXtV2 layer and a convolutional layer for feature extraction. Then, a max pooling layer is used to reduce the dimensionality of the extracted feature data. The ConvNeXt V2 layer and the convolutional layer are set alternately.
5. The automatic underwater target sound classification method based on a lightweight multi-scale convolutional attention neural network as described in claim 1, characterized in that, In step S6, the training epochs for optimizing the lightweight multi-scale convolutional attention neural network structure and parameters are 300.
