A method and apparatus for underwater acoustic signal classification based on Mamba-attention network

By using a Mamba-attention network that integrates Mel spectrum and LOFAR spectrum features, the problems of incomplete feature information and insufficient modeling ability in underwater acoustic signal classification are solved, achieving efficient and accurate underwater acoustic signal classification.

CN122132900APending Publication Date: 2026-06-02INST OF ACOUSTICS CHINESE ACAD OF SCI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INST OF ACOUSTICS CHINESE ACAD OF SCI
Filing Date
2026-01-19
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing underwater acoustic signal classification technologies suffer from limited feature information dimensions and incomplete representation. Traditional models are insufficient for modeling long-term underwater acoustic signals, resulting in inaccurate classification results and low efficiency.

Method used

A Mamba-attention network is used to classify underwater acoustic signals by fusing Mel spectrum and LOFAR spectrum features, capturing long-term dependencies and local key features through Mamba blocks and multi-head self-attention mechanism, and combining global correlation information.

Benefits of technology

It improves the accuracy of underwater acoustic signal classification and real-time processing performance, meeting the needs of efficient classification in complex marine environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122132900A_ABST
    Figure CN122132900A_ABST
Patent Text Reader

Abstract

This invention provides a method and apparatus for underwater acoustic signal classification based on a Mamba-attention network. The method includes: preprocessing a pre-acquired underwater acoustic signal dataset to obtain segmented data samples, dividing the segmented data samples into a training set and a test set; extracting Mel spectral features and LOFAR spectral features from the training set and the test set respectively, and fusing the features to obtain a fused feature sequence of the training set and the test set; constructing a Mamba-attention network, inputting the fused feature sequence of the training set into the Mamba-attention network for model training, performing deep feature extraction through a multi-layer selective state-space model and a multi-head attention module to capture long-term dependencies, local key features, and global correlation information of the sequence, and updating the network parameters by combining a loss function and an optimizer until the model converges; inputting the fused feature sequence of the test set into the trained Mamba-attention network, and obtaining the classification result of the underwater acoustic signal through the trained Mamba-attention network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of underwater acoustic signal processing technology, specifically to an underwater acoustic signal classification method and apparatus based on Mamba-attention networks. Background Technology

[0002] Underwater acoustic signal classification is a core technology supporting underwater target identification, marine environmental monitoring, and other scenarios, and its performance directly determines the reliability and effectiveness of related applications. In the underwater acoustic signal classification technology system, feature extraction and classification models are two core technical links. Existing technologies have insurmountable defects in both links, which cannot meet the actual needs of efficient and accurate classification in complex underwater environments.

[0003] In the feature extraction stage, existing technologies for underwater acoustic signal classification mainly include time-domain features, frequency-domain features, and time-frequency-domain features. Among them, the Mel spectrum, due to its advantage of simulating the auditory perception characteristics of the human ear, has strong sensitivity to mid-to-high frequency underwater acoustic signals and can effectively capture the transient acoustic features of target signals. The LOFAR spectrum focuses on capturing low-frequency signals and can better reflect the low-frequency acoustic characteristics generated by the mechanical vibrations of underwater targets such as ships, making it a key feature type in underwater target identification scenarios. However, existing technologies generally use a single type of feature to represent underwater acoustic signals, resulting in limited feature information dimensions and incomplete representation. This fails to fully cover the complex acoustic properties of underwater acoustic signals, thus limiting classification and discrimination capabilities and making it difficult to guarantee the accuracy of classification results.

[0004] In the classification model stage, existing technologies are mainly divided into two categories: traditional pattern recognition methods and deep learning methods. Both types of methods have significant technical shortcomings. Traditional pattern recognition methods, represented by Support Vector Machines (SVM) and Hidden Markov Models (HMM), have a core deficiency in their weak ability to model complex temporal features and are prone to classification performance degradation in high-dimensional feature spaces, making them unsuitable for classifying complex underwater temporal acoustic signals. Deep learning methods: In recent years, deep learning technology has been gradually applied to the field of underwater acoustic signal classification. However, all types of models have inherent technical shortcomings: Convolutional Neural Networks (CNNs) have the ability to extract local spatial features, but they lack the ability to model long-term underwater acoustic signals and cannot capture global correlation features in the temporal dimension; Recurrent Neural Networks (RNNs) and their variants (such as Long Short-Term Memory Networks (LSTM) and Gated Recurrent Units (GRUs)) can process temporal data, but they are prone to gradient vanishing or gradient exploding during training, making it difficult to effectively capture ultra-long-term temporal dependencies; Transformer models achieve long-term dependency modeling through self-attention mechanisms, but they have the inherent defect of high computational complexity, resulting in low processing efficiency when processing long-term underwater acoustic signals and failing to meet the application needs of real-time requirements and resource-constrained scenarios.

