A method, medium and system for underwater acoustic target identification

CN122575408APending Publication Date: 2026-08-14青岛国实科技集团有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-15
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0005]有鉴于此,本发明提供一种水声目标识别方法、介质及系统,能够解决现有技术中存在水声目标识别模型在复杂水下声场环境中对长序列音频特征的全局依赖建模能力不足的技术问题

Benefits of technology

[0029]本发明采用稀疏变换编码器中基于滑动窗口局部注意力与跨帧全局令牌交互机制相结合的稀疏注意力机制,将注意力计算复杂度从平方量级降至线性量级,使模型在有限计算资源下能够完整处理长序列音频特征,从而建模线谱周期等长程依赖关系,解决了水声目标识别模型在复杂水下声场环境中对长序列音频特征的全局依赖建模能力不足的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122575408A_ABST
    Figure CN122575408A_ABST
Patent Text Reader

Abstract

This invention provides a method, medium, and system for underwater acoustic target recognition, belonging to the field of underwater acoustic target recognition technology. The invention constructs an underwater acoustic field target recognition dataset and performs noise reduction and data augmentation preprocessing. It employs a multi-head attention acoustic feature extraction method to fuse multi-dimensional audio features, and utilizes a multi-scale residual sparse transform underwater acoustic recognition model to combine multi-scale convolutional local feature extraction with long-range modeling by a sparse transform encoder. The sparse attention window width parameter is dynamically adjusted through a spectral quality evaluation function, and the model is deployed and inferred on the Sunway supercomputing platform in a distributed data parallel mode. Finally, it outputs probability vectors for each category, using the category corresponding to the maximum probability as the recognition result. This invention solves the technical problem of insufficient global dependency modeling capability of underwater acoustic target recognition models for long-sequence audio features in complex underwater acoustic field environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of underwater acoustic target recognition technology, and specifically relates to an underwater acoustic target recognition method, medium, and system. Background Technology

[0002] Underwater acoustic target recognition is a core technology of underwater situational awareness, widely used in marine safety monitoring, underwater target classification, and marine bioacoustic research. Existing technologies typically employ a model architecture combining convolutional neural networks and long short-term memory networks, using short-time frequency domain features such as Mel-frequency cepstral coefficients as input to classify and identify underwater acoustic signals.

[0003] However, in actual underwater sound fields, the periodic characteristics of the line spectrum of underwater acoustic signals often span a long time scale. The receptive field of convolutional neural networks is limited, making it difficult to model long-range dependencies between audio frames. The computational complexity of standard self-attention mechanisms increases quadratically with the sequence length. When processing audio sequences that are several minutes long, computational resources are consumed at an extreme rate, which may even lead to memory overflow or uncontrollable inference delay.

[0004] In current underwater acoustic target recognition tasks, the non-stationarity of underwater channels and multipath interference significantly increase the duration of audio feature sequences. The squared complexity of standard global attention mechanisms on long sequences makes it impossible for models to fully model long-range features such as line spectrum periods under limited computational resources, leading to a decrease in recognition accuracy. In other words, existing technologies suffer from insufficient ability to model the global dependencies of long audio feature sequences in complex underwater acoustic environments. Summary of the Invention

[0005] In view of this, the present invention provides an underwater acoustic target recognition method, medium and system, which can solve the technical problem that the existing underwater acoustic target recognition model has insufficient global dependency modeling ability for long sequence audio features in complex underwater acoustic field environments.

[0006] The present invention is implemented as follows: The first aspect of the present invention provides a method for underwater acoustic target recognition, comprising the following steps:

[0007] We acquired hydrophone data, open-source underwater acoustic datasets, and internet data. After data filtering, cleaning, equalization settings, and data segmentation, we constructed an underwater sound field target recognition dataset.

[0008] The audio data in the underwater sound field target recognition dataset is subjected to noise reduction and data augmentation processing in sequence to obtain the enhanced audio dataset.

[0009] Based on the multi-head attention acoustic feature extraction method, Mel frequency cepstral coefficient features, chroma features, Mel spectrum features, contrast features, and tonality network features are extracted from the enhanced audio dataset, and the above features are fused into an audio feature sequence.

[0010] The audio feature sequence is input into the multi-scale residual sparse transform underwater acoustic recognition model. The attention window width parameter of the model is adjusted according to the quality assessment value output by the spectral quality assessment function to complete the model training.

[0011] The production environment of the Sunway supercomputing platform was set up, and the trained multi-scale residual sparse transform underwater acoustic recognition model was deployed on the cluster in a distributed data parallel mode to perform distributed inference and prediction on underwater acoustic target audio data.

[0012] Based on the probability vectors of each category output by the multi-scale residual sparse transform underwater acoustic recognition model, the category corresponding to the maximum probability is output as the recognition result.

[0013] Specifically, the balance setting involves adjusting the data of each category from three dimensions: audio duration, audio quantity, and audio quality, to ensure that each category has consistent weights during model training.

[0014] Specifically, the data segmentation involves using a Python-written audio segmentation program to remove audio files with a duration shorter than the segmentation duration threshold, and to uniformly segment audio files with a duration exceeding the segmentation duration threshold into audio files with a duration corresponding to the segmentation duration threshold.

[0015] Specifically, the noise reduction process involves using Audition CC2015 software to remove noise from all audio data in the underwater sound field target recognition dataset in order to eliminate background noise in the marine environment.

[0016] Specifically, the data enhancement processing employs three methods—waveform shifting, waveform stretching, and treble correction—to augment the audio data.

[0017] Specifically, the multi-head attention acoustic feature extraction method extracts Mel frequency cepstral coefficient features, chroma features, Mel spectrum features, contrast features, and tonality network features from the librosa audio processing library. These features are then fused into an audio feature sequence and used as input to the multi-head attention mechanism. After scaling dot product attention calculation and linear mapping, weighted audio semantic space features are obtained.

[0018] The input layer of the multi-scale residual sparse transform underwater acoustic recognition model receives a 3-channel fused feature map, which is then spliced ​​together in the spatial dimension to form a triplet feature tensor. The feature extraction backbone uses a multi-scale residual convolution module with 3 parallel branches. The outputs of each branch are weighted by the channel attention SE-Net module and then spliced ​​together. The outputs are added to the input through cross-scale residual connections, resulting in a total of 5 multi-scale residual convolution modules.

[0019] The multi-scale residual sparse transform underwater acoustic recognition model flattens the feature map into a sequence and inputs it into the sparse transform encoder. The sparse transform encoder adopts a sliding window local attention and cross-frame global token interaction mechanism to reduce the attention complexity from... Down to ,in This is the window width.

[0020] The multi-scale residual sparse transform underwater acoustic recognition model introduces a dynamic routing capsule layer after the sparse transform encoder. The capsule network aggregates low-level feature vectors into high-level target attitude capsules through an iterative dynamic routing algorithm, which is equally variable to changes in target orientation and velocity.

