Task-based focal loss to improve multilingual meta-learning speech recognition
By introducing task-based focus loss and difficult task adjuster in multilingual speech recognition, combined with support set and query set gradients, the problem of imbalance between tasks is solved, the model's focus on difficult tasks is realized, and the generalization ability and performance.
Patent Information
- Application Number
- CN202210778061.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-06-28
AI Technical Summary
In multilingual speech recognition, due to the imbalance of task difficulty, model initialization tends to be simple and has a large amount of data, and deviates from difficult languages with a small amount of data, resulting in low generalization.
A task-based focal loss is used to enhance the multilingual meta-learning speech recognition method. Through the combination of the difficult task regulator and the support set gradient and the query set gradient, the model is guided to focus on the difficult task and the meta-parameters are updated to achieve a more balanced initialization.
It effectively improves the model's generalization ability to the target language, ensures full utilization of all source language knowledge, and improves the performance and convergence speed of multi-language speech recognition.
Smart Images

Figure CN115132171B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of speech recognition technology, and in particular to a task-based focal loss-boosting multilingual meta-learning speech recognition method. Background Art
[0002] In multilingual pre-training, when learning from different source languages, different types of languages have different training data scales and different speech systems, resulting in an imbalance in task difficulty. As a result, the model initialization tends to be close to large-scale and easy languages, and deviates from small-scale and difficult languages, making the initialization learned by the model suboptimal, thereby reducing the generalization to the target language. Summary of the invention
[0003] In view of the problem of low model generalization due to unbalanced task difficulty in multilingual speech recognition, the present invention provides a task-based focal loss-enhanced multilingual meta-learning speech recognition method, which guides the model to focus on those difficult tasks, thereby making the initialization of the model more balanced among various languages.
[0004] The task-based focal loss-enhanced multilingual meta-learning speech recognition method provided by the present invention adopts an end-to-end speech recognition network architecture, specifically including:
[0005] Step 1: Initialize the speech recognition model f θ , input the original speech feature sequence (x1,x2,...,x T );
[0006] Step 2: Targeting multilingual datasets The task T extracted from i , the task T i Support Set and queryset Represents the i-th language data;
[0007] Step 3: Calculate the task T i The ASR loss is obtained using gradient descent on the support set The updated parameter θ i ;
[0008] Step 4: Use in support set The updated parameter θ i In the query set Calculate the query loss
[0009] Step 5: According to the task T i The query loss Calculate the task T i The difficult task regulator MTFL (θ), the difficult task regulator M TFL (θ) is used to represent the task T i The learning difficulty level of The larger the value, the more difficult the corresponding task regulator M is. TFL The larger (θ) is;
[0010] Step 6: Repeat steps 2 to 5 N times to calculate the query loss and difficult task regulator corresponding to N tasks;
[0011] Step 7: Calculate the task-based focal loss L based on the query loss corresponding to all N tasks and the difficult task regulator TFL ;
[0012] Step 8: Use the focal loss L TFL Update the speech recognition model f θ The meta-parameter θ of
[0013] Step 9: Repeat steps 2 to 8 until the updated speech recognition model f θ Satisfy the given requirements. Further, in step 5, the difficult task regulator M TFL The calculation formula of (θ) is:
[0014]
[0015] Among them, k ≥ 0 and γ ≥ 0 are adjustable hyper parameters.
[0016] Furthermore, in step 7, the task-based focal loss L TFL The calculation formula is:
[0017]
[0018] in, is the loss function of the base learner.
[0019] Furthermore, in step 8, the update formula of the meta-parameter θ is:
[0020]
[0021] Among them, β represents the learning rate.
[0022] Furthermore, the end-to-end speech recognition network architecture specifically adopts a CTC-attention joint architecture;
[0023] Correspondingly, in step 3, task T i The calculation formula of ASR loss is:
[0024] L=λL ctc +(1-λ)Latt
[0025] Among them, L ctc is the CTC loss, L att is the decoding loss, and the hyperparameter λ represents L ctc The weight of .
[0026] Beneficial effects of the present invention:
[0027] The current multi-language meta-learning (MML-ASR) method ignores the imbalance between tasks, causing the model initialization to tend to be simple languages with large data volumes and away from difficult languages with small data volumes, resulting in a decrease in the generalization ability of new tasks, such as Figure 4 (a). The task-based focal loss proposed in the present invention improves the neglect of task imbalance in multilingual meta-learning. A difficult task regulator is introduced based on the query loss of each task to guide the model to pay more attention to difficult tasks. In order to make full use of the data of difficult tasks, the support set gradient and the query set gradient are used to update the meta-parameters. In addition, the present invention also explains the significance of the difficult task regulator at the sample level. After formula derivation, it is found that it is inversely correlated with the product of the predicted probabilities of samples within the task. By using the method of the present invention, the initialization learned by the model can be made more balanced, such as Figure 4 As shown in (b), all source language knowledge is more fully utilized, thus enabling effective generalization to the target language. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flowchart of a task-based focal loss-enhanced multilingual meta-learning speech recognition method provided by an embodiment of the present invention;
[0029] Figure 2 A schematic diagram of MML-ASR and TFL-MML-ASR provided in an embodiment of the present invention;
[0030] Figure 3 A schematic diagram of the structure of a multi-language learning model based on a joint CTC-Attention architecture provided in an embodiment of the present invention;
[0031] Figure 4 A graph showing the relationship between the loss after using the task-based focus loss and the original loss provided in an embodiment of the present invention;
[0032] Figure 5 The character error rate (%) of the multilingual pre-training validation set on the IPARA BABEL dataset and the OpenSLR dataset provided by the embodiments of the present invention;
[0033] Figure 6Different methods of fine-tuning curves at 25% Vietnamese provided by the embodiment of the present invention;
[0034] Figure 7 The character error rate of the verification set of TFL-MML-ASR under different parameters provided by the embodiment of the present invention;
[0035] Figure 8 The character error rate (%) of the validation set of multilingual pre-training on the IPARA BABEL dataset and the OpenSLR dataset with and without support set gradient provided by the embodiments of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] In a meta-learner like MAML, when the query loss of a task is large, it means that the model cannot learn the task well, and the present invention considers such a task to be a difficult task. For these difficult tasks, the present invention considers that it is best to use the support set gradient and query set gradient of the task at the same time to learn it. The reason for doing so is that the present invention believes that there are two reasons for the large query loss of the task. One reason is that the model is not well learned on the support set, and the other reason is that although it is well trained on the support set, the model performs poorly on the query set. For the first reason, the introduction of the support set gradient is obviously useful. For the second reason, the large query loss of the task means the difficulty of the task; at this time, it is best to use more data to train again, especially in the case of few instances. Therefore, it is very beneficial to introduce the support set gradient to update the meta parameters of the difficult task. In particular, we want to make the model more focused on difficult tasks, which means that the weights of tasks with large query losses need to be increased.
[0038] Based on the above content, the present invention mainly includes two aspects: on the one hand, a difficult task regulator M is introduced into the sum of the query losses of the outer loop. TFL (θ). On the other hand, the loss gradients of the hard task on both the support set and the query set are used to update the parameters of the meta-learner.
[0039] Based on the above-mentioned inventive concept, Figure 1As shown, the embodiment of the present invention provides a task-based focus loss-enhanced multilingual meta-learning speech recognition method, which uses an end-to-end speech recognition network architecture for multilingual speech recognition. In the embodiment of the present invention, the method adopts the following Figure 2 The CTC-attention joint architecture shown is used as an example of an end-to-end speech recognition network architecture. The network architecture is divided into three parts: the encoder and decoder in the Transformer model, and the connectionist temporal classification (CTC) module; among them, the CTC module can guide the model to learn good alignment and improve the convergence speed.
[0040] The speech recognition method specifically comprises the following steps:
[0041] S101: Initialize speech recognition model f θ , input the original speech feature sequence (x1,x2,...,x T );
[0042] S102: For multilingual datasets The task T extracted from i , the task T i Support Set and queryset Represents the i-th language data; Indicates that N different languages are included;
[0043] S103: Calculation task T i The ASR loss is obtained using gradient descent on the support set The updated parameter θ i ;
[0044] Specifically, since the embodiment of the present invention adopts the CTC-attention joint architecture for multilingual speech recognition, the task T i The calculation formula of ASR loss is:
[0045] L=λL ctc +(1-λ)L att
[0046] Among them, L ctc is the CTC loss, L att is the decoding loss, and the hyperparameter λ represents L ctc The weight of .
[0047] In the inner loop, the base learners are trained from the initial meta-learner f θ Learn a model for each task. i For example, using task T i Support set Through The gradient descent calculation updates the model parameters θ from θ i : in, is the loss function of the base learner, and α is the learning rate of the inner loop.
[0048] S104: Use in support set The updated parameter θ i In the query set Calculate the query loss
[0049] S105: According to task T i The query loss Calculate the task T i The difficult task regulator M TFL (θ), the difficult task regulator M TFL (θ) is used to represent the task T i The level of learning difficulty;
[0050] As an implementable method, the difficult task regulator M TFL The calculation formula of (θ) is:
[0051]
[0052] Among them, k ≥ 0 and γ ≥ 0 are adjustable hyper parameters.
[0053] Specifically, taking the CTC-attention joint architecture as the speech recognition network structure as an example, the above-mentioned difficult task regulator M is designed TFL The rationality analysis process of (θ) is as follows:
[0054] (1) ASR loss is the weighted sum of CTC loss and decoding loss. CTC loss is defined as: Where P(Y|X) represents the cumulative sum of the output probabilities of all alignment paths Y that produce X; S represents the total number of corresponding samples in a task. Therefore, exp(-kL ctc ) can be expressed as:
[0055]
[0056] (2) The decoding loss uses cross entropy loss, which can be defined as: Among them, i is the output layer node index, is the true label of the t-th frame, y(t) is the activation output of the t-th frame, and T is the number of feature sequence frames. For classification problems, is a one-hot vector. Therefore, exp(-kL att ) can be expressed as:
[0057]
[0058] Among them, j represents the index corresponding to the true label, y j (t) represents the output probability value of frame t at position j.
[0059] (3) For the ASR model, the difficult task regulator (1-exp(-kL)) γ It can be expressed as:
[0060]
[0061] Since P(Y|X)≤1, y j (t)≤1, and 0≤λ≤1, so it is necessary to satisfy k≥0,γ≥0. In addition, k and γ are hyperparameters, which are used to adjust the product of the predicted probabilities of all samples and the degree of attention to difficult tasks, respectively.
[0062] From exp(-kL ctc ) and exp(-kL att ) is calculated from the formula, when the predicted probability p of the sample within the task t When it is low, it indicates that the task is difficult, that is, M TFL (θ) is inversely related to the product of the predicted probabilities of each sample in the task. So the regulator for hard tasks is (1-exp(-kL)) γ will be adjusted to be larger, and the larger the difficult task regulator is, the more attention the meta-learning model pays to the difficult task, and vice versa. This shows that the M designed in the embodiment of the present invention TFL The new loss function after adding the hard task regulator with different hyperparameters k and γ is as follows: Figure 3 shown.
[0063] from Figure 3 It can be found that when γ becomes larger, tasks with small query loss will be ignored more. When k becomes smaller, the conversion loss curve will be flatter. Therefore, it is necessary to set appropriate hyperparameters for losses of different sizes.
[0064] It is worth noting that different tasks require samples of the same size. In speech recognition, the sequence length affects the product of all samples. Therefore, in practical applications, the length frame sorting method can be used to combine tasks during training, so that the sequence lengths of samples contained in each batch of tasks are almost equal.
[0065] S106: Repeat steps S102 to S105 N times to calculate the query loss and difficult task regulator corresponding to the N tasks;
[0066] S107: Calculate the task-based focus loss L based on the query loss corresponding to all N tasks and the difficult task regulatorTFL ;
[0067] As an implementation option, the task-based focal loss L TFL The calculation formula is:
[0068]
[0069] in, is the loss function of the base learner.
[0070] S108: Using the focus loss L TFL Update the speech recognition model f θ The meta-parameter θ of
[0071] As an implementable method, the update formula of the meta-parameter θ is:
[0072]
[0073] Among them, β represents the learning rate of the outer loop.
[0074] S109: Repeat steps S102 to S108 until the updated speech recognition model f θ Meet the given requirements. For example, evaluate the accuracy of the model on the validation set and retain the models with the best 5 validation set accuracies.
[0075] The embodiment of the present invention improves the problem of task imbalance that meta-learning ignores by treating all tasks equally based on task focus loss. This method uses a difficult task regulator based on task query loss to guide the model to focus on more difficult tasks. The larger the query loss, the more difficult the task is, so it is necessary to increase the attention to the task. In addition, the significance of the difficult task regulator is analyzed at the sample level, and it is found that it is inversely correlated with the product of the predicted probabilities of all samples in the task. When the task is more difficult, the predicted probability of the samples in the task is lower, and the larger the difficult task regulator is, the more attention the meta-learning model pays to difficult tasks, proving its effectiveness.
[0076] like Figure 4 Schematic diagram of multilingual meta-learning MML-ASR and task-based focal loss multilingual meta-learning TFL-MML-ASR of the present invention, in which the circle pointed by the dotted arrow represents the source language, the dotted line represents multilingual pre-training, the circle pointed by the solid arrow represents the target language, and the solid line represents the adaptation path from initialization θ to the target language; Figure 4 It can be seen that the TFL-MML-ASR of the present invention makes the path from initialization θ to each language basically the same, solving the problem of imbalance between tasks.
[0077] In order to verify the effectiveness of the method of the present invention, the present invention also provides the following experiments.
[0078] Experiments were conducted on two datasets, IPARA BABEL and OpenSLR. The experimental results show that the proposed method can effectively improve the pre-training process and adapt to new tasks, and has greatly improved both the final result and the convergence speed.
[0079] Experimental setup: Feature extraction was performed using the Kaldi toolkit to obtain 40-dimensional Mel-spectrogram coefficient (MFCC) features and 3-dimensional pitch features calculated every 10 milliseconds within a 25 millisecond window. The speech recognition model used a 6-layer VGG convolutional network, and the Transformer consisted of 4 encoders and 2 decoders. The weight λ of the CTC loss was set to 0.3. The hard task regulator adjusted the hyperparameters k to 1 and γ to 5 for IPARA BABEL, and k to 1 and γ to 1 for OpenSLR. During inference, beam search was used to obtain the best sequence. When BPE was used, the vocabulary size was set to 9000. Except for the inner loop in meta-learning, the SGD algorithm was used. For the rest of the model optimization, Adam was used. The warm start step was set to 12000 and k to 0.5. In the experiment, the character error rate (CER) was used as the criterion, and the five best models were retained. Finally, the parameters of the best five models were averaged as the final model. In training, spectral enhancement and speed perturbation were used. For OpenSLR, the warm start step was set to 1000 and k was 0.5.
[0080] Pre-training effect: The convergence speed and convergence performance of multi-language transfer learning ASR (MTL-ASR), multi-language meta-learning ASR (MML-ASR) and the task-based focal loss multi-language meta-learning (TFL-MML-ASR) of the present invention during pre-training are compared. Figure 5 As shown in the figure, TFL-MML-ASR outperforms MML-ASR and MTL-ASR in both convergence speed and final performance. Unlike MTL-ASR, the method of the present invention remains effective as the number of languages increases. This is because meta-learning integrates the information of each task and obtains better initialization. TFL-MML-ASR performs better on multiple tasks by focusing on difficult tasks.
[0081] Fine-tuning performance: The performance of fine-tuning the target language on BABEL and OpenSLR is compared with random initialization, MTL-ASR, MML-ASR, and TFL-MML-ASR. As shown in Table 1, the proposed TFL-MML-ASR outperforms MML-ASR on all languages.
[0082] Table 1 Character error rate of verification set in different target languages (%)
[0083]
[0084] From Table 1, we find that the improvement of the model is not as good as expected. The reason is the abundance of data, especially about 80 hours of training data on BABEL. Therefore, we further compare the performance of these methods under three settings with different proportions of 10%, 25% and 50% target language data. The experimental results are shown in Table 2.
[0085] Table 2 Character error rate of validation set in target languages of different scales (%)
[0086]
[0087]
[0088] For the BABEL dataset, TFL-MML-ASR is more effective in few-shot learning. Compared to meta-learning, it improves the CER by about 12% when fine-tuning on 25% of the Vietnamese training data, and by about 7%-8% when fine-tuning on 10% and 50% of the training data. It can also be seen that TFL-MML-ASR is also very effective for other low-resource target languages such as Swahili and Tamil.
[0089] For the OpenSLR dataset, the model failed to converge when only 10% was used for fine-tuning. Therefore, the fine-tuning results of 25% and 50% of the target language data were compared, and it can be found that TFL-MML-ASR performs better than MML-ASR in all languages of different scales.
[0090] In addition to convergence performance, TFL-MML-ASR also converges faster than MML-ASR during fine-tuning. The fine-tuning process for all languages shows the same trend. Only the fine-tuning experiment for Vietnamese at 25% is shown here. Figure 6 As shown in Figure 1, it shows the effective CER curves of the three methods No-pretrain, MML-ASR, and TFL-MML-ASR in epochs. It can be seen that the meta-learning method effectively improves the performance of low-resource speech recognition. However, TFL-MML-ASR is faster and better in adapting to the target language.
[0091] Experimental analysis: In TFL-MML-ASR, a difficult task regulator M is introduced TFL (θ) is used to guide the model to focus on difficult tasks. There are two hyperparameters k and γ in the difficult task regulator. Since the choice of k and γ affects the performance of TFL-MML-ASR, the choice of parameters is further explored.
[0092] like Figure 7As shown in Figure 1, the performance of TFL-MML-ASR with different parameters k and γ on IPARA BABEL and OpenSLR is compared. On IPARA BABEL, when k is kept constant and set to 1, the performance of the model gradually gets better by adjusting γ. The model performs best when γ is set to 5, and the performance of the model starts to decline as γ increases. When γ is kept constant and set to 5, k performs similarly, and setting it to 1 achieves the best results. On OpenSLR, similar results can be observed, except that the optimal k and γ values are different from the optimal k and γ values in the BABEL dataset.
[0093] Figure 7 The results shown are consistent with the original motivation of the proposed method, namely: an increase in γ means that the weight of the loss is more inclined to those difficult tasks. However, when γ continues to rise, the performance will decline. This can be explained by the fact that the model with high γ excessively ignores the tasks with low loss, which harms the overall performance of the model, so the model performs poorly. When k increases, the product of the sample prediction probabilities of the tasks will be adjusted. When the sample prediction probabilities within the task are small, lowering k can help the model focus on more difficult tasks. When k is too small, the model will focus too much on difficult tasks, resulting in a decline in overall performance, and vice versa.
[0094] Therefore, in practical applications, it is necessary to configure the hyperparameters k and γ in combination with the query loss value and select a suitable conversion loss so that it does not ignore easy training tasks and can focus on difficult tasks.
[0095] The impact of adding support loss in TFL-MML-ASR: Figure 8 As shown, on the one hand, meta-learning with the introduction of support gradients is useful in IPARA BABEL, but not in OpenSLR. This shows that using support gradients to update meta parameters is not always successful. On the other hand, in IPARA BEBAL and OpenSLR, introducing support gradients in TFL-MML-ASR is better than not doing so. Without the support gradient, the performance of the method of the present invention on OpenSLR is worse than meta-learning. The present invention believes that this is because there is little data in OpenSLR, and the model learns poorly on the support set. If the model is simply encouraged to focus on difficult tasks, the performance of difficult tasks cannot be improved.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. Task-based focus loss to enhance multilingual meta-learning speech recognition method, characterized by: The method adopts an end-to-end speech recognition network architecture, specifically including: Step 1: Initialize the speech recognition model f θ , input the original speech feature sequence (x1,x2,...,x T ); Step 2: Targeting the multilingual dataset Task T extracted from i , the task T i Support Set and queryset Represents the i-th language data; Step 3: Calculate the task T i The ASR loss is obtained using gradient descent on the support set The updated parameter θ i ; Step 4: Use in support set The updated parameter θ i In the query set Calculate the query loss Step 5: According to the task T i Query loss Calculate the task T i Difficult Task Regulator M TFL (θ), the difficult task regulator M TFL (θ) is used to represent the task T i The learning difficulty level of The larger the value, the more difficult the corresponding task regulator M is. TFL The larger (θ) is; Step 6: Repeat steps 2 to 5 N times to calculate the query loss and hard task regulator corresponding to the N tasks; Step 7: Calculate the task-based focus loss L based on the query loss corresponding to all N tasks and the difficult task regulator TFL ; Step 8: Use the focal loss L TFL Update the speech recognition model f θ The meta-parameter θ of Step 9: Repeat steps 2 to 8 until the updated speech recognition model f θ Satisfy the given requirements.
2. The task-based focus loss-boosting multilingual meta-learning speech recognition method according to claim 1, characterized in that: In step 5, the difficult task regulator M TFL The calculation formula for (θ) is: Among them, k ≥ 0 and γ ≥ 0 are adjustable hyperparameters.
3. The task-based focus loss-boosting multilingual meta-learning speech recognition method according to claim 1, characterized in that: In step 7, the task-based focal loss L TFL The calculation formula is: in, is the loss function of the base learner.
4. The task-based focal loss-boosting multilingual meta-learning speech recognition method according to claim 1, characterized in that: In step 8, the update formula of the meta-parameter θ is: Among them, β represents the learning rate.
5. The task-based focal loss-enhanced multilingual meta-learning speech recognition method according to claim 1, wherein the end-to-end speech recognition network architecture specifically adopts a CTC-attention joint architecture; Correspondingly, in step 3, task T i The calculation formula of ASR loss is: L=λL ctc +(1-λ)L att in, L ctc is the CTC loss, L att is the decoding loss, and the hyperparameter λ represents L ctc The weight of .
Citation Information
Patent Citations
Meta-learning-based adaptive speech recognition method and device, equipment and medium
CN112562648A
Adversarial sampling training method and device based on meta-learning
CN112786030A