[0005] Therefore, there is a need for a method and apparatus for underwater acoustic signal classification based on Mamba-attention networks. Summary of the Invention

[0006] The purpose of this invention is to provide a method and apparatus for classifying underwater acoustic signals based on Mamba-attention networks. By fusing Mel spectrum and LOFAR spectrum features with the advantages of long-range modeling of the Mamba model, it solves the problems of incomplete single feature information and insufficient ability of traditional models to model long-term underwater acoustic signals.

[0007] To achieve the above objectives, in a first aspect, the present invention provides a method for underwater acoustic signal classification based on a Mamba-attention network, comprising:

[0008] The pre-acquired underwater acoustic signal dataset is preprocessed to obtain segmented data samples, which are then divided into a training set and a test set.

[0009] Mel spectral features and LOFAR spectral features are extracted from the training set and the test set, respectively;

[0010] The Mel spectrum features and LOFAR spectrum features of the training set are fused to obtain the training set fused feature sequence, and the Mel spectrum features and LOFAR spectrum features of the test set are fused to obtain the test set fused feature sequence.

[0011] A Mamba-attention network is constructed, comprising an input adaptation layer, a Mamba block, an attention block, a global feature aggregation layer, and a classifier. The fused feature sequence of the training set is input into the Mamba-attention network for model training. The fused feature sequence is first projected through the input adaptation layer and positional encoding is added. It then alternately passes through the Mamba block and the attention block. The Mamba block utilizes a selective state space layer and gating mechanism to adaptively capture the long-term dependencies and local key features of the fused feature sequence of the training set. The attention block models the global correlation information of the fused feature sequence of the training set through a multi-head self-attention mechanism. At the end of the network, a compact representation of the sequence is obtained through the global feature aggregation layer. Finally, the classifier outputs a prediction, and the network model parameters are updated by combining the loss function and the optimizer until the network model converges, resulting in the trained Mamba-attention network.

[0012] The fused feature sequence of the test set is input into the trained Mamba-attention network, and the classification result of the underwater acoustic signal is obtained through the trained Mamba-attention network.

[0013] Preferably, the pre-acquired underwater acoustic signal dataset is resampled, normalized, and time-series segmented to obtain segmented data samples. These segmented data samples are then divided into a training set and a test set, including:

[0014] The pre-acquired underwater acoustic signal dataset is resampled, normalized, and time-series segmented to obtain segmented data samples. Normalization linearly maps the underwater acoustic signal to peak values ​​through peak normalization. Within the range, time segmentation divides the underwater acoustic signal into segments of fixed duration, with overlaps between segments to preserve temporal continuity. If the signal duration is less than the fixed duration, zero padding is used to bring it to the fixed duration. The segmented data samples are divided into training and test sets according to a preset ratio.

[0015] Specifically, the Mel spectral features and LOFAR spectral features of the training set and the test set are extracted respectively, including:

[0016] Mel spectral features and LOFAR spectral features of each signal segment in the training and test sets are extracted respectively to obtain the shape of The mel spectrum features, and the shape of The LOFAR spectral characteristics, among which, For time frames, For the frequency dimension, the number of time frames for Mel spectral features and LOFAR spectral features. Maintain consistency.

[0017] Preferably, the method involves fusing the Mel spectral features and LOFAR spectral features of the training set to obtain a training set fused feature sequence, and fusing the Mel spectral features and LOFAR spectral features of the test set to obtain a test set fused feature sequence, including:

[0018] Mel spectrum features time-aligned to the training or test sets and LOFAR spectral features The features are concatenated along their dimensions, and then rearranged dimensionally, resulting in the following representation:

[0019]

[0020] in, For dimension rearrangement operations, This is a concatenation operation along the feature dimension. This represents the dimension of the fused single-step feature vector, ensuring that each time step contains a multimodal fused single-step feature vector, which facilitates subsequent sequence modeling and yields the fused feature sequence. .

[0021] Specifically, a Mamba-attention network is constructed, comprising an input adaptation layer, two Mamba blocks, two attention blocks, a global feature aggregation layer, and a classifier;

[0022] The input adaptation layer is used to fuse the Mel spectrum and LOFAR spectrum features of the underwater acoustic signal. Adaptation processing is performed, and the training set feature sequences are fused through linear mapping. Projecting onto the model dimension and adding learnable positional encoding yields the sequence. The expression is ,in, It is a linear projection matrix. For learnable positional encoding, To fuse feature sequences, Used as input for the first subsequent Mamba block;

