Unsupervised pre-training speech recognition model and training method with enhanced local dependency
By combining the transformer encoder with a depthwise separable convolution module and a self-attention module, local dependency modeling is enhanced, solving the problem of insufficient local dependencies of unsupervised pre-training models in low-resource speech recognition, and improving speech recognition. accuracy and migration efficiency.
Patent Information
- Application Number
- CN202110642843.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-09
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-06-09
AI Technical Summary
Existing unsupervised pre-trained speech recognition models lack modeling of local dependencies in low-resource speech recognition, resulting in high recognition error rates and low efficiency when transferred to speech recognition tasks.
A transformer encoder that combines a depthwise separable convolution module and a self-attention module is used to enhance local dependency modeling through a serial-parallel structure, and a variety of loss functions are used in the pre-training stage, including contrastive loss, codebook diversity loss and L2 loss, CTC or CE loss function is used in the fine-tuning stage.
It improves the pre-training efficiency and speech recognition accuracy, reduces the recognition error rate, and accelerates the fine-tuning of the model on labeled data.
Smart Images

Figure CN113380237B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of low-resource speech recognition, and in particular to an unsupervised pre-trained speech recognition model and a training method for enhancing local dependencies. Background Art
[0002] Speech recognition is also called Automatic Speech Recognition (ASR). Its goal is to convert human speech into computer-readable text or instructions. Low-resource speech recognition is a field of speech recognition. Currently, using unsupervised speech pre-training methods to improve low-resource speech recognition performance is one of the mainstream methods.
[0003] Unsupervised pre-training methods use a large amount of unlabeled speech data for training, which can make full use of the easily accessible unlabeled speech data to learn the structural information in speech. A representative unsupervised pre-training model for speech is the wav2vec 2.0 model. Wav2vec 2.0 masks speech frame information, predicts the masked speech frame information through context, and then constructs a contrast loss function to distinguish positive and negative samples to learn the structural information in speech. The wav2vec 2.0 model is based on the transformer model structure, which can effectively model long-range contextual dependencies, but lacks modeling of fine-grained local information. Since sound events often occur in a short time range, both long-range contextual dependencies and local fine-grained dependencies are necessary. Some researchers have proposed an end-to-end conformer model, which combines a deep separable convolution module and a self-attention module to simultaneously model long-range contextual dependencies and local fine-grained dependencies in speech. This model reduces the error rate of speech recognition. However, this conformer model is used in an end-to-end speech recognition model. Another researcher proposed the lite transformer model, which consists of two branches, one is a convolution module and the other is a self-attention module, and then the outputs of the two branches are concatenated. The convolution module can capture local dependencies, while the self-attention module focuses on capturing contextual dependencies. They each perform their respective functions and then achieve performance improvements in machine translation tasks. These similar ideas have brought performance improvements in different fields, but in the field of speech, how to model local and global dependency relationships in pre-trained models remains an open question. Summary of the invention
[0004] In view of this, the main purpose of the present invention is to provide an unsupervised pre-trained speech recognition model that enhances local dependencies, in order to partially solve at least one of the above-mentioned technical problems.
[0005] In order to achieve the above-mentioned object, as one aspect of the present invention, an unsupervised pre-trained speech recognition model for enhancing local dependencies is provided, wherein the speech recognition model comprises an encoder module and a decoder module; the encoder module comprises a feature extraction module and a context module, the context module adopts a transformer encoder comprising a depthwise separable convolution module, and the transformer encoder comprises a self-attention module; wherein,
[0006] The positions of the depthwise separable convolution module and the self-attention module are combined as follows: the self-attention module is followed by the depthwise separable convolution module, and the two are in a serial relationship; the self-attention module and the depthwise separable convolution module are in parallel; the self-attention module is first in parallel with the depthwise separable convolution module, and then in series with the depthwise separable convolution module; the self-attention module is first in series with the depthwise separable convolution module, and then in parallel with the depthwise separable convolution module.
[0007] Wherein, the feature extraction module adopts a multi-layer convolutional neural network.
[0008] Among them, the feature extraction module contains 7 layers of convolution, the convolution step is (5, 2, 2, 2, 2, 2, 2), the convolution kernel is (10, 3, 3, 3, 3, 3, 2, 2), and the feature extraction module outputs a frame length of 25ms and a frame shift of 20ms.
[0009] The original speech sampling points are passed through a feature extractor to extract shallow features, and the shallow features are passed through a context module to obtain context features.
[0010] The decoder module adopts a linear mapping layer or a transformer decoder layer.
[0011] The input of the decoder module is the context feature vector, and the output is the predicted text.
[0012] The speech recognition model also includes a loss function. The speech recognition model uses three loss functions in the pre-training stage and uses one loss function when fine-tuning on labeled data.
[0013] The speech recognition model uses three loss functions in the pre-training stage, including a contrast loss function, a codebook diversity loss function and an L2 loss function.
[0014] Among them, one loss function is used when fine-tuning on labeled data, which is the CTC loss function or the CE loss function.
[0015] As another aspect of the present invention, a method for training the speech recognition model as described above is also provided, comprising the following steps:
[0016] Pre-training the speech data using the speech recognition model described above;
[0017] After the speech recognition model is pre-trained, the decoder module is connected after the context module, and the pre-trained model is fine-tuned using the CTC loss function or CE loss function using labeled data;
[0018] Use unsupervised pre-training on unlabeled data and fine-tune on labeled data.
[0019] Based on the above technical solution, it can be known that the unsupervised pre-trained speech recognition model with enhanced local dependency of the present invention has at least some of the following beneficial effects compared with the prior art:
[0020] The unsupervised pre-trained speech recognition model with enhanced local dependencies proposed in the present invention can make up for the problem that the unsupervised pre-trained model wav2vec 2.0 is insufficient in modeling local dependencies, and can be transferred to speech recognition tasks more quickly and reduce the recognition error rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 An unsupervised pre-trained speech recognition model diagram with enhanced local dependencies provided by an embodiment of the present invention;
[0022] Figure 2 The position relationship between the self-attention module and the depth-separable convolution module in the transformer module provided in the embodiment of the present invention;
[0023] Figure 3 The 960-hour pre-training model provided in the embodiment of the present invention is fine-tuned in different epochs for WER results. DETAILED DESCRIPTION
[0024] At present, low-resource speech recognition based on the unsupervised pre-training wav2vec 2.0 method has problems such as insufficient local information modeling, long pre-training model training time, and the inability of unsupervised pre-training models to migrate to low-resource speech recognition tasks more quickly. Therefore, the present invention proposes an unsupervised pre-training speech recognition model that enhances modeling of local dependencies, which can improve pre-training efficiency, migrate to low-resource speech recognition tasks more quickly, and improve low-resource recognition accuracy under the condition of adding a small number of parameters.
[0025] The present invention proposes an unsupervised pre-trained speech recognition model that enhances local dependencies. The transformer encoder of the model enhances the model's ability to model local dependencies by combining serial-parallel depthwise separable convolution modules, while using a feedforward neural network with shared parameters. The model proposed by the invention can improve the efficiency of pre-training, increase the speed of fine-tuning the pre-trained model on labeled data, and reduce the error rate of speech recognition while ensuring that a small number of parameters are added.
[0026] The present invention utilizes a method for enhancing the local dependency relationship of the model modeling by using a deep separable convolution module. Aiming at the problem that the transformer has insufficient ability to model local dependency relationships, a serial-parallel deep separable convolution module is introduced into the transformer structure. The serial-parallel deep separable convolution module can model local dependencies, and the self-attention module in the transformer can model long-distance dependencies. In order to ensure that only a small amount of parameters are added and compared with the conformer structure, a shared feedforward neural network layer is introduced. The two layers of feedforward neural network layers in each transformer layer share parameters, and each transformer layer is a sandwich structure (feedforward neural network-self-attention module (convolution module)-feedforward neural network).
[0027] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0028] like Figure 1 As shown in FIG. , the unsupervised pre-training speech recognition model diagram for enhancing local dependencies proposed by the present invention is shown in FIG. Figure 1 On the left, during the pre-training phase, the model inputs 16KHz speech sampling points X = [x1, x2, ..., x m …,x n ], and the shallow features Z = [z1,z2,…,z t …,z T ], then the shallow feature Z passes through the context module to obtain the context vector C = [c1, c2, ..., c t …,c T ] Among them, the context module can choose Figure 2 The transformer modules enhanced by different convolution modules are shown in Figure 1. After the model is pre-trained, a linear mapping layer or decoder (such as Figure 1 The right part is then fine-tuned on labeled data.
[0029] The model consists of two parts: encoder and decoder, as well as a loss function. The following is a detailed introduction to each of them.
[0030] (1) Encoder module
[0031] The encoder module includes a feature extraction module and a context module. The feature extraction module uses a 7-layer convolutional neural network, and the input of the feature extraction module is a 16KHz speech sampling point X = [x1, x2, ..., x m …,x n ], and the shallow features Z = [z1,z2,…,z t …,z T The context module uses a transformer encoder enhanced by a deep separable convolutional network. The context module contains 12 layers of transformer encoder modules. The input of the context module is the shallow feature Z = [z1, z2, …, z t …,z T ], the output is the context feature vector C = [c1, c2, ..., c t …,c T ]. There are many combinations of convolution-enhanced context modules, such as Figure 3 As shown in the figure. There are many combinations of the positions of the depthwise separable convolution module and the self-attention module: 1) The self-attention module is followed by the depthwise separable convolution module, and the two are in a serial relationship. 2) The self-attention module and the depthwise separable convolution module are in parallel. 3) The self-attention module is first in parallel with the depthwise separable convolution module, and then in series with the depthwise separable convolution module. 4) The self-attention module and the depthwise separable convolution module are in series, and then in parallel with the depthwise separable convolution module.
[0032] (2) Decoder module
[0033] The decoder module uses a linear mapping layer or a multi-layer transformer decoder layer as a decoder. The input of the decoder is the context feature vector C = [c1, c2, ..., c t …,c T ], the output is the predicted text, and the predicted text and the true text calculate the CTC loss function or the CE loss function.
[0034] (3) Loss Function
[0035] In the unsupervised pre-training stage, the model uses three loss functions. 1) Contrastive loss function. 2) Codebook diversity loss function. 3) L2 loss function. The loss function of unsupervised pre-training is L = L m +αL d +βL f , where L m is the contrast loss function, L d is the codebook diversity function, L fis the L2 regularization function, and α and β are adjustable hyperparameters.
[0036]
[0037]
[0038]
[0039] In the formula, sim represents cosine similarity, q t It is the quantized speech representation. g,v Indicates the probability of selecting the vth codebook in the gth group. The contrast loss function allows the model to learn discriminative representation information, the codebook diversity loss function allows the model to use the learned codebook as much as possible to enhance the robustness of the representation, and the L2 loss function makes the pre-training process more stable. After the unsupervised speech pre-training is completed, when fine-tuning on labeled data, use the CTC (Connectionist Temporal Classification) loss function or the CE (Cross Entropy) loss function.
[0040] After the model is pre-trained, a linear mapping layer or decoder is connected after the context module, and then fine-tuned on labeled data. The loss function used at this time is the CTC loss function or the CE loss function. Then the model is continuously optimized to minimize the loss function of the model on the validation set.
[0041] The present invention also discloses a method for training the speech recognition model as described above, comprising the following steps:
[0042] Pre-training the speech data using the speech recognition model described above;
[0043] After the speech recognition model is pre-trained, the decoder module is connected after the context module, and the pre-trained model is fine-tuned using the CTC loss function or CE loss function using labeled data;
[0044] Use unsupervised pre-training on unlabeled data and fine-tune on labeled data.
[0045] In order to verify the effectiveness of the method proposed in this invention, the following experiment was designed.
[0046] (1) Experimental setup
[0047] The unlabeled data used in the pre-training stage of this paper is the public English dataset librispeech, which contains a total of 960 hours of speech data. The labeled data is a 100-hour subset of librispeech. In the pre-training stage, the feature extraction module contains 7 layers of convolution, the convolution step size is (5, 2, 2, 2, 2, 2, 2) and the convolution kernel is (10, 3, 3, 3, 3, 3, 2, 2). The feature extraction module outputs a Z frame length of 25ms and a frame shift of 20ms. The context module contains a 12-layer convolution-enhanced transformer module. The transformer model dimension is 768, the feedforward neural network dimension is 3072, the depthwise separable convolution kernel size is 32, and the depthwise separable convolution dimension is 256. The model is implemented using pytorch, and the Adam optimizer is used to optimize the parameters.
[0048] (2) Experimental results
[0049] After the model pre-training is completed, the linear mapping layer is connected after the context module, and the pre-trained model is fine-tuned with the CTC loss function using labeled data. First, unsupervised pre-training is performed with 100 hours of unsupervised data, and then CTC fine-tuning is performed with 10 hours of supervised data. The results are shown in Table 1. From Table 1, it can be seen that the transformer encoder2 word error rate WER (Word Error Rate) is the lowest, that is, the self-attention module is first paralleled with the depthwise separable convolution module, and then serially with the depthwise separable convolution module, which has the best performance.
[0050] Table 1. WER results of fine-tuning with 10 hours of supervised data using 100 hours of unsupervised data.
[0051]
[0052]
[0053] Then, unsupervised pre-training was performed using 960 hours of unsupervised data, and CTC fine-tuning was performed using 100 hours of supervised data. Figure 3 The results show that the model enhanced by the depthwise separable convolution converges faster in the pre-training stage, which indicates that enhancing local dependencies can improve the training efficiency of the pre-trained model. The 960-hour pre-trained model was fine-tuned in 1 hour, 10 hours, and 100 hours, respectively, and the experimental results are shown in Table 2. After the enhanced model models local dependencies, the model has a lower WER on labeled low-resource data.
[0054] Table 2: Using 960 hours of unsupervised data, fine-tuning WER results on 1 hour, 10 hours, and 100 hours of supervised data
[0055]
[0056] In general, the present invention proposes an unsupervised pre-training model that enhances local dependencies. The advantages of this method are: first, the model can improve the model pre-training efficiency in the pre-training stage under the condition of only adding a small number of model parameters. Second, when the model is fine-tuned on low-resource labeled data, the local context information can be better fine-tuned to the downstream tasks, so the speech recognition accuracy is better.
[0057] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An unsupervised pre-trained speech recognition model with enhanced local dependencies, It is characterized in that The speech recognition model includes an encoder module and a decoder module; the encoder module includes a feature extraction module and a context module, the context module uses a transformer encoder including a depth-separable convolution module, each transformer layer of the transformer encoder includes a first feedforward neural network layer, a self-attention module and a second feedforward neural network layer, and the first feedforward neural network layer and the second feedforward neural network layer share parameters; wherein, The positions of the depthwise separable convolution module and the self-attention module are combined in the following manner: the self-attention module is followed by the depthwise separable convolution module, and the two are in a serial relationship; the self-attention module and the depthwise separable convolution module are in parallel; the self-attention module is first in parallel with the depthwise separable convolution module, and then in series with the depthwise separable convolution module; the self-attention module is first in series with the depthwise separable convolution module, and then in parallel with the depthwise separable convolution module; The original speech sampling points are passed through the feature extraction module to extract shallow features, and the shallow features are passed through the context module to obtain context features; Among them, the speech recognition model uses three loss functions in the pre-training stage, and the three loss functions include contrast loss function, codebook diversity loss function and L2 loss function. The pre-training stage is used to perform unsupervised pre-training on the encoder module using unlabeled data, and the contrast loss function is used to enable the encoder module to learn the discriminative representation information between the contextual features and the quantized speech representation.
2. The speech recognition model according to claim 1, It is characterized in that The feature extraction module adopts a multi-layer convolutional neural network.
3. The speech recognition model according to claim 1, It is characterized in that The feature extraction module includes 7 layers of convolution, the convolution step size is (5, 2, 2, 2, 2, 2, 2) and the convolution kernel is (10, 3, 3, 3, 3, 3, 2, 2). The feature extraction module outputs a frame length of 25 ms and a frame shift of 20 ms.
4. The speech recognition model according to claim 1, It is characterized in that The decoder module adopts a linear mapping layer or a transformer decoder layer.
5. The speech recognition model according to claim 1, It is characterized in that The input of the decoder module is the context feature vector, and the output is the predicted text.
6. The speech recognition model according to claim 1, It is characterized in that The speech recognition model also includes a loss function. The speech recognition model uses three loss functions in the pre-training stage and uses one loss function when fine-tuning on labeled data.
7. The speech recognition model according to claim 6, It is characterized in that When fine-tuning on labeled data, a loss function is used, which is the CTC loss function or the CE loss function.
8. A method for training a speech recognition model according to any one of claims 1 to 7, It is characterized in that The following steps are involved: Pre-training the speech data using the speech recognition model described in any one of claims 1 to 7; After the speech recognition model is pre-trained, the decoder module is connected after the context module, and the pre-trained model is fine-tuned using the CTC loss function or CE loss function using labeled data; Use unsupervised pre-training on unlabeled data and fine-tune on labeled data.
Citation Information
Patent Citations
A convolutional echo state network time sequence classification method based on a multi-head self-attention mechanism
CN109919205A
Voice recognition system adopting bidirectional temporal convolution and self-attention mechanism networks
CN111477221A
Speech recognition model training method and device and speech recognition method and device
CN111862953A