[0021] The multi-scale residual sparse transform underwater acoustic recognition model is designed with a cross-layer feature jump path. When the activation entropy of a certain layer of the sparse transform encoder for a certain target category is lower than the activation entropy threshold, an early exit mechanism is triggered, and the output result of the shallow classifier is directly connected.

[0022] The multi-scale residual sparse transform underwater acoustic recognition model integrates a conditional random field as a sequence-level post-processing layer, and uses the class transition probability of adjacent frames to constrain the temporal consistency of the output sequence.

[0023] The spectral quality assessment function calculates the quality assessment value based on the mean signal-to-noise ratio of the current batch of audio data and the mean inter-frame cosine similarity of the Mel frequency cepstral coefficients. ,when Attention window width at a quality threshold or higher Take the high-quality window width value; when When the quality is below the high-quality threshold but not below the low-quality threshold, Take a medium window width value; when When below the low quality threshold, Take the width value of the low-quality window.

[0024] The multi-scale residual sparse transform underwater acoustic recognition model introduces a domain adaptive transfer learning framework during the training phase. It uses maximum mean difference loss to minimize the feature distribution distance between the source and target domains, thereby implicitly decoupling the adversarial domain adaptation network from changes in the vocal tract.

[0025] The multi-scale residual sparse transform underwater acoustic recognition model uses a homomorphic deconvolution method to perform multipath separation on the audio data before feature extraction, reconstructs the minimum phase equivalent channel, and performs equalization processing to restore the line spectrum clarity and Mel frequency cepstral coefficient smoothness.

[0026] The distributed data parallel mode is configured with 10 computing nodes. The communication backend uses a message passing interface, and the inter-layer neuron weight gradients are synchronized among the nodes through the AllReduce operation. The forward propagation of the convolutional layer and the preprocessing of Mel frequency cepstral coefficient features are allocated to independent asynchronous CUDA streams for parallel execution. The iterative routing calculation of the dynamic routing capsule layer occupies a separate CUDA stream. The high-quality threshold is 0.7, the low-quality threshold is 0.4, the high-quality window width is 256, the medium window width is 128, and the low-quality window width is 64.

[0027] A second aspect of the present invention provides a computer-readable storage medium storing program instructions that, when executed in a computer, perform the aforementioned underwater acoustic target recognition method.

[0028] A third aspect of the present invention provides an underwater acoustic target recognition system comprising the aforementioned computer-readable storage medium, wherein the system is a computer, the computer-readable storage medium is disposed within the system, and the system is provided with a microprocessor for executing program instructions stored in the computer-readable storage medium.

[0029] This invention employs a sparse attention mechanism that combines sliding window local attention with cross-frame global token interaction in a sparse transform encoder. This reduces the computational complexity of attention from the quadratic order of magnitude to the linear order of magnitude, enabling the model to fully process long-sequence audio features with limited computational resources. This allows the model to model long-range dependencies such as spectral periods, thus solving the technical problem of insufficient global dependency modeling capability for long-sequence audio features in complex underwater acoustic field environments for underwater target recognition models.

[0030] This invention dynamically adjusts the window width parameter of sparse attention through a spectral quality evaluation function. When the audio quality is high, the window is expanded to fully model long-range features, and when the audio quality is low, the window is narrowed to suppress noise interference. This makes the attention range match the actual signal quality, further ensuring the effectiveness and robustness of long sequence modeling.

[0031] In summary, this invention solves the technical problem mentioned in the background art of insufficient global dependency modeling ability of underwater acoustic target recognition models for long sequence audio features in complex underwater acoustic field environments. Attached Figure Description

[0032] Figure 1This is a flowchart of the method of the present invention.

[0033] Figure 2 This is the overall architecture diagram.

[0034] Figure 3 This is a characteristic image of the acoustic spectrum of a cargo ship.

[0035] Figure 4 This is a characteristic image of the acoustic spectrum of a passenger ship.

[0036] Figure 5 This is a characteristic image of the acoustic spectrum of an oil tanker.

[0037] Figure 6 This is a spectrogram feature diagram of a tugboat. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below.

[0039] like Figure 1 The diagram shown is a flowchart of an underwater acoustic target recognition method provided by the first aspect of the present invention. This method includes the following steps:

[0040] S01. Acquire hydrophone data, open-source underwater acoustic datasets, and internet data. After data filtering, cleaning, equalization settings, and data segmentation, construct an underwater sound field target recognition dataset.

[0041] S02. The audio data in the underwater sound field target recognition dataset is subjected to noise reduction and data augmentation processing in sequence to obtain the enhanced audio dataset.

[0042] S03. Based on the multi-head attention acoustic feature extraction method, Mel frequency cepstral coefficient features, chroma features, Mel spectrum features, contrast features and tonality network features are extracted from the enhanced audio dataset, and the above features are fused into an audio feature sequence.

[0043] S04. Input the audio feature sequence into the multi-scale residual sparse transform underwater acoustic recognition model, and adjust the attention window width parameter of the model according to the quality assessment value output by the spectral quality assessment function to complete the model training.

[0044] S05. Set up the production environment of the Sunway supercomputing platform, and deploy the trained multi-scale residual sparse transform underwater acoustic recognition model on the cluster in a distributed data parallel mode to perform distributed inference prediction on underwater acoustic target audio data.

[0045] S06. Based on the probability vectors of each category output by the multi-scale residual sparse transform underwater acoustic recognition model, the category corresponding to the maximum probability is output as the recognition result.

[0046] The underwater sound field target recognition dataset comprises three main categories and ten subcategories: marine life data, ship data, and white noise data. Specifically, it includes data on tankers, passenger ships, cargo ships, tugboats, white noise, dolphins, whales, seals, manatees, and walruses. Ship data is collected using hydrophones, while marine life data comes from the Best of Watkins Marine MammalSound Database open-source underwater acoustic recognition dataset. The dataset contains a total of 53,760 audio files, with 5,376 files per category. Each audio file is 3 seconds long, resulting in a total duration of approximately 16,128 seconds per category. The file sizes range from 150 to 300 KB. The dataset is divided into training, validation, and test sets in a 6:2:2 ratio, with a total size of 15.1 GB.

[0047] Among them, the balance setting refers to the equalization adjustment of data of each category from three dimensions: audio duration, audio quantity, and audio quality, so as to ensure that the weights of each category are consistent during model training.

[0048] Among them, data cutting refers to using Python to write an audio cutting program to remove audio files with a duration of less than 3 seconds and to cut audio files with a duration of more than 3 seconds into 3-second audio files. After processing, a total of 53,760 audio files were obtained.

[0049] Among them, noise reduction processing refers to using Audition CC2015 software to remove noise from all audio in the underwater sound field target recognition dataset, in order to eliminate the background noise of the marine environment caused by seawater movement, water layer movement, marine biological activities and human production activities.