[0023] Each Mamba block consists of an input projection, a selective state-space layer, and a residual connection. The input is first normalized using the layer normalization operation, and then passed through the input projection matrix. Project the normalized input as candidate features and gating signals Gating signal through The modulation signal is obtained after activation function processing, and candidate features are generated. The selective state-space layer models the time-dependent input, and the output of the selective state-space layer is multiplied element-wise with the modulated signal and then projected onto the output matrix. The mapping is then performed, and the output of the Mamba block is obtained by superimposing the original input of the Mamba block through a residual connection. The expression is:

[0024]

[0025]

[0026]

[0027]

[0028] in, For element-wise multiplication, For layer normalization operation, and These are the input projection matrix and the output projection matrix, respectively. and For candidate features and gate vectors, For activation function, For selective state space layers, The output is for the selective state space; the input of the second Mamba block is the output of the first Mamba block.

[0029] Each attention block contains a multi-head self-attention mechanism and residual connections, for the input... After normalization, the execution layer is input into the multi-head self-attention mechanism layer, and its output... With the original input The attention block output is obtained by superimposing residual connections, and the expression is:

[0030]

[0031]

[0032]

[0033] in, For layer normalization operation, For multi-head self-attention mechanism layer, For attention block output, This is the output of the multi-head self-attention mechanism; the input of the first attention block is the output of the second Mamba block. The input to the second attention block is the output of the first attention block;

[0034] The global feature aggregation layer outputs the last layer. Temporal average pooling is used to obtain the global feature vector. The expression is: ,in For time frames, Represents a sequence In the Feature vectors at each time step;

[0035] The classifier is a fully connected layer used to process the global feature vector. Mapping to the target category space yields the classification score vector:

[0036]

[0037] in, , Given the number of target categories, the score vector is transformed into a predicted probability distribution using the Softmax function. During model training, the cross-entropy loss function is used to calculate the prediction loss. The expression for the loss function is as follows:

[0038]

[0039] in For real labels, To predict probabilities, minimize the loss function. Optimize all learnable parameters in the network until the model converges.

[0040] Specifically, the selective state space layer includes:

[0041] The selective state space layer first processes candidate features through depthwise separable convolution. Local context modeling is performed, represented as:

[0042]

[0043] in, The output sequence of the convolution. For depthwise separable convolution; then calculate the dynamic stride parameter:

[0044]

[0045] in, and For linear mapping weights, For learnable bias, This is the Softplus activation function; based on Perform a state space update, with the update formula as follows:

[0046]

[0047] in, and Let these represent the state vectors of the previous time step and the current time step, respectively. For state decay parameters, Given the input projection matrix, the final output is:

[0048]

[0049] in, This is the mapping matrix from state to output. For channel-by-channel residual weights, This is the final output of SSM.

[0050] Specifically, the multi-head attention mechanism layer includes:

[0051] The multi-head self-attention mechanism layer first processes the input... The linear mapping projection results in a query, key, and value.

[0052]

[0053]

[0054]

[0055] in, , , For learnable projection matrices, The query, key, and value are split into multiple parts, and the result is... Split along the feature dimension One point of attention:

[0056]

[0057]

[0058]

[0059] Calculate the first Attention weights for each attention head:

[0060]

[0061] in, Calculated along the time dimension, For each dimension of the attention head, the outputs of all attention heads are concatenated and then projected through a matrix. The mapping yields the output of the multi-head attention mechanism:

[0062]

[0063] in, To output the projection matrix, This is the output of the multi-head attention mechanism.

[0064] In a second aspect, the present invention provides an underwater acoustic signal classification device based on a Mamba-attention network, comprising:

[0065] The signal processing unit is configured to preprocess a pre-acquired underwater acoustic signal dataset to obtain segmented data samples, and divide the segmented data samples into a training set and a test set.

[0066] The feature extraction unit is configured to extract Mel spectral features and LOFAR spectral features from the training set and the test set, respectively.

[0067] The feature fusion unit is configured to fuse the Mel spectrum features and LOFAR spectrum features of the training set to obtain a training set fused feature sequence, and to fuse the Mel spectrum features and LOFAR spectrum features of the test set to obtain a test set fused feature sequence.

[0068] The model training unit is configured to construct a Mamba-attention network, which includes an input adaptation layer, a Mamba block, an attention block, a global feature aggregation layer, and a classifier. The fused feature sequence of the training set is input into the Mamba-attention network for model training. The fused feature sequence is first projected through the input adaptation layer and positional encoding is added. It then alternately passes through the Mamba block and the attention block. The Mamba block utilizes a selective state space layer and gating mechanism to adaptively capture the long-term dependencies and local key features of the fused feature sequence of the training set. The attention block models the global correlation information of the fused feature sequence of the training set through a multi-head self-attention mechanism. At the end of the network, a compact representation of the sequence is obtained through the global feature aggregation layer. Finally, the classifier outputs a prediction, and the network model parameters are updated using a loss function and an optimizer until the network model converges, resulting in the trained Mamba-attention network.

