Wakeup word speech recognition method and apparatus, computer device, and storage medium
Patent Information
- Application Number
- CN202511572037.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2045-10-30
AI Technical Summary
[0004]本发明提供一种唤醒词语音识别方法、装置、计算机设备和存储介质,旨在解决现有技术中唤醒词语音误识别率高的技术问题
本发明的唤醒词语音识别方法,以唤醒词识别网络为基础,通过“队列维护-音素筛选-向量生成-细粒度判别”四步实现优化。首先维护队列存储网络输出的音素概率分布,中文场景下音素为声韵母组合,英文场景下音素为基础发音单元;每次推理先判断blank分值,若大于阈值则跳过,小于阈值则排序并保存前Top-k个音素的得分与序号,减少存储占用。队列长度按唤醒词时长设定,由音频分帧步长、网络下采样率、blank占比决定,且按先入先出规则更新。注册阶段通过队列音素位置的最大池化生成注册向量,识别阶段对缓存队列池化得实时向量,再通过向量相似度和/或音素集合公共部分阈值判断是否唤醒。本发明的唤醒词语音识别方法,一是高效轻量,可以复用现有网络无额外计算消耗,单独申请内存仅0.5k左右,适配低资源设备;二是降误识别,突破传统句子级判别局限,引入音素级细粒度比较,如“小黄小黄”与“小美小美”等相近词可精准区分;三是优化灵活,识别网络与自定义网络独立,后续可分别迭代升级,无需整体调整,满足智能家居、智能终端等场景的实际应用需求。
Smart Images

