An end-to-end speech recognition incremental learning method and system based on knowledge distillation

Through knowledge distillation and text clustering technology, the multi-task objective function and Grad-cam++ method are designed to realize the rapid adaptation of the end-to-end speech recognition model to new scene data and the retention of old data sets, solving the problem of catastrophic forgetting and reducing save time and computational cost.

CN115064155BActive Publication Date: 2024-09-06FUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210652586.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-09
Publication Date
2024-09-06
Estimated Expiration
2042-06-09

AI Technical Summary

Technical Problem

End-to-end speech recognition has a catastrophic forgetting problem in fine-tune training of new tasks, resulting in a sharp increase in the error rate of old data sets, and incremental learning methods based on knowledge distillation require exposure to a large number of old data sets, time and computation The cost is high.

Method used

An end-to-end speech recognition incremental learning method based on knowledge distillation is adopted. By designing a multi-task objective function and the Grad-cam++ method, the output probability distribution of the student model is close to that of the teacher model, and a small amount of old data is extracted and added to the new data through the idea of ​​text clustering. Data set training, reducing dependence on old data sets.

Benefits of technology

Without any or a small amount of contact with old data sets, it can quickly adapt to new scene data, reduce the error rate of new scene data, and almost never forget old data sets, saving time and computing costs, and solving the problem of catastrophic forgetting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115064155B
    Figure CN115064155B
Patent Text Reader

Abstract

The present invention relates to an end-to-end speech recognition incremental learning method and system based on knowledge distillation. The method first initializes the speech recognition model into a teacher model and a student model; the first part of the encoder's objective function is to perform KL divergence on the output probability distribution of the encoders of the teacher and student models, and the second part is to use the Grad‑cam++ method to generate respective attention maps from the outputs of the encoders of the teacher and student models, and to transfer the attention maps; similarly, the decoder's objective function is calculated, and then the generated losses are linearly combined and the student model is trained under the cooperation of the original training strategy; at the same time, the labels of the old data set are clustered based on the text clustering idea, and a small amount of old data is extracted from each class and added to the new data set to train the student model. The method and system are conducive to solving the problem of catastrophic forgetting without contacting or only contacting the old data set in small quantities, and realizing the rapid fine-tuning convergence of the model on a small data set, thereby saving time and computing costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of speech recognition, and in particular relates to an end-to-end speech recognition incremental learning method and system based on knowledge distillation. Background Art

[0002] End-to-end speech recognition is a multi-classification problem that unifies acoustic and language models. Currently, this method has gradually reached or even surpassed traditional machine learning methods. However, multi-classification end-to-end speech recognition methods have catastrophic forgetting problems during fine-tuning of new tasks. Therefore, an effective training strategy is needed to minimize forgetting of old data sets while quickly reducing the error rate of new scene data.

[0003] The common fine-tune training method directly trains on the new data set without restrictions. Due to the inconsistent distribution of the new data set and other issues, it often leads to catastrophic forgetting, that is, the error rate of the old data set increases sharply. The incremental learning method based on knowledge distillation generally requires access to more old data sets or joint training with old data sets, but this is often limited in practical applications and consumes a lot of time and computational costs. It has broad application prospects in practice to achieve attention transfer through the constraints of effective objective functions and then realize incremental learning based on knowledge distillation without or with only a small amount of old data. Summary of the invention

[0004] The purpose of the present invention is to provide an end-to-end speech recognition incremental learning method and system based on knowledge distillation, which is conducive to solving the problem of catastrophic forgetting without contact or only a small amount of contact with old data sets, and realizing rapid fine-tuning and convergence of the model on a small data set, thereby saving time and computing costs.

[0005] To achieve the above-mentioned purpose, the technical solution adopted by the present invention is: an end-to-end speech recognition incremental learning method based on knowledge distillation, which realizes incremental learning by using the knowledge distillation framework and designing a multi-task objective function; first, the end-to-end speech recognition model is initialized as a teacher model and a student model; the first part of the encoder's objective function is to perform KL divergence on the output probability distribution of the encoders of the teacher model and the student model, so that the output probability distribution of the student model is as close to the teacher model as possible during the training process, and the second part is to use the Grad-cam++ method to generate respective attention maps from the outputs of the encoders of the teacher model and the student model, and transfer the attention maps of the teacher model and the student model; the same method is used to calculate the first and second parts of the decoder's objective function, and then the losses generated by the encoders and decoders of the teacher model and the student model are linearly combined and the student model is trained under the cooperation of the original training strategy, so that the student model can quickly adapt to the new scene data and forget less; at the same time, the labels of the old data set are clustered based on the idea of ​​text clustering, and a small amount of old data is extracted from each class and added to the new data set to train the student model, further ensuring that the student model will not forget the old data set.