[0069] The classification unit is configured to input the fused feature sequence of the test set into a trained Mamba-attention network, and obtain the classification result of the underwater acoustic signal through the trained Mamba-attention network. Attached Figure Description

[0070] Figure 1 A flowchart of an underwater acoustic signal classification method based on Mamba-attention network provided in an embodiment of the present invention;

[0071] Figure 2 A schematic diagram illustrating an underwater acoustic signal classification method based on a Mamba-attention network, provided in an embodiment of the present invention;

[0072] Figure 3 This is a schematic diagram of the structure of a Mamba-attention network provided in an embodiment of the present invention;

[0073] Figure 4 A schematic diagram of a training loss curve provided in an embodiment of the present invention;

[0074] Figure 5 This is a schematic diagram of a test accuracy curve provided in an embodiment of the present invention;

[0075] Figure 6 This is a schematic diagram of a confusion matrix provided in an embodiment of the present invention. Detailed Implementation

[0076] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0077] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be described below with reference to the accompanying drawings. It should be noted that similar reference numerals and letters in the following drawings indicate similar items; therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0078] In the description of the embodiments of the present invention, the words "exemplary," "for example," or "for instance" are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design that is described as "exemplary," "for example," or "for instance" in the embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of the words "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a specific manner.

[0079] In existing technologies, the Mamba model is built around the Selective State-Space Model (SSM). This model has linear computational complexity in sequence data modeling scenarios and excellent long-range dependency modeling capabilities. Its technical advantages have been verified in sequence-related technologies such as speech signal processing and natural language processing, and it has demonstrated good application performance.

[0080] For the technical scenario of multi-feature fusion of Mel spectrum and LOFAR spectrum used in this invention, existing technologies lack a suitable Mamba model input adaptation scheme. This technological gap directly results in existing underwater acoustic signal classification methods being unable to fully leverage the complementary feature information of Mel spectrum and LOFAR spectrum by utilizing the technical advantages of the Mamba model, thus failing to fully utilize the synergistic effect of the two types of features. Simultaneously, existing methods have significant room for improvement in both underwater acoustic signal recognition accuracy and real-time processing performance in complex marine environments, making it difficult to meet the high classification performance requirements of practical applications.

[0081] To overcome the shortcomings of existing technologies, this invention provides an underwater acoustic signal classification method. This method combines Mel spectrum and LOFAR spectrum features with the advantages of long-range modeling using the Mamba model to address the problems of incomplete information from single features and the insufficient modeling capability of traditional models for long-term underwater acoustic signals.

[0082] Figure 1 A flowchart of an underwater acoustic signal classification method based on a Mamba-attention network, provided as an embodiment of the present invention, is shown in the figure. The method includes:

[0083] Step S101: Preprocess the pre-acquired underwater acoustic signal dataset to obtain segmented data samples, and divide the segmented data samples into training set and test set.

[0084] For example, a pre-acquired underwater acoustic signal dataset is resampled, normalized, and time-series segmented to obtain segmented data samples. Normalization linearly maps the underwater acoustic signal to peak values ​​through peak normalization. Within the range, time segmentation divides the underwater acoustic signal into segments of fixed duration, with overlaps between segments to preserve temporal continuity. If the signal duration is less than the fixed duration, zero padding is used to bring it to the fixed duration. The segmented data samples are divided into training and test sets according to a preset ratio.

[0085] For example, Figure 2 This is a schematic diagram of an underwater acoustic signal classification method based on a Mamba-attention network provided in an embodiment of the present invention. As shown in the figure, the pre-acquired underwater acoustic dataset ShipsEar is resampled, normalized, and time-series segmented. The resampling frequency is 16kHz, and the signal normalization is performed by peak normalization. Linear mapping to Within the range, the expression is:

[0086]

[0087] in, The maximum value, For the minimum value, The mapped underwater acoustic signal is segmented into 3s segments with an overlap of 1.5s (50% overlap) to preserve the temporal continuity of the signal. If the signal duration is less than 3s, zero values ​​are used to fill the 48,000 sampling points. The preprocessed segmented signals are randomly divided into training and test sets at a ratio of 1:9.

[0088] Step S102: Extract the Mel spectrum features and LOFAR spectrum features of the training set and the test set respectively.

[0089] For example, Mel spectral features and LOFAR spectral features are extracted from each signal segment in the training and test sets, respectively, to obtain a shape of The mel spectrum features, and the shape of The LOFAR spectral characteristics, among which, For time frames, For the frequency dimension, the number of time frames for Mel spectral features and LOFAR spectral features. Maintain consistency.