[0050] Among them, data augmentation refers to using three methods—waveform shifting, waveform stretching, and treble correction—to augment audio data using Python. The total size of the augmented data is approximately 20GB. Data augmentation makes the trained model more generalizable and more robust.

[0051] The specific process of the multi-head attention acoustic feature extraction method is as follows: First, the Mel frequency cepstral coefficient (MFC) feature is extracted by calling the Mel frequency cepstral coefficient (MFC) algorithm from the librosa audio processing library. The algorithm reference format is librosa.feature.mfcc, and the main parameters include the audio time series. Sampling rate Logarithmic power Mel spectrum Number of returned coefficients Discrete Cosine Transform Type and standardization methods Next, librosa.feature.chroma_stft, librosa.feature.melspectrogram, librosa.feature.spectral_contrast, and librosa.feature.tonnetz are called respectively to extract chroma features, Mel spectrogram features, contrast features, and tonality network features, and these features are fused into an audio feature sequence. Finally, the fused audio feature sequence is used as the input to a multi-head attention mechanism, and the specific calculation formula is expressed as follows:

[0052] ;

[0053] Among them, the processed Mel frequency cepstral coefficient audio features , , After fully connected linear transformation, they are respectively mapped to , , ; after mapping , , Input scaled dot product attention and calculate intermediate attention values. The calculation formula is: Concatenate all intermediate attention values ​​into Finally, through linear mapping The final output of the multi-head attention mechanism is obtained. Thus, the weighted audio semantic space features are obtained.

[0054] The purpose of introducing the multi-head attention mechanism is to highlight the key content in the audio feature sequence, enhance the model's ability to identify different target categories, and make the model more accurate in extracting effective target features in the underwater sound field environment.

[0055] The multi-scale residual sparse transform underwater acoustic recognition model is based on deep learning. The main structure of the model network includes convolutional layers, long short-term memory (LSTM) layers, attention layers, and fully connected layers. The model input is an audio feature sequence, and the model output is a classification probability vector for each category. The specific structure of the multi-scale residual sparse transform underwater acoustic recognition model is as follows: the input layer receives a 3-channel fused feature map. The first channel is the original waveform's short-time Fourier transform spectrum, the second channel is the Mel frequency cepstral coefficient matrix, and the third channel is the DEMON demodulation envelope spectrum. These three channels are concatenated spatially to form a triplet feature tensor. The feature extraction backbone uses a multi-scale residual convolution module with three parallel branches, each employing... , , Convolutional kernels extract local features at different time-frequency resolutions. The outputs of each branch are weighted by a channel attention SE-Net module and then concatenated. This concatenation is then added to the input via a cross-scale residual connection to avoid the loss of shallow speaker texture information. A total of five multi-scale residual convolutional modules are stacked, compressing the feature map dimension at each level. Subsequently, the feature map is flattened into a sequence and input into a sparse Transformer encoder. The sparse Transformer encoder employs a Longformer-style sliding window local attention and cross-frame global token interaction mechanism, reducing the attention complexity from... Down to ,in With a window width of [value missing], it effectively handles long sequence features corresponding to audio files lasting several minutes. A dynamic routing capsule layer is introduced after the sparse Transformer encoder to replace the traditional fully connected classifier head. The capsule network aggregates low-level feature vectors into high-level target pose capsules through an iterative dynamic routing algorithm, exhibiting equivariance to changes in target orientation and velocity, and maintaining robust classification even when the target's motion state changes. The network incorporates a cross-layer feature jump path. When the activation entropy of a certain layer of the sparse Transformer for a target category falls below a set threshold, an early exit mechanism is triggered, directly accessing the output of the shallow classifier and skipping subsequent deep layer calculations to maintain real-time inference efficiency. Finally, a conditional random field is fused as a sequence-level post-processing layer, using the class transition probability of adjacent frames to constrain the temporal consistency of the output sequence and eliminate single-frame misclassification noise. The model was tested on the Sunway supercomputing platform. The communication backend uses a message passing interface. The weight gradients of neurons between layers are synchronized among nodes through the AllReduce operation. The activation entropy threshold required for the jump decision of the cross-layer feature jump path is broadcast from the master node to all slave kernels. In terms of CUDA stream allocation, the forward propagation of the convolutional layer and the preprocessing of Mel-frequency cepstral coefficient features are allocated to independent asynchronous CUDA streams for parallel execution. The iterative routing calculation of the dynamic routing capsule layer occupies a separate CUDA stream to ensure iteration synchronization. Each node releases and reallocates GPU memory uniformly after each batch to prevent the accumulation of GPU memory fragmentation. The hidden state tensors of the Long Short-Term Memory network layer adopt a block memory allocation strategy when expanding at time steps. The size of each block is dynamically calculated according to the batch size and the number of time steps to avoid allocation failure due to excessively large single continuous memory requests. The above resource allocation strategy and the attention window width parameter in S04 Having a direct functional relationship, when As the computational load of a single layer of the sparse Transformer encoder increases, the system automatically increases the number of CUDA streams allocated to the sparse Transformer encoder to maintain overall inference latency stability. The multi-scale residual sparse transform underwater acoustic recognition model integrates multi-scale convolutional local feature extraction, sparse Transformer global dependency modeling, capsule network-based variable classification, and conditional random field temporal constraints. It extracts short-term transient features through multi-scale residual convolution modules and models long-range spectral periodic features through the sparse Transformer encoder. These two complementary approaches cover the dual time-frequency attributes of underwater acoustic signals, significantly improving target recognition accuracy and robustness in underwater acoustic environments. Simultaneously, a cross-layer early exit mechanism ensures real-time inference efficiency, and the conditional random field post-processing layer further eliminates misjudgment noise in the temporal dimension, forming a complete closed loop from feature extraction to sequence decision. The steps for establishing the training dataset of the multi-scale residual sparse transform underwater acoustic recognition model specifically include: using the enhanced dataset (after data denoising and augmentation) of the underwater acoustic field target recognition dataset as the training dataset; dividing the dataset into training, validation, and test sets in a 6:2:2 ratio; using the training set for model parameter updates, the validation set for hyperparameter tuning, and the test set for final performance evaluation; and the steps for training the multi-scale residual sparse transform underwater acoustic recognition model specifically include: using the cross-entropy loss function as the loss function, accuracy as the metric, a batch size of 128, 120 iterations, using the Sigmoid activation function for the convolutional layer, and the Tanh activation function for the long short-term memory network layer; employing a distributed data parallel mode during training, deploying the model on a cluster and configuring 10 computing nodes (Node1 to Node10); dividing each batch of data into 10 parts and distributing them to the 10 nodes for parallel training; synchronizing the gradients of each node through a message passing interface during training; and generating three model weight files (feat.npy, label.npy, and model.h5) after training.