[0006] Furthermore, the specific method to make the output probability distribution of the encoder or decoder of the teacher model and the student model as close as possible is:

[0007] The KL divergence of the output probability distribution of the encoder or decoder of the teacher model and the student model is performed, and the difference in the distribution between the two is calculated to obtain the first part of the multi-task objective function of incremental learning. The loss generated during the training process makes the output probability distribution of the student model as close as possible to the teacher model, controlling the student model's forgetfulness of the old data set.

[0008] Furthermore, the specific method of using the Grad-cam++ method to generate the attention maps of the teacher model and the student model is as follows:

[0009] The output of the encoder is selected as the feature map, and the weight matrix of the feature map is calculated using the Grad-cam++ idea. The weight matrix is ​​multiplied by the feature map element by element, and the influence of negative classes is removed through the ReLU function. Finally, the attention maps of the teacher model and the student model are obtained respectively. The decoders of the teacher model and the student model are processed in the same way to obtain their respective attention maps.

[0010] Furthermore, the specific method for transferring the attention maps of the teacher model and the student model is:

[0011] After the generated attention map is globally normalized, the influence of negative classes is filtered out through the ReLU function, and the L_2 norm of the attention map generated by the teacher model and the student model is calculated. The calculation result of this part is the second part of the multi-task objective function of incremental learning; the objective function of the encoder or decoder is a linear combination of the first and second parts of each.

[0012] Furthermore, the specific method of training the student model with the cooperation of the original training strategy is:

[0013] The original training strategy is to train the end-to-end speech recognition student model with time series classification CTC and cross entropy CE objective functions. The overall objective function of this method is a linear combination of the objective function generated by knowledge distillation and the original training strategy, so as to accelerate the rapid convergence of the objective function of the original training strategy and control forgetting.

[0014] Furthermore, the specific method of extracting old data for training based on the idea of ​​text clustering is:

[0015] Firstly, we use text-to-vec to embed the labels of the old dataset. Specifically, we use the CoSENT model to unify the labels into vectors of fixed length. Then, we use the k-means method to cluster the label vectors. The cluster center is larger than the preset value to eliminate the high semantic correlation of text-to-vec, so that the cluster categories can cover the old dataset from different texts and pronunciation information as much as possible. In each class, we extract a small amount of old data from the class center to the edge and add them to the new dataset to train the student model, so as to further ensure that the student model will not forget the old dataset.

[0016] The present invention also provides an incremental learning system for end-to-end speech recognition, including a memory, a processor, and computer program instructions stored in the memory and capable of being executed by the processor. When the processor executes the computer program instructions, the above-mentioned method steps can be implemented.

[0017] Compared with the prior art, the present invention has the following beneficial effects: the present invention can quickly adapt to the data set of the new scene without contacting the old data set or with a small amount of contact with the old data set, and the old data set is almost forgotten, while the wer / cer of the new scene data set drops rapidly. The present invention effectively solves the problem of catastrophic forgetting, so that retraining is no longer required under the business data of the new scene, which greatly saves time and computing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 The present invention is a flowchart of a method implementation according to an embodiment of the present invention.

[0019] Figure 2 This is a model architecture diagram of an embodiment of the present invention.

[0020] Figure 3 This is the test comparison result of the present invention and other methods. DETAILED DESCRIPTION

[0021] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0022] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0023] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0024] like Figure 1 As shown, this embodiment provides an incremental learning method for end-to-end speech recognition based on knowledge distillation, which uses the knowledge distillation framework and designs a multi-task objective function to achieve incremental learning. The end-to-end speech recognition models targeted by this method include sequence-to-sequence structures such as Conformer and non-sequence-to-sequence structures. First, the end-to-end speech recognition model is initialized as a teacher model and a student model; the first part of the encoder's objective function is to perform KL divergence on the output probability distribution of the encoders of the teacher model and the student model, so that the output probability distribution of the student model is as close to the teacher model as possible during the training process, and the second part is to use the Grad-cam++ method to generate respective attention maps from the outputs of the encoders of the teacher model and the student model, and transfer the attention maps of the teacher model and the student model. The same method is used to calculate the first and second parts of the decoder's objective function. Then the losses generated by the encoders and decoders of the teacher model and the student model are linearly combined and the student model is trained with the cooperation of the original training strategy, so that the student model can quickly adapt to new scene data and forget less. At the same time, based on the idea of ​​text clustering, the labels of the old data set are clustered, and a small amount of old data is extracted from each class and added to the new data set to train the student model, further ensuring that the student model will not forget the old data set. The model structure of this embodiment is as follows Figure 2 shown.