[0090] For example, Mel spectrum and LOFAR spectrum features are extracted from the segmented signals of the training set and the test set, respectively, ensuring that the time frame number of the two features is consistent. After feature extraction, the output shapes of the Mel spectrum and LOFAR spectrum are [128, 94] and [1025, 94], respectively. The Mel spectrum extraction parameters are set as follows: FFT number of points is 2048, frame shift is 512, Mel frequency dimension is 128, and frequency range is [0, 8000] Hz. LOFAR is implemented through short-time Fourier transform (STFT), and the extraction parameters are set as follows: FFT number of points is 2048, frame shift is 512, window function is Hanning window, and power spectrum output is used.

[0091] Step S103: Perform feature fusion on the Mel spectrum features and LOFAR spectrum features of the training set to obtain a training set fused feature sequence, and perform feature fusion on the Mel spectrum features and LOFAR spectrum features of the test set to obtain a test set fused feature sequence.

[0092] For example, time-aligned Mel spectrum features from the training or test sets. and LOFAR spectral features The features are concatenated along the feature dimension and then rearranged along the frequency dimension, as follows:

[0093]

[0094] in, For dimension rearrangement operations, This is a concatenation operation along the feature dimension. To fuse feature sequences, This represents the dimension of the fused single-step feature vector, ensuring that each time step contains a multimodal fused single-step feature vector, which facilitates subsequent sequence modeling and yields the fused feature sequence. .

[0095] For example, the Mel spectrum and LOFAR spectrum features are concatenated along the frequency dimension to form a fused feature sequence, which is used for model training and testing respectively. The fused feature sequence for the training set is obtained by concatenating the Mel spectrum and LOFAR spectrum of the segmented signal in the training set and is used for model training; the fused feature sequence for the test set is obtained by concatenating the Mel spectrum and LOFAR spectrum of the segmented signal in the test set and is used for classification prediction.

[0096] Step S104: Construct a Mamba-Attention Network, which includes an input adaptation layer, a Mamba block, an attention block, a global feature aggregation layer, and a classifier. The fused feature sequence of the training set is input into the Mamba-Attention Network for model training. The fused feature sequence is first projected through the input adaptation layer and positional encoding is added. Then, it passes through the Mamba block and the attention block. The Mamba block utilizes a selective state space layer and gating mechanism to adaptively capture the long-term dependencies and local key features of the fused feature sequence of the training set. The attention block models the global correlation information of the fused feature sequence of the training set through a multi-head self-attention mechanism. At the end of the network, a compact representation of the sequence is obtained through the global feature aggregation layer. Finally, the classifier outputs a prediction, and the network model parameters are updated by combining the loss function and the optimizer until the network model converges, resulting in the trained Mamba-Attention Network.

[0097] For example, Figure 3 This is a schematic diagram of the structure of a Mamba-attention network provided in an embodiment of the present invention. The Mamba-attention network includes an input adaptation layer, two Mamba blocks, two attention blocks, a global feature aggregation layer, and a classifier.

[0098] The input adaptation layer is used to fuse the Mel spectrum and LOFAR spectrum features of the underwater acoustic signal. Adaptation processing is performed, and the training set feature sequences are fused through linear mapping. Projecting onto the model dimension and adding learnable positional encoding yields the sequence. The expression is ,in, It is a linear projection matrix. For learnable positional encoding, To fuse feature sequences, Used as input for the first subsequent Mamba block;

[0099] Each Mamba block consists of an input projection, a selective state-space layer, and a residual connection. The input is first normalized using the layer normalization operation, and then passed through the input projection matrix. Project the normalized input as candidate features and gating signals Gating signal through The modulation signal is obtained after activation function processing, and candidate features are generated. The selective state-space layer models the time-dependent input, and the output of the selective state-space layer is multiplied element-wise with the modulated signal and then projected onto the output matrix. The mapping is then performed, and the output of the Mamba block is obtained by superimposing the original input of the Mamba block through a residual connection. The expression is:

[0100]

[0101]

[0102]

[0103]

[0104] in, For element-wise multiplication, For layer normalization operation, and These are the input projection matrix and the output projection matrix, respectively. and For candidate features and gate vectors, For activation function, For selective state space layers, The output is for the selective state space; the input of the second Mamba block is the output of the first Mamba block.

[0105] The selective state space layer first processes candidate features through depthwise separable convolution. Local context modeling is performed, represented as:

[0106]

[0107] in, The output sequence of the convolution. For depthwise separable convolution; then calculate the dynamic stride parameter:

[0108]

[0109] in, and For linear mapping weights, For learnable bias, This is the Softplus activation function; based on Perform a state space update, with the update formula as follows:

[0110]

[0111] in, and Let these represent the state vectors of the previous time step and the current time step, respectively. For state decay parameters, Given the input projection matrix, the final output is:

[0112]

[0113] in, This is the mapping matrix from state to output. For channel-by-channel residual weights, This is the final output of SSM;