[0056] The spectral quality evaluation function is used to adjust the attention window width parameter of the sparse Transformer encoder in the multi-scale residual sparse transform underwater acoustic recognition model. The spectrum quality assessment function is based on the mean signal-to-noise ratio of the current batch of audio data. (Unit: dB), Mel frequency cepstral coefficients, mean inter-frame cosine similarity. (Dimensionless, value range 0-1) and spectral quality assessment value The calculation is expressed by the following formula:

[0057] ;

[0058] in, and These are the minimum and maximum signal-to-noise ratios (SNR) of the training set, respectively (in dB). The weighting coefficients (ranging from 0 to 1) were determined by conducting at least 50 batch iterations on the training set, recording the signal-to-noise ratio distribution and the inter-frame similarity distribution of Mel frequency cepstral coefficients, and using the parameter combination that resulted in the highest accuracy of the model on the validation set as the final value. Attention window width Take a larger value of 256 to fully model the long-range spectral periodicity; when hour, Taking a moderate value of 128, a balance is struck between computational efficiency and the range of feature modeling; when hour, Taking the smaller value of 64 reduces the impact of noise interference on global attention and also reduces video memory usage.

[0059] Among them, the multi-scale residual sparse transform underwater acoustic recognition model addresses the problem of time-varying feature drift caused by the non-stationarity of the marine channel. In the model training stage, a domain adaptive transfer learning framework is introduced. The maximum mean difference loss is used to minimize the feature distribution distance between the source domain and the target domain, so as to implicitly decouple the adversarial domain adaptation network from changes in the sound channel and improve the generalization performance of the model in different sea areas and seasons. The maximum mean difference is a kernel function method used to measure the difference between two probability distributions. By minimizing the distance between the mean embeddings of the source domain and the target domain in the regenerating kernel Hilbert space, feature distribution alignment is achieved.

[0060] Among them, the multi-scale residual sparse transform underwater acoustic recognition model addresses the frequency domain feature ambiguity problem caused by multipath interference. Before feature extraction, it uses homomorphic deconvolution to separate multiple paths in the audio data, reconstructs the minimum phase equivalent channel, and performs equalization processing to restore line spectrum clarity and Mel frequency cepstral coefficient smoothness. Homomorphic deconvolution is a signal processing method that transforms convolutional aliased signals into additive superposition in the logarithmic spectrum domain, thereby separating the source and channel response. Multipath interference refers to the phenomenon where acoustic signals, after being reflected multiple times by the sea surface and seabed in shallow water waveguides, exhibit convolutional aliasing of the original signal and multipath responses in the time domain, and periodic comb-like notches in the frequency domain, leading to a decrease in line spectrum clarity and Mel frequency cepstral coefficient smoothness.

[0061] Among them, DEMON demodulation envelope spectrum refers to the low-frequency spectrum obtained after demodulating the high-frequency modulation envelope of the underwater acoustic signal, which is used to extract target feature information such as propeller speed; SE-Net channel attention module refers to the attention mechanism module that scores and weights the feature maps of each channel through global average pooling and fully connected layers; Conditional Random Field is a probabilistic graphical model for sequence labeling, which imposes temporal consistency constraints on the output sequence by modeling the class transition probability between adjacent frames; Long Short-Term Memory Network is a recurrent neural network with a gating mechanism, used to model the temporal dependencies in audio feature sequences; Best of Watkins Marine Mammal Sound Database is an open-source marine mammal sound database released by the Woods Hole Oceanographic Institution in the United States.

[0062] The specific implementation of step S01 is as follows: First, raw underwater audio data is collected from the hydrophone on-site, the Best of Watkins Marine Mammal Sound Database open source database, and Internet channels. The data categories cover 10 subcategories, including oil tankers, passenger ships, cargo ships, tugboats, white noise, dolphins, whales, seals, manatees, and walruses. In the data screening stage, low-quality audio files were removed based on indicators such as signal-to-noise ratio and sampling rate consistency. The data cleaning stage removed duplicate files and files with abnormal formats. The data balance settings adjusted each category from three dimensions: audio duration, audio quantity, and audio quality, ensuring consistent weights for each category during training. The total duration of a single audio category was approximately 16128 seconds, with a target duration of 3 seconds for each audio file and a target quantity of 5376 audio files per category. The audio file size was maintained between 150 and 300 KB. In the data segmentation stage, an audio segmentation program written in Python was used to remove audio files shorter than 3 seconds and to segment audio files longer than 3 seconds into 3-second files. After processing, a total of 53760 audio files were obtained, and the total dataset size was 15.1 GB. The dataset was divided into training, validation, and test sets in a 6:2:2 ratio.

[0063] The specific implementation of step S02 is as follows: Noise reduction processing uses Audition CC 2015 software to perform a spectral noise reduction algorithm on all audio. This algorithm first collects noise fingerprints on pure noise segments, then performs spectral subtraction on each frame of the entire audio segment to eliminate marine environmental background noise generated by seawater movement, water layer movement, marine biological activity, and human production activities, thereby improving the audio signal-to-noise ratio and providing a cleaner signal foundation for subsequent feature extraction. Data augmentation processing uses Python to implement three methods: waveform shifting, waveform stretching, and treble correction. Waveform shifting simulates acquisition delay changes by randomly translating the audio waveform along the time axis; waveform stretching simulates target speed changes by changing the audio duration ratio; and treble correction simulates frequency response differences in different underwater acoustic channels by adjusting the gain of high-frequency components. The three methods work together to give the training data richer diversity in both the time and frequency domains. The total size of the augmented data is approximately 20GB.

[0064] The specific implementation of step S03 is as follows: The multi-head attention acoustic feature extraction method sequentially calls the Mel frequency cepstral coefficient algorithm, chroma short-time Fourier transform algorithm, Mel spectrum algorithm, spectrum contrast algorithm, and tonality network algorithm through the librosa audio processing library to extract Mel frequency cepstral coefficient features, chroma features, Mel spectrum features, contrast features, and tonality network features, respectively. The key parameters of the Mel frequency cepstral coefficient algorithm include the audio time series. Sampling rate Logarithmic power Mel spectrum Number of returned coefficients Discrete Cosine Transform Type and standardization methods Five types of features are concatenated and fused along the feature dimension into a unified audio feature sequence. The fused audio feature sequence is then mapped to query matrices via a fully connected linear transformation. Key matrix Value matrix Input scaling dot product attention to calculate intermediate attention value The intermediate attention values ​​of all heads are concatenated and then linearly mapped. The final output of the multi-head attention mechanism is obtained, which is the weighted audio semantic space feature sequence. The purpose of introducing the multi-head attention mechanism is to highlight the key content in the audio feature sequence and enhance the model's ability to identify different target categories.