[0025] In this embodiment, the specific processing method for the output probability distribution of the teacher model and the student model is:

[0026] Use the linear combination of KL divergence to measure the distribution of the two. Specifically, the corresponding Figure 2 In the sequence-to-sequence model in , the output of the encoder of the teacher model and the student model passes through the fully connected layer and softmax, and the output is the output probability distribution matrix of the multi-classification task. The difference between the output probability matrices of the two models is calculated using KL divergence to obtain the first part of the multi-task objective function of incremental learning. The loss generated makes the output distribution of the teacher model and the student model as close as possible during the training process. The decoders of the teaching model and the student model do the same operation. This part of the objective function is mainly to control forgetting and does not directly affect the fitting of the new data set.

[0027]

[0028] Among them, p and q represent the output probability distribution of the student model and the teacher model respectively. The objective function calculated in this part is the first part of the multi-task objective function of incremental learning, corresponding to Figure 2 RBKD section in.

[0029] In this embodiment, the specific method of generating the attention maps of the teacher model and the student model and transferring the attention is:

[0030] First, the Gradient-cam++ idea is used to generate an attention map from the feature map, and the output of the encoder is used as the feature map, which is expressed as where d h is the dimension, K is the sequence length. The probability matrix of the feature map after the full connection layer and softmax output is expressed as M is the length of the dictionary. The score of the model is calculated using CTC greedy search, which is:

[0031] We can assume that category C gets score Y C is the feature map A υ The global linear weighting of Weight Matrix Generally, it is CTC greedy search Y C Score pair feature map A υ The first-order derivative of , because the gradient can reflect the importance of information to a certain extent, if an additional weight is added to weight the first-order gradient, becomes:

[0032]

[0033] in as follows:

[0034]

[0035] The generated attention map is represented as:

[0036]

[0037] Where Q v That is the generated attention map. In this method, the attention map provides reasoning about the high-level features of interest for the most likely prediction of the model, which proves to be very useful for the student model to learn the behavior of the teacher model.

[0038] The decoders of the teacher model and the student model are processed in the same way to obtain their respective attention maps.

[0039] Transfer the attention map, and the calculation process of attention transfer is:

[0040]

[0041] The objective function calculated in this part is the second part of the multi-task objective function of incremental learning, corresponding to Figure 2 SBKD section in.

[0042] The loss of incremental learning based on knowledge distillation is: L st =α·L RBKD +β·L SBKD , that is, the objective function of the encoder or decoder is a linear combination of the first part and the second part.

[0043] It should be noted that this method still needs to train the student model in cooperation with the original training strategy. The original training strategy is to train the CTC (Connectionist temporal classification) and CE (cross entropy) objective functions of the student model of the end-to-end speech recognition model. The overall objective function of this method is a linear combination of the objective function generated by knowledge distillation and the original training strategy, so as to accelerate the rapid convergence of the objective function of the original training strategy and control forgetting.

[0044] Taking the Conformer model as an example, the student network still needs to be trained with the CTC loss based on the encoder output and the CE loss based on the decoder output. These two losses are expressed as L ctc+ce Therefore, the loss of training the student network is expressed as: Loss = γ·L ctc+ce +δ·L st At the same time, the decoder based on the teacher-student network undergoes the same processing, namely L st =μ·L st-encoder +(1-μ)·Lst-decoder The entire training process is based on the training configuration of the teacher model, and the new dataset has no intersection with the old dataset used to train the teacher model.

[0045] In this embodiment, the specific method of extracting old data for training based on the text clustering idea is:

[0046] First, text-to-vec is used to embed the labels of the old data set. In this embodiment, the CoSENT model is used to unify the labels into vectors of fixed length. Then, the k-means method is used to cluster the label vectors. The cluster center is greater than the preset value to eliminate the high semantic correlation of text-to-vec, so that the clustering categories cover the old data set as much as possible from different texts and pronunciation information. In each class, a small amount of old data is extracted from the class center to the edge in descending order and added to the new data set to train the student model, further ensuring that the student model will not forget the old data set.

[0047] Figure 3 The test results of several incremental learning methods are shown, where Dataset1, 2, and 3 represent aishell, aidatatang, and dialect datasets respectively. The new dataset is trained uniformly for 7 rounds. Under the New training column, you can compare the test error rates of several methods on the new dataset, and the second column of Old training and New training can compare the forgetting of the old dataset. Figure 3 It can be seen that compared with other advanced incremental learning methods, this method can control forgetting more obviously, and can also ensure that the error rate of new data sets is quickly reduced, which can solve the problem of catastrophic forgetting very well. At the same time, the use of text clustering to extract old data and add it to training has the best effect, because the extracted old data is generally controlled at about 0.5%, so it will not consume more resources.