[0114] Each attention block contains a multi-head self-attention mechanism and residual connections, for the input... After normalization, the execution layer is input into the multi-head self-attention mechanism layer, and its output... With the original input The attention block output is obtained by superimposing residual connections, and the expression is:

[0115]

[0116]

[0117]

[0118] in, For layer normalization operation, For multi-head self-attention mechanism layer, For attention block output, This is the output of the multi-head self-attention mechanism; the input of the first attention block is the output of the second Mamba block. The input to the second attention block is the output of the first attention block; the multi-head self-attention mechanism layer first processes the input... The linear mapping projection results in a query, key, and value.

[0119]

[0120]

[0121]

[0122] in, , , For learnable projection matrices, The query, key, and value are split into multiple parts, and the result is... Split along the feature dimension One point of attention:

[0123]

[0124]

[0125]

[0126] Calculate the first Attention weights for each attention head:

[0127]

[0128] in, Calculated along the time dimension, For each dimension of the attention head, the outputs of all attention heads are concatenated and then projected through a matrix. The mapping yields the output of the multi-head attention mechanism:

[0129]

[0130] in, To output the projection matrix, This is the output of the multi-head attention mechanism;

[0131] The global feature aggregation layer outputs the last layer. Temporal average pooling is used to obtain the global feature vector. The expression is: ,in For time frames, Represents a sequence In the Feature vectors at each time step;

[0132] The classifier is a fully connected layer used to process the global feature vector. Mapping to the target category space yields the classification score vector:

[0133]

[0134] in, , Given the number of target categories, the score vector is transformed into a predicted probability distribution using the Softmax function. During model training, the cross-entropy loss function is used to calculate the prediction loss. The expression for the loss function is as follows:

[0135]

[0136] in For real labels, To predict probabilities, minimize the loss function. Optimize all learnable parameters in the network until the model converges.

[0137] For example, the input dimensions can be configured as follows: feature dimension 1153, including 128-dimensional Mel-ray spectral features and 1025-dimensional LOFAR spectral features, with a sequence length of 94; model hidden layer dimension... The model is set to 512, and its main body consists of two Mamba blocks and two attention modules; the attention mechanism uses an 8-head dimension; the state vector... Dimensions are 32, time step is The dimension is set to 64; the number of classes output by the classifier is 5.

[0138] The training parameters were configured as follows: batch size of 64, Adam optimizer (initial learning rate of 0.001), StepLR scheduling strategy, learning rate decayed to 0.1 every 200 training epochs to adapt to the model's later convergence requirements, and a total of 300 training epochs were conducted.

[0139] Figure 4 The figure shows a schematic diagram of a training loss curve provided in an embodiment of the present invention. As the number of training rounds increases, the overall model loss value shows a gradual decrease and tends to converge. Figure 5 The figure shows a schematic diagram of a test accuracy curve provided by an embodiment of the present invention. As the number of training rounds increases, the classification accuracy of the model on the test set gradually increases and tends to stabilize.

[0140] Step S105: Input the fused feature sequence of the test set into the trained Mamba-attention network, and obtain the classification result of the underwater acoustic signal through the trained Mamba-attention network.

[0141] For example, the fused feature sequence of the test set is input into a trained Mamba-attention network. The network output features are then classified using global feature aggregation and a classifier to obtain the category prediction results for the underwater acoustic signal. Overall accuracy is used to evaluate the performance of the method.

[0142] Figure 6 The figure shows a confusion matrix diagram provided by an embodiment of the present invention. The overall classification accuracy of the present invention reaches 85.51%, with each category achieving an accuracy exceeding 80%, indicating that the present invention has good recognition capabilities for samples of different categories. Categories 3 and 5 show the best recognition performance, with accuracies of 89.65% and 88.53%, respectively.

[0143] According to another embodiment, an underwater acoustic signal classification device based on a Mamba-attention network is provided, the device comprising:

[0144] The signal processing unit is configured to preprocess a pre-acquired underwater acoustic signal dataset to obtain segmented data samples, and divide the segmented data samples into a training set and a test set.

[0145] The feature extraction unit is configured to extract Mel spectral features and LOFAR spectral features from the training set and the test set, respectively.

[0146] The feature fusion unit is configured to fuse the Mel spectrum features and LOFAR spectrum features of the training set to obtain a training set fused feature sequence, and to fuse the Mel spectrum features and LOFAR spectrum features of the test set to obtain a test set fused feature sequence.

[0147] The model training unit is configured to construct a Mamba-attention network, input the fused feature sequence of the training set into the Mamba-attention network, perform deep feature extraction through a multi-layer selective state space model and a multi-head attention module, capture the long-term dependency, local key features and global correlation information of the fused feature sequence of the training set, and update the network model parameters by combining the loss function and the optimizer until the network model converges to obtain the trained Mamba-attention network.