[0065] The specific implementation of step S04 is as follows: The input layer of the multi-scale residual sparse transform underwater acoustic recognition model receives a triplet feature tensor formed by splicing the original waveform's short-time Fourier transform spectrum, the Mel frequency cepstral coefficient matrix, and the DEMON demodulation envelope spectrum in the spatial dimension. The feature extraction backbone consists of five stacked multi-scale residual convolutional modules, each with three parallel branches, each using... , , Convolutional kernels extract local features at different time-frequency resolutions. The outputs of each branch are weighted by the SE-Net channel attention module and then concatenated. This concatenation is then added to the input via a cross-scale residual connection to avoid the loss of shallow speaker texture information. The feature maps are flattened into a sequence and then input to a sparse transform encoder. The sparse transform encoder employs a sliding window local attention and cross-frame global token interaction mechanism to reduce the attention complexity from... Down to This approach effectively handles long sequence features. A dynamic routing capsule layer is introduced after the sparse transform encoder, aggregating high-level target pose capsules through an iterative dynamic routing algorithm. Within the network, an early exit mechanism is triggered when the activation entropy of a certain layer falls below an activation entropy threshold, which is determined based on ablation experiments on a validation set. Finally, a conditional random field is fused as a sequence-level post-processing layer to constrain the temporal consistency of the output sequence. The spectral quality evaluation function is based on the mean signal-to-noise ratio. Mean inter-frame cosine similarity to Mel frequency cepstral coefficients The weighted combination is used to calculate the quality assessment value. Weighting coefficients and signal-to-noise ratio normalization parameters , It was determined through at least 50 batch iteration experiments on the training set that when hour Take 256, when hour Take 128, when hour A value of 64 was chosen to adaptively match modeling requirements under different signal quality conditions. The model training employed the cross-entropy loss function, with accuracy as the metric. The batch size was 128, the number of iterations was 120, the convolutional layer activation function was Sigmoid, and the long short-term memory network layer activation function was Tanh. After training, three model weight files were generated: feat.npy, label.npy, and model.h5.

[0066] The specific implementation of step S05 is as follows: On the Sunway supercomputing platform, the swPython environment and the swPyTorch environment are activated sequentially, the key environment variables required by the message passing interface communication backend are loaded, 10 computing nodes Node1 to Node10 are configured, the trained multi-scale residual sparse transform underwater acoustic recognition model is deployed on the cluster through a distributed data parallel framework, each batch of data is divided into 10 parts and distributed to 10 nodes for parallel inference, the gradients of each node are synchronized through the AllReduce operation, the forward propagation of the convolutional layer and the preprocessing of Mel frequency cepstral coefficient features are allocated to independent asynchronous CUDA streams for parallel execution, the iterative routing calculation of the dynamic routing capsule layer occupies a separate CUDA stream, and each node releases and reallocates the GPU memory after each batch to prevent the accumulation of GPU memory fragmentation.

[0067] The specific implementation of step S06 is as follows: After the multi-scale residual sparse transform underwater acoustic recognition model completes inference on the input underwater acoustic target audio data, it outputs a probability vector with the same dimension as the number of categories in the dataset. Each element in the vector corresponds to the predicted probability of a target category, and the sum of all elements is 1. The category label corresponding to the element with the largest value in the probability vector is taken as the final recognition result output. At the same time, the complete probability vector can be retained for subsequent confidence analysis or multi-frame fusion decision. Before output, the conditional random field post-processing layer uses the category transition probability of adjacent frames to perform temporal constraints on the sequence results, eliminate single-frame misjudgment noise, and ensure the consistency of the recognition results in the time dimension.

[0068] It should be noted that the key technologies of this invention include: a multi-scale residual convolution module extracts local features at different time-frequency resolutions through parallel convolution kernels of three scales. Compared with a single convolution kernel architecture, this can simultaneously capture the short-term transient components and medium-time-scale periodic components of underwater acoustic signals. Each branch is weighted by the SE-Net channel attention module and added to the input residual, preventing shallow acoustic information from disappearing in deep networks. The sparse transform encoder adopts a sliding window local attention and cross-frame global token interaction mechanism, reducing the attention complexity from the quadratic order to the linear order, thus enabling the capture of the spectral periodic features of long audio sequences. The model achieves complete modeling, overcoming the bottleneck that standard global self-attention is computationally infeasible on long sequences. The spectral quality evaluation function dynamically adjusts the attention window width based on signal quality, enabling the modeling range to adaptively match the actual signal state. This avoids the introduction of noise interference under low signal-to-noise ratio conditions or the loss of long-range dependency information under high signal-to-noise ratio conditions by using a fixed window. The synergistic effect of these three elements creates a complementary closed loop between local feature extraction accuracy, long-range dependency modeling capability, and noise robustness. Overall, the recognition performance is significantly improved compared to the traditional combination architecture of convolutional neural networks and long short-term memory networks under complex underwater acoustic field conditions.

[0069] It should be noted that in underwater acoustic target recognition tasks, the characteristics of underwater acoustic channels differ significantly across different sea areas and seasons, leading to a noticeable shift in the audio feature distribution of the same target under different acquisition conditions. When a model is trained on data from only a single sea area or season and then directly applied to other sea areas or seasons, the feature distribution shift causes the model's decision boundary to mismatch with the actual distribution of the new domain data, resulting in a significant drop in recognition accuracy. The reason for this technical problem is that the non-stationarity of the underwater acoustic channel manifests in the spatiotemporal variations of physical parameters such as seawater temperature, salinity, and current velocity, causing changes in the sound velocity profile, refraction path, and multipath delay. Audio data from the same type of target acquired in different sea areas exhibits different mean and covariance structures in the feature spaces such as Mel frequency cepstral coefficients and Mel spectrum; that is, there is a significant difference in feature distribution between the source and target domains. Traditional deep learning models lack cross-domain adaptability and cannot automatically eliminate this distribution shift. A common solution to this technical problem is to expand the geographical and seasonal coverage of the training dataset by increasing the amount of data acquired from multiple sea areas and seasons to reduce the distribution differences. However, in practical engineering scenarios, large-scale multi-ocean-area hydrophone data acquisition is extremely costly and constrained by factors such as confidentiality requirements and equipment limitations, making it difficult to obtain sufficient labeled data covering all target sea areas and seasons. Simply relying on data expansion cannot fundamentally solve the feature distribution offset problem. This invention effectively solves this technical problem by introducing a domain adaptive transfer learning framework during the training stage of the multi-scale residual sparse transform underwater acoustic recognition model. It uses the maximum mean difference loss to measure the feature distribution distance between the source and target domains in the reproducing kernel Hilbert space, and jointly optimizes the minimization of the maximum mean difference loss and the minimization of the classification cross-entropy loss. This forces the model to automatically learn representations invariant to duct changes during the feature extraction stage. Simultaneously, an adversarial domain adaptation network implicitly decouples duct changes, and adversarial training between the domain discriminator and the feature extractor further aligns the feature distributions of the source and target domains. This allows the model to maintain high recognition accuracy even in unseen sea areas or seasons, fundamentally improving the model's cross-domain generalization performance.

