One-dimensional sonar data recognition method based on category incremental learning
Patent Information
- Application Number
- CN202310463013.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2043-04-26
AI Technical Summary
然而,传统的深度学习方法存在一个重要问题,即类别数量固定,当需要增加新类别时,需要重新训练整个模型,这不仅消耗大量计算资源,而且可能导致灾难性遗忘,即模型在学习新类别的过程中遗忘原有类别的知识
[0048]1、本发明通过类增量学习解决水声问题。传统的声呐数据处理方法通常需要大量标注数据来训练模型,并且在新类别出现时需要重新训练整个模型。本发明采用类增量学习的动态可扩展表征策略,使得在新类别出现时,不需要重新训练整个模型,仅需更新超特征提取器和分类器。这种创新性的应用使得水声问题处理变得更为高效和灵活,特别是在实际应用场景中,声呐数据可能随时出现新的类别,采用类增量学习方法能够显著降低模型更新的成本和复杂度。
Smart Images

Figure CN117786448B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of artificial intelligence and underwater acoustic electronic information, specifically relating to a one-dimensional sonar data recognition method based on category incremental learning. Background Technology
[0002] Sonar technology is currently one of the main means of underwater detection, monitoring, and communication. Unlike traditional optical detection technologies, sound waves can penetrate deeper areas of seawater, offering advantages such as greater depth, wider range, and lower cost. Therefore, it has wide applications in military, civilian, and marine resource development fields. Underwater target detection and identification is a continuously developing and important technology based on sonar technology, information science, computer science, artificial intelligence, and other fields. It is also a crucial component of modern sonar systems and underwater acoustic countermeasures, a key research focus for maritime security in every country, and has consistently received widespread attention from all sectors of society, technical personnel, and military departments. It is also one of the key issues that the Chinese Navy urgently needs to address.
[0003] However, due to the complex and variable marine environment, severe noise interference, and unclear target features, the classification and identification of sonar data still faces significant challenges. Traditional sonar target identification methods are mainly based on feature engineering, which involves manually designing feature extractors to extract target features and then using classifiers for classification. This method can achieve certain results in specific scenarios, but for targets of unknown categories and new environments, extensive feature engineering adjustments are required. In recent years, the development of deep learning technology has provided new ideas for sonar target identification. By constructing deep neural networks, the feature representation of targets can be automatically learned and classified. However, traditional deep learning methods have a significant problem: the number of categories is fixed. When a new category needs to be added, the entire model needs to be retrained. This not only consumes a lot of computational resources but may also lead to catastrophic forgetting, that is, the model forgets knowledge of the original categories while learning new categories.
[0004] In 2006, Geoffrey Hinton proposed the deep learning method. Since then, deep learning has achieved tremendous success in many fields and has received widespread attention. In 2012, Hinton's research group used deep learning to win the ImageNet image classification competition, significantly reducing the error rate to 15.315%, far surpassing traditional image processing methods, marking the most influential breakthrough of deep learning in the field of computer science. Meanwhile, the application of deep learning in object recognition has continued to develop. In the ILSVRC 2014 competition, the winner, GooLeNet, reduced the top-5 error rate to 6.656%. In July 2017, the top-5 error rate of the deep learning algorithm SE-ResNeXt-152 on the dataset was only 2.251%, far exceeding the error rate of manual annotation (5%). In the field of computer vision, the EfficientNet series of models was proposed in 2019, achieving higher performance with lower parameters and computational complexity through automatic network structure search and model scaling strategies. Furthermore, in the fields of object detection and instance segmentation, a series of advanced algorithms such as Mask R-CNN, YOLOv4, and YOLOv5 have emerged, providing more powerful tools for object recognition in complex scenes. In the fields of speech recognition and generation, the emergence of neural network models such as WaveNet and Tacotron has greatly improved the performance of speech synthesis and automatic speech recognition. Meanwhile, end-to-end speech recognition systems such as DeepSpeech2 have also made significant progress, significantly improving the performance of speech recognition in complex environments. Beyond image classification and speech recognition, deep learning has achieved astonishing results in multiple fields such as face recognition, object detection, and video analysis. Currently, well-known high-tech companies with vast amounts of data, such as Google, Microsoft, and Baidu, are investing heavily in deep learning to seize the technological high ground, achieving numerous excellent results in various fields. All of the above demonstrates the enormous potential and superiority of deep learning technology.
[0005] Based on a survey and analysis of cutting-edge deep learning methods, this invention proposes a dynamic and scalable representation for incremental learning of one-dimensional sonar data categories to address the aforementioned problems. This method employs an incremental learning approach, enabling the learning of newly added one-dimensional sonar category data without retraining the entire model, while maintaining high classification accuracy and avoiding catastrophic forgetting. Summary of the Invention
[0006] The purpose of this invention is to provide a one-dimensional sonar data recognition method based on category incremental learning.
[0007] This invention provides a one-dimensional sonar data recognition method based on category incremental learning, comprising the following steps:
[0008] Step 1: Construct the initial training set; the initial training set contains target samples of all categories that need to be identified.
[0009] Step 2: Construct a dynamically scalable representation network for incremental category learning. The dynamically scalable representation network consists of one or more feature extraction network units and a fully connected layer. The output features of all feature extraction network units are fed into the fully connected layer. The initial number of feature extraction network units is one; one more feature extraction network unit is added each time a new category task is encountered.
[0010] A feature extraction network unit comprises an input layer, a first stage, a second stage, and a third stage connected in sequence. The first stage comprises three residual blocks, each with two convolutional layers. The second stage comprises three residual blocks, each with two convolutional layers. The input layer and the output data of the first stage both have 16 channels. The first convolutional layer of the first residual block of the second stage increases the number of channels in the output data of the first stage from 16 to 32. The third stage comprises three residual blocks, each with two convolutional layers. The first convolutional layer of the first residual block of the third stage increases the number of channels in the output data of the second stage from 32 to 64.
[0011] Step 3: Perform initial training on the dynamic scalable representation network obtained in Step 2 using the initial training set. After the initial training is complete, select multiple samples that can represent each category from the samples corresponding to each category, based on the initial training set, as the training auxiliary dataset.
[0012] Step 4: Use the Dynamically Scalable Representation Network (DRM) to identify the one-dimensional sonar data. Whenever a new category is added, an additional feature extraction network unit is added to the DRM. The sample dataset corresponding to the added category is combined with the current training auxiliary dataset to obtain an incremental training set for incremental class training. The updated DRM is then used to incrementally train the DRM.
[0013] After incremental training is completed, based on the current incremental training set, select multiple samples that can represent each category from each sample to serve as the updated training auxiliary dataset.
[0014] Preferably, the samples in the initial training set mentioned in step 1 are obtained by preprocessing the original audio signal and extracting the MFCC features of the original audio signal.
[0015] As a preferred embodiment, the specific process of preprocessing in step 1 is as follows:
[0016] 1-1. First, the audio is divided into slices of fixed length and stored in a list.
[0017] 1-2. Calculate the MFCC features of the audio slice. Set the number of MFCC coefficients to be extracted, n_mfcc, and the number of time frames, t, and build an MFCC feature array.
[0018] 1-2-1. Process the original audio signal by pre-emphasizing it.
[0019] 1-2-2. Divide the audio signal into frames to obtain multiple data frames.
[0020] 1-2-3. Apply a window function to each data frame.
[0021] 1-2-4. Apply Fast Fourier Transform to each data frame to obtain the power spectrum.
[0022] 1-2-5. Map the power spectrum onto the Mel scale to obtain the logarithmic value of the Mel filter bank response.
[0023] 1-2-6. Applying the discrete cosine transform to the logarithmic value of the Mel filter bank response converts the logarithmic value of the Mel filter bank response from the frequency domain to the cepstral domain, resulting in the MFCC feature array representing the characteristics of the audio signal.
[0024] 1-3. Transpose the MFCC feature array obtained in step 1-2 to obtain the MFCC feature transpose array.
[0025] 1-4. Along the time frame axis, calculate the average value of the MFCC features for the transposed array of MFCC features to obtain the MFCC feature vector.
[0026] 1-5. Add the calculated MFCC feature vector to the feature list of the sample, and add the corresponding class label to the label list of the sample.
[0027] Preferably, the input layer is a convolutional layer used to convert 40-channel data into 16-channel data, with a kernel size of 1, a stride of 1, and padding of 1.
[0028] As a preferred option, the kernel size of the convolutional layer in the first stage is 3, the stride is 1, the padding is 1, and the number of output channels is 16.
[0029] Preferably, in the first residual block of the second stage, the kernel size of the three convolutional layers is 3, the stride is 2, and the padding is 1. In the first residual block of the third stage, the kernel size of the three convolutional layers is 3, the stride is 3, and the padding is 1.
[0030] Preferably, the first residual block in the second stage also includes a downsampling layer; the downsampling layer increases the number of channels of the input features of the first residual block from 16 to 32, and then superimposes the output of the second convolutional layer of the first residual block into the second residual block. The kernel size of this downsampling layer is 1, and the stride is 2.
[0031] Preferably, the first residual block in the third stage also includes a downsampling layer; the downsampling layer increases the number of channels of the input features of the first residual block from 32 to 64, and then superimposes the output of the second convolutional layer of the first residual block into the second residual block. The kernel size of this downsampling layer is 1, and the stride is 3.
[0032] As a preferred option, the specific process of step 3 is as follows:
[0033] 3-1. Feed the training set data into the Dynamically Scalable Representation Network and initialize the optimizer, learning rate scheduler, and loss function of the Dynamically Scalable Representation Network.
[0034] 3-1-1. Obtain model parameters and create an optimizer. The optimizer used is the stochastic gradient descent optimizer.
[0035] 3-1-2. Create a learning rate scheduler.
[0036] 3-1-3. Initialize the loss function.
[0037] 3-1-4. Training the model involves iterating through batches of training data. For each batch: zero out the optimizer's gradients; feed the data into the dynamic scalable representation network for forward propagation to obtain the output; calculate the loss function value.
[0038] 3-2. Input the training set data into each feature extraction network unit in the Dynamically Scalable Representation Network and store the results in a feature list. Then, concatenate all feature vectors in the feature list.
[0039] 3-3. Using the feature vector obtained by concatenation in step 3-2 as input, the output is calculated through a fully connected layer.
[0040] As a preferred option, the specific process for incremental training in step 4 is as follows:
[0041] (1) During the update of the dynamic scalable representation network, the parameters of the newly added feature extraction network units are initialized to be consistent with any existing feature extraction network unit. The output features of the newly added feature extraction network units and the output features of the original feature extraction network units are input into the auxiliary classifier for binary classification and the auxiliary loss is obtained.
[0042] (2) Iterate through batches of training data in the incremental training set. For each batch: clear the gradient of the optimizer to zero; feed the data into the dynamic scalable representation network, perform forward propagation, and obtain the output results;
[0043] (3) Calculate the loss function value for incremental training. The loss function value for incremental training includes the main loss and the auxiliary loss. The main loss refers to the cross-entropy loss calculated between the output obtained from forward propagation and the label.
[0044] (4) Backpropagate the loss and calculate the gradient; update the model parameters using the optimizer; update the learning rate scheduler; calculate and output the average loss for each training round.
[0045] (5) The incremental training set data is processed through each feature extraction network unit in the Dynamically Scalable Representation Network, and the results are stored in the feature list. Then, all feature vectors in the feature list are concatenated.
[0046] (6) Use the feature vector obtained by splicing in step (5) as input and calculate the output through a fully connected layer.
[0047] The beneficial effects of this invention are:
[0048] 1. This invention solves underwater acoustic problems through incremental learning. Traditional sonar data processing methods typically require large amounts of labeled data to train the model, and the entire model needs to be retrained when a new category appears. This invention employs a dynamic and scalable representation strategy based on incremental learning, which eliminates the need to retrain the entire model when a new category appears; only the super-feature extractor and classifier need to be updated. This innovative application makes underwater acoustic problem processing more efficient and flexible, especially in real-world applications where new categories may appear in sonar data at any time. Incremental learning significantly reduces the cost and complexity of model updates.
[0049] 2. This invention possesses high-performance feature extraction and classification capabilities. It employs an improved ResNet20 as the feature extractor, combining it with MFCC feature vectors to preprocess one-dimensional sonar data, thereby enabling the model to achieve high-performance feature extraction. The design of the super-feature extractor and classifier allows the model to achieve high classification accuracy during incremental learning, meeting the classification performance requirements of practical applications.
[0050] 3. This invention possesses the ability to handle diverse sonar data. In practical applications, sonar data may exhibit diverse characteristics, including different target types, background noise, and signal propagation properties. This invention employs a dynamic and scalable representation method based on incremental learning, enabling it to adapt to various sonar data types while continuously learning new categories. This adaptability gives the model better practicality and robustness when facing diverse sonar data. Attached Figure Description
[0051] Figure 1 This is the overall flowchart of the present invention.
[0052] Figure 2 This is a flowchart of the preprocessing process in step 1 of the present invention.
[0053] Figure 3 This is a structural diagram of the dynamically scalable representation network in this invention.
[0054] Figure 4 The diagram shows the loss curves of this invention on the ShipEar dataset (the four curves from left to right correspond to the loss curves of the initial training, the first incremental training, the second incremental training, and the third incremental training, respectively).
[0055] Figure 5 This is a graph showing the accuracy of the model on the ShipEar dataset (the four curves from left to right correspond to the accuracy curves of the initial training, the first incremental training, the second incremental training, and the third incremental training, respectively). Detailed Implementation
[0056] The present invention will be further described below with reference to the accompanying drawings.
[0057] like Figure 1 As shown, the specific steps of a one-dimensional sonar data recognition method based on category incremental learning are as follows:
[0058] Step 1, as follows Figure 2 As shown, an initial training set is constructed; the initial training set contains target samples of all categories that need to be identified. The samples in the initial training set are obtained by preprocessing the original audio signal to extract the MFCC (Mel-frequency cepstral coefficients) features of the original audio signal.
[0059] 1-1. First, the audio is divided into slices of fixed length and stored in a list.
[0060] 1-2. Calculate the MFCC features of the audio slice. Set the number of MFCC coefficients to be extracted, n_mfcc, and the number of time frames, t. Return an MFCC feature array of shape (n_mfcc, t).
[0061] The specific steps are as follows:
[0062] 1-2-1. Pre-emphasis: Processing the original audio signal by pre-emphasis to reduce the energy of the lower frequency components (specifically frequencies below 1kHz) in the signal. This helps to balance the spectrum of the audio signal, enabling more accurate feature extraction in subsequent steps.
[0063] 1-2-2. Framing: Convert the audio signal into a series of data frames (i.e., short-time signals) to facilitate spectrum analysis in the following steps.
[0064] 1-2-3. Window function: Apply a window function to each data frame to reduce signal distortion at frame boundaries and eliminate signal discontinuities at frame boundaries, thereby making the signal more suitable for Fourier transform in the following steps.
[0065] 1-2-4. Fast Fourier Transform (FFT): Applying the FFT to each data frame converts the audio signal from the time domain to the frequency domain, resulting in the spectrum of each frame, represented as a sequence of complex values. The power spectrum is calculated from the frequency domain signal obtained from the FFT; the power spectrum is obtained by calculating the squared magnitude of each frequency component of the frequency domain signal, thus obtaining the energy distribution of each frame.
[0066] 1-2-5. The power spectrum is mapped onto a Mel scale, a scale based on human auditory perception that makes the features more consistent with the response characteristics of the human auditory system. It consists of a set of triangular filters uniformly distributed on the Mel scale. The filters are applied to the power spectrum, and then the outputs of each filter are summed to obtain the filter bank response. Logarithmic compression is performed by taking the logarithm of the Mel filter bank response to further refine the features and make them more consistent with the response characteristics of the human auditory system.
[0067] 1-2-6. Discrete Cosine Transform (DAC): Applying the Discrete Cosine Transform to the logarithmic value of the Mel filter bank response transforms it from the frequency domain to the cepstral domain. The DAC can extract the spectral peaks of the signal and can decorrelate highly correlated filter responses. This ultimately yields the MFCC feature array representing the characteristics of the audio signal.
[0068] 1-3. Transpose the MFCC feature array obtained in step 1-2 to obtain the transposed MFCC feature array. This gives the new array shape (t, n_mfcc). The purpose of this step is to ensure that the calculation of the average value is performed along the correct axis.
[0069] 1-4. Calculate the average value of the MFCC features along the time frame axis (axis=0) on the transposed array of MFCC features. This simplifies the transposed array of MFCC features of shape (t, n_mfcc) to an MFCC feature vector of shape (n_mfcc,). The purpose of calculating the average value is to extract a unified feature representation from multiple time frames, which facilitates subsequent model training and classification.
[0070] 1-5. Add the calculated MFCC feature vectors to the feature list and the corresponding class labels to the label list. After all files have been processed, convert the feature vectors and label lists into NumPy arrays and save them to an NumPy file.
[0071] Step 2, as follows Figure 1 , Figure 3 As shown, a dynamic and scalable representation network for incremental category learning is constructed.
[0072] The dynamically scalable representation network for incremental category learning changes as the task increases. The initial network uses a 20-layer deep residual network, consisting of three stages, each containing several residual blocks. Each residual block contains two convolutional layers, and the network output is classified through a fully connected layer. The specific structure is as follows:
[0073] 2-1. Input layer: First, the input data goes through a convolutional layer to convert the 40-channel data into 16 channels. The convolutional kernel size is 1, the stride is 1, and the padding is 1.
[0074] 2-2. First stage: Contains 3 residual blocks. Each residual block contains two convolutional layers (conv_a and conv_b), with a kernel size of 3, a stride of 1, and padding of 1. All convolutional layers in this stage have 16 input and output channels.
[0075] 2-3. Second Stage: Contains 3 residual blocks. The first residual block consists of two contiguous convolutional layers. The output channels of the convolutional layers are 32, the kernel size is 3, the stride is 2, and the padding is 1. The first convolutional layer increases the number of channels of the output data from the first stage from 16 to 32. The first residual block also contains a downsampling layer, which increases the number of input channels from 16 to 32, with a kernel size of 1 and a stride of 2; this allows the output of the downsampling layer to be superimposed with the output of the convolutional layer.
[0076] The last two residual blocks of the second stage each contain two convolutional layers connected in sequence; the kernel size, stride, and padding of the convolutional layers in the last two residual blocks of the second stage are consistent with those of the convolutional layers in the first residual block of the second stage, and the number of input and output channels is 32.
[0077] 2-4. Third Stage: Similar to the first two stages, it contains three residual blocks. The first residual block consists of two convolutional layers connected in sequence. The output channels of the convolutional layers are 64, the kernel size is 3, the stride is 3, and the padding is 1. The first convolutional layer increases the number of channels of the output data from the second stage from 32 to 64. The first residual block also contains a downsampling layer, which increases the number of input channels from 32 to 64, with a kernel size of 1 and a stride of 3; this allows the output of the downsampling layer to be superimposed on the output of the convolutional layer.
[0078] The last two residual blocks of the third stage each contain two convolutional layers connected in sequence; the kernel size, stride, and padding of the convolutional layers in the last two residual blocks of the third stage are consistent with those of the convolutional layers in the first residual block of the third stage, and the number of input and output channels is 64.
[0079] 2-5. Fully Connected Layer: The 64-channel features extracted in step 2-4 are classified through a fully connected layer. With 64 input features and 10 output features, this network can classify a maximum of 10 categories.
[0080] The input layer, the first stage, the second stage, and the third stage constitute a feature extraction network unit in the Dynamically Scalable Representation Network. Initially, the Dynamically Scalable Representation Network has only one feature extraction network unit; as the number of categories and tasks increases, the number of feature extraction network units increases accordingly, thereby achieving the scalability of the Dynamically Scalable Representation Network.
[0081] Step 3: Set the initial training data and incremental training data, and set the learning rate decay step size and learning rate decay base. The data information includes the initial number of categories, the number of categories to be learned incrementally, and the size of the data sample set. Construct the initial training set, which contains target samples of all categories that need to be identified. Use the initial training set to perform initial training on the dynamic scalable representation network for incremental learning of one-dimensional sonar data categories obtained in Step 2.
[0082] 3-1. Feed the training set data into the Dynamically Scalable Representation Network (DRM). The training set data first passes through one or more feature extraction network units (since this is the initial training, there will only be one unit, as described in step 2), and then through fully connected layers and auxiliary fully connected layers. After the training set data enters the network, the optimizer, learning rate scheduler, and loss function are initialized. The specific process is as follows:
[0083] 3-1-1. Obtain model parameters and create an optimizer. The optimizer used is a stochastic gradient descent (SGD) optimizer; the momentum, weight decay, and learning rate parameters in the optimizer are set in advance.
[0084] 3-1-2. Create a learning rate scheduler based on the set learning rate decay step size and learning rate decay base. The learning rate scheduler can adjust the learning rate during training according to a predetermined strategy; here, a strategy of decaying the learning rate at regular intervals is used.
[0085] 3-1-3. Initialize the loss function. This invention uses cross-entropy loss as the loss function for the task with added categories.
[0086] 3-1-4. Training the model, iterating through batches of training data. For each batch: move the input data and labels to the appropriate device (CPU or GPU); clear the optimizer's gradients to zero; feed the input data into the model, perform forward propagation, and obtain the output; calculate the loss function value. Here, the output obtained from forward propagation and the labels are used to calculate the cross-entropy loss; backpropagation loss is used to calculate the gradient; the optimizer is used to update the model parameters; the learning rate scheduler is updated; the average loss for each batch is calculated and output.
[0087] 3-2. The input training set data is processed through each feature extraction network unit in the Dynamically Scalable Representation Network, and the results are stored in a feature list. Then, all feature vectors in the feature list are concatenated along the second dimension (i.e., the number of channels) to form a longer feature vector, features.
[0088] 3-3. Using the feature vectors obtained by concatenation in step 3-2 as input, the output out is calculated through a fully connected layer.
[0089] 3-4. Based on the initial training set, select multiple samples that can represent each category from each sample set corresponding to each category, and use them as training auxiliary datasets; in the next category addition task, use the training auxiliary dataset and the sample dataset corresponding to the added category to form a new training set.
[0090] Choose the update method for the training auxiliary dataset based on whether a fixed memory size is used.
[0091] If a fixed memory size is used, only samples of the new category are added each time the training auxiliary dataset is updated. The specific steps are as follows: In the task of adding a new category, a new training set is constructed. First, the mean of the old category is calculated, then the sample set of the new category is constructed and its mean is calculated. When constructing the sample set of the new category, the samples that best represent that category are selected as samples in the training auxiliary dataset. The process of selecting the most representative sample of the category is: calculate the distance between each sample and the mean of other samples in that category, and select the sample with the smallest distance.
[0092] If a fixed memory size is not used, then during each update of the training auxiliary dataset, for every new class sample added, one old class sample is deleted, keeping the number of samples in the training auxiliary dataset constant. Specifically, the sample set of the old class is reduced. The amount reduced depends on the size of the sample set for each class. This ensures that the overall size of the sample set always remains within the set range. The sample set for the new class is then constructed. Similar to the fixed memory size method, the sample that best represents the class is selected as the final sample.
[0093] The training auxiliary dataset is used for incremental training of the dynamically scalable representation network, which can learn information about new categories on new tasks while retaining knowledge of known categories.
[0094] Step 4: Use a Dynamically Scalable Representation Network to identify the one-dimensional sonar data. Whenever a category addition task is encountered, the Dynamically Scalable Representation Network is trained incrementally based on the newly added category and its corresponding sample dataset. A category addition task means adding one or more target categories to the existing identified target categories.
[0095] The specific process of incremental training of the dynamic scalable representation network is as follows:
[0096] 4-1. Obtain the sample dataset corresponding to the added category; construct the training set for incremental training; the newly constructed training set is obtained by combining the sample dataset corresponding to the added category with the current training auxiliary dataset (the combination method can be either direct superposition or superposition with deletion).
[0097] 4-2. Update the Dynamically Scalable Representation Network by feeding the training set data into the updated network. The updated network then uses the training set data to incrementally train on the new category of sonar data. The specific process is as follows:
[0098] 4-2-1. Update the Dynamically Scalable Representation Network: Add an additional feature extraction network unit to the Dynamically Scalable Representation Network; initialize the parameters of the new feature extraction network unit to be consistent with the original feature extraction network unit. The output features of the new feature extraction network unit and the output features of the original feature extraction network unit are input into the auxiliary classifier for binary classification (divided into new target category and old target category), and the auxiliary loss is obtained.
[0099] 4-2-2. Iterate through batches of training data. For each batch: move the input data and labels to the appropriate device (CPU or GPU); clear the optimizer's gradients to zero; feed the input data into the model, perform forward propagation, and obtain the output results;
[0100] 4-2-3. Calculate the loss function value. This step requires calculating two parts of the loss: the main loss and the auxiliary loss. The main loss is the cross-entropy loss calculated using the output results obtained from forward propagation and the labels. The auxiliary loss is the cross-entropy loss calculated using the auxiliary output results and the labels of the auxiliary task. The labels of the auxiliary task represent their positions in the label space of the newly added categories. The total loss value is the weighted sum of the main loss and the auxiliary loss.
[0101] 4-2-4. Backpropagate loss and calculate gradient; update model parameters using the optimizer; update the learning rate scheduler; calculate and output the average loss for each training round (i.e., one epoch).
[0102] 4-3. The input data is processed through each feature extraction network unit in the Dynamically Scalable Representation Network, and the results are stored in a feature list. Then, all feature vectors in the feature list are concatenated along the second dimension (i.e., the number of channels) to form a longer feature vector.
[0103] 4-4. Using the feature vector obtained by concatenation in step 4-3 as input, the output out is calculated through a fully connected layer.
[0104] 4-5. Update the training auxiliary dataset. For all categories after adding tasks to the execution category, select multiple samples that can represent each category from each sample and use them as the updated training auxiliary dataset.
[0105] This embodiment was validated using the ShipEar public dataset for underwater acoustic targets. The database consists of 90 records representing sounds from 11 types of ships. Due to the basic requirements of incremental learning for the number of samples, four types of data with too short a duration were removed, and the remaining seven types of data were used for validation. Figure 4 , Figure 5 The images in the diagram, from left to right, represent the curves for the initial training (4 classes of data) and the subsequent addition of one class of data. This embodiment demonstrates excellent performance in incremental learning training with one-dimensional sonar data, achieving accuracies of 99.08%, 98.58%, 95.24%, and 94.82%, respectively. This superior performance is attributed to the dynamically scalable representation method, which enables the model to maintain a high level of classification accuracy while continuously learning new categories, avoiding catastrophic forgetting. Simultaneously, the improved ResNet20 feature extractor and MFCC feature preprocessing ensure the model has efficient feature extraction capabilities, laying the foundation for accurate identification of various sonar targets.
Claims
1. A one-dimensional sonar data recognition method based on category incremental learning, characterized in that: Includes the following steps: Step 1: Construct the initial training set; The initial training set contains target samples for all categories that need to be identified. Step 2: Construct a dynamically scalable representation network for incremental category learning; the dynamically scalable representation network includes one or more feature extraction network units and a fully connected layer; the output features of all feature extraction network units are fed into the fully connected layer; the initial number of feature extraction network units is one; each time a category increase task is encountered, one more feature extraction network unit is added. A feature extraction network unit comprises an input layer, a first stage, a second stage, and a third stage connected in sequence. The first stage comprises three residual blocks, each with two convolutional layers. The second stage comprises three residual blocks, each with two convolutional layers. The input layer and the output data of the first stage both have 16 channels. The first convolutional layer of the first residual block of the second stage increases the number of channels of the output data of the first stage from 16 to 32. The third stage comprises three residual blocks, each with two convolutional layers. The first convolutional layer of the first residual block of the third stage increases the number of channels of the output data of the second stage from 32 to 64. Step 3: Initially train the dynamic scalable representation network obtained in Step 2 using the initial training set; After the initial training is completed, based on the initial training set, select multiple samples that can represent each category from each sample to serve as the training auxiliary dataset. Step 4: Use the Dynamically Extensible Representation Network to identify the one-dimensional sonar data; whenever a new category is encountered, add an additional feature extraction network unit to the Dynamically Extensible Representation Network. The sample dataset corresponding to the added category is combined with the current training auxiliary dataset to obtain the incremental training set for class incremental training. The updated dynamic scalable representation network is incrementally trained using the obtained incremental training set. After incremental training is completed, based on the current incremental training set, select multiple samples that can represent each category from each sample to serve as the updated training auxiliary dataset.
2. The one-dimensional sonar data recognition method based on category incremental learning according to claim 1, characterized in that: The samples in the initial training set mentioned in step 1 are obtained by preprocessing the original audio signal and extracting the MFCC features of the original audio signal.
3. The one-dimensional sonar data recognition method based on category incremental learning according to claim 1, characterized in that: The specific preprocessing steps in step 1 are as follows: 1-1. First, divide the audio into slices of fixed length and store them in a list; 1-2. Calculate the MFCC features of the audio slice; Set the number of MFCC coefficients to be extracted, n_mfcc, and the number of time frames, t, and establish an MFCC feature array; 1-2-1. Process the original audio signal by pre-emphasizing it; 1-2-2. Divide the audio signal into frames to obtain multiple data frames; 1-2-3. Apply a window function to each data frame; 1-2-4. Apply Fast Fourier Transform to each data frame to obtain the power spectrum; 1-2-5. Map the power spectrum onto the Mel scale to obtain the logarithmic value of the Mel filter bank response; 1-2-6. Applying the discrete cosine transform to the logarithmic value of the Mel filter bank response converts the logarithmic value of the Mel filter bank response from the frequency domain to the cepstral domain, resulting in the MFCC feature array representing the characteristics of the audio signal; 1-3. Transpose the MFCC feature array obtained in step 1-2 to obtain the MFCC feature transpose array; 1-4. Calculate the average value of the MFCC features along the time frame axis for the transposed array of MFCC features to obtain the MFCC feature vector; 1-5. Add the calculated MFCC feature vector to the feature list of the sample, and add the corresponding class label to the label list of the sample.
4. The one-dimensional sonar data recognition method based on category incremental learning according to claim 1, characterized in that: The input layer is a convolutional layer used to convert 40-channel data into 16-channel data. Its convolutional kernel size is 1, stride is 1, and padding is 1.
5. The one-dimensional sonar data recognition method based on category incremental learning according to claim 1, characterized in that: In the first stage, the convolutional layer has a kernel size of 3, a stride of 1, padding of 1, and 16 output channels.
6. The one-dimensional sonar data recognition method based on category incremental learning according to claim 1, characterized in that: In the first residual block of the second stage, the kernel size of the three convolutional layers is 3, the stride is 2, and the padding is 1. In the first residual block of the third stage, the kernel size of the three convolutional layers is 3, the stride is 3, and the padding is 1.
7. The one-dimensional sonar data recognition method based on category incremental learning according to claim 1, characterized in that: The first residual block in the second stage also includes a downsampling layer; the downsampling layer increases the number of channels of the input features of the first residual block from 16 to 32, and then superimposes the output of the second convolutional layer of the first residual block into the second residual block; the kernel size of the downsampling layer is 1, and the stride is 2.
8. The one-dimensional sonar data recognition method based on category incremental learning according to claim 1, characterized in that: The first residual block in the third stage also includes a downsampling layer; the downsampling layer increases the number of channels of the input features of the first residual block from 32 to 64, and then superimposes the output of the second convolutional layer of the first residual block into the second residual block; the kernel size of the downsampling layer is 1, and the stride is 3.
9. The one-dimensional sonar data recognition method based on category incremental learning according to claim 1, characterized in that: The specific process of step 3 is as follows: 3-1. Feed the training set data into the Dynamically Scalable Representation Network and initialize the optimizer, learning rate scheduler, and loss function of the Dynamically Scalable Representation Network; 3-1-1. Obtain model parameters and create an optimizer; the optimizer used is a stochastic gradient descent optimizer. 3-1-2. Create a learning rate scheduler; 3-1-3. Initialize the loss function; 3-1-4. Train the model, iterating through batches of training data; for each batch: clear the optimizer's gradient to zero; feed the data into the dynamic scalable representation network, perform forward propagation, and obtain the output results; calculate the loss function value; 3-2. Input the training set data into each feature extraction network unit in the Dynamically Scalable Representation Network and store the results in the feature list; Next, all feature vectors in the feature list are concatenated; 3-3. Using the feature vector obtained by concatenation in step 3-2 as input, the output is calculated through a fully connected layer.
10. The one-dimensional sonar data recognition method based on category incremental learning according to claim 1, characterized in that: The specific process of incremental training in step 4 is as follows: (1) During the process of updating the dynamic scalable representation network, the parameters of the newly added feature extraction network unit are initialized to be consistent with any existing feature extraction network unit; the output features of the newly added feature extraction network unit and the output features of the original feature extraction network unit are input into the auxiliary classifier for binary classification and the auxiliary loss is obtained. (2) Traverse the batches of training data in the incremental training set; for each batch: clear the gradient of the optimizer to zero; feed the data into the dynamic scalable representation network, perform forward propagation, and obtain the output results; (3) Calculate the loss function value for incremental training; the loss function value for incremental training includes the main loss and the auxiliary loss; the main loss refers to the cross-entropy loss calculated between the output obtained by forward propagation and the label; (4) Backpropagate the loss and calculate the gradient; update the model parameters using the optimizer; update the learning rate scheduler; calculate and output the average loss for each training round. (5) Extract the incremental training set data through each feature extraction network unit in the dynamic scalable representation network and store the results in the feature list; Next, all feature vectors in the feature list are concatenated; (6) Use the feature vector obtained by splicing in step (5) as input and calculate the output through a fully connected layer.