Figure CN121506153B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of speech recognition, and in particular, to a wake-up word speech recognition method, apparatus, computer device and storage medium. Background Art
[0002] Recognition of wake-up word speech belongs to the field of speech recognition, and is widely applied to voice controls of smart devices. Custom wake-up word speech allows users to dynamically register wake-up word speech and achieve rapid adaptation, making the use of smart devices more user-friendly. When deploying custom wake-up words on low-resource devices, since command speech recognition needs to be supported simultaneously, the network is required to be extremely lightweight and have low computing power consumption. The problem arises therefrom that such customization generally performs comparison at sentence-level similarity, and cannot further distinguish fine-grained differences, resulting in a large number of false recognitions. For example, when the registered wake-up word is "Xiao Huang Xiao Huang", utterances like "Xiao Mei Xiao Mei" and "Xiao Hua Xiao Hua" made by a user can also trigger the wake-up, leading to numerous false wake-ups.
[0003] Therefore, how to reduce false recognition of custom wake-up words without introducing excessive computing resources and consumption is an urgent problem to be solved. Summary of the Invention
[0004] The present invention provides a wake-up word speech recognition method, apparatus, computer device and storage medium, aiming at solving the technical problem of high false recognition rate of wake-up word speech in the prior art.
[0005] In order to achieve the above invention object, a first aspect of the present invention provides a wake-up word speech recognition method, comprising: calculating, by a wake-up word recognition network, a first probability distribution of each phoneme in input speech; determining whether a blank score in the first probability distribution is less than a first threshold; if yes, sorting the first probability distribution of each phoneme, selecting a preset number of target phonemes at the top, and saving the scores and phoneme sequence numbers of each target phoneme as an effective phoneme distribution; inputting the effective phoneme distribution into a queue with a preset length according to a first-in first-out rule, and performing maximum pooling on probability values of the same phoneme sequence number in the queue at different time points to generate an effective phoneme distribution vector; outputting a recognition result of the input speech based on the effective phoneme distribution vector and a preset registered phoneme distribution vector.
[0006] Further, the outputting a recognition result of the input speech based on the effective phoneme distribution vector and a preset registered phoneme distribution vector comprises: calculating a first similarity between the effective phoneme distribution vector and the registered phoneme distribution vector; If the first similarity is greater than the first similarity threshold, then the correct recognition result of the input speech is output.
[0007] Further, the step of outputting the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector includes: The phonemes in the effective phoneme distribution vector that are greater than a first vector threshold are obtained to form a first phoneme set; and the phonemes in the registered phoneme distribution vector that are greater than the first vector threshold are obtained to form a second phoneme set. Calculate the number of intersections between the first phoneme set and the second phoneme set; If the number of intersections is greater than a preset intersection threshold, then the correct recognition result of the input speech is output.
[0008] Further, the step of outputting the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector includes: Calculate the first similarity between the effective phoneme distribution vector and the registered phoneme distribution vector; The phonemes in the effective phoneme distribution vector that are greater than a first vector threshold are obtained to form a first phoneme set; and the phonemes in the registered phoneme distribution vector that are greater than the first vector threshold are obtained to form a second phoneme set. Calculate the number of intersections between the first phoneme set and the second phoneme set; If the number of intersections is greater than a preset intersection threshold, and the first similarity is greater than a first similarity threshold, then the correct recognition result of the input speech is output.
[0009] Further, before calculating the first probability distribution of each phoneme in the input speech through the wake word recognition network, the following steps are included: Receive the input voice; Calculate the overall speech vector of the input speech; Calculate the second similarity between the overall speech vector and the preset overall registered speech vector; If the second similarity is greater than the second similarity threshold, then the step of calculating the probability distribution of each phoneme in the input speech is performed.
[0010] Furthermore, the method for setting the length of the queue includes: Based on a pre-set corpus sample, the duration of wake word speech with different numbers of words was counted. The duration of the current wake word is determined based on the number of words in the current wake word speech. The step size of the audio feature frame segmentation is obtained, and the length of the queue is set by combining the duration of the current wake word speech, the proportion of blank in the current wake word speech output, and the downsampling rate of the wake word recognition network.
[0011] Further, before calculating the first probability distribution of each phoneme in the input speech through the wake word recognition network, the following steps are included: The second probability distribution of each phoneme in the current wake word speech is calculated using a wake word recognition network; Determine whether the blank score in the second probability distribution is less than the first threshold; If so, sort the second probability distribution of each phoneme, select the first preset number of registered phonemes, and save the score and phoneme number of each registered phoneme as the registered phoneme distribution; The registered phoneme distribution is input into the queue according to the first-in-first-out rule. Max pooling is performed on the probability values of the same phoneme index at different time points in the queue to generate a registered phoneme distribution vector.
[0012] A second aspect of the present invention provides a wake-word speech recognition device, comprising: The computing unit is used to calculate the first probability distribution of each phoneme in the input speech through the wake word recognition network; The judgment unit is used to determine whether the blank score in the first probability distribution is less than a first threshold. The selection unit is used to sort the first probability distribution of each phoneme if the blank score in the first probability distribution is less than the first threshold, select a preset number of target phonemes, and save the score and phoneme number of each target phoneme as an effective phoneme distribution. The max pooling unit is used to input the effective phoneme distribution into a queue of preset length according to the first-in-first-out rule, and to perform max pooling on the probability values of the same phoneme index at different time points in the queue to generate an effective phoneme distribution vector. The recognition unit is used to output the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector.
[0013] A third aspect of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the wake word speech recognition method described in any of the preceding claims.
[0014] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the wake word speech recognition method described in any of the preceding claims.
[0015] Beneficial effects: The wake-up word speech recognition method of the present invention is based on a wake-up word recognition network, and realizes optimization through four steps of "queue maintenance-phoneme screening-vector generation-fine-grained discrimination". First, a queue is maintained to store the phoneme probability distribution output by the network. In Chinese scenarios, phonemes are combinations of initials and finals, and in English scenarios, phonemes are basic pronunciation units; in each inference, the blank score is judged first, if it is greater than the threshold, it is skipped, and if it is less than the threshold, the scores and sequence numbers of the top-k phonemes are sorted and saved, which reduces storage occupation. The queue length is set according to the duration of the wake-up word, determined by the audio framing step, the network downsampling rate, and the blank ratio, and is updated according to the first-in-first-out rule. In the registration phase, a registration vector is generated through maximum pooling of phoneme positions in the queue; in the recognition phase, a real-time vector is obtained by pooling the cache queue, and then whether to wake up is determined according to vector similarity and / or a threshold for the common part of the phoneme set. The wake-up word speech recognition method of the present invention has three advantages: first, it is efficient and lightweight, can reuse the existing network without additional computational consumption, and only applies for about 0.5k of independent memory, which is adapted to low-resource devices; second, it reduces false recognition, breaks through the limitation of traditional sentence-level discrimination, and introduces phoneme-level fine-grained comparison, for example, similar words such as "Xiao Huang Xiao Huang" and "Xiao Mei Xiao Mei" can be accurately distinguished; third, it is flexible to optimize, the recognition network is independent of the custom network, and they can be iteratively upgraded separately in the subsequent process without overall adjustment, which meets the actual application requirements of scenarios such as smart homes and smart terminals. Description of Drawings
[0016] Figure 1 is a schematic flow chart of a wake-up word speech recognition method according to an embodiment of the present invention; Figure 2 is a schematic structural block diagram of a wake-up word speech recognition device according to an embodiment of the present invention; Figure 3 is a structural schematic diagram of a computer device according to an embodiment of the present invention.
[0017] The implementation, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed Description of the Embodiments
[0018] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0019] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any modules and all combinations of one or more associated listed items.
[0020] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0021] Reference Figure 1 This invention provides a wake-word speech recognition method, comprising the following steps: S1: Calculate the first probability distribution of each phoneme in the input speech through the wake word recognition network.
[0022] In this step, the wake word recognition network is a neural network model used to recognize each phoneme in input speech, and it is a lightweight model in this embodiment, suitable for low-resource devices. For Chinese, the output phonemes are initials and finals; for English, the output phonemes are basic pronunciation units. The first probability distribution is a vector composed of probability values of occurrence of each phoneme output by the wake word recognition network, each element in the vector corresponds to the probability of one phoneme, the probability value ranges from [0,1], representing the possibility that the phoneme occurs in the current speech segment. When a user inputs speech (e.g., "xiǎo huáng xiǎo huáng"), the wake word recognition network processes the speech, extracts speech features (Mel-frequency Cepstral Coefficients (MFCC)), and obtains the probability distribution of each phoneme through model inference. For example, for the input speech "xiǎo huáng xiǎo huáng", the network may output the probability distribution of initials and finals such as "xiǎo" and "huáng". Assuming that the wake word recognition network supports 100 phonemes, the pinyin corresponding to the input speech "xiǎo huáng" is "xiǎo huáng", in the first probability distribution output by the network, the probability of the initial "x" of "xiǎo" is 0.9, and the probability of the final "iǎo" is 0.85; the probability of the initial "h" of "huáng" is 0.92, the probability of the final "uáng" is 0.88, and the probabilities of other phonemes are relatively low. Obtaining the phoneme probability distribution through the wake word recognition network provides a data basis for subsequent fine-grained discrimination, enabling discrimination to be performed based on phoneme-level features instead of only staying at the sentence level.
[0023] S2: determining whether the blank score in the first probability distribution is less than a first threshold value.
[0024] In this step, the above blank score is the probability value of a special marker representing "invalid phoneme" or "speech blank" in the first phoneme probability distribution, which is used to indicate the amount of valid phoneme information in the current speech segment. The first threshold value is a preset critical value for determining whether the blank score is valid, and is usually set to a relatively large value (e.g., 0.99), which can be adjusted according to actual application scenarios. For the first probability distribution output by the wake word recognition network, the blank score therein is extracted and compared with the first threshold value. If the blank score is greater than or equal to the first threshold value, it indicates that there is very little valid phoneme information in the current speech segment (such as speech pauses, background noise, etc.), and this output can be skipped; if the blank score is less than the first threshold value, it indicates that the current output contains valid phoneme information and needs further processing. Assuming the first threshold value is set to 0.99, the blank score output by the network in a certain inference is 0.95, which is less than 0.99, indicating that this output contains valid phoneme information and needs to be processed further; if the blank score is 0.995, this output is skipped. Screening valid speech segments through the blank score reduces the processing of invalid data, lowers the computation and storage requirements, and meets the requirements of low-resource devices.
[0025] S3: If so, sort the first probability distribution of each phoneme, select a preset number of target phonemes, and save the score and phoneme number of each target phoneme as the effective phoneme distribution.
[0026] In this step, the target phonemes are selected from the first probability distribution, with a predetermined number of Top-k phonemes (k being a positive integer). The score of each target phoneme is its probability value in the first probability distribution. The phoneme number is a unique identifier used to associate specific phonemes, such as the fixed numbers for Chinese initials and finals, or English phonemes. The effective phoneme distribution is a data structure consisting of the scores and phoneme numbers of the target phonemes. When the blank score is less than the first threshold, the probability values of each phoneme are sorted in descending order, and the top k phonemes (k being a predetermined number, such as 5) are selected as target phonemes. The score and phoneme number of each target phoneme are saved, forming the effective phoneme distribution. This significantly reduces the amount of data stored, retaining only the key phonemes with high probabilities. Assuming a preset quantity k=5, after ranking the probabilities of each phoneme in the first probability distribution, the top 5 phonemes are "x" (0.9), "h" (0.92), "iǎo" (0.85), "uáng" (0.88), and "ng" (0.75), with corresponding phoneme numbers of 10, 20, 30, 40, and 50, respectively. The effective phoneme distribution stores the scores and numbers of these 5 phonemes. Only storing the scores and numbers of the top-k phonemes reduces storage space (memory consumption is only about 0.5k) while retaining key phoneme information, thus not affecting the accuracy of subsequent discrimination.
[0027] S4: Input the effective phoneme distribution into a queue of preset length according to the first-in-first-out rule, and perform max pooling on the probability values of the same phoneme index at different time points in the queue to generate an effective phoneme distribution vector.
[0028] In this step, the aforementioned queue is a first-in, first-out (FIFO) data structure used to store the valid phoneme distribution. Its length is preset and covers the duration of the wake-up word. The FIFO rule means that new valid phoneme distributions are added to the tail of the queue, and old data at the head of the queue is removed, ensuring that the queue always stores the latest valid phoneme distributions. Max pooling takes the maximum probability value of the same phoneme index at different time points in the queue, generating a fixed-length vector. The valid phoneme distribution vector is a vector generated through max pooling, where each dimension corresponds to a phoneme index, and the value is the maximum probability value of that phoneme index at each time point in the queue. The valid phoneme distributions are input into the queue according to the FIFO rule, and the queue length is set according to the wake-up word duration (e.g., 3 seconds corresponds to a queue length of 50). After the queue stores a certain number of valid phoneme distributions, max pooling is performed on the probability values of the same phoneme index at different time points to obtain the valid phoneme distribution vector. For example, the probability values of phoneme index 10 at each time point in the queue are [0.9, 0.8, 0.95], and after pooling, the value of this dimension is 0.95. Assuming a queue length of 50, an input speech duration of approximately 3 seconds ("Xiao Huang Xiao Huang"), a frame step size of 10ms, and a network downsampling rate of 4x, a queue length of 50 is sufficient; an excessively long queue is unnecessary. Each generated effective phoneme distribution is enqueued according to a first-in, first-out (FIFO) rule. When the queue is full, the maximum probability value for each phoneme index in the queue is taken to generate a 50-dimensional effective phoneme distribution vector. Through queue maintenance and max-pooling operations, a vector representing the phoneme features of the input speech is generated, achieving temporal aggregation of speech features, highlighting the features of key phonemes, and providing an accurate vector representation for subsequent similarity comparisons.
[0029] S5: Based on the effective phoneme distribution vector and the preset registered phoneme distribution vector, output the recognition result of the input speech.
[0030] In this step, the aforementioned registered phoneme distribution vector refers to the vector generated when registering a custom wake word. It is obtained by max pooling the effective phoneme distribution of the registered speech and is used to compare with the real-time generated effective phoneme distribution vector. The real-time generated effective phoneme distribution vector is compared with the preset registered phoneme distribution vector, and the recognition result of whether the input speech is a registered wake word is output based on the comparison result. Comparison methods can include similarity calculation, phoneme set intersection calculation, etc., as explained in detail below. By comparing the real-time vector (effective phoneme distribution vector) with the registered vector (registered phoneme distribution vector), the discrimination of custom wake words is achieved. Based on phoneme-level vector comparison, wake words with similar pronunciations can be distinguished, reducing the false recognition rate.
[0031] This embodiment provides a complete wake-word speech recognition method. It obtains the phoneme probability distribution through a wake-word recognition network, filters by blank scores and saves the top-k phonemes, maintains the effective phoneme distribution using a queue, generates vectors through max pooling, and finally outputs the recognition result based on vector comparison. This method processes at the phoneme level, achieving fine-grained discrimination. Simultaneously, queue maintenance and Top-k filtering ensure efficient operation on low-resource devices. It achieves fine-grained discrimination of custom wake-words, effectively reducing the false recognition rate based on phoneme-level feature comparison; it requires no additional computational resources, reuses existing networks, and reduces storage and computational load through Top-k filtering and queue maintenance; it is suitable for low-resource devices and meets the needs of smart home, smart terminal, and other scenarios. It should be noted that this application requires the use of a preset custom wake-word discrimination network. The custom wake-word discrimination network mainly outputs embeddings and compares their similarity with registered embeddings. In this embodiment, the wake-word recognition network is used to output phonemes, reusing the encoder part of the custom wake-word discrimination network for auxiliary judgment. The training corpus for the main network of custom recognition is a general corpus, possessing the recognition capability for general data. When the main network of custom recognition recognizes a custom wake word, the aforementioned wake word speech recognition method is configured to perform accurate recognition, achieving a comprehensive balance between the accuracy and misrecognition of custom word recognition.
[0032] In one embodiment, step S5, which outputs the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector, includes: S501: Calculate the first similarity between the effective phoneme distribution vector and the registered phoneme distribution vector.
[0033] In this step, the first similarity is used to measure the similarity between the effective phoneme distribution vector and the registered phoneme distribution vector. In this embodiment, cosine similarity is used, but other similarity calculation methods such as Euclidean distance can also be used. The cosine similarity is calculated between the real-time generated effective phoneme distribution vector and the registered phoneme distribution vector. Each dimension of the vector corresponds to a phoneme index, and the value is the maximum probability value of that phoneme index. The cosine similarity is obtained by calculating the ratio of the dot product of the two vectors to their magnitude. For example, if the registered phoneme distribution vector is V1=[0.9,0.85,0.92,0.88,0.75,...] and the effective phoneme distribution vector is V2=[0.88,0.86,0.9,0.87,0.76,...], the cosine similarity between the two is calculated as: cos(θ)=(V1•V2) / (||V1||•||V2||)=0.95. Cosine similarity calculation can effectively measure the degree of similarity between two vectors in a direction. It is suitable for comparing phoneme distribution vectors and provides a quantitative basis for wake word discrimination.
[0034] S502: if the first similarity is greater than a first similarity threshold, outputting a correct recognition result of the input speech.
[0035] In this step, the above-mentioned first similarity threshold is a preset critical value for determining whether to wake up, which can be adjusted according to actual application scenarios, for example, set to 0.9. Comparing the calculated first similarity with the first similarity threshold, if the similarity is greater than the threshold, it indicates that the phoneme distribution of the input speech is highly similar to the phoneme distribution of the registered wake word, and a correct recognition result is output; otherwise, no wake-up is output. For example, if the first similarity threshold is set to 0.9 and the calculated similarity is 0.95, which is greater than the threshold, it is output that the input speech "Xiao Huang Xiao Huang" is correctly recognized, and the device is woken up. By setting the similarity threshold, the accuracy and sensitivity of wake-up can be flexibly controlled, and the success rate of wake-up is improved while ensuring a low false recognition rate.
[0036] In this embodiment, the recognition result output mode based on similarity calculation is specifically described. By calculating the cosine similarity between the effective phoneme distribution vector and the registered vector and comparing it with a threshold, the wake word discrimination is realized. The method is simple and efficient in calculation and is suitable for low-resource devices. Specifically, based on vector similarity calculation, fine-grained discrimination is realized; the calculation complexity is low, no additional calculation burden is added, and it meets the requirements of low-resource devices; the accuracy and sensitivity of wake-up can be balanced by adjusting the similarity threshold.
[0037] In one embodiment, the step S5 of outputting the recognition result of the input speech based on the effective phoneme distribution vector and a preset registered phoneme distribution vector comprises: S511: acquiring phonemes greater than a first vector threshold in the effective phoneme distribution vector to form a first phoneme set; and acquiring phonemes greater than the first vector threshold in the registered phoneme distribution vector to form a second phoneme set.
[0038] In this step, the aforementioned first vector threshold is a preset critical value used to filter available phonemes. Phonemes with a probability value greater than this threshold in the vector are considered available phonemes. The first phoneme set is a set of available phonemes selected from the effective phoneme distribution vector whose probability value is greater than the first vector threshold, with each element being a phoneme index. The second phoneme set is a set of available registered phonemes selected from the registered phoneme distribution vector whose probability value is greater than the first vector threshold. Specifically, the effective phoneme distribution vector and the registered phoneme distribution vector are traversed respectively, and the probability value of each dimension is compared with the first vector threshold. Phoneme indices greater than the threshold are added to the corresponding set. For example, if the first vector threshold is set to 0.7, phoneme indices with a probability value greater than 0.7 in the vector are added to the set. For example, in the effective phoneme distribution vector, phoneme indices 10 (0.9), 20 (0.92), 30 (0.85), and 40 (0.88) are greater than the first vector threshold of 0.7, forming the first phoneme set {10,20,30,40}; in the registered phoneme distribution vector, phoneme indices 10 (0.9), 20 (0.92), 30 (0.85), 40 (0.88), and 50 (0.75) are greater than the threshold, forming the second phoneme set {10,20,30,40,50}. By selecting phonemes with higher probabilities to form a set, the focus is on comparing key phonemes, reducing unnecessary calculations, and highlighting phonemes that play a key role in the wake-up word.
[0039] S512: Calculate the number of intersections between the first phoneme set and the second phoneme set.
[0040] In this step, the aforementioned intersection count refers to the number of phoneme indices commonly found in both the first and second phoneme sets. Identify the identical phoneme indices in both sets and count their number. For example, if the first set is {10,20,30,40} and the second set is {10,20,30,40,50}, the intersection is {10,20,30,40}, and the intersection count is 4. By calculating the intersection count, the phoneme overlap between the input speech and the registered wake word is quantified, directly reflecting their consistency in key phonemes and providing an intuitive basis for judgment.
[0041] S513: If the number of intersections is greater than the preset intersection threshold, then output the correct recognition result of the input speech.
[0042] In this step, the aforementioned intersection threshold is a preset critical value for determining whether to wake up, which is set according to the number of phonemes of the wake word and the application scenario (e.g., set to 3). The calculated number of intersections is compared with the intersection threshold. If the number of intersections is greater than the threshold, it indicates that the input speech and the registered wake word have a high degree of coincidence in key phonemes, and a correct recognition result is output; otherwise, a non-wake-up output is generated. For example, if the intersection threshold is set to 3 and the calculated number of intersections is 4, which is greater than the threshold, it is output that the input speech "Xiao Huang Xiao Huang" is correctly recognized, and the device is woken up. If the input speech is "Xiao Mei Xiao Mei", the number of intersections between its phoneme set and the registered set may be less than the threshold, and the device cannot be woken up. The intersection judgment based on phoneme sets can distinguish similar wake words from the perspective of "phoneme existence", which is especially suitable for scenarios where pronunciations are similar but key phonemes are different (such as the difference in initials and finals between "Xiao Huang" and "Xiao Mei"), further reducing the false recognition rate.
[0043] In this embodiment, another wake word discrimination method is provided, which forms a set by extracting phonemes with high probability from the effective phoneme distribution vector and the registered vector, calculates the number of set intersections and compares it with a threshold. This method performs fine-grained discrimination from the dimension of "phoneme existence", and is suitable for wake word recognition requirements under different scenarios. In this embodiment, focusing on the coincidence analysis of key phonemes can effectively distinguish wake words with similar pronunciations but different phoneme compositions (such as the difference in initials between "Xiao Hua" and "Xiao Huang"), and solve the problem of high false recognition rate in sentence-level discrimination. It only requires set operation and quantity statistics, no complex vector multiplication, has small computation amount, and is suitable for deployment on low-resource devices. The discrimination strictness can be flexibly controlled by adjusting the intersection threshold, for example, increasing the threshold in noisy environments to reduce false wake-ups, and decreasing the threshold in quiet environments to improve the wake-up success rate.
[0044] In one implementation, the step S5 of outputting the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector includes: S521: calculating a first similarity between the effective phoneme distribution vector and the registered phoneme distribution vector; S522: acquiring phonemes in the effective phoneme distribution vector that are greater than a first vector threshold to form a first phoneme set; and acquiring phonemes in the registered phoneme distribution vector that are greater than the first vector threshold to form a second phoneme set; S523: calculating the number of intersections between the first phoneme set and the second phoneme set; S524: if the number of intersections is greater than a preset intersection threshold and the first similarity is greater than a first similarity threshold, outputting a correct recognition result of the input speech.
[0045] This embodiment combines the discrimination methods of "number of intersections > threshold" and "similarity > threshold" in the foregoing embodiments, and judges the wake-up word through the dual condition of "similarity + number of intersections". This method performs fine-grained discrimination from two dimensions of "overall feature matching" and "existence of key phonemes", forms a stricter discrimination logic, and is suitable for scenarios with extremely high requirements on false wake-up rate (such as financial equipment, smart home security control). The two conditions complement each other, avoiding misjudgment that may be caused by a single condition (for example, only high similarity but missing key phonemes, or only a large number of intersections but large overall feature difference), which greatly improves the reliability of discrimination. The discrimination stringency can be flexibly balanced by adjusting the two thresholds, for example, increasing the dual thresholds in high-security scenarios and lowering the thresholds in ordinary scenarios, which improves the adaptability of the solution. Although conditional judgment is added, the core calculation is still vector similarity and set operation, the increment of calculation amount is limited, and it still meets the performance requirements of low-resource devices.
[0046] In one embodiment, before step S1 of calculating the first probability distribution of each phoneme in the input speech through the wake-up word recognition network, the method includes: S10: receiving the input speech.
[0047] In this step, a user's speech input is received through an audio input device such as a microphone. For example, when the user says "Xiao Huang Xiao Huang", the device acquires a speech signal.
[0048] S20: calculating an overall speech vector of the input speech.
[0049] In this step, the foregoing overall speech vector is a vector that encodes the overall features of the input speech, which is usually extracted through traditional speech feature extraction methods (such as MFCC, Mel spectrum) or a lightweight neural network, and represents the overall acoustic features of the speech (such as pitch, speech rate, timbre, etc.). For example, 13-dimensional features are extracted through MFCC to form the overall speech vector.
[0050] S30: calculating a second similarity between the overall speech vector and a preset overall registered speech vector.
[0051] In this step, the foregoing overall registered speech vector is an overall speech feature vector extracted when registering a wake-up word, which has the same dimension as the overall speech vector of the input speech. The second similarity measures the similarity between the two overall speech vectors, and cosine similarity or Euclidean distance can be used. For example, similarity calculation is performed between the overall registered vector stored in the registration stage (such as the overall vector of "Xiao Huang Xiao Huang") and the overall vector of the real-time input speech. For example, the cosine similarity between the overall vector of the input speech and the registered vector is 0.85.
[0052] S40: if the second similarity is greater than a second similarity threshold, executing the step of calculating the probability distribution of each phoneme in the input speech.
[0053] In this step, the aforementioned second similarity threshold is a preset critical value for screening suspected wake words (e.g., 0.8). The subsequent phoneme-level processing is triggered only when the overall similarity exceeds the threshold. If the overall similarity is greater than the threshold, it indicates that the input speech may be a registered wake word, and the calculation of phoneme probability distribution is continued; if the similarity is less than the threshold, it is directly determined as a non-wake word, and the subsequent complex processing is skipped. For example, if the threshold is set to 0.8, and the similarity is 0.85 which is greater than 0.8, the phoneme-level processing is triggered; if the similarity is 0.7, the speech is directly ignored. Through the preliminary screening based on the overall speech vector, speeches that are obviously non-wake words (such as background noise and irrelevant dialogues) are filtered out, the number of phoneme-level processing is reduced, the amount of calculation is further decreased, and the response efficiency of the system is improved.
[0054] In this embodiment, a preliminary screening link based on the overall speech vector is added before the phoneme-level processing. This design forms a two-level discrimination architecture of "coarse screening via overall features → fine discrimination via phoneme features". Invalid speech is quickly filtered out through overall similarity first, and then fine-grained phoneme analysis is performed on suspected wake words, which optimizes the discrimination process. The frequency of phoneme-level processing is reduced by placing the coarse screening in the front, which can greatly reduce invalid calculation especially in noisy environments. Speeches that are obviously non-wake words are directly filtered out, which does not need to enter the complex phoneme processing flow, shortens the system response time, and improves user experience. The overall speech vector can capture the overall prosodic features of speech, has certain robustness to interference factors such as noise and speech rate changes, and reduces false triggering caused by environmental factors.
[0055] In one embodiment, the method for setting the length of the queue includes: Based on preset corpus samples, count the duration of wake word speeches with different word counts.
[0056] In this step, wake word corpora containing different word counts (such as 2 words, 3 words, and 4 words) are collected in advance, and the average pronunciation duration corresponding to each word count is counted through experiments. For example, statistics show that the average duration of a 2-word wake word is 1.5 seconds, that of a 3-word wake word is 2.5 seconds, and that of a 4-word wake word is 3.5 seconds.
[0057] Determine the duration corresponding to the current wake word speech based on the word count of the current wake word speech.
[0058] In this step, when a user registers a wake word, the word count of the wake word is obtained (for example, "Xiao Huang Xiao Huang" is 4 words), and the corresponding estimated duration is determined according to the statistical results. For example, a 4-word wake word corresponds to a duration of 3 seconds.
[0059] Obtain the step size for framing audio features, and set the length of the queue in combination with the duration corresponding to the current wake word speech, the proportion of blank in the output of the current wake word speech, and the downsampling rate of the wake word recognition network.
[0060] In this step, the aforementioned audio feature frame step size is the frame interval during speech signal processing, typically 10ms, 20ms, etc., determining the number of frames generated per second. The downsampling rate is the downsampling factor of the wake-word recognition network on the input features; for example, a 4x downsampling means the network outputs 1 / 4 of the input frames. The blank percentage is the proportion of outputs with a blank score greater than a threshold in the wake-word phoneme probability distribution output, reflecting the density of effective phonemes. The queue length is calculated as follows: Queue length = [(wake-word duration / frame step size) / downsampling rate] × (1 - blank percentage). For example: wake-word duration 3 seconds, frame step size 10ms (0.01 seconds), downsampling rate 4, blank percentage 30%, then: original frame count = 3 / 0.01 = 300 frames, network output frame count = 300 / 4 = 75 frames, effective frame count = 75 × (1 - 0.3) = 52.5, rounded down to 50 frames (queue length set to 50). The queue length is dynamically set based on the wake word duration, frame step size, downsampling rate, and blank ratio to ensure that the queue can cover the effective phoneme information of the wake word, avoiding storage waste due to an excessively long queue or information loss due to an excessively short queue.
[0061] This embodiment details the method for setting the queue length. This method calculates the queue length by statistically analyzing the corpus duration and combining it with technical parameters (frame step size, downsampling rate, blank percentage). This ensures the queue can fully capture the phonemic features of the wake word while optimizing storage resources. The queue length is dynamically adjusted based on the actual duration of the wake word and the effective phoneme density, avoiding potential "storage waste" (e.g., long queues for short wake words) or "information loss" (e.g., short queues for long wake words) that might result from a fixed-length queue. The queue length can be adjusted according to wake words with different word counts and different application scenarios (e.g., differences in blank percentages under different environments), improving the versatility of the solution. An appropriate queue length ensures that the stored effective phoneme distribution can fully represent the wake word features, providing sufficient data support for subsequent vector generation and similarity calculation, and avoiding misjudgments due to the loss of key phonemes caused by an excessively short queue.
[0062] In one embodiment, before step S1 of calculating the first probability distribution of each phoneme in the input speech using a wake-word recognition network, the method further includes: S100: Calculate the second probability distribution of each phoneme in the current wake word speech through the wake word recognition network.
[0063] In this step, when a user registers a wake word (such as entering "Xiao Huang Xiao Huang"), the wake word recognition network processes the registered speech and generates a probability distribution (second probability distribution) of each phoneme, which is consistent with the first probability distribution processing logic in the recognition stage mentioned above.
[0064] S101: determining whether a blank score in the second probability distribution is less than a first threshold.
[0065] In this step, the logic is consistent with that of "determining whether a blank score in the first probability distribution is less than a first threshold" in the foregoing embodiment. The effective phoneme distribution of registered speech is screened by the blank score, and blank or noise segments are filtered out.
[0066] S102: if yes, sorting the second probability distribution of each phoneme, selecting a preset number of registered phonemes in the top order, and saving the scores and phoneme serial numbers of each of the registered phonemes as a registered phoneme distribution.
[0067] In this step, the processing logic is consistent with that of the foregoing "sorting the first probability distribution of each phoneme, selecting a preset number of target phonemes in the top order, and saving the scores and phoneme serial numbers of each of the target phonemes as an effective phoneme distribution". The registered phoneme distribution is sorted according to probability, and the scores and serial numbers of top-k registered phonemes are saved, which reduces the storage capacity.
[0068] S103: inputting the registered phoneme distribution into a queue according to a first-in first-out rule, and performing maximum pooling on probability values of a same phoneme serial number at different time points in the queue to generate a registered phoneme distribution vector.
[0069] In this step, the registered phoneme distribution is queued according to the first-in first-out rule, a registered vector is generated through maximum pooling, and the registered vector is stored in a system for comparison in a subsequent recognition stage. For example, when "Xiao Huang Xiao Huang" is registered, the generated registered vector includes key phoneme features of the wake word.
[0070] In this embodiment, the complete flow of the registration phase is defined: the wake word recognition network is used to process the registered speech, screen effective phoneme distributions, maintain the queue and generate a registered phoneme distribution vector. This flow is consistent with the processing logic of the recognition phase, ensuring that the registered vector and the real-time vector are generated under the same framework, and guaranteeing the accuracy of subsequent similarity comparison. For example, when registering the wake word "Xiao Huang Xiao Huang", the speech duration is 3 seconds, the frame shifting step is 10ms, the downsampling rate of the wake word recognition network is 4 times, the blank ratio is 30%, and the queue length is set to 50. The effective phoneme distributions generated by each registered speech (including phoneme sequence numbers such as "x", "h", "iǎo", "uáng" and corresponding scores) are enqueued according to the first-in-first-out rule. After the queue stores 50 effective phoneme distributions, the maximum probability value of the same phoneme sequence number is taken: for example, the probability values of phoneme sequence number 10 (corresponding to "x") at each time point in the queue are [0.85, 0.92, 0.88, ...], and the value of this dimension after max pooling is 0.92; the probability value of phoneme sequence number 20 (corresponding to "h") after pooling is 0.95. Finally, a registered phoneme distribution vector including all phoneme sequence number dimensions is generated and stored in the local database of the device. Adopting the same queue maintenance and max pooling logic as the recognition phase ensures that the registered phoneme distribution vector and the effective phoneme distribution vector generated subsequently in real time are completely unified in "dimension definition" and "feature extraction standard", which provides a reliable basis for subsequent similarity comparison and avoids discrimination deviation caused by differences between registration and recognition processes.
[0071] This embodiment fully discloses the core process of the registration phase for custom wake words. This process mirrors the "recognition phase process" in the previous embodiment: both are centered on the wake word recognition network and proceed through the steps of "phoneme probability distribution calculation → blank score filtering → Top-k phoneme storage → queue maintenance → max-pooling vector generation". This consistency in the "registration-recognition" process is a key prerequisite for achieving fine-grained discrimination. Only when the registration vector and real-time vector generated based on the same rules have a valid similarity comparison result can they accurately distinguish wake words with similar pronunciations, such as "Xiao Huang Xiao Huang" and "Xiao Mei Xiao Mei". Through designs such as "storing Top-k phonemes" and "queue length adapted to wake word duration", storage consumption is controlled during the registration phase (e.g., a 50-length queue + top 5 phoneme storage requires only 0.5k memory), without the need for additional hardware resources. In this application, the registration and recognition stages employ completely consistent phoneme processing, queue maintenance, and vector generation logic. This ensures that the registered phoneme distribution vector is aligned with the real-time effective phoneme distribution vector in terms of "feature dimension," avoiding similarity discrepancies caused by process differences and fundamentally reducing the risk of false wake-ups. The wake-up word recognition network is reused, eliminating the need for additional computation modules during the registration stage. Storage consumption is controlled through "Top-k phoneme filtering" and "queue length optimization," meeting the core requirement of "lightweight and low computational consumption" in the disclosure document, making it compatible with low-resource devices such as smart homes and smartwatches. The registration process is highly automated; users only need to input the wake-up word, and the system can generate registration vectors according to preset rules without manual parameter configuration. Furthermore, the registration vectors are stored stably and can be directly called upon in subsequent recognition stages, improving the ease of use of custom wake-up words.
[0072] Referring to 2, this embodiment of the invention also provides a wake-up word speech recognition device for implementing the wake-up word speech recognition method in the above embodiments, including: The computing unit 10 is used to calculate the first probability distribution of each phoneme in the input speech through the wake word recognition network; Judgment unit 20 is used to determine whether the blank score in the first probability distribution is less than the first threshold; Selection unit 30 is used to sort the first probability distribution of each phoneme if the blank score in the first probability distribution is less than the first threshold, select a preset number of target phonemes, and save the score and phoneme number of each target phoneme as an effective phoneme distribution. The max pooling unit 40 is used to input the effective phoneme distribution into a queue of preset length according to the first-in-first-out rule, and to perform max pooling on the probability values of the same phoneme index at different time points in the queue to generate an effective phoneme distribution vector. The recognition unit 50 is used to output the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector.
[0073] Since the above-mentioned wake word speech recognition device implements the wake word speech recognition method in the above embodiments, the implementation process is the same as the execution process of the wake word speech recognition method in the above embodiments, and will not be repeated here.
[0074] Reference Figure 3 The present invention also provides a computer device, the internal structure of which can be as follows: Figure 3 As shown, this computer device includes a processor, memory, network interface, and database connected via a system bus. The processor is designed to provide computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores operating devices, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores registered phoneme distribution vectors, etc. The network interface is used for communication with external terminals via a network connection. Furthermore, the computer device may also include input devices and a display screen, etc. When the aforementioned computer program is executed by a processor to implement a wake-word speech recognition method, it includes: calculating a first probability distribution of each phoneme in the input speech through a wake-word recognition network; determining whether the blank score in the first probability distribution is less than a first threshold; if so, sorting the first probability distributions of each phoneme, selecting the top preset number of target phonemes, and saving the score and phoneme number of each target phoneme as an effective phoneme distribution; inputting the effective phoneme distribution into a queue of preset length according to a first-in-first-out rule, performing max pooling on the probability values of the same phoneme number at different time points in the queue to generate an effective phoneme distribution vector; and outputting the recognition result of the input speech based on the effective phoneme distribution vector and a preset registered phoneme distribution vector. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.
[0075] One embodiment of this application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements a wake-word speech recognition method, including: calculating a first probability distribution of each phoneme in the input speech through a wake-word recognition network; determining whether the blank score in the first probability distribution is less than a first threshold; if so, sorting the first probability distributions of each phoneme, selecting a preset number of target phonemes, and saving the score and phoneme number of each target phoneme as an effective phoneme distribution; inputting the effective phoneme distribution into a queue of preset length according to a first-in-first-out rule, performing max pooling on the probability values of the same phoneme number at different time points in the queue to generate an effective phoneme distribution vector; and outputting the recognition result of the input speech based on the effective phoneme distribution vector and a preset registered phoneme distribution vector. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0076] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in this application and in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0077] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0078] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A wake-word speech recognition method, characterized in that, include: The first probability distribution of each phoneme in the input speech is calculated using a wake word recognition network. Determine whether the blank score in the first probability distribution is less than the first threshold; If so, sort the first probability distribution of each phoneme, select the first preset number of target phonemes, and save the score and phoneme number of each target phoneme as the effective phoneme distribution. The effective phoneme distribution is input into a queue of a preset length according to the first-in-first-out rule. Max pooling is performed on the probability values of the same phoneme index at different time points in the queue to generate an effective phoneme distribution vector. Based on the effective phoneme distribution vector and the preset registered phoneme distribution vector, the recognition result of the input speech is output.
2. The wake-word speech recognition method according to claim 1, characterized in that, The step of outputting the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector includes: Calculate the first similarity between the effective phoneme distribution vector and the registered phoneme distribution vector; If the first similarity is greater than the first similarity threshold, then the correct recognition result of the input speech is output.
3. The wake-word speech recognition method according to claim 1, characterized in that, The step of outputting the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector includes: The phonemes in the effective phoneme distribution vector that are greater than a first vector threshold are obtained to form a first phoneme set; and the phonemes in the registered phoneme distribution vector that are greater than the first vector threshold are obtained to form a second phoneme set. Calculate the number of intersections between the first phoneme set and the second phoneme set; If the number of intersections is greater than a preset intersection threshold, then the correct recognition result of the input speech is output.
4. The wake-word speech recognition method according to claim 1, characterized in that, The step of outputting the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector includes: Calculate the first similarity between the effective phoneme distribution vector and the registered phoneme distribution vector; The phonemes in the effective phoneme distribution vector that are greater than a first vector threshold are obtained to form a first phoneme set; and the phonemes in the registered phoneme distribution vector that are greater than the first vector threshold are obtained to form a second phoneme set. Calculate the number of intersections between the first phoneme set and the second phoneme set; If the number of intersections is greater than a preset intersection threshold, and the first similarity is greater than a first similarity threshold, then the correct recognition result of the input speech is output.
5. The wake-word speech recognition method according to claim 1, characterized in that, Before calculating the first probability distribution of each phoneme in the input speech through the wake word recognition network, the following steps are included: Receive the input voice; Calculate the overall speech vector of the input speech; Calculate the second similarity between the overall speech vector and the preset overall registered speech vector; If the second similarity is greater than the second similarity threshold, then the step of calculating the probability distribution of each phoneme in the input speech is performed.
6. The wake-word speech recognition method according to claim 1, characterized in that, The method for setting the length of the queue includes: Based on a pre-set corpus sample, the duration of wake word speech with different numbers of words was counted. The duration of the current wake word is determined based on the number of words in the current wake word speech. The step size of the audio feature frame segmentation is obtained, and the length of the queue is set by combining the duration of the current wake word speech, the proportion of blank in the current wake word speech output, and the downsampling rate of the wake word recognition network.
7. The wake-word speech recognition method according to claim 1, characterized in that, Before calculating the first probability distribution of each phoneme in the input speech through the wake word recognition network, the following steps are included: The second probability distribution of each phoneme in the current wake word speech is calculated using a wake word recognition network; Determine whether the blank score in the second probability distribution is less than the first threshold; If so, sort the second probability distribution of each phoneme, select the first preset number of registered phonemes, and save the score and phoneme number of each registered phoneme as the registered phoneme distribution; The registered phoneme distribution is input into the queue according to the first-in-first-out rule. Max pooling is performed on the probability values of the same phoneme index at different time points in the queue to generate a registered phoneme distribution vector.
8. A wake-word speech recognition device, characterized in that, include: The computing unit is used to calculate the first probability distribution of each phoneme in the input speech through the wake word recognition network; The judgment unit is used to determine whether the blank score in the first probability distribution is less than a first threshold. The selection unit is used to sort the first probability distribution of each phoneme if the blank score in the first probability distribution is less than the first threshold, select a preset number of target phonemes, and save the score and phoneme number of each target phoneme as an effective phoneme distribution. The max pooling unit is used to input the effective phoneme distribution into a queue of preset length according to the first-in-first-out rule, and to perform max pooling on the probability values of the same phoneme index at different time points in the queue to generate an effective phoneme distribution vector. The recognition unit is used to output the recognition result of the input speech based on the effective phoneme distribution vector and the preset registered phoneme distribution vector.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the wake word speech recognition method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the wake word speech recognition method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Voice wakeup method and voice wakeup device based on artificial intelligence
CN106611597A
Audio recognition confidence determination method, device, equipment and storage medium
CN111145748A