[0070] A second aspect of the present invention provides a computer-readable storage medium storing program instructions that, when executed in a computer, perform the aforementioned underwater acoustic target recognition method.

[0071] A third aspect of the present invention provides an underwater acoustic target recognition system, comprising the aforementioned computer-readable storage medium, wherein the system is any one of a computer, a server, or a microcontroller, the computer-readable storage medium is disposed within the system, and the system is provided with a microprocessor for executing program instructions stored in the computer-readable storage medium.

[0072] Specifically, the principle of this invention is:

[0073] The fundamental reason why this invention can solve the above-mentioned technical problems is that the sparse transform encoder adopts a Longformer-style sliding window local attention and cross-frame global token interaction mechanism, which reduces the attention complexity from Down to ,in For window width, The sequence length is given.

[0074] In standard self-attention mechanisms, attention weights need to be calculated with all other time steps in the sequence at each time step. When the audio frame sequence is long, the computational load increases quadratically, leading to excessive memory usage and unacceptable inference latency. The sparse attention mechanism of this invention restricts the attention range of each time step to a local sliding window, while introducing a small number of cross-frame global tokens to preserve global contextual information. The synergistic effect of these two mechanisms allows the model to capture long-range spectral periodic features in the audio sequence while significantly reducing computational complexity.

[0075] The spectral quality assessment function designed in this invention is based on a weighted combination of the mean signal-to-noise ratio and the mean inter-frame cosine similarity of the Mel frequency cepstral coefficients, and outputs a spectral quality assessment value. .when A higher signal-to-noise ratio indicates sufficient signal-to-noise ratio and strong inter-frame feature continuity in the current batch of audio, making it suitable to increase the window width. To fully capture long-range dependencies; when A lower value indicates strong background noise and poor inter-frame feature consistency; therefore, the value should be reduced. This avoids interference between noisy frames within a wide range of attention. This adaptive adjustment mechanism dynamically matches the modeling range of the sparse transform encoder with the actual quality state of the input signal, logically ensuring a balance between long-range modeling capability and noise robustness.

[0076] Furthermore, the multi-scale residual convolution module extracts local features at different time-frequency resolutions through parallel convolution kernels of three scales, compensating for the modeling blind spot of sparse attention in the extremely short time domain. This, combined with the sparse transform encoder, forms a complementary coverage of short-term local features and long-term global features, enabling the overall model to effectively represent both time-frequency attributes of underwater acoustic signals. The dynamic routing capsule layer exhibits equivariance to changes in target orientation and velocity, maintaining robust classification even as the target's motion state changes, further ensuring the temporal consistency of the recognition results. The conditional random field post-processing layer eliminates single-frame misjudgment noise through adjacent frame category transition probability constraints, forming a complete closed loop from feature extraction to sequence decision, theoretically guaranteeing the temporal consistency of long-sequence inference results.

[0077] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.

[0078] The specific implementation of step S01 is as follows: Ship data is collected using hydrophones, marine biological data is obtained by combining the Best of Watkins Marine Mammal Sound Database open-source dataset, and supplementary data is obtained from the Internet. After data filtering and cleaning, the categories are balanced and adjusted from three dimensions: audio duration, audio quantity, and audio quality, to ensure that the weights of each category are consistent in model training. An audio segmentation program is written in Python to remove audio files shorter than 3 seconds and to uniformly segment audio files longer than 3 seconds into 3-second files, resulting in 53,760 audio files. The total dataset size is 15.1G, which is divided into training, validation, and test sets in a 6:2:2 ratio.

[0079] The specific implementation of step S02 is as follows: Audition CC 2015 software is used to remove noise from all audio data, eliminating background noise from the marine environment caused by seawater movement, water layer movement, marine biological activity, and human production activities. After noise reduction, three methods—waveform shifting, waveform stretching, and treble correction—are used to augment the audio data, resulting in a total data size of approximately 20GB, thereby improving the model's generalization performance and robustness.

[0080] The specific implementation of step S03 is as follows: The librosa audio processing library sequentially calls librosa.feature.mfcc, librosa.feature.chroma_stft, librosa.feature.melspectrogram, librosa.feature.spectral_contrast, and librosa.feature.tonnetz to extract Mel-frequency cepstral coefficient features, chroma features, Mel-spectral features, contrast features, and tonality network features. These features are then fused into an audio feature sequence. The fused audio feature sequence is used as the input to a multi-head attention mechanism. The formula for scaling dot product attention is as follows:

[0081] ;

[0082] In the formula, For querying the matrix, The key matrix, The three are value matrices, all obtained from the fused audio feature sequences through different linear transformations. The number of frames in the audio feature sequence. For the input feature dimension, The key vector dimension for each attention head, This is a scaling factor used to prevent the gradient from vanishing due to an excessively large dot product result. The function takes the exponent of each element in the input vector and divides it by the sum of the exponents of all elements, so that the sum of the output elements is 1. This represents the matrix transpose operation. , , After fully connected linear transformation, they are respectively mapped to , , ,in , , For the first The learnable projective weight matrix corresponding to each attention head. For the dimension of the value vector, For attention head index. The formula for calculating the intermediate attention value of an attention head is as follows:

[0083] ;

[0084] All The intermediate attention values ​​of each attention head are concatenated, and the calculation formula is expressed as follows:

[0085] ;

[0086] In the formula, To indicate the total number of attention heads, the default value is 8. This represents the concatenation operation along the feature dimension. Finally, the output of the multi-head attention mechanism is obtained through linear mapping, and the calculation formula is as follows:

[0087] ;

[0088] In the formula, This is used to output the projection weight matrix. The multi-head attention mechanism introduces multiple parallel attention heads to highlight key content in the audio feature sequence, enhancing the model's ability to identify different target categories.

[0089] The specific implementation of step S04 is as follows: The input layer of the multi-scale residual sparse transform underwater acoustic recognition model receives a 3-channel fused feature map. The first channel is the short-time Fourier transform spectrum of the original waveform, the second channel is the Mel-frequency cepstral coefficient matrix, and the third channel is the demodulated envelope spectrum. The three channels are concatenated in the spatial dimension to form a triplet feature tensor. The feature extraction backbone adopts a multi-scale residual convolution module, designed... , , Three parallel convolutional branches extract local features at different time-frequency resolutions. The outputs of each branch are weighted by a channel attention module and concatenated, then added to the input via a cross-scale residual connection, resulting in a total of five multi-scale residual convolutional modules. The feature maps are then flattened into a sequence and input to a sparse transform encoder. A sliding window local attention and cross-frame global token interaction mechanism is employed to reduce the attention complexity from... Down to ,in This refers to the number of frames in the sequence, consistent with the meaning in step S03. The sliding window width parameter, whose value is output by the spectral quality assessment function. The value is determined, corresponding to 64, 128, or 256. A dynamic routing capsule layer is introduced after the sparse transform encoder to replace the traditional fully connected classification head. An iterative dynamic routing algorithm aggregates low-level feature vectors into high-level target pose capsules. The network internally designs cross-layer feature jump paths. When the activation entropy of a layer in the sparse transform encoder for a certain target category falls below a set threshold, an early exit mechanism is triggered, directly connecting to the output of the shallow classifier. Finally, a conditional random field is fused as a sequence-level post-processing layer, using the class transition probability of adjacent frames to constrain the temporal consistency of the output sequence. The loss function is the cross-entropy loss function, the batch size is 128, the number of iterations is 120, and the convolutional layer activation function is... A function that takes linear input values ​​from a neuron Mapped to The interval is calculated as The activation function for the Long Short-Term Memory (LSTM) network layer is: The function that will Mapped to The interval is calculated as In the formula These are the linear input values ​​for the corresponding layer of neurons. This is a natural constant. The spectral quality evaluation function is used to dynamically adjust the attention window width parameter. The calculation formula is expressed as follows:

