Wake-up word detection model training method, electronic device and storage medium
Through the modified cross-entropy loss function and multi-level detection loss function, combined with the text adaptive detection framework and attention mechanism, it solves the problem in the existing technology that the wake-up word detection system cannot customize the wake-up word and the training standards and evaluation indicators do not match. problem, achieving a more robust and efficient wake word detection model.
Patent Information
- Application Number
- CN202210084326.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-01-20
AI Technical Summary
The existing wake word detection system cannot customize wake words, and the training standards and evaluation indicators do not match, which limits the robustness and performance of the model.
Using the modified cross-entropy loss function, frame-level detection loss function and sequence-level detection loss function as the training standard, the posterior prediction is strengthened through text information, and wake-up words are randomly customized during the training process, using the text adaptive detection framework and Attention mechanism to optimize detection metrics.
It improves the robustness and ease of use of the model, realizes the ability to detect any wake-up word, significantly improves the accuracy and recall rate, and reduces the misrecognition rate.
Smart Images

Figure CN114420098B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of wake-up word detection model training, and in particular relates to a wake-up word detection model training method, system, electronic device and storage medium. Background Art
[0002] With the development of the Internet of Things, wake-up word detection technology has attracted the interest of many real-world applications, such as voice assistants. Users can wake up their smart devices through predefined keywords such as "OK Google", "Hey Siri", "Alexa", etc., and issue various control commands to the devices.
[0003] The wake-up word detection task requires the model to listen to and decode audio in a streaming manner. It is a special case of the general keyword detection system (KWS) task. There is a rich literature on the topic of keyword detection systems in continuous speech processing. Offline large vocabulary continuous speech recognition (LVCSR) systems can transcribe acoustic features into text, which can be used to detect keywords of interest, but most of these systems are not suitable for the wake-up word detection task in computationally constrained environments. For online, low-latency wake-up word detection systems with low memory consumption, the traditional approach is a hidden Markov model (HMM) based on keyword / filler nodes. With the advancement of deep learning technology, some previous works have proposed single neural network systems without HMM to directly predict the wake-up word. The neural networks used in such systems include deep neural networks (DNN), convolutional neural networks (CNN), recurrent neural networks (RNN) or long short-term memory (LSTM), and attention mechanisms. This method mainly consists of an acoustic model and a post-processing module. The acoustic model aims to encode the speech signal into features or convert it into a posterior probability matrix. The post-processing module can be a similarity comparison method or a decoding algorithm, and its purpose is to calculate the detection score of each speech frame.
[0004] Although the above approach works well under certain conditions, such as when the keywords are predefined, there are still two unsolved problems that limit the potential of the model.
[0005] (1) Keywords are fixed. Most existing wake-up word detection systems require a specific wake-up word to be defined in advance. These systems require a large amount of data containing predefined keywords for training, and the model cannot be changed after training. Although some research has been devoted to studying the open-vocabulary wake-up word detection task to allow users to customize any wake-up word, there are still many challenges. For example, the robustness of the model and how to detect keywords in real time.
[0006] (2) Mismatch between training criteria and evaluation metrics. Although the wake-up word detection task usually uses a method consisting of an acoustic model and a post-processing module, most existing works use cross entropy as the training criterion, which does not well reflect the performance of evaluation metrics such as precision, recall, false recognition rate, and non-recognition rate. Summary of the invention
[0007] Embodiments of the present invention provide a wake-up word detection model training method, an electronic device, and a storage medium, which are used to solve at least one of the above-mentioned technical problems.
[0008] In a first aspect, an embodiment of the present invention provides a wake-up word detection model training method, comprising: providing the wake-up word detection model with text information of the wake-up word as the input of the model, wherein the text information is used to strengthen the prediction of the posterior of each frame; using a modified cross entropy loss function, a frame-level detection loss function and a sequence-level detection loss function as training criteria for the model, wherein the modified cross entropy loss function is used to characterize the difference between wake-up words and non-wake-up words, and the frame-level sequence in the frame-level detection is mapped to the sequence-level sequence in the sequence-level detection after deduplication operation.
[0009] According to a second aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the wake-up word detection model training method and system of any embodiment of the present invention.
[0010] In a third aspect, an embodiment of the present invention further provides a computer program product, comprising a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes the steps of the wake-up word detection model training method and system of any embodiment of the present invention.
[0011] The embodiment of the present application can not only make full use of a large amount of existing data, but also greatly improve the robustness of the model. In addition, this solution can also randomly customize various wake-up words during the training process, and better constrain them through the detection loss we proposed. This enables us to obtain a robust and easy-to-use model. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0013] Figure 1 A flowchart of a wake-up word detection model training method provided by an embodiment of the present invention;
[0014] Figure 2 A flowchart of another wake-up word detection model training method provided by an embodiment of the present invention;
[0015] Figure 3 The structure of a wake-up word detection system with text prompts provided by an embodiment of the present invention;
[0016] Figure 4 An example of a frame-level detection process provided by an embodiment of the present invention;
[0017] Figure 5 An example of a sampling frame level sequence provided for an embodiment of the present invention;
[0018] Figure 6 The F1 scores obtained using different w values on the dev93 dataset provided by an embodiment of the present invention;
[0019] Figure 7 F1 score comparison of the baseline provided by an embodiment of the present invention;
[0020] Figure 8 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of 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.
[0022] Please refer to Figure 1 , which shows a flowchart of an embodiment of a wake-up word detection model training method and system of the present application.
[0023] like Figure 1 As shown, in step 101, the text information of the wake-up word is provided to the wake-up word detection model as the input of the model, wherein the text information is used to strengthen the prediction of the posterior for each frame;
[0024] In step 102, a modified cross entropy loss function, a frame-level detection loss function, and a sequence-level detection loss function are used as training criteria for the model, wherein the modified cross entropy loss function is used to characterize the difference between wake-up words and non-wake-up words, and the frame-level sequence in the frame-level detection is mapped to the sequence-level sequence in the sequence-level detection after deduplication operation.
[0025] The embodiment of the present application can not only make full use of a large amount of existing data, but also greatly improve the robustness of the model. In addition, this solution can also randomly customize various wake-up words during the training process, and better constrain them through the detection loss we proposed. This enables us to obtain a robust and easy-to-use model.
[0026] In some optional embodiments, the input of the model includes acoustic features, keyword embedding sequences, and learnable filler sequences, wherein the learnable filler sequences provide non-keyword text information.
[0027] In some optional embodiments, the model outputs a frame-level posterior matrix, which is used to calculate the modified cross entropy loss function, the frame-level detection loss function and the sequence-level detection loss function.
[0028] In some optional embodiments, the calculation formula of the modified cross entropy loss function is:
[0029]
[0030] Among them, p t is the predicted probability of the corresponding label in the tth frame, w is the hyperparameter used to emphasize the wake-up word, and W represents the frame corresponding to the wake-up word.
[0031] In some optional embodiments, the calculation formula of the frame-level detection loss function is:
[0032]
[0033] Among them, pl corresponds to the probability of the label category, po corresponds to the probability of the output prediction category, TN indicates that the category of the frame is true negative, FP indicates that the category of the frame is false positive, TP indicates that the category of the frame is true positive and FN indicates that the category of the frame is false negative.
[0034] In some optional embodiments, the calculation formula of the sequence-level detection loss function is:
[0035]
[0036] Where T is the total number of frames, is the posterior of the i-th category at the t-th time frame.
[0037] In some optional embodiments, the model applies an attention mechanism, the hidden size is 240, the projection size is 48, and the dimension of text embedding is set to 48.
[0038] In some optional embodiments, the model includes a 5-layer deep feedforward sequential memory network and an output layer, so that it can be used on devices with relatively scarce resources.
[0039] It should be noted that the above method steps are not used to limit the execution order of each step. In fact, some steps may be executed simultaneously or in the opposite order to the specified step order, and this application has no limitation on this.
[0040] The following describes some problems encountered by the inventor in the process of implementing the present invention and a specific embodiment of the solution finally determined, so that those skilled in the art can better understand the solution of the present application.
[0041] In the process of implementing this application, the inventors found that the prior art has the following defects: (1) Keywords are usually preset at the factory and users generally cannot modify them at will, which has poor DIY (Do it yourself) properties; (2) Model performance has the potential to be improved. The inventors also found that the above defects are mainly caused by the following reasons: The current technology for customizing the wake-up word model is not mature enough. The wake-up accuracy and false wake-up are difficult to control.
[0042] When faced with the above defects, technicians in this field usually predefine one or a small number of wake-up words for users to use; or customize some syllables and let users combine their own wake-up words, but it is not possible to fully customize. Our solution provides users with more freedom, but it also requires the model to have a stronger ability to model and distinguish each phoneme.
[0043] The method of the embodiment of the present application randomly selects keywords for training during the model training process, so that the model has the ability to define wake-up words at will when used. At the same time, we return the detection problem to its origin and propose multiple levels of detection Loss (Loss Function) to make the model naturally have stronger detection capabilities.
[0044] Please refer to Figure 2 , which shows a structural block diagram of a specific example of a wake-up word detection model training method and system provided by an embodiment of the present invention.
[0045] like Figure 2 As shown in the figure, this solution can not only make full use of a large amount of existing data, but also greatly improve the robustness of the model. In addition, this solution can also randomly customize various wake-up words during the training process, and better constrain them through the detection loss we proposed. This allows us to obtain a robust and easy-to-use model.
[0046] The following specific experiments and experimental data verify the beneficial effects of the embodiments of the present application compared with the prior art.
[0047] In the process of implementing this application, the inventors found that there are two possible directions to solve the above problem. One is to use an end-to-end model to directly predict the probability of the existence of keywords, and the other is to optimize the detection index in the training phase to solve the mismatch between training and evaluation. In the embodiment of this application, we focus on the latter direction to alleviate the mismatch and improve performance.
[0048] In this application example, we proposed a text adaptive detection framework for always-on keyword spotting tasks. We designed a low-memory streaming system that allows customization of arbitrary wake-up words and optimizes detection metrics. The core contributions are summarized as follows:
[0049] The present application embodiment proposes a wake-up word detection system that can customize any wake-up word using text adaptation technology combined with a modified weighted cross entropy loss. The loss assigns different weights to different frames based on the text adaptation information to distinguish between wake-up words and non-wake-up words.
[0050] To address the loss metric mismatch problem, we introduce frame-level detection metrics and sequence-level detection metrics to directly optimize the training process.
[0051] 2. Text Adaptive Detection
[0052] In this section, we propose a novel text-adaptive detection framework that directly formulates KWS as a detection problem rather than a classification problem. We first introduce the entire framework, including the network structure, training data annotation, model input and output, etc. Next, we introduce how to stream-fuse text information with acoustic features. Finally, we define a modified cross-entropy loss based on text cues.
[0053] Figure 3 The structure of the wake-up word detection system with text prompts is shown. The input of the system is the acoustic feature sequence and the modeling unit embedding corresponding to the keyword. We concatenate a filler embedding vector after the keyword embedding. The detection module uses the frame-level posterior matrix, the temporal information of the keyword, and the alignment corresponding to the utterance to calculate the loss and update the model. Among them, the Chinese and English correspondence is as follows: Alignments-alignment, One Best-best path, Sample-sample, Keyword Positon-keyword position, Frame Posterior-frame-level posterior probability, Detection Module-detection module, Model-model, Feed Forward-fully connected layer, Cross Attention-cross-modal attention module, Query-query, Key-key, Value-value, Audio Features-audio feature sequence, Text Prompt-text prompt, Keyword and FillerEmbedding-keyword and filler node feature sequence.
[0054] 2.1. Overview of Text Adaptive Detection Framework
[0055] Feedforward Sequential Memory Network (FSMN) is proposed to model long-term dependencies in sequential data without using cyclic feedback. Its modified version, named Compact Feedforward Sequential Memory Network (cFSMN), introduces projection layers by combining FSMN with low-rank matrix factorization to reduce the model size, which is beneficial for small footprint keyword spotting tasks. Since it has been shown to outperform RNN / LSTM and can learn more reliably and faster, we adopt this variant FSMN architecture as the backbone of our system to extract information from acoustic features.
[0056] We use monophonic as the modeling unit. Before training the wake-up word detection model, we pre-train a Gaussian Mixture Models-Hidden MarkovModel (GMM-HMM) acoustic model using the same dataset to provide forced alignment to create frame-level acoustic targets. During the training phase, the input to our model includes acoustic features, keyword embedding sequences, and learnable padding embeddings designed to provide non-keyword text information such as hn / ai (not for keywords) labels for non-keyword frames. The model outputs a frame-level posterior matrix, which is used in the detection module to calculate the L tp , L fd and L sd The loss function of the proposed system is as follows: Figure 1 shown.
[0057] During the testing phase, wake-up word detection can be done by simply feeding the test audio and the customized wake-up word into the trained model, followed by a scoring algorithm including posterior smoothing and confidence calculation.
[0058] 2.2. Classification Model with Text Prompts
[0059] Textual hints refer to textual information that provides keywords to the model as input to promote biased classification and make the model more sensitive to keywords. During training, we randomly select a continuous token subsequence from the monophone sequence of the transcript as the keyword phoneme sequence. Then, the acoustic embedding and the token embedding are fused through the cross attention module. In the test phase, we can customize any keyword by using different phoneme sequences as textual hints.
[0060] Some previous works share similar ideas to leverage information from acoustic features and text embeddings of wake-up words. Our work differs from previous works in two aspects. (1) In this work, we use textual cues to strengthen the prediction of each frame posterior, while in previous works, textual information is used to locate the position of keywords and detect utterances. (2) In addition, in our work, additional padding vectors are used to model non-wake-up words. All processes are as follows Figure 3 shown.
[0061] 2.3. Modified Cross Entropy Loss Function
[0062] We use a modified cross entropy loss function as the training criterion. The loss can be calculated as:
[0063]
[0064] where p tis the predicted probability of the corresponding label in the tth frame. w is a hyperparameter used to emphasize the wake-up word, and W represents the frame corresponding to the wake-up word.
[0065] The modified cross entropy loss can be thought of as the distinction between wake-up words and non-wake-up words. In this work, keywords are randomly selected for each utterance in different epochs, and the start and end timestamps are obtained instantaneously. The temporal information is then used to calculate the loss defined in Equation 1. Therefore, using weights w>1 naturally encourages the model to pay more attention to the frames corresponding to the keywords.
[0066] 3. Training detection module
[0067] In this section, we introduce the proposed training criteria to address the loss metric mismatch problem in the wake-up word detection task. More specifically, we propose frame-level and sequence-level detection procedures, respectively, to enhance the ability to detect keywords provided by textual cues.
[0068] 3.1. Frame-level detection loss
[0069] Predicting a single tone in each frame can be regarded as a frame-level single tone detection task. Therefore, the frames can be divided into four categories, namely true negative (TN), false positive (FP), true positive (TP) and false negative (FN). The category is determined by whether the frame in the reference and hypothesis belongs to the wake-up word. For example, Figure 2 As shown, the red nodes represent the frames belonging to the keyword. If both nodes in Ref and Hyp are red, the frame is determined to be a TP frame. Since the text prompt already provides the temporal information of Ref, we only need to calculate the temporal information of Hyp. First, the hypothesis is generated through a greedy search, in which each frame adopts the phoneme with the highest probability. After obtaining an optimal frame-level sequence, a deduplication operation is applied to map the frame-level sequence to the sequence level, and the index of each token is recorded. The Knuth-Morris-Pratt (KMP) algorithm is then used to find all matching points between the text prompt and the phoneme sequence generated by the hypothesis. It is worth noting that there may be 0, 1, or more matching points. Based on the matching results, the location of the keyword can be determined, and then mapped back to the frame level to obtain the temporal information of the hypothesis. Finally, a frame-level detection module is used to classify each frame into one of four categories. We Figure 2 An example of two matching points is shown in the hypothesis in .
[0070] The cross entropy loss is used to optimize frames with the correct category (TN and TP). At the same time, it is also used for FN frames to push the prediction towards the correct label. However, for FP frames, we do not care about their target category, so we reformulate the classification of FP frames as a binary detection problem and reduce the probability of predicting the wake-up word. The final frame-level detection loss is defined as follows:
[0071]
[0072] where p l The probability corresponding to the label category; p o Corresponds to the probability of the output predicted class.
[0073] Figure 4 An example of the frame-level detection process is shown. In this figure, there are a total of T frames in the speech, and each frame belongs to one of the following four categories: TN, FP, TP, FN. Ref and Hyp represent reference (label) and hypothesis (prediction), respectively. The light-colored nodes represent the states corresponding to non-wake-up words, and the dark-colored nodes represent the states belonging to wake-up words. In the Hyp sequence, there are two potential matching points, the first one is not completely aligned with the reference, and the latter is a false alarm. Among them, the Chinese and English comparisons are as follows: non-wakp word frame-non-wake-up word frame, wakp word frame-wake-up word frame.
[0074] 3.2. Sequence-level detection loss
[0075] After deriving the output of the frame-level posterior matrix, we sample some frame-level sequences according to the posterior. The sampling process is as follows Figure 3 The log probability of each sequence is defined as:
[0076]
[0077] Where T is the total number of frames, is the posterior of the i-th category at the t-th time frame.
[0078] We then use a deduplication operation to merge the same consecutive monophones in Section 3.1, so we get a monophone sequence for each hypothesis. We can then detect whether the keyword appears in the hypothesis sequence. The reward function is defined as: if the keyword appears, the sample gets a reward r = 1; otherwise, r = -1.
[0079] According to the REINFORCE (Monte-Carlo policy gradient) rule, we can calculate the reward for each utterance as follows:
[0080]
[0081] Where n is the number of samples sampled by the sampler and j represents the index of each sample. The variable baseline is defined as:
[0082]
[0083] Figure 5An example of a sampled frame-level sequence is shown. In this figure, there are T frames in the utterance, and each frame can be predicted into D classes. The sequence is sampled from a categorical distribution, and the total number of samples for each utterance is n=4.
[0084] Finally, the sequence-level loss function for training the detection module using the policy gradient strategy is:
[0085]
[0086] 4. Experiments and Results
[0087] Dataset
[0088] The Wall Street Journal (WSJ) is used to evaluate the effectiveness of our ideas. We use the scripts in Kaldi for data preparation. During training, each word has a chance to be randomly selected as a keyword if the length of the corresponding phoneme sequence is between `min=3 and `max=9. In our experiments, `min and `max are based on the maximum and minimum keyword lengths of the test set to maintain consistency between training and testing. Since our goal is to build a model to detect arbitrary wake-up words, we randomly select wake-up words in the test set according to the following rules: (1) The keyword must appear at least 5 times in the reference to ensure that there are enough positive examples to evaluate the performance and reduce randomness. (2) The keyword is not a chord. Since we only have a single acoustic model and no language model, we must avoid the appearance of polyphonic words to ensure a one-to-one mapping between words and monophonic sequences. After meeting these two requirements, we finally selected 80 words in the dev93 set, 56 words in the ev92 set, and 29 words in the ev93 set. In addition, we randomly selected 20 utterances that do not contain any keywords as the negative dataset. Finally, we selected 37,396 utterances for training, 503 utterances for development, and 333 (ev92) and 213 (ev93) utterances for testing.
[0089] 4.2. Configuration
[0090] The baseline model consists of 5 deep feedforward sequential memory network (DFSMN) layers and an output layer with 75 nodes corresponding to a set of phonemes from the CMU pronunciation dictionary. The hidden size and projection size are 256 and 64, respectively. The larger baseline consists of 7 DFSMN layers with a hidden size of 1024 and a projection size of 256. The model with the text hint module also consists of 5 layers, consistent with the baseline model. Since our model applies the attention mechanism, we reduce the hidden size to 240, the projection size to 48, and set the dimensionality of the text embedding to 48 to make the total number of model parameters comparable.
[0091] In the embodiment of the present application, the acoustic features are 40-dimensional logarithmic Mel filter bank coefficients extracted using a 25 millisecond Hamming window and a 10 millisecond window jump. We splice 5 frames from the left and right, a total of 440-dimensional vectors as the input of the model. We set the frame jump parameter to 3 to reduce the computational cost of the model.
[0092] Figure 6 Shown are the F1 scores obtained using different values of w on the dev93 dataset.
[0093] We use the standard cross entropy loss to train the baseline. The proposed model with textual hints uses L in Eq. (1) tp When using the frame-level detection loss L proposed above, fd and sequence-level detection loss L sd When optimizing a model, its parameters are initialized by a well-trained model whose loss L tp Optimize with a lower learning rate. The final model is optimized in a multi-task manner using the loss L:
[0094]
[0095] Since α and β are hyperparameters, we empirically set α = 1000 and β = 0.001 as they yielded the best performance in our experiments.
[0096] Evaluation metrics
[0097] As described in Section 3, we incorporate multi-level detection metrics into model training. To alleviate the loss metric mismatch, we use detection statistics (TN, FP, TP, FN) to construct the loss function. We use these statistics to calculate precision, recall, and F1-scores (F1 scores). For each test dataset, micro F1 scores are used to measure system performance.
[0098] 4.4. Impact of weight w on loss
[0099] To study the effect of different weights w in equation (1), we tested different w values from 1 to 25. The results are shown in Figure 4 As shown in Figure 2. When w = 1, our modified loss degenerates into the original cross entropy loss and obtains the worst performance. Experimental results show that the best performance is achieved around w = 15. For comparison, we also use the original cross entropy with L fd and L sd The model was fine-tuned using the trained detection module together, instead of the training standard proposed in Eq. (7). The results show that this does not perform as well as using w = 15, so it is not shown in the table. Therefore, in the following experiments, we only show the results obtained with w = 15 compared to Ltp Related experimental results.
[0100] Results
[0101] Figure 7 A screenshot of Table 1 of an embodiment of the present application is shown, which shows the F1 score comparison of the baseline, the attention model with text prompts, and the attention model with text prompts and training detection modules. The Chinese and English comparisons are as follows: Model-model, Baseline-baseline model, Larger Baseline-large model, Text Prompt-with text prompt model, Frame level-frame level criteria, Sequence level-sequence level criteria, Frame-frame level, Sequence-sequence level, #Param.-number of parameters, #MACs-computation amount, Dataset-dataset.
[0102] The present application embodiment presents the experimental results in Table 1. For simplicity, we only show the F1 score, which reflects the combined results of precision and recall. The baseline model consists of 5 DFSMN layers with a total of 270k parameters, while the larger model has 4000k parameters. For comparability, our proposed model has only 268k parameters, slightly smaller than the baseline model. The number of MACs for each model is calculated on 1 second samples. It also shows that our proposed model has a relatively small computational cost compared to the baseline model. When only text prompts are used, our method can significantly outperform the baseline model and even beat a larger baseline model. Compared with the baseline models on the dev93, ev92, and ev93 datasets, it achieves relative improvements of 14.79%, 16.77%, and 6.35%, respectively.
[0103] In addition, we train models using text cues with both frame-level and sequence-level trained detection modules. In addition to the frame-level detection method on the EV92 dataset, both methods can further improve the performance of the basic text-cue based model. According to our failure analysis on EV92, the text-cue based model with frame-level trained detection module improves the recall but reduces the precision, resulting in a lower F1 score overall. The increase in recall means a decrease in the number of false positives, which is consistent with our special treatment of FP frames in Section 3.1. It shows that the model is trained in the direction we expect. These experimental results show that both our frame-level and sequence-level training methods can effectively assist detection model training.
[0104] The embodiment of the present application finally merges all three modules, modifies the training criterion to equation (7), and fine-tunes the previously trained model at a lower learning rate. Compared with the baseline model, the combination of the proposed methods achieves final relative improvements of 22.83%, 19.22%, and 8.59% on the three datasets, respectively. Compared with the larger baseline, although its parameter size is 15 times larger than that of our proposed system, we still obtain relative improvements of 9.03%, 10.14%, and 3.85%. The above observations show the great potential of our system and illustrate that our system is very suitable for deployment on low-resource devices and well meets the requirements of the wake-up word detection task.
[0105] 5. Conclusion
[0106] In an embodiment of the present application, we propose a text adaptive detection framework for the always-on keyword spotting task, which can customize arbitrary wake-up words and solve the mismatch between DNN training criteria and keyword detection metrics. We introduced a modified version of text prompts with cross-entropy loss to distinguish frames belonging to wake-up words and non-wake-up words. With the proposed text prompt module, we can randomly sample wake-up words during training and then use multi-level detection criteria to assist training. For comparable model sizes, our method significantly outperforms the baseline in the test dataset; even if the baseline model has 15 times more parameters than ours, the proposed system can still achieve better performance. In future work, we will explore more fine-grained detection criteria and further improve the generalization ability of the model.
[0107] In some other embodiments, the embodiments of the present invention further provide a non-volatile computer storage medium, the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the wake-up word detection model training method and system in any of the above method embodiments;
[0108] As an implementation mode, the non-volatile computer storage medium of the present invention stores computer executable instructions, and the computer executable instructions are configured as follows:
[0109] Providing the wake-up word detection model with text information of the wake-up word as input to the model, wherein the text information is used to strengthen the prediction of the posterior for each frame;
[0110] A modified cross entropy loss function, a frame-level detection loss function, and a sequence-level detection loss function are used as training criteria for the model, wherein the modified cross entropy loss function is used to characterize the difference between wake-up words and non-wake-up words, and the frame-level sequence in the frame-level detection is mapped to the sequence-level sequence in the sequence-level detection after deduplication operation.
[0111] The non-volatile computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the wake-up word detection model training method and system, etc. In addition, the non-volatile computer-readable storage medium may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the non-volatile computer-readable storage medium may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the wake-up word detection model training method and system via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0112] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes any of the above-mentioned wake-up word detection model training methods and systems.
[0113] Figure 7 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 7 As shown, the device includes: one or more processors 710 and a memory 720, Figure 7 A processor 710 is taken as an example. The device of the wake-up word detection model training method and system may also include: an input device 730 and an output device 740. The processor 710, the memory 720, the input device 730 and the output device 740 may be connected via a bus or other means. Figure 7 The example of connecting through a bus is taken. The memory 720 is the above-mentioned non-volatile computer-readable storage medium. The processor 710 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 720, that is, the wake-up word detection model training method and system of the above-mentioned method embodiment are realized. The input device 730 can receive input digital or character information, and generate key signal input related to user settings and function control of the communication compensation device. The output device 740 may include display devices such as display screens.
[0114] The above product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0115] As an implementation mode, the electronic device is applied to a wake-up word detection model training method and system, and is used for a client, including: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can:
[0116] Providing the wake-up word detection model with text information of the wake-up word as input to the model, wherein the text information is used to strengthen the prediction of the posterior for each frame;
[0117] A modified cross entropy loss function, a frame-level detection loss function, and a sequence-level detection loss function are used as training criteria for the model, wherein the modified cross entropy loss function is used to characterize the difference between wake-up words and non-wake-up words, and the frame-level sequence in the frame-level detection is mapped to the sequence-level sequence in the sequence-level detection after deduplication operation.
[0118] The electronic device of the embodiment of the present application exists in various forms, including but not limited to:
[0119] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0120] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0121] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
[0122] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to the general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc.
[0123] (5) Other electronic devices with data interaction functions.
[0124] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0126] 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. A wake-up word detection model training method, include: Providing the wake-up word detection model with text information of the wake-up word as input to the model, wherein the text information is used to strengthen the prediction of the posterior for each frame; A modified cross entropy loss function, a frame-level detection loss function, and a sequence-level detection loss function are used as training criteria for the model, wherein the modified cross entropy loss function is used to characterize the difference between wake-up words and non-wake-up words, and the frame-level sequence in the frame-level detection is mapped to the sequence-level sequence in the sequence-level detection after deduplication operation.
2. The method according to claim 1, in, The input to the model includes acoustic features, keyword embedding sequences, and learnable filler sequences that provide non-keyword textual information.
3. The method according to claim 2, in, The model outputs a frame-level posterior matrix, which is used to calculate the modified cross entropy loss function, the frame-level detection loss function and the sequence-level detection loss function.
4. The method according to claim 3, in, The calculation formula of the modified cross entropy loss function is: Among them, p t is the predicted probability of the corresponding label in the tth frame, w is the hyperparameter used to emphasize the wake-up word, and W represents the frame corresponding to the wake-up word.
5. The method according to claim 4, in, The calculation formula of the frame-level detection loss function is: Among them, p l The probability corresponding to the label category, p o Corresponding to the probability of the output predicted class, TN indicates that the class of the frame is true negative, FP indicates that the class of the frame is false positive, TP indicates that the class of the frame is true positive and FN indicates that the class of the frame is false negative.
6. The method according to claim 5, in, The calculation formula of the sequence-level detection loss function is: Where T is the total number of frames, is the posterior of the i-th category at the t-th time frame.
7. The method according to any one of claims 1 to 6, in, The model applies the attention mechanism, the hidden size is 240, the projection size is 48, and the dimension of text embedding is set to 48.
8. The method according to claim 7, in, The model consists of a 5-layer deep feed-forward sequential memory network and an output layer.
9. An electronic device, wherein include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method described in any one of claims 1 to 8.
10. A storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