[0148] The classification unit is configured to input the fused feature sequence of the test set into a trained Mamba-attention network, and classify the network output features through global feature aggregation and a classifier to obtain the classification result of the underwater acoustic signal.

[0149] It is understood that the method steps in the embodiments of the present invention can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.

[0150] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0151] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for classifying underwater acoustic signals based on Mamba-attention networks, comprising: The pre-acquired underwater acoustic signal dataset is preprocessed to obtain segmented data samples, which are then divided into a training set and a test set. Mel spectral features and LOFAR spectral features are extracted from the training set and the test set, respectively; The Mel spectrum features and LOFAR spectrum features of the training set are fused to obtain the training set fused feature sequence, and the Mel spectrum features and LOFAR spectrum features of the test set are fused to obtain the test set fused feature sequence. A Mamba-attention network is constructed, comprising an input adaptation layer, a Mamba block, an attention block, a global feature aggregation layer, and a classifier. The fused feature sequence of the training set is input into the Mamba-attention network for model training. The fused feature sequence is first projected through the input adaptation layer and positional encoding is added. Then, it passes through the Mamba block and the attention block. The Mamba block utilizes a selective state space layer and gating mechanism to adaptively capture the long-term dependencies and local key features of the fused feature sequence of the training set. The attention block models the global correlation information of the fused feature sequence of the training set through a multi-head self-attention mechanism. At the end of the network, a compact representation of the sequence is obtained through the global feature aggregation layer. Finally, the classifier outputs a prediction, and the network model parameters are updated by combining the loss function and the optimizer until the network model converges, resulting in the trained Mamba-attention network. The fused feature sequence of the test set is input into the trained Mamba-attention network, and the classification result of the underwater acoustic signal is obtained through the trained Mamba-attention network.

2. The method according to claim 1, wherein, The pre-acquired underwater acoustic signal dataset is preprocessed to obtain segmented data samples. These segmented data samples are then divided into a training set and a test set, including: The pre-acquired underwater acoustic signal dataset is resampled, normalized, and time-series segmented to obtain segmented data samples. Normalization linearly maps the underwater acoustic signal to peak values ​​through peak normalization. Within the range, time segmentation divides the underwater acoustic signal into segments of fixed duration, with overlaps between segments to preserve temporal continuity. If the signal duration is less than the fixed duration, zero padding is used to bring it to the fixed duration. The segmented data samples are divided into training and test sets according to a preset ratio.

3. The method according to claim 1, wherein, Extract the Mel spectral features and LOFAR spectral features from the training set and the test set respectively, including: Mel spectral features and LOFAR spectral features of each signal segment in the training and test sets are extracted respectively to obtain the shape of The mel spectrum features, and the shape of The LOFAR spectral characteristics, among which, For time frames, For the frequency dimension, the number of time frames for Mel spectral features and LOFAR spectral features. Maintain consistency.

4. The method according to claim 1, wherein, The training set fused feature sequence is obtained by fusing the Mel spectral features and LOFAR spectral features of the training set, and the test set fused feature sequence is obtained by fusing the Mel spectral features and LOFAR spectral features of the test set, including: Mel spectrum features time-aligned to the training or test sets and LOFAR spectral features The features are concatenated along their dimensions, and then rearranged dimensionally, resulting in the following representation: in, For dimension rearrangement operations, This is a concatenation operation along the feature dimension. To fuse feature sequences, This represents the dimension of the fused single-step feature vector, ensuring that each time step contains a multimodal fused single-step feature vector, which facilitates subsequent sequence modeling and yields the fused feature sequence. .