[0090] ;

[0091] In the formula, This is a dimensionless spectral quality assessment value, ranging from 0 to 1. The signal-to-noise ratio (SNR) of the current batch of audio data, in dB. and These represent the minimum and maximum signal-to-noise ratios of the training set, respectively, both in dB. Dividing the signal-to-noise ratio difference by the signal-to-noise ratio range eliminates the dimensions, resulting in a dimensionless value. The mean cosine similarity of the Mel-frequency cepstral coefficients between feature frames is dimensionless and ranges from 0 to 1. It is obtained by calculating the cosine similarity of the Mel-frequency cepstral coefficient vectors of adjacent frames and then taking the batch average. These are weighting coefficients, dimensionless, ranging from 0 to 1, determined by the parameter combination that yields the highest accuracy on the validation set. It is obtained by weighted summation of dimensionless terms, and is dimensionless overall. hour, Take 256; when hour, Take 128; when hour, Take 64. After training, generate three model weight files: feat.npy, label.npy, and model.h5.

[0092] The specific implementation of step S05 is as follows: A production environment for the Sunway supercomputing platform is built. The trained multi-scale residual sparse transform underwater acoustic recognition model is deployed on the cluster using a distributed data parallel mode, with 10 computing nodes configured. The communication backend uses a message passing interface. Inter-layer neuron weight gradients are synchronized among nodes through a full reduction operation. The activation entropy threshold of cross-layer feature jump paths is broadcast from the master node to all slave kernels. Convolutional layer forward propagation and Mel-frequency cepstral coefficient feature preprocessing are allocated to independent asynchronous computation streams for parallel execution. Iterative routing calculations for the dynamic routing capsule layer occupy a separate computation stream. Each node releases and reallocates GPU memory uniformly after each batch. When the load increases, the system automatically increases the number of computational streams allocated to the sparse transform encoder to maintain overall inference latency stability.

[0093] The specific implementation of step S06 is as follows: Based on the probability vectors of each category output by the multi-scale residual sparse transform underwater acoustic recognition model, the category corresponding to the maximum probability is output as the recognition result, thereby realizing the classification and recognition of 10 categories of underwater acoustic targets, including oil tankers, passenger ships, cargo ships, tugboats, white noise, dolphins, whales, seals, manatees, and walruses.

[0094] The specific implementation method explained is as follows: the maximum mean difference loss is used to minimize the feature distribution distance between the source domain and the target domain, and the calculation formula is expressed as follows:

[0095] ;

[0096] In the formula, For the maximum mean difference loss, dimensionless Number of samples in the source domain Number of samples in the target domain For the first Feature vectors of source domain samples For the first Feature vectors of samples in the target domain and Sample indices for the source and target domains, respectively. To map eigenvectors to the reproducing kernel Hilbert space, a Gaussian kernel function is typically used. The 2-norm of a vector As a reference value for dimensional normalization, the empirical value is set to 1, so that It remains dimensionless. This loss achieves feature distribution alignment by minimizing the distance between the source and target domains in the mean embedding of the regenerating kernel Hilbert space, thereby improving the model's generalization performance in different sea areas and seasons.

[0097] To better understand and implement this invention, the following is a specific application scenario of this invention, Example 2:

[0098] To verify the effectiveness of the invention, technicians set up a test environment and deployed four hydrophone arrays in a nearshore water area to collect raw underwater audio data covering 10 types of targets, including oil tankers, passenger ships, cargo ships, tugboats, white noise, dolphins, whales, seals, manatees, and walruses. Combined with marine life audio data from the Best of Watkins Marine Mammal Sound Database open-source database, an underwater sound field target recognition dataset was constructed and the entire process was verified.

[0099] During the dataset construction phase, the original audio recordings ranged in length from 1 second to 20 minutes. After processing with a Python audio segmentation program, audio recordings shorter than 3 seconds were removed, and those longer than 3 seconds were uniformly segmented into 3-second files. The number of audio recordings in each category after processing is shown in Table 1.

[0100] Table 1. Audio Data Size by Category

[0101]

[0102] The total size of the dataset is 15.1G, which is divided into training set, validation set and test set in a 6:2:2 ratio. The training set contains 32,256 audio files, and the validation set and test set each contain 10,752 audio files.

[0103] In the data denoising stage, Audition CC 2015 software was used to perform spectral denoising on all 53,760 audio files to eliminate background noise introduced by seawater movement and human production activities. In the data augmentation stage, the training set was expanded using three methods: waveform shifting, waveform stretching, and treble correction. The total size of the augmented training data was approximately 20GB.

[0104] During the data annotation phase, technicians manually annotated each category of audio data based on the visual features of the spectrograms. For example... Figure 3 As shown, the spectrogram of the cargo ship resembles an inverted trapezoid, with concentrated mid-to-low frequency energy and a well-defined outline; for example... Figure 4 As shown, the passenger ship's acoustic spectrogram exhibits a distinct columnar pattern, with an overall low sound pressure level; as Figure 5 As shown, the acoustic spectrogram of the oil tanker exhibits a thick, well-defined sheet-like pattern with abundant low-frequency components; for example... Figure 6 As shown, the tugboat's spectrogram features a diffuse, light-colored distribution, with a weak overall signal and diverse morphology. Technicians completed data annotation based on these spectrogram features. Marine biological data were directly taken from the Best of Watkins Marine Mammal Sound Database dataset, requiring no additional annotation.

[0105] In the acoustic feature extraction stage, the librosa audio processing library was used to extract Mel-frequency cepstral coefficient features, chroma features, Mel-frequency spectral features, contrast features, and tonality network features from each 3-second audio clip, and these features were then fused into a unified audio feature sequence. A multi-head attention mechanism was used to weight the fused feature sequence. The main parameter settings for the Mel-frequency cepstral coefficient algorithm are shown in Table 2.

