Autonomous task perception-based underwater acoustic target recognition method and system
By employing an autonomous task perception method, utilizing an audio spectrum Transformer and a task type extraction network, combined with a sparse selection mechanism and a router, and dynamically selecting an expert network, the shortcomings of underwater acoustic target recognition systems in autonomous task recognition and cross-task association are addressed, achieving rapid adaptation and efficient recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAT UNIV OF DEFENSE TECH
- Filing Date
- 2026-01-19
- Publication Date
- 2026-06-02
AI Technical Summary
Existing underwater acoustic target recognition systems suffer from insufficient autonomous task recognition capabilities and neglect of correlations between tasks, resulting in an inability to quickly adapt to new targets while maintaining recognition accuracy for old targets.
An autonomous task perception method is adopted, which extracts features through an audio spectrum Transformer backbone network and a task type extraction network. Combined with a sparse selection mechanism and a router to dynamically select an expert network, autonomous task recognition and cross-task feature association are achieved.
It enables autonomous discovery and rapid adaptation of new tasks, maintains the recognition accuracy of known tasks, reduces computing resource requirements, improves system robustness and real-time performance, and supports long-term stable incremental learning.
Smart Images

Figure CN121542862B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of underwater acoustic signal processing and artificial intelligence, and in particular to a method and system for underwater acoustic target recognition based on autonomous task perception. Background Technology
[0002] Underwater acoustic target identification is a core component of the marine sensing system. Its task is to accurately identify underwater targets such as ships, submarines, and marine mammals from complex, variable, and noisy underwater acoustic signals. Due to the strong attenuation of light and electromagnetic waves by seawater, sound waves become the only information carrier that can propagate over long distances. Therefore, underwater acoustic target identification directly determines the effectiveness of maritime safety, anti-submarine warfare, marine ecological monitoring, and intelligent shipping. However, the real marine environment exhibits the characteristics of "three highs and one change": high background noise (merchant ships on shipping routes, rain waves and reefs), high reverberation (multipath propagation in shallow waters), high dynamics (time-varying sound velocity profiles caused by thermo-salinity transitions), and a continuous increase in target types (new types of low-noise submarines, unmanned underwater vehicles, and new populations of marine mammals).
[0003] Traditional deep learning-based underwater target recognition employs an offline training-fixed deployment model. Once a new target is encountered, all historical data must be retrieved and retrained, resulting in extremely high data acquisition costs (requiring research vessel-level expenses for deep-sea testing). Furthermore, the old model parameters are completely overwritten by the new gradients, causing "catastrophic forgetting" and a sharp drop in performance for already identified targets. Incremental learning has therefore become a rigid requirement in the field of underwater acoustics: without leaking or uploading original data, the system continuously evolves with the task, maintaining accuracy in recognizing old targets while quickly adapting to new ones.
[0004] The core objective of incremental learning is to maintain the continuous retention of old knowledge when introducing new knowledge. It can be broadly categorized into three types: category incremental learning, task incremental learning, and domain incremental learning. For underwater acoustic target recognition tasks, targets are generally classified according to different tasks, making task incremental learning particularly important. For example, identifying submarines and identifying marine mammals can be considered two different tasks. For these two tasks, the model needs to autonomously determine the task identity and allocate dedicated network resources, while simultaneously mining shareable acoustic-spectral features (such as propeller line spectra and harmonic structures of whale calls) across different tasks. Only by achieving parameter-efficient and minimally forgotten incremental learning can the technical requirements of low-power nodes such as unmanned underwater vehicles and seabed observation networks for "deployment, learning, and evolution on the same time" be met.
[0005] Existing incremental learning frameworks for underwater tasks primarily employ parameter isolation methods. This means that for different tasks, task-specific parameters are used for model inference, with parameters independent of each task. This "plug-and-play" parameter replacement allows for the retention of old knowledge and the introduction of new knowledge. The advantage of this approach is the ease of introducing new knowledge while retaining old knowledge. However, it fails to consider the connections between different tasks, neglecting the correlation between them.
[0006] In existing technologies, the paper "DER: Dynamically Expandable Representation for ClassIncremental Learning" (Yan, Shipeng et al., IEEE / CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021) employs a dynamically expandable method, achieving incremental learning by freezing existing feature extractors and successively adding new feature modules. However, this method suffers from the problem of linear growth in model parameters with the task, and the simple concatenation strategy of the feature space fails to achieve knowledge reuse, resulting in reduced representation efficiency. The paper "SSAST-Adapter: A Parameter-efficient Incremental Learning Algorithm for Underwater Acoustic Target Recognition" (Zhu, Qian et al., IEEE International Conference on Acoustics, Speech, and Signal Processing, ICASSP 2025, 2025) transfers the self-supervised audio spectrum Transformer to underwater acoustic target recognition. By freezing the backbone network and inserting a task-specific adapter, it suppresses catastrophic forgetting with minimal parameter increments. However, it is necessary to clearly define the task type classification before calling the corresponding sub-network, which requires manual setting of task types. It is impossible to achieve autonomous discovery of task categories based on underwater acoustic signals. Furthermore, it is assumed that different tasks are completely unrelated, ignoring the correlation between tasks. Summary of the Invention
[0007] The technical problem to be solved by this invention is: how to solve the problems of insufficient autonomous identification capability of task categories and neglect of the correlation between tasks in existing underwater acoustic target recognition.
[0008] This invention solves the above-mentioned technical problems through the following technical solution: an underwater acoustic target recognition method based on autonomous task perception, the method comprising:
[0009] S1. Preprocess the underwater acoustic signal to obtain the time spectrum. Input the time spectrum into the audio spectrum Transformer backbone network for feature extraction. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features.
[0010] S2. Input the time-spectrum image into the trained task type extraction network. The task type extraction network extracts features from the time-spectrum image to obtain the task embedding vector. Calculate the similarity score between the task embedding vector and the task prototype in the playback memory. When the maximum similarity score is greater than the set threshold, output the task representation vector and proceed to step S3. Otherwise, input the deep features output from the last Transformer layer into the classifier and output the classification result.
[0011] S3. Select a router based on the task representation vector. The router selects the trained expert network based on the sparse selection mechanism and calculates the gating weights of each expert network. The trained expert networks process the general acoustic features in parallel. The outputs of the trained expert networks are fused according to the gating weights to obtain fused features. The deep features and fused features are fused to obtain enhanced features. The enhanced features output by each Transformer layer are used as the input of the next Transformer layer. The enhanced features output by the last Transformer layer are fed into the classifier to output the classification result.
[0012] This invention extracts features from the temporal spectrogram using a task type extraction network to obtain a task embedding vector. It then calculates the similarity score between the task embedding vector and the task prototype in the playback memory. Through distributed similarity calculation, autonomous task recognition is achieved, enabling the system to discover unknown tasks and accurately identify known tasks, thus solving the problem of insufficient autonomous recognition capabilities in existing methods. The task representation vector guides the router to activate relevant expert networks. The hybrid expert adapter employs a sparse activation mechanism, dynamically selecting the most relevant subset of experts through task-specific routers. Through expert specialization, each expert can focus on learning specific types of acoustic feature patterns. Collaborative combinations among experts can handle complex cross-task feature associations, achieving knowledge fusion between tasks and addressing the problem of existing methods neglecting task relevance.
[0013] Preferably, the audio spectrum Transformer backbone network includes an image patch embedding module and 12 stacked Transformer layers. Each Transformer layer includes a layer normalization module, an MHSA module, a layer normalization module, and a feedforward neural network connected in sequence. The time-spectrum image enters the image patch embedding module and is segmented into 16×16 image patches. The image patches enter the layer normalization module for linear transformation to obtain embedding vectors, and learnable positional codes are added. The embedding vectors enter the MHSA module for feature extraction to obtain general acoustic features. The general acoustic features are then processed by layer normalization and the feedforward neural network to obtain deep features. Using a frozen backbone network maintains the basic recognition function of the system, and its lightweight network design also ensures the real-time requirements of the system.
[0014] Preferably, the trained task type extraction network includes multiple 5×5 deep convolutional kernels, multiple 3×3 deep convolutional kernels, and self-attention pooling layers connected in sequence, with each convolutional layer followed by normalization and ReLU activation.
[0015] The lightweight task type extraction network extracts essential task features through deepest separable convolutions. Deep convolutional layers process each feature channel independently, capturing task-specific frequency domain patterns; point convolutional layers fuse cross-channel information to form a comprehensive task representation. Self-attention pooling layers perform weighted aggregation based on the importance of time frames, highlighting key discrimination periods for the task.
[0016] Preferably, the similarity score calculation process includes:
[0017] Compute task embedding vector Mahalanobis distance metric from the mission prototype :
[0018]
[0019] in, , They are the first The mean and covariance of each task prototype;
[0020] Mahalanobis distance measurement uses temperature parameters Converting the exponential function to a similarity score : .
[0021] Mahalanobis distance takes into account the covariance structure of task features, enabling it to more accurately distinguish the essential differences between tasks. The introduction of a temperature parameter non-linearly scales the distance, enhancing the discriminative power of the similarity score.
[0022] Preferably, the router selects the trained expert network based on a sparse selection mechanism and calculates the gating weights for each trained expert network. The process includes:
[0023] Router for task representation vector Perform a linear transformation to obtain the features :
[0024]
[0025] K expert networks G are selected based on the Top-K sparse selection mechanism;
[0026] Calculate the gating weights for each trained expert network. :
[0027]
[0028] in, This is the weight matrix. For bias vectors, .
[0029] Employing a Top-K sparse selection mechanism, only the K highest-scoring expert networks are activated, while the remaining experts remain dormant. The number of experts can be flexibly expanded according to task complexity, overcoming the model capacity limitations of traditional methods. Through expert specialization, the sparse selection mechanism allows each expert to focus on learning specific types of acoustic feature patterns. Collaborative combinations among experts enable the handling of complex cross-task feature associations.
[0030] Preferred, enhanced features for:
[0031]
[0032] in, For the first Gating weights of an expert network, Indicates the first Forward computation of an expert network, These are general acoustic characteristics.
[0033] The residual connection mechanism ensures that gradients propagate effectively in deep networks, mitigating the gradient vanishing problem during training.
[0034] Preferably, the trained expert network includes a dimensionality reduction layer, a ReLU activation function, and a dimensionality increase layer connected in sequence. General acoustic features are input into the expert network. The dimensionality reduction layer compresses the 768-dimensional features to 192 dimensions. The 192-dimensional features are linearly transformed by the ReLU activation function. The linearly transformed features are then processed by the dimensionality increase layer to restore the dimensionality to 768 dimensions.
[0035] The bottleneck structure within the expert network operates based on the feature distillation theory. The dimensionality reduction layer (768→192 dimensions) removes feature redundancy while retaining core discriminative information; the nonlinear activation layer introduces necessary feature transformation capabilities; and the dimensionality increase layer restores the feature dimension, ensuring compatibility with subsequent modules. The expert network structure is relatively simple, significantly reducing the number of parameters while maintaining the model's expressive power.
[0036] Preferably, the task type extraction network and expert network are obtained through incremental training, and the training process includes:
[0037] S31. Mix the new task data with the old samples in the playback memory in an equal proportion to obtain training data. Preprocess the training data to obtain preprocessed training data.
[0038] S32. Preprocess the training data to obtain the time-spectrum graph. Input the time-spectrum graph into the audio spectrum Transformer backbone network for feature extraction. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features.
[0039] S33. Input the time-spectrum image into the task type extraction network. After the task type extraction network extracts features from the time-spectrum image, it obtains the task embedding vector. Calculate the similarity score between the task embedding vector and the task prototype in the playback memory. When the maximum similarity score is greater than the set threshold, output the task representation vector and dynamically update the set threshold, then proceed to step S34. Otherwise, input the deep features output from the last Transformer layer into the classifier, output the classification result, and dynamically update the playback memory.
[0040] S34. Select a router based on the task representation vector. The router selects the trained expert network based on the sparse selection mechanism, calculates the gating weight of each expert network, and processes the general acoustic features in parallel. The output of the trained expert network is fused according to the gating weight to obtain the fused features. The deep features and the fused features are fused to obtain the enhanced features. The enhanced features output by each Transformer layer are used as the input of the next Transformer layer. The enhanced features output by the last Transformer layer are fed into the classifier to output the classification result.
[0041] S35. When the loss function is minimized or the set number of training iterations are reached, the trained task type extraction network and expert network are obtained.
[0042] This invention, through modular design and knowledge consolidation mechanisms, enables the system to support long-term, stable incremental learning and possess continuous learning capabilities. Task recognition decision-making is based on an adaptive threshold mechanism, automatically adjusting the decision threshold through percentile estimation to ensure stable task recognition performance even with environmental changes. After each training cycle, the system recalculates the feature statistics of the current task and updates the task prototype in the replay memory. The task prototype update employs a moving average mechanism to ensure the prototype can adapt to slow data changes.
[0043] Preferably, the loss function for:
[0044]
[0045] For classification cross-entropy loss, expert load balancing loss is used. for:
[0046]
[0047] in, Selecting frequencies for expert networks , Indicates whether the nth sample selected the expert network. i , N The total number of samples, Assuming a uniform prior distribution, , The total number of experts, This is the regularization coefficient.
[0048] During training, the system simultaneously optimizes two loss functions: classification cross-entropy loss and expert load balancing loss. Classification cross-entropy loss ensures the model's recognition performance on new tasks, while expert load balancing loss constrains the frequency of expert usage through KL divergence, preventing some experts from being overused while others are ignored.
[0049] This invention also provides an underwater acoustic target recognition system based on autonomous task perception, the system comprising:
[0050] The feature extraction module is used to preprocess the underwater acoustic signal to obtain the time-spectrum map. The time-spectrum map is then input into the audio spectrum Transformer backbone network for feature extraction. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features.
[0051] The task self-discovery module is used to input the time spectrogram into the trained task type extraction network. After the task type extraction network extracts features from the time spectrogram, it obtains the task embedding vector. It calculates the similarity score between the task embedding vector and the task prototype in the playback memory. When the maximum similarity score is greater than a set threshold, it outputs the task representation vector and enters the hybrid expert adapter module. Otherwise, it inputs the deep features output from the last Transformer layer into the classifier and outputs the classification result.
[0052] The hybrid expert adapter module is used to select a router based on the task representation vector. The router selects the trained expert network based on the sparse selection mechanism, calculates the gating weights of each expert network, and the trained expert network processes the general acoustic features in parallel. The outputs of the trained expert network are fused according to the gating weights to obtain fused features. The deep features and fused features are fused to obtain enhanced features. The enhanced features output by each Transformer layer are used as the input of the next Transformer layer. The enhanced features output by the last Transformer layer are fed into the classifier to output the classification result.
[0053] The advantages provided by this invention are:
[0054] 1. This invention can autonomously discover new tasks and adapt quickly, demonstrating robustness in real, complex marine environments. For known tasks, a complete hybrid expert adapter network is used for computation, with the enhanced features output from the final Transformer layer fed into the classifier to output the classification result. For unknown tasks, the adapter module is bypassed, and the output features of the SSAST backbone are used directly for classification, with the deep features output from the backbone network fed into the classifier to output the classification result. This dual-path design ensures optimal performance for known tasks while providing basic recognition capabilities for unknown tasks.
[0055] 2. The hybrid expert adapter and the task self-discovery module form a task-adaptive inference chain, constructing a closed-loop optimization mechanism. Task identification results guide expert selection, and expert output feedback optimizes task representation, forming a continuously improving inference process. The collaborative mechanism of replay caching and hybrid experts provides balanced training data for the model, effectively preventing expert bias. Combined with load balancing loss, it ensures balanced expert utilization, providing strong support for long-term incremental learning. The collaborative work of lightweight task identification and sparse expert activation also enables dynamic allocation of computing resources, improving the overall operating efficiency of the system. Attached Figure Description
[0056] Figure 1 This is a schematic diagram of the underwater acoustic target recognition method based on autonomous task perception provided in Embodiment 1 of the present invention;
[0057] Figure 2 This is a flowchart of the underwater acoustic target recognition method based on autonomous task perception provided in Embodiment 1 of the present invention;
[0058] Figure 3 This is a structural block diagram of the underwater acoustic target recognition system based on autonomous task perception provided in Embodiment 2 of the present invention;
[0059] Figure 4 This is a schematic diagram of the task self-discovery module in the underwater acoustic target recognition system based on autonomous task perception provided in Embodiment 2 of the present invention;
[0060] Figure 5 This is a schematic diagram of the hybrid expert adapter module in the underwater acoustic target recognition system based on autonomous task perception provided in Embodiment 2 of the present invention. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0062] Existing underwater acoustic target recognition methods have two problems: (1) They rely on manually pre-defined task categories for recognition and cannot autonomously discover task types based on underwater acoustic signals. For example, if the received underwater acoustic signal is a marine animal, an error will occur if the preset task category is a ship. (2) They assume that tasks are independent of each other and ignore the correlation between tasks. In fact, the marine environment in which underwater acoustic targets are located is complex and variable, and the acoustic characteristics of different types of targets (such as ships, marine life, and environmental noise) are intrinsically related. In order to solve the problems of insufficient autonomous task category recognition capability and neglect of the correlation between tasks in existing underwater acoustic target recognition methods, this invention provides an underwater acoustic target recognition method based on autonomous task perception, which can realize end-to-end autonomous task discovery and underwater acoustic target recognition. The details are as follows:
[0063] Example 1
[0064] like Figure 1 and Figure 2 As shown, this embodiment provides an underwater acoustic target recognition method based on autonomous task perception, including the following steps:
[0065] Step 1: Acquire the raw acoustic signal of the underwater target using a hydrophone array. In actual deployment, a multi-channel acquisition method is adopted, with the sampling rate of each channel set to 16kHz and the sampling precision to 16-bit to ensure complete capture of acoustic features. The acquired raw acoustic signal is preprocessed with bandpass filtering to remove low-frequency noise below 50Hz and high-frequency interference above 8Hz, retaining the most discriminative frequency band to obtain the filtered underwater acoustic signal. Short-time Fourier transform (SFT) is used to extract time-frequency features from the filtered underwater acoustic signal. Specific parameters are set as follows: Hamming window function, window length of 25ms, frame shift of 10ms, and FFT points of 2048. Based on this, 128-dimensional Log-Mel spectral features are calculated. The center frequency of the Mel filter bank is optimized according to the characteristics of the underwater acoustic signal, focusing on covering the main acoustic feature region of 200Hz-6kHz, and the time-domain signal is converted into a time-spectrum graph.
[0066] The time-spectrum graph is input into the backbone network, which is a pre-trained audio spectrum transformer (SSAST, Self-Supervised Audio Spectrogram Transformer) backbone network. This network adopts a VisionTransformer-based architecture, which includes an image patch embedding module and 12 stacked Transformer layers. Figure 1 In this diagram, the Transformer Block is the fundamental unit of the Transformer, processing sequential data through a self-attention mechanism and a feedforward neural network to achieve feature interaction and extraction. LayerNorm is the layer normalization block, standardizing all features of a single sample to stabilize the training process and accelerate convergence. MHSA represents Multi-Head Self-Attention, mapping the input to multiple subspaces in parallel and calculating attention, enhancing the model's ability to capture dependencies at different locations. MLP is a multilayer perceptron, a feedforward network consisting of two fully connected layers and a non-linear activation function, performing non-linear transformations on features to enhance the model's expressive power. TI-Net is the task type extraction network proposed in this invention, VRC represents the playback memory, Experts represents the expert adapter group, and Router represents the router.
[0067] Each Transformer layer consists of a layer normalization module, an MHSA module, another layer normalization module, and a feedforward neural network connected in sequence. The hidden layer dimension is 768, and the number of attention heads is 12. The backbone network extracts features from the temporal spectrogram. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features. In the feature extraction process, the temporal spectrogram first enters the image patch embedding module and is segmented into 16×16 image patches. The image patch is input into the linear projection layer to perform a linear transformation on the image patch to obtain a 768-dimensional embedding vector, and a learnable positional encoding is added. The embedding vector enters the MHSA module for feature extraction to obtain general acoustic features. The general acoustic features are then processed by layer normalization and the feedforward neural network to obtain deep features.
[0068] Step 2: Input the time-spectrum image into the trained task type extraction network. After the task type extraction network extracts features from the time-spectrum image, it obtains the task embedding vector. It calculates the similarity score between the task embedding vector and the task prototype in the playback memory. When the maximum similarity score is greater than the set threshold, it is determined to be a known task, and the task representation vector is output and proceeds to step 3. Otherwise, it is marked as an unknown task. At this time, the system uses the parameter-frozen SSAST backbone network to perform zero-shot inference. The deep features output from the last Transformer layer in the backbone network are input into the classifier, and the classification result is output.
[0069] The trained Task Type Extraction Network (TINet) adopts a depthwise separable convolutional architecture, which includes multiple 5×5 deep convolutional kernels, multiple 3×3 deep convolutional kernels, and self-attention pooling layers connected in sequence. In this invention, there are 32 5×5 deep convolutional kernels and 64 3×3 deep convolutional kernels. Each convolutional layer is followed by normalization and ReLU activation. The convolutional features processed by the first 5×5 deep convolutional kernel and the second 3×3 deep convolutional kernel are passed through the self-attention pooling layer to calculate the importance weights of different time frames and generate a 128-dimensional task embedding vector.
[0070] The lightweight TINet network works by extracting essential features of the task through deepest separable convolutions. Deep convolutional layers process each feature channel independently, capturing task-specific frequency domain patterns; point convolutional layers fuse cross-channel information to form a comprehensive task representation. Self-attention pooling layers perform weighted aggregation based on the importance of time frames, highlighting key discrimination periods of the task.
[0071] The replay memory maintains feature statistics for each known task, including the mean vector. Covariance Matrix The similarity score is calculated between the task embedding vector and the task prototype in the playback memory. The similarity score calculation process includes:
[0072] Compute task embedding vector Mahalanobis distance metric from the mission prototype :
[0073]
[0074] in, , They are the first The mean and covariance of each task prototype;
[0075] Mahalanobis distance measurement uses temperature parameters Converting the exponential function to a similarity score : The temperature parameters have been set through extensive experimental verification, ensuring that they maintain discriminative power while avoiding numerical instability.
[0076] Mahalanobis distance works based on the statistical distribution assumption. Compared to simple Euclidean distance, Mahalanobis distance considers the covariance structure of task features, enabling it to more accurately distinguish essential differences between tasks. The introduction of a temperature parameter non-linearly scales the distance, enhancing the discriminative power of the similarity score.
[0077] Step 3: Select a router based on the task representation vector. The router selects the trained expert network based on the sparse selection mechanism, calculates the gating weights of each expert network, and processes the general acoustic features in parallel. The outputs of the trained expert networks are fused according to the gating weights to obtain fused features. The deep features and fused features are fused to obtain enhanced features. The enhanced features output by each Transformer layer are used as the input to the next Transformer layer. The enhanced features output by the last Transformer layer are fed into the classifier to output the classification result.
[0078] Multiple expert networks and routers are set up. This invention sets up 20 expert networks and 5 routers. Each router corresponds to a specific task. The router is a linear transformation layer. The trained expert network adopts an efficient bottleneck structure, which includes a dimensionality reduction layer, a ReLU activation function, and a dimensionality increase layer connected in sequence. General acoustic features are input into the expert network. The dimensionality reduction layer compresses the 768-dimensional features to 192 dimensions. The 192-dimensional features are nonlinearly transformed by the ReLU activation function. The nonlinearly transformed features are processed by the dimensionality increase layer to restore the dimensionality to 768 dimensions.
[0079] The bottleneck structure within the expert network operates based on feature distillation theory. Dimensionality reduction layers (768→192 dimensions) remove feature redundancy while retaining core discriminative information; nonlinear activation layers introduce necessary feature transformation capabilities; and dimensionality increase layers restore feature dimensions, ensuring compatibility with subsequent modules. Residual connection mechanisms ensure effective gradient propagation in deep networks, mitigating the gradient vanishing problem during training. This invention's expert network is an adapter, with a relatively simple structure that significantly reduces the number of parameters while maintaining the model's expressive power.
[0080] The router selects the trained expert networks based on a sparse selection mechanism and calculates the gating weights for each trained expert network. The process includes:
[0081] Router for task representation vector Perform a linear transformation to obtain the features :
[0082]
[0083] in, A learnable weight matrix used to transform the task representation vector The weight matrix linearly maps from the original dimension to the dimension of the "expert scoring space," which is generally equal to the total number of experts. Each row can be viewed as a "scoring template" corresponding to a certain expert, which is related to the task representation vector. The expert's raw score is obtained by performing the inner product calculation. A learnable bias vector is used to provide an adjustable "prior preference" or "threshold" for each expert, even if the task representation vector... It can also output non-zero raw scores, enhancing the router's expressive power and stability.
[0084] K expert networks were selected based on the Top-K sparse selection mechanism. G :
[0085]
[0086] The number of activated experts, K, can be adjusted according to the actual computing power of the device. When computing resources are sufficient, the number of activated experts, K, can be set to 5, that is, the 5 most relevant experts are activated for each sample to obtain better performance; when computing resources are limited, the number of activated experts, K, can be set to 2, that is, the 2 most relevant experts are activated for each sample to ensure real-time requirements. In this invention, the number of activated experts, K, is set to 3, that is, the 3 most relevant experts are activated for each sample. The Top-K sparse selection mechanism is adopted to activate only the 3 experts with the highest scores, while the remaining experts remain dormant, which ensures the specialization of the model and controls the computational overhead. This sparse activation mode achieves two important functions: (1) through the specialization of experts, each expert can focus on learning specific types of acoustic feature patterns; (2) through the collaborative combination of experts, complex cross-task feature associations can be handled.
[0087] Calculate the gating weights for each trained expert network. :
[0088]
[0089] in, .
[0090] The gating weights can be calculated using a parameter including temperature. Functions to balance exploration and utilization, temperature parameters It is a manually configured hyperparameter, obtained by dividing the original score vector G by the temperature parameter. Do it again Temperature parameters The larger the value, the smoother the output distribution, the smaller the difference in expert gating weights, and the better the temperature parameter. The smaller the value, the sharper the output, and the greater the difference in expert gating weights.
[0091] Enhanced features for:
[0092]
[0093] in, For the first Gating weights of an expert network, Indicates the first Forward computation of an expert network, These are general acoustic characteristics.
[0094] The task type extraction network and expert network are obtained through incremental training. The training process includes:
[0095] Step 3.1: Sample representative samples from the replay memory for previous tasks. The replay memory employs a stratified sampling strategy, retaining 50 of the most representative samples from each previous task. These samples are selected from the original training data using k-means clustering. The new task data is mixed with the old samples from the replay memory in a 1:1 ratio to obtain training data. This training data is used as the current training batch. The training data is then preprocessed to obtain preprocessed training data.
[0096] Step 3.2: Extract features from the preprocessed training data to obtain a time-spectrum graph. Input the time-spectrum graph into the audio spectrum Transformer backbone network for feature extraction. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features.
[0097] Step 3.3: Input the time-spectrum image into the task type extraction network. After feature extraction from the time-spectrum image, the task type extraction network obtains the task embedding vector. Calculate the similarity score between the task embedding vector and the task prototype in the playback memory. If the maximum similarity score is greater than a set threshold, output the task representation vector and dynamically update the set threshold, proceeding to step S3.4. Otherwise, input the deep features output from the last Transformer layer in the backbone network into the classifier, output the classification result, and dynamically update the playback memory. The task recognition decision is based on an adaptive threshold mechanism, setting a threshold... The initial threshold is set to 0.7, and is dynamically adjusted during system operation based on the 70th percentile of historical similarity scores. Specifically, each time a task representation vector is output, the threshold is updated to 70% of the original threshold. After each training cycle, the system recalculates the feature statistics of the current task and updates the task prototype in the replay memory. The task prototype update uses a moving average mechanism to ensure that the prototype can adapt to slow data changes.
[0098] The adaptive threshold mechanism works based on dynamic statistical inference. The system continuously monitors changes in the distribution of historical similarity scores and automatically adjusts the decision threshold through percentile estimation. This mechanism ensures that the system maintains stable task recognition performance even when the environment changes.
[0099] Step 3.4: Select a router based on the task representation vector. The router selects an expert network based on the sparse selection mechanism, calculates the gating weight of each expert network, and the selected expert networks process the acoustic features in parallel. The outputs of the selected expert networks are fused according to the gating weights to obtain fused features. The fused features are residually connected with the acoustic features to obtain enhanced features. The enhanced features are input into the classifier and the classification result is output.
[0100] Step 3.5: When the loss function is minimized or the set number of training iterations are reached, the trained task type extraction network and expert network are obtained.
[0101] During training, the system simultaneously optimizes two loss functions: classification cross-entropy loss. Expert load balancing loss Classification cross-entropy loss ensures the model's recognition performance on new tasks; expert load balancing loss coefficient By using KL divergence to constrain the frequency of expert usage, we can prevent some experts from being overused while others are ignored. Loss function for:
[0102]
[0103] For classification cross-entropy loss, expert load balancing loss is used. for:
[0104]
[0105] in, Selecting frequencies for expert networks , Indicates whether the nth sample selected the expert network. i , The value is 1 or 0, when the expert network i When selected, For 1, when the expert network i When not selected, =0, N The total number of samples, Assuming a uniform prior distribution, , The total number of experts, This is the regularization coefficient.
[0106] The load balancing monitoring employs an exponential moving average mechanism. The system tracks the activation frequency of each expert in real time. When the activation frequency of an expert exceeds 1.5 times the average, a dynamic freeze mechanism is automatically triggered, temporarily halting parameter updates for that expert. Correspondingly, a negative bias term is added to experts with lower activation frequencies to ensure their priority activation in subsequent training.
[0107]
[0108] in, Indicates in the task t The next updated version i The activation frequency of each expert Indicates in the task t The first update before the next updatei The activation frequency of each expert Indicates in the task t -1 after the update i The activation frequency of each expert It is an exponentially decreasing coefficient, typically close to 1, for example, set to 0.995. (Exponentially decreasing coefficient) The larger the value, the higher the historical proportion, and the smoother the curve.
[0109] Experts whose activation frequency exceeds a threshold are temporarily frozen to preserve acquired knowledge, while the insufficient expert network is exploited through modified routing bias terms. Prioritize new tasks. This approach achieves a balance between knowledge preservation and adaptive learning capabilities. Modified bias vector. for:
[0110]
[0111] in, The activation frequency of the i-th expert after the update. This is a configurable parameter that, by modifying the routing bias, can increase the activation probability for experts with low activation frequency.
[0112] The classifiers in steps 2 and 3 are used for the final identification of the input features. The classifiers employ a two-layer cascaded structure: the first layer is a global average pooling layer, which converts spatial features into a global feature representation; the second layer is a fully connected layer, whose output dimension corresponds to the number of all currently known categories. For known tasks, a complete hybrid expert adapter network is used for computation, and the enhanced features output from the last Transformer layer are fed into the classifier to output the classification result. For unknown tasks, the adapter module is bypassed, and the output features of the SSAST backbone are used directly for classification. The deep features output from the backbone network are fed into the classifier to output the classification result. This dual-path design ensures optimal performance for known tasks while providing basic recognition capabilities for unknown tasks.
[0113] Traditional methods rely on pre-defined task identifiers. This invention uses a task self-discovery module based on playback data to autonomously discover tasks. The task self-discovery module is based on the task discovery principle of "distribution matching". After the task type extraction network extracts features from the time-spectrum map, it obtains the task embedding vector. The similarity score between the task embedding vector and the task prototype in the playback memory is calculated. Autonomous task recognition is achieved through distribution similarity calculation. This constructs a task identification method from the data distribution level rather than the simple classification level, enabling the system to have the ability to discover unknown tasks and accurately identify known tasks, thus solving the problem of insufficient autonomous recognition ability of existing methods.
[0114] In traditional incremental learning methods, all tasks share the same set of model parameters, leading to interference between new and old tasks. This invention introduces a hybrid expert architecture based on the "divide and conquer" principle of expert collaborative learning. The hybrid expert adapter employs a sparse activation mechanism, dynamically selecting the most relevant subset of experts through task-specific routers to achieve knowledge fusion between tasks, thus solving the problem of existing methods ignoring task relevance. Specifically, when input underwater acoustic features enter the adapter module, the router network first analyzes the task characteristics of the input features and calculates the fitness score for each expert. Based on the Top-K selection mechanism, only the three expert networks with the highest scores are activated, while the remaining experts remain dormant. Through expert specialization, each expert can focus on learning specific types of acoustic feature patterns; through collaborative combinations among experts, complex cross-task feature correlations can be handled.
[0115] Unlike traditional parameter isolation methods that fix tasks and subnetworks, this invention uses a dynamic routing mechanism to sparsely activate the most relevant subset of experts based on task characteristics, thus achieving "soft" parameter isolation. This maintains knowledge isolation between tasks while promoting cross-task knowledge transfer and reuse through expert sharing and combination.
[0116] At the component level, this invention's hybrid expert adapter module significantly reduces the number of training parameters and effectively lowers computational resource requirements through its unique bottleneck structure and sparse activation mechanism. Simultaneously, this module avoids inter-task interference through expert specialization and achieves cross-task knowledge reuse via a router mechanism. Furthermore, the number of experts can be flexibly expanded according to task complexity, breaking through the model capacity limitations of traditional methods. The task self-discovery module possesses autonomous task discovery capabilities, automatically identifying new tasks through distribution similarity without pre-setting task identifiers, and exhibiting zero-shot inference capabilities for unknown tasks. By using a frozen backbone network to maintain the system's basic recognition functions, its lightweight network design also ensures the system's real-time requirements.
[0117] At the component integration level, the hybrid expert adapter and the task self-discovery module form a task-adaptive inference chain, constructing a closed-loop optimization mechanism. Task identification results guide expert selection, and expert output feedback optimizes task representation, forming a continuously improving inference process. The collaborative mechanism of replay caching and hybrid experts provides balanced training data for the model, effectively preventing expert bias. Combined with load balancing loss, it ensures balanced expert utilization, providing strong support for long-term incremental learning. The collaborative work of lightweight task identification and sparse expert activation also enables dynamic allocation of computing resources, improving the overall operating efficiency of the system.
[0118] At the overall technical system level, the system can autonomously discover new tasks and adapt quickly, demonstrating robustness in real-world, complex marine environments. Through modular design and knowledge consolidation mechanisms, the system supports long-term, stable incremental learning and possesses continuous learning capabilities. Significantly improved parameter efficiency enables the system to operate in real-time on resource-constrained underwater equipment, supports edge computing deployment, and reduces reliance on cloud services. Furthermore, the autonomous task discovery capability reduces the need for manual annotation and system retraining, lowering system maintenance costs and enhancing the practical value of the technology.
[0119] Example 2
[0120] This embodiment provides an underwater acoustic target recognition system based on autonomous task awareness, including:
[0121] The feature extraction module is used to preprocess the underwater acoustic signal to obtain the time-spectrum map. The time-spectrum map is then input into the audio spectrum Transformer backbone network for feature extraction. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features.
[0122] The audio spectrum Transformer backbone network consists of an image patch embedding module and 12 stacked Transformer layers. Each Transformer layer includes a layer normalization module, an MHSA module, a layer normalization module, and a feedforward neural network connected in sequence. The time spectrum image enters the image patch embedding module and is segmented into 16×16 image patches. The image patches enter the layer normalization module for linear transformation to obtain embedding vectors, and learnable positional codes are added. The embedding vectors enter the MHSA module for feature extraction to obtain general acoustic features. The general acoustic features are then processed by the layer normalization module and the feedforward neural network to obtain deep features.
[0123] The task self-discovery module is used to input the time-spectrum map into the trained task type extraction network. After the task type extraction network extracts features from the time-spectrum map, it obtains the task embedding vector. It calculates the similarity score between the task embedding vector and the task prototype in the playback memory. When the maximum similarity score is greater than a set threshold, it outputs the task representation vector and enters the hybrid expert adapter module to activate the corresponding routing path in the hybrid expert adapter. Otherwise, it inputs the deep features output from the last Transformer layer in the backbone network into the classifier and outputs the classification result.
[0124] The trained task type extraction network consists of multiple 5×5 deep convolutional kernels, multiple 3×3 deep convolutional kernels, and self-attention pooling layers connected in sequence. Each convolutional layer is followed by normalization and ReLU activation.
[0125] The similarity score calculation process includes:
[0126] Compute task embedding vector Mahalanobis distance metric from the mission prototype :
[0127]
[0128] in, , They are the first The mean and covariance of each task prototype;
[0129] Mahalanobis distance measurement uses temperature parameters Converting the exponential function to a similarity score : .
[0130] The hybrid expert adapter module is used to select a router based on the task representation vector. The router selects the trained expert network based on the sparse selection mechanism, calculates the gating weights of each expert network, and the trained expert network processes the general acoustic features in parallel. The outputs of the trained expert network are fused according to the gating weights to obtain fused features. The deep features and fused features are fused to obtain enhanced features. The enhanced features output by each Transformer layer are used as the input of the next Transformer layer. The enhanced features output by the last Transformer layer are fed into the classifier to output the classification result.
[0131] The audio spectrum Transformer backbone network consists of 12 stacked Transformer layers. This invention sets up a Hybrid Expert Adapter (HEA) module for each Transformer layer. The MHSA module of each Transformer layer outputs general acoustic features, which are then input to the corresponding HEA module. The router selects the trained expert network based on a sparse selection mechanism. The trained expert network processes the general acoustic features in parallel. The outputs of the trained expert network are fused according to gating weights to obtain fused features. The deep features output by the feedforward neural network in the Transformer layer are then fused with the fused features to obtain enhanced features. The enhanced features output by each Transformer layer serve as the input to the next Transformer layer. Finally, the enhanced features output by the last Transformer layer are fed into the classifier for recognition.
[0132] The router selects the trained expert networks based on a sparse selection mechanism and calculates the gating weights for each trained expert network. The process includes:
[0133] Router for task representation vector Perform a linear transformation to obtain the features :
[0134]
[0135] K expert networks G are selected based on the Top-K sparse selection mechanism;
[0136] Calculate the gating weights for each trained expert network. :
[0137]
[0138] in, This is the weight matrix. For bias vectors, .
[0139] Enhanced features for:
[0140]
[0141] in, For the first Gating weights of an expert network, Indicates the first Forward computation of an expert network, These are general acoustic characteristics.
[0142] The trained expert network consists of a dimensionality reduction layer, a ReLU activation function, and a dimensionality increase layer connected in sequence. General acoustic features are input into the expert network. The dimensionality reduction layer compresses the 768-dimensional features to 192 dimensions. The 192-dimensional features are linearly transformed by the ReLU activation function. The linearly transformed features are then processed by the dimensionality increase layer to restore the dimensionality to 768 dimensions.
[0143] The task type extraction network and expert network are obtained through incremental training. The training process includes:
[0144] S31. Mix the new task data with the old samples in the playback memory in an equal proportion to obtain training data. Preprocess the training data to obtain preprocessed training data.
[0145] S32. Preprocess the training data to obtain the time-spectrum graph. Input the time-spectrum graph into the audio spectrum Transformer backbone network for feature extraction. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features.
[0146] S33. Input the time-spectrum image into the task type extraction network. After the task type extraction network extracts features from the time-spectrum image, it obtains the task embedding vector. Calculate the similarity score between the task embedding vector and the task prototype in the playback memory. When the maximum similarity score is greater than the set threshold, output the task representation vector and dynamically update the set threshold, then proceed to step S34. Otherwise, input the deep features output from the last Transformer layer in the backbone network into the classifier, output the classification result, and dynamically update the playback memory.
[0147] S34. Select a router based on the task representation vector. The router selects the trained expert network based on the sparse selection mechanism, calculates the gating weight of each expert network, and processes the general acoustic features in parallel. The output of the trained expert network is fused according to the gating weight to obtain the fused features. The deep features and the fused features are fused to obtain the enhanced features. The enhanced features output by each Transformer layer are used as the input of the next Transformer layer. The enhanced features output by the last Transformer layer are fed into the classifier to output the classification result.
[0148] S35. When the loss function is minimized or the set number of training iterations are reached, the trained task type extraction network and expert network are obtained.
[0149] loss function for:
[0150]
[0151] For classification cross-entropy loss, expert load balancing loss is used. for:
[0152]
[0153] in, Selecting frequencies for expert networks , Indicates whether the nth sample selected the expert network. i , N The total number of samples, Assuming a uniform prior distribution, , The total number of experts, This is the regularization coefficient.
[0154] The underwater acoustic target recognition system based on autonomous task perception of this invention also includes:
[0155] The dynamic computing resource allocation module automatically adjusts the number of active experts in the hybrid expert adapter based on the actual computing power of the device. When computing resources are sufficient, the number of active experts K can be increased to 5 to obtain better performance; when resources are limited, the number of active experts K can be reduced to 2 to ensure real-time requirements.
[0156] The memory management module uses the Least Recently Used (LRU) strategy to manage the replay cache. When the cache space is insufficient, it prioritizes the elimination of the least recently used samples, while ensuring that each task retains at least 20 core samples.
[0157] The online learning module supports incremental model updates. New training data is continuously injected in small batches. The model parameters are updated using stochastic gradient descent with momentum. The momentum coefficient is set to 0.9, and the learning rate is adjusted by cosine annealing according to the training progress. The initial learning rate is 1e-4.
[0158] In this invention, the various modules of the system work collaboratively through information flow, forming a complete incremental learning loop. During forward inference, the input signal sequentially passes through feature extraction, task identification, expert selection, feature enhancement, and classification decision-making, forming a hierarchical processing flow. During feedback learning, the system updates expert parameters, adjusts task prototypes, and optimizes routing strategies based on the identification results, achieving continuous performance improvement. The knowledge consolidation mechanism is based on the principle of "elastic weight consolidation," using load balancing loss to constrain the specialization of experts and prevent some experts from overfitting to new tasks and forgetting old ones. The dynamic freezing mechanism ensures the stability of high-utilization experts while providing opportunities for low-utilization experts to learn new knowledge.
[0159] Comparative experiment
[0160] Table 1 shows a comparison between the method of this invention (Ours) and alternative methods for the MTIL task. Alternative methods for the MTIL task include: FineTuning, the machine learning algorithm LwF (Learning without Forgetting), Incremental Classifier and Representation Learning (iCaRL), the few-shot incremental audio classification method META-SC, and the few-shot incremental audio classification method FCAC based on a dynamically expanding classifier with self-attention adjustment prototypes. The five datasets—DeepShip, ShipsEar, Whale, Watkins, and OceanShip—are treated as five different tasks and processed in left-to-right order. After training for each task, the corresponding test set is evaluated, and the accuracy (Acc) is recorded. After completing all five tasks, the test set for each task is evaluated to obtain the final accuracy (Last), and the performance degradation rate (PD) is calculated. As shown in Table 1, the method of this invention achieves best or second-best prediction accuracy in most tasks, with an average forgetting rate of 1.93%, demonstrating excellent resilience to catastrophic forgetting.
[0161] Table 1. Comparison of the accuracy, precision, and average performance degradation score between the present invention and existing methods.
[0162]
[0163] The method of this invention was further compared with other methods in terms of training parameters and additional storage space. Table 2 shows that the method of this invention outperforms other methods, reducing training parameters (M), total parameters (M), and additional storage space (MiB) by approximately 60%, 30%, and 40%, respectively. This demonstrates the superiority of the method of this invention in terms of computational overhead and storage space.
[0164] Table 2 Comparison of the method of the present invention and existing methods in terms of training parameters, total parameters, and additional storage space.
[0165]
[0166] To verify the effectiveness of the proposed hybrid expert adapter module, an ablation study was conducted, as shown in Table 3. SSAST represents only the pre-trained encoder, and the adapter refers to the fine-tuning of the SSAST adapter. "mE / nR" indicates that the hybrid expert adapter module contains m experts and n routers. △1 represents the difference in overall accuracy (Acc) compared to the proposed method (Ours), and △2 represents the difference in final performance (Last) compared to the proposed method (Ours). For example, the overall accuracy (Acc) of the SSAST method is 57.05, while the overall accuracy (Acc) of the proposed method is 91.84, with a difference of -34.79. Metrics include overall accuracy and final performance (Last), evaluation of classification effectiveness, and resistance to forgetting. The results show that task-specific routers contribute more to reducing forgetting than increasing the number of experts. Achieving optimal performance through task-aware routing and an appropriate number of experts confirms the effectiveness of the hybrid expert adapter module.
[0167] Table 3 Ablation test results of the hybrid expert adapter module of the present invention
[0168]
[0169] To verify the effectiveness of the proposed task self-discovery module, an ablation experiment was designed, as shown in Table 4. Here, SSAST represents using only the pre-trained model as the encoder, MoE-Adapter is the hybrid expert adapter module (added to SSAST without task type information guidance), and TaskID represents using only task labels to guide routing. RA-TID is the task self-discovery module, representing using task type vectors to guide routing. △1 represents the difference in overall accuracy (Acc) compared to the proposed method (Ours), and △2 represents the difference in final performance (Last) compared to the proposed method (Ours). Experimental results show that, compared to routing guided only by task labels, the proposed method achieves higher task relevance through task vector feature fusion. This allows the hybrid expert adapter module to more appropriately select experts consistent with the task, validating the effectiveness of the proposed task self-discovery module.
[0170] Table 4 Ablation Experiment Results of the Self-Discovery Module of this Invention
[0171]
[0172] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for underwater acoustic target recognition based on autonomous task perception, characterized in that: The methods include: S1. Preprocess the underwater acoustic signal to obtain the time spectrum. Input the time spectrum into the audio spectrum Transformer backbone network for feature extraction. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features. S2. Input the time-spectrum image into the trained task type extraction network. The task type extraction network extracts features from the time-spectrum image to obtain the task embedding vector. Calculate the similarity score between the task embedding vector and the task prototype in the playback memory. When the maximum similarity score is greater than the set threshold, output the task representation vector and proceed to step S3. Otherwise, input the deep features output from the last Transformer layer into the classifier and output the classification result. S3. Select a router based on the task representation vector. The router selects the trained expert network based on the sparse selection mechanism and calculates the gating weights of each expert network. The trained expert networks process the general acoustic features in parallel. The outputs of the trained expert networks are fused according to the gating weights to obtain fused features. The deep features and fused features are fused to obtain enhanced features. The enhanced features output by each Transformer layer are used as the input of the next Transformer layer. The enhanced features output by the last Transformer layer are fed into the classifier to output the classification result.
2. The underwater acoustic target recognition method based on autonomous task perception according to claim 1, characterized in that: The audio spectrum Transformer backbone network consists of an image patch embedding module and 12 stacked Transformer layers. Each Transformer layer includes a layer normalization module, an MHSA module, a layer normalization module, and a feedforward neural network connected in sequence. The time spectrum image enters the image patch embedding module and is segmented into 16×16 image patches. The image patches enter the layer normalization module for linear transformation to obtain embedding vectors, and learnable positional codes are added. The embedding vectors enter the MHSA module for feature extraction to obtain general acoustic features. The general acoustic features are then processed by the layer normalization module and the feedforward neural network to obtain deep features.
3. The underwater acoustic target recognition method based on autonomous task perception according to claim 1, characterized in that: The trained task type extraction network consists of multiple 5×5 deep convolutional kernels, multiple 3×3 deep convolutional kernels, and self-attention pooling layers connected in sequence. Each convolutional layer is followed by normalization and ReLU activation.
4. The underwater acoustic target recognition method based on autonomous task perception according to claim 1, characterized in that: The similarity score calculation process includes: Compute task embedding vector Mahalanobis distance metric from the mission prototype : in, , They are the first The mean and covariance of each task prototype; Mahalanobis distance measurement uses temperature parameters Converting the exponential function to a similarity score : .
5. The underwater acoustic target recognition method based on autonomous task perception according to claim 1, characterized in that: The router selects the trained expert networks based on a sparse selection mechanism and calculates the gating weights for each trained expert network. The process includes: Router for task representation vector Perform a linear transformation to obtain the features : K expert networks G are selected based on the Top-K sparse selection mechanism; Calculate the gating weights for each trained expert network. : in, This is the weight matrix. For bias vectors, .
6. The underwater acoustic target recognition method based on autonomous task perception according to claim 1, characterized in that: Enhanced features for: in, For the first Gating weights of an expert network, Indicates the first Forward computation of an expert network, These are general acoustic characteristics.
7. The underwater acoustic target recognition method based on autonomous task perception according to claim 1, characterized in that: The trained expert network consists of a dimensionality reduction layer, a ReLU activation function, and a dimensionality increase layer connected in sequence. General acoustic features are input into the expert network. The dimensionality reduction layer compresses the 768-dimensional features to 192 dimensions. The 192-dimensional features are linearly transformed by the ReLU activation function. The linearly transformed features are then processed by the dimensionality increase layer to restore the dimensionality to 768 dimensions.
8. The underwater acoustic target recognition method based on autonomous task perception according to claim 1, characterized in that: The task type extraction network and expert network are obtained through incremental training. The training process includes: S31. Mix the new task data with the old samples in the playback memory in an equal proportion to obtain training data. Preprocess the training data to obtain preprocessed training data. S32. Preprocess the training data to obtain the time-spectrum graph. Input the time-spectrum graph into the audio spectrum Transformer backbone network for feature extraction. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features. S33. Input the time-spectrum image into the task type extraction network. After the task type extraction network extracts features from the time-spectrum image, it obtains the task embedding vector. Calculate the similarity score between the task embedding vector and the task prototype in the playback memory. When the maximum similarity score is greater than the set threshold, output the task representation vector and dynamically update the set threshold, then proceed to step S34. Otherwise, input the deep features output from the last Transformer layer into the classifier, output the classification result, and dynamically update the playback memory. S34. Select a router based on the task representation vector. The router selects the trained expert network based on the sparse selection mechanism, calculates the gating weight of each expert network, and processes the general acoustic features in parallel. The output of the trained expert network is fused according to the gating weight to obtain the fused features. The deep features and the fused features are fused to obtain the enhanced features. The enhanced features output by each Transformer layer are used as the input of the next Transformer layer. The enhanced features output by the last Transformer layer are fed into the classifier to output the classification result. S35. When the loss function is minimized or the set number of training iterations are reached, the trained task type extraction network and expert network are obtained.
9. The underwater acoustic target recognition method based on autonomous task perception according to claim 1, characterized in that: loss function for: For classification cross-entropy loss, expert load balancing loss is used. for: in, Selecting frequencies for expert networks , Indicates whether the nth sample selected the expert network. i , N The total number of samples, Assuming a uniform prior distribution, , The total number of experts, is the regularization coefficient.
10. An underwater acoustic target recognition system based on autonomous task perception, characterized in that: The system includes: The feature extraction module is used to preprocess the underwater acoustic signal to obtain the time-spectrum map. The time-spectrum map is then input into the audio spectrum Transformer backbone network for feature extraction. The MHSA module of each Transformer layer outputs general acoustic features, and the feedforward neural network outputs deep features. The task self-discovery module is used to input the time spectrogram into the trained task type extraction network. After the task type extraction network extracts features from the time spectrogram, it obtains the task embedding vector. It calculates the similarity score between the task embedding vector and the task prototype in the playback memory. When the maximum similarity score is greater than a set threshold, it outputs the task representation vector and enters the hybrid expert adapter module. Otherwise, it inputs the deep features output from the last Transformer layer into the classifier and outputs the classification result. The hybrid expert adapter module is used to select a router based on the task representation vector. The router selects the trained expert network based on the sparse selection mechanism, calculates the gating weights of each expert network, and the trained expert network processes the general acoustic features in parallel. The outputs of the trained expert network are fused according to the gating weights to obtain fused features. The deep features and fused features are fused to obtain enhanced features. The enhanced features output by each Transformer layer are used as the input of the next Transformer layer. The enhanced features output by the last Transformer layer are fed into the classifier to output the classification result.