5. The method according to claim 1, wherein, A Mamba-attention network is constructed, comprising an input adaptation layer, a Mamba block, an attention block, a global feature aggregation layer, and a classifier. The fused feature sequence of the training set is input into the Mamba-attention network for model training. The fused feature sequence is first projected through the input adaptation layer and positional encoding is added. Subsequently, it passes through the Mamba block and the attention block. The Mamba block utilizes a selective state space layer and gating mechanism to adaptively capture the long-term dependencies and local key features of the fused feature sequence of the training set. The attention block models the global correlation information of the fused feature sequence of the training set through a multi-head self-attention mechanism. At the end of the network, a compact representation of the sequence is obtained through the global feature aggregation layer. Finally, the classifier outputs a prediction, and the network model parameters are updated by combining the loss function and the optimizer until the network model converges, resulting in the trained Mamba-attention network. Construct a Mamba-attention network that includes an input adaptation layer, two Mamba blocks, two attention blocks, a global feature aggregation layer, and a classifier; The input adaptation layer is used to fuse the Mel spectrum and LOFAR spectrum features of the underwater acoustic signal. Adaptation processing is performed, and the training set feature sequences are fused through linear mapping. Projecting onto the model dimension and adding learnable positional encoding yields the sequence. The expression is ,in, It is a linear projection matrix. For learnable positional encoding, To fuse feature sequences, Used as input for the first subsequent Mamba block; Each Mamba block consists of an input projection, a selective state-space layer, and a residual connection. The input is first normalized using the layer normalization operation, and then passed through the input projection matrix. Project the normalized input as candidate features and gating signals Gating signal through The modulation signal is obtained after activation function processing, and candidate features are generated. The selective state-space layer models the time-dependent input, and the output of the selective state-space layer is multiplied element-wise with the modulated signal and then projected onto the output matrix. The mapping is then performed, and the output of the Mamba block is obtained by superimposing the original input of the Mamba block through a residual connection. The expression is: in, For element-wise multiplication, For layer normalization operation, and These are the input projection matrix and the output projection matrix, respectively. and For candidate features and gate vectors, For activation function, For selective state space layers, The output is for the selective state space; the input of the second Mamba block is the output of the first Mamba block. Each attention block contains a multi-head self-attention mechanism and residual connections, for the input... After normalization, the execution layer is input into the multi-head self-attention mechanism layer, and its output... With the original input The attention block output is obtained by superimposing residual connections, and the expression is: in, For layer normalization operation, For multi-head self-attention mechanism layer, For attention block output, This is the output of the multi-head self-attention mechanism; the input of the first attention block is the output of the second Mamba block. The input to the second attention block is the output of the first attention block; The global feature aggregation layer outputs the last layer. Temporal average pooling is used to obtain the global feature vector. The expression is: ,in For time frames, Represents a sequence In the Feature vectors at each time step; The classifier is a fully connected layer used to process the global feature vector. Mapping to the target category space yields the classification score vector: in, , Given the number of target categories, the score vector is transformed into a predicted probability distribution using the Softmax function. During model training, the cross-entropy loss function is used to calculate the prediction loss. The expression for the loss function is as follows: in For real labels, To predict probabilities, minimize the loss function. Optimize all learnable parameters in the network until the model converges.

6. The method according to claim 5, wherein, The selective state space layer includes: The selective state space layer first processes candidate features through depthwise separable convolution. Local context modeling is performed, represented as: in, The output sequence of the convolution. For depthwise separable convolution; then calculate the dynamic stride parameter: in, and For linear mapping weights, For learnable bias, This is the Softplus activation function; based on Perform a state space update, with the update formula as follows: in, and Let these represent the state vectors of the previous time step and the current time step, respectively. For state decay parameters, Given the input projection matrix, the final output is: in, This is the mapping matrix from state to output. For channel-by-channel residual weights, This is the final output of SSM.

7. The method according to claim 5, wherein, The multi-head attention mechanism layer includes: The multi-head self-attention mechanism layer first processes the input... The linear mapping projection results in a query, key, and value. in, , , For learnable projection matrices, The query, key, and value are split into multiple parts, and the result is... Split along the feature dimension One point of attention: Calculate the first Attention weights for each attention head: in, Calculated along the time dimension, For each dimension of the attention head, the outputs of all attention heads are concatenated and then projected through a matrix. The mapping yields the output of the multi-head attention mechanism: in, To output the projection matrix, This is the output of the multi-head attention mechanism.

8. A device for classifying underwater acoustic signals based on a Mamba-attention network, comprising: The signal processing unit is configured to preprocess a pre-acquired underwater acoustic signal dataset to obtain segmented data samples, and divide the segmented data samples into a training set and a test set. The feature extraction unit is configured to extract Mel spectral features and LOFAR spectral features from the training set and the test set, respectively. The feature fusion unit is configured to fuse the Mel spectrum features and LOFAR spectrum features of the training set to obtain a training set fused feature sequence, and to fuse the Mel spectrum features and LOFAR spectrum features of the test set to obtain a test set fused feature sequence. The model training unit is configured to construct a Mamba-attention network, which includes an input adaptation layer, a Mamba block, an attention block, a global feature aggregation layer, and a classifier. The fused feature sequence of the training set is input into the Mamba-attention network for model training. The fused feature sequence is first projected through the input adaptation layer and positional encoding is added. It then alternately passes through the Mamba block and the attention block. The Mamba block utilizes a selective state space layer and gating mechanism to adaptively capture the long-term dependencies and local key features of the fused feature sequence of the training set. The attention block models the global correlation information of the fused feature sequence of the training set through a multi-head self-attention mechanism. At the end of the network, a compact representation of the sequence is obtained through the global feature aggregation layer. Finally, the classifier outputs a prediction, and the network model parameters are updated using a loss function and an optimizer until the network model converges, resulting in the trained Mamba-attention network. The classification unit is configured to input the fused feature sequence of the test set into a trained Mamba-attention network, and obtain the classification result of the underwater acoustic signal through the trained Mamba-attention network.