[0106] Table 2 Mel Frequency Cepstral Coefficient Algorithm Parameter Configuration Table

[0107]

[0108] During the model training phase, the multi-scale residual sparse transform underwater acoustic recognition model was trained on the Sunway supercomputing platform in a distributed data parallel mode, configured with 10 computing nodes. The communication backend adopted a message passing interface, and each batch of data was divided into 10 parts and distributed to each node for parallel computation. Gradients were synchronized through the AllReduce operation. The model hyperparameter configuration is shown in Table 3.

[0109] Table 3 Model Hyperparameter Configuration Table

[0110]

[0111] The parameters of the spectral quality assessment function were determined through 60 batch iterations on the training set, with a signal-to-noise ratio normalization interval. Take -5dB, Take 25dB as the weighting factor. A value of 0.6 is chosen, and the final value is determined when the above parameter combination achieves the highest accuracy on the validation set. During training, the spectral quality assessment value... The distribution statistics of different batches are shown in Table 4:

[0112] Table 4. Statistical distribution of spectrum quality assessment values

[0113]

[0114] After model training, three weight files are generated: feat.npy, label.npy, and model.h5. Inference and prediction are then performed on the test set, outputting probability vectors for each category. Taking an audio clip of a cargo ship as an example, the model outputs a cargo ship probability of 0.96, a tugboat probability of 0.02, a passenger ship probability of 0.01, and the sum of the probabilities for the remaining categories is 0.01. The final recognition result is a cargo ship. Figure 2 As shown in the diagram, the overall architecture diagram illustrates the complete technical roadmap from dataset construction to distributed inference prediction, with clear data flow between modules.

[0115] Compared to the traditional combination architecture of convolutional neural networks and long short-term memory networks, this invention represents a significant advancement in its technical principles. Traditional architectures, with their fixed receptive fields for convolutional kernels, cannot capture the periodic features of the spectral spectrum spanning long time scales in underwater acoustic signals. In contrast, the sparse transform encoder of this invention reduces the attention complexity from the quadratic to the linear order, enabling the model to fully process long audio sequences with limited computational resources, thus fundamentally addressing the bottleneck of insufficient long-range dependency modeling capabilities. The spectral quality evaluation function adaptively adjusts the attention window width based on the actual signal quality, avoiding performance degradation under different signal-to-noise ratios with fixed parameters. The dynamic routing capsule layer endows the model with equivariance to changes in target orientation and velocity, ensuring robust classification results as the target's motion state changes, overcoming the sensitivity of traditional fully connected classification heads to feature space transformations. The conditional random field post-processing layer eliminates single-frame misjudgments through temporal constraints, guaranteeing temporal consistency of recognition results at the sequence level, whereas traditional architectures make independent decisions frame by frame, lacking inter-frame constraint mechanisms. The synergistic effect of the above-mentioned technical modules makes the robustness and accuracy of the recognition in complex underwater acoustic environments a fundamental improvement in technical principles compared with traditional methods.

[0116] It should be noted that the variables involved in this invention are explained in detail in Table 5.

[0117] Table 5. Variable Explanation Table

[0118]

[0119] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for underwater acoustic target recognition, characterized in that, Includes the following steps: We acquired hydrophone data, open-source underwater acoustic datasets, and internet data. After data filtering, cleaning, equalization settings, and data segmentation, we constructed an underwater sound field target recognition dataset. The audio data in the underwater sound field target recognition dataset is subjected to noise reduction and data augmentation processing in sequence to obtain the enhanced audio dataset. Based on the multi-head attention acoustic feature extraction method, Mel frequency cepstral coefficient features, chroma features, Mel spectrum features, contrast features, and tonality network features are extracted from the enhanced audio dataset, and the above features are fused into an audio feature sequence. The audio feature sequence is input into the multi-scale residual sparse transform underwater acoustic recognition model. The attention window width parameter of the model is adjusted according to the quality assessment value output by the spectral quality assessment function to complete the model training. The production environment of the Sunway supercomputing platform was set up, and the trained multi-scale residual sparse transform underwater acoustic recognition model was deployed on the cluster in a distributed data parallel mode to perform distributed inference and prediction on underwater acoustic target audio data. Based on the probability vectors of each category output by the multi-scale residual sparse transform underwater acoustic recognition model, the category corresponding to the maximum probability is output as the recognition result.

2. The underwater acoustic target recognition method according to claim 1, characterized in that, The balance setting specifically involves balancing the data across different categories based on three dimensions: audio duration, audio quantity, and audio quality, to ensure consistent weights for each category during model training.

3. The underwater acoustic target recognition method according to claim 2, characterized in that, The data segmentation specifically involves using a Python-written audio segmentation program to remove audio files with a duration shorter than the segmentation duration threshold, and to uniformly segment audio files with a duration exceeding the segmentation duration threshold into audio files with a duration corresponding to the segmentation duration threshold.

4. The underwater acoustic target recognition method according to claim 3, characterized in that, The noise reduction process specifically involves using Audition CC2015 software to remove noise from all audio data in the underwater sound field target recognition dataset, in order to eliminate background noise in the marine environment.

5. The underwater acoustic target recognition method according to claim 4, characterized in that, The data enhancement process specifically employs three methods—waveform shifting, waveform stretching, and treble correction—to augment the audio data.

6. The underwater acoustic target recognition method according to claim 5, characterized in that, The multi-head attention acoustic feature extraction method specifically extracts Mel frequency cepstral coefficient features, chroma features, Mel spectrum features, contrast features, and tonality network features from the librosa audio processing library. These features are then fused into an audio feature sequence and used as input to the multi-head attention mechanism. After scaling dot product attention calculation and linear mapping, weighted audio semantic space features are obtained.

7. The underwater acoustic target recognition method according to claim 6, characterized in that, The input layer of the multi-scale residual sparse transform underwater acoustic recognition model receives a 3-channel fused feature map. The 3 channels are spliced ​​together in the spatial dimension to form a triplet feature tensor. The feature extraction backbone adopts a multi-scale residual convolution module with 3 parallel branches. The output of each branch is weighted by the channel attention SE-Net module and then spliced ​​together. It is added to the input through cross-scale residual connections, resulting in a total of 5 multi-scale residual convolution modules stacked.

8. The underwater acoustic target recognition method according to claim 7, characterized in that, The multi-scale residual sparse transform underwater acoustic recognition model flattens the feature map into a sequence and inputs it into the sparse transform encoder. The sparse transform encoder adopts a sliding window local attention and cross-frame global token interaction mechanism.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions, which, when executed in a computer, are used to perform an underwater acoustic target recognition method according to any one of claims 1-8.

10. An underwater acoustic target recognition system, characterized in that, The system comprises the computer-readable storage medium of claim 9, wherein the system is a computer, the computer-readable storage medium is disposed within the system, and the system is provided with a microprocessor that executes program instructions stored in the computer-readable storage medium.