[0048] When incremental learning only on the new scene data set causes a large amount of forgetting, such as when the new scene data is a special dialect, it is necessary to extract a portion of the old data and the new scene data for joint training. The strategy for accessing old data is to use models such as CoSENT to embed the labels of the old data set, and output a unified 768-dimensional feature vector. Then, using k-means clustering, extract a portion of the old data from each class and add it to the new data set to train the student model. The specific operation of extracting data in each cluster is to extract in descending order from the center of the cluster to the edge, and the total amount of data extracted is about 0.5% of the old data set. The extracted data and the new scene data are combined to train the student model under the objective function and training strategy proposed in the present invention.

[0049] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0050] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0051] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0052] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0053] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.

Claims

1. An end-to-end speech recognition incremental learning method based on knowledge distillation, characterized in that: The knowledge distillation framework is used to design a multi-task objective function to achieve incremental learning. First, the end-to-end speech recognition model is initialized as a teacher model and a student model. The first part of the encoder's objective function is to perform KL divergence on the output probability distribution of the encoders of the teacher model and the student model, so that the output probability distribution of the student model is as close to the teacher model as possible during the training process. The second part is to use the Grad-cam++ method to generate respective attention maps from the outputs of the encoders of the teacher model and the student model, and transfer the attention maps of the teacher model and the student model. The same method is used to calculate the first and second parts of the decoder's objective function, and then the losses generated by the encoders and decoders of the teacher model and the student model are linearly combined and the student model is trained under the cooperation of the original training strategy, so that the student model can quickly adapt to the new scene data and forget less. At the same time, the labels of the old data set are clustered based on the idea of ​​text clustering, and a small amount of old data is extracted from each class and added to the new data set to train the student model, further ensuring that the student model does not forget the old data set. The specific method to make the output probability distribution of the encoder or decoder of the teacher model and the student model as close as possible is: Perform KL divergence on the output probability distribution of the encoder or decoder of the teacher model and the student model, calculate the distribution difference between the two, and obtain the first part of the multi-task objective function of incremental learning. The generated loss makes the output probability distribution of the student model as close as possible to the teacher model during the training process, and controls the student model's forgetfulness of the old data set; The specific method of training the student model with the cooperation of the original training strategy is: The original training strategy is to train the end-to-end speech recognition student model with time series classification CTC and cross entropy CE objective functions. The overall objective function of this method is a linear combination of the objective function generated by knowledge distillation and the original training strategy, so as to accelerate the rapid convergence of the objective function of the original training strategy and control forgetting. The specific method of extracting old data and adding it to training based on the idea of ​​text clustering is: Firstly, we use text-to-vec to embed the labels of the old dataset. Specifically, we use the CoSENT model to unify the labels into vectors of fixed length. Then, we use the k-means method to cluster the label vectors. The cluster center is larger than the preset value to eliminate the high semantic correlation of text-to-vec, so that the cluster categories can cover the old dataset from different texts and pronunciation information as much as possible. In each class, we extract a small amount of old data from the class center to the edge and add them to the new dataset to train the student model, so as to further ensure that the student model will not forget the old dataset.

2. The end-to-end speech recognition incremental learning method based on knowledge distillation according to claim 1, characterized in that: The specific method of using the Grad-cam++ method to generate the attention maps of the teacher model and the student model is: The output of the encoder is selected as the feature map, and the weight matrix of the feature map is calculated using the Grad-cam++ idea. The weight matrix is ​​multiplied by the feature map element by element, and the influence of negative classes is removed through the ReLU function. Finally, the attention maps of the teacher model and the student model are obtained respectively. The decoders of the teacher model and the student model are processed in the same way to obtain their respective attention maps.

3. The end-to-end speech recognition incremental learning method based on knowledge distillation according to claim 1, characterized in that: The specific method for transferring the attention maps of the teacher model and the student model is: After the generated attention map is globally normalized, the influence of negative classes is filtered out through the ReLU function, and the L_2 norm of the attention map generated by the teacher model and the student model is calculated. The calculation result of this part is the second part of the multi-task objective function of incremental learning; the objective function of the encoder or decoder is a linear combination of the first and second parts of each.

4. An end-to-end speech recognition incremental learning system based on knowledge distillation, characterized in that: The method comprises a memory, a processor, and computer program instructions stored in the memory and executable by the processor. When the processor executes the computer program instructions, the method steps as described in any one of claims 1 to 3 can be implemented.