Decision tree generation method, audio data processing method and wearable device
By generating a decision tree in a smart wearable device and judging the audio data source using specific feature values, the problem of the device being accidentally awakened by a non-wearer is solved, and the wake-up accuracy and user experience are improved.
Patent Information
- Application Number
- CN202411817205.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-25
AI Technical Summary
Smart wearable devices may be mistakenly awakened by non-wearers after recognizing the wake-up word, resulting in a wake-up error trigger.
By generating a decision tree, multiple eigenvalues in the training data (including wake-up confidence, time-domain root mean square, audio-enhanced root mean square ratio and frequency-domain energy mean) are used to determine whether the audio data collected by the microphone is a sound emitted by the wearer or non-wearer.
It effectively reduces the number of false wake-ups of wearable devices by non-wearers and improves the user experience.
Smart Images

Figure CN119694310A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio data processing, and in particular to the generation of a decision tree, an audio data processing method, and a wearable device. Background Art
[0002] Smart wearable devices (for example, smart glasses) have some private usage scenarios, and the wearer does not want others to hear them, so the wearer can speak in a low voice. The minimum sound volume that the smart wearable device voice assistant can correctly identify is about -45dB. The characteristics of the wearer's low-volume speech and the non-wearer's normal-volume speech are similar after being recorded by the smart wearable device. In this way, the normal speech of the non-wearer is likely to be mistaken by the smart wearable device as the wearer's low voice, especially when waking up, which is easy to trigger false wake-up. Summary of the invention
[0003] The generation of a decision tree, the method for processing audio data, and the wearable device provided in the embodiments of the present application at least solve the problem of the smart wearable device being mistakenly awakened by a non-wearer.
[0004] According to one aspect of an embodiment of the present application, a method for generating a decision tree is provided, comprising: obtaining training data, wherein the training data comprises: audio data including a wake-up word emitted by multiple different wearers of a wearable device and audio data including a wake-up word emitted by multiple different non-wearers of the wearable device; extracting values of multiple eigenvalues of each audio data in the training data as a first training sample set, wherein the multiple eigenvalues comprise: wake-up confidence, a time domain root mean square of the original audio data, a time domain root mean square of the original audio data after audio enhancement, a ratio of the time domain root mean square of the original audio data after audio enhancement to the time domain root mean square of the original audio data, and a frequency domain energy mean of the original audio data; fitting the multiple eigenvalues according to the first training sample set to generate a decision tree.
[0005] According to another aspect of an embodiment of the present application, a method for processing audio data applied to a wearable device is also provided, including: obtaining audio data collected by a microphone; processing the obtained audio data to obtain multiple eigenvalues, the multiple eigenvalues including: wake-up confidence, time domain root mean square of original audio data, time domain root mean square of original audio data after audio enhancement, the ratio of the time domain root mean square of original audio data after audio enhancement to the time domain root mean square of original audio data, and frequency domain energy mean of original audio data; using a decision tree to process the multiple eigenvalues to determine whether to wake up the wearable device, wherein the decision tree is generated using the above method.
[0006] According to another aspect of an embodiment of the present application, a wearable device is provided, including: a processor, and a memory storing a program, wherein the program includes instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0007] According to another aspect of the embodiments of the present application, a non-transitory machine-readable medium storing computer instructions is also provided, where the computer instructions are used to enable a computer to execute the above method.
[0008] Beneficial effects of the embodiments of the present application:
[0009] In an embodiment of the present application, training data is obtained, wherein the training data includes: audio data including the wake-up word emitted by multiple different wearers of the wearable device and audio data including the wake-up word emitted by multiple different non-wearers of the wearable device; multiple feature values of each audio data in the training data are extracted as a first training sample set, wherein the multiple feature values include: wake-up confidence, time domain root mean square of the original audio data, time domain root mean square of the original audio data after audio enhancement, ratio of the time domain root mean square of the original audio data after audio enhancement to the time domain root mean square of the original audio data, and frequency domain energy mean of the original audio data; multiple feature values are fitted according to the first training sample set to generate a decision tree. That is, by counting the audio data including the wake-up word emitted by a certain number of people wearing wearable devices and not wearing wearable devices, then extracting feature values from the audio data, fitting a decision tree based on these feature values, and using the decision tree to infer whether the audio data collected by the wearable device is a false wake-up of the non-wearer, thereby achieving the technical effect of reducing the number of false wake-ups of the wearable device by the non-wearer and improving the user experience.
[0010] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can be obtained based on these drawings without creative work.
[0012] Figure 1 is a curve diagram of a wearer wake-up rate and a non-wearer false wake-up interception rate provided according to an embodiment of the present application;
[0013] Figure 2is a flow chart of a method for generating a decision tree according to an embodiment of the application;
[0014] Figure 3 is a decision tree schematic diagram according to an embodiment of the present application;
[0015] Figure 4 is a flowchart of a method for processing audio data applied to a wearable device according to an embodiment of the present application;
[0016] Figure 5 is a flowchart of another method for processing audio data applied to a wearable device according to an embodiment of the present application;
[0017] Figure 6 Schematic diagram of the structure of the electronic device of this embodiment. DETAILED DESCRIPTION
[0018] Embodiments of the present embodiment will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present embodiment are shown in the accompanying drawings, it should be understood that the present embodiment can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein, which are instead provided for a more thorough and complete understanding of the present embodiment. It should be understood that the drawings and embodiments of the present embodiment are only for exemplary purposes and are not intended to limit the scope of protection of the present embodiment.
[0019] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0020] The decision tree algorithm is a typical classification method. It generates readable rules and decision trees through an inductive algorithm, and then uses these rules to classify new data. The core of the decision tree algorithm is how to construct a decision tree with high accuracy and small scale. The steps of the decision tree algorithm include two main stages: generation and pruning of decision trees. The generation stage is the process of building a decision tree from the training sample set, while the pruning stage is to test, correct and modify the generated decision tree to ensure its accuracy.
[0021] In the related technology, after recognizing the wake-up word, the smart wearable device will further determine whether it is the wearer who wakes up. If so, it will further execute the wake-up. If it is not the wearer who wakes up, the wake-up will be intercepted and the smart wearable device will continue to remain in the non-wake-up state.
[0022] However, since the characteristics of the low-volume speech of the wearer of the smart wearable device and the normal-volume speech of the non-wearer after being recorded by the smart wearable device are relatively similar, the smart wearable device may recognize the awakening of the non-wearer as the awakening of the wearer, thereby causing the problem of being mistakenly awakened by the non-wearer.
[0023] Specifically, the wearer wake-up rate at low volume and the non-wearer false wake-up rate are a pair of contradictory indicators. It is necessary to find a suitable threshold value that takes into account both the wearer's low-volume wake-up success recognition rate and the non-wearer wake-up interception rate. Generally speaking, the best threshold value can be found directly based on the data (for example, the frequency domain energy mean max_sum of the original signal), such as Figure 1 The figure shows the curve diagram of "wearer wake-up accuracy" and "non-wearer false wake-up interception accuracy" drawn according to different means. Among them, the wearer wake-up accuracy refers to the proportion of the number of wearer wake-up samples identified from these samples to the total number of samples. The non-wearer false wake-up interception accuracy refers to the proportion of the number of non-wearer wake-up samples intercepted from these samples to the total number of samples.
[0024] Figure 1 The vertical axis represents the ratio, and the horizontal axis represents the threshold value. Figure 1 As shown in the figure, as the threshold value increases, the wearer wake-up accuracy gradually decreases, and the non-wearer false wake-up interception accuracy gradually increases. In order to take into account both the wearer wake-up accuracy and the non-wearer false wake-up interception accuracy, the intersection of the two curves is usually taken as the optimal threshold value, at which time the two accuracy rates are equal.
[0025] However, although this solution takes into account both the accuracy of the wearer's wake-up and the accuracy of the non-wearer's false wake-up interception, the two accuracy rates are still low. In order to solve this problem, the embodiments of the present application provide a relevant solution, and the technical solution proposed in the present application is described below in conjunction with specific embodiments.
[0026] Figure 2 is a flow chart of a method for generating a decision tree according to an embodiment of the application, such as Figure 2 As shown, the method comprises the following steps:
[0027] Step S202: acquiring training data, wherein the training data includes: audio data including the wake-up word emitted by a plurality of different wearers of the wearable device and audio data including the wake-up word emitted by a plurality of different non-wearers of the wearable device.
[0028] It should be noted that the above-mentioned wearable devices include but are not limited to: smart glasses, smart watches, health trackers, smart headphones, smart clothing, smart helmets, etc. The wake-up word can be a word or phrase used to wake up the wearable device, for example, "Xiaoyi, Xiaoyi", "Hello Xiaoyi".
[0029] According to an optional embodiment of the present application, executing step S202 to obtain training data can be achieved by the following method: multiple times collecting audio data including wake-up words emitted by multiple different wearers of the wearable device; multiple times collecting audio data including wake-up words emitted by multiple different non-wearers of the wearable device from different angles.
[0030] Table 1
[0031]
[0032] As shown in Table 1, in the embodiment provided by the present application, in the data preparation stage, multiple users are used to record wake-up data, and the users are as diverse as possible, such as a balance between men and women, a wide age distribution, and a wide geographical distribution, and it is better if it can include various Mandarin systems.
[0033] As a wearer, each user collects the wake-up word as quietly as possible, and collects audio data including the wake-up word 10 times. As a non-wearer, the audio data including the wake-up word is collected from 5 angles (90° to the left, 45° to the left, directly behind, 90° to the right, and 45° to the right as shown in Table 1), using a normal conversation volume, and each angle is collected 3 times. The key information shown in Table 1 can be used to collect audio data of wearers and non-wearers. For example, the experimenter Zhang San can record audio data including the wake-up word as a wearer. As a non-wearer, audio data including the wake-up word is recorded at 5 angles of 90° to the left of the wearer, 45° to the left, directly behind, 90° to the right, and 45° to the right.
[0034] Step S204, extracting the values of multiple eigenvalues of each audio data in the training data as the first training sample set, wherein the multiple eigenvalues include: wake-up confidence, the time domain root mean square of the original audio data, the time domain root mean square of the original audio data after audio enhancement, the ratio of the time domain root mean square of the original audio data after audio enhancement to the time domain root mean square of the original audio data, and the frequency domain energy mean of the original audio data.
[0035] In an embodiment of the present application, the feature values extracted from each audio data in the training data include 5:
[0036] "score", "output_rms", "mic_rms", "rate" and "max_sum", where
[0037] 1) score: wake-up confidence, between 0 and 1, 1 is the highest score, the closer to 1, the higher the wake-up confidence.
[0038] 2) mic_rms: The time domain root mean square (RMS) of the original audio data.
[0039] 3) output_rms: The time domain root mean square RMS of the original audio data after audio enhancement. The RMS calculation formula is: Here, n represents the number of eigenvalues, and x1 to xn represent the respective eigenvalues.
[0040] In order to increase robustness, the embodiment of the present application uses a sliding average of the RMS value. The duration of the sliding window can be determined according to the length of the wake-up word. For example, for a wake-up word consisting of 4 characters, there are 4 corresponding pinyins, and the approximate duration is not less than 1 second. Therefore, 1 second can be taken as the duration of the sliding window, that is, the average of the RMS values of all frames within 1 second.
[0041] 4)rate: The ratio of the time-domain root mean square of the original audio data after audio enhancement to the time-domain root mean square of the original audio data, that is, the output_rms / mic_rms ratio.
[0042] 5) max_sum: the frequency domain energy mean of the original audio data.
[0043] Frequency domain energy calculation uses short-time Fast Fourier Transform (FFT) to calculate the frequency domain signal of a frame, obtain the complex value x at N frequency domain points, and then calculate the energy of the frequency domain signal. Energy calculation: x.real 2
[0044] +x.imag 2 , where N is an integer power of 2, x.real 2 is the modulus of the real part of a complex value x, x.real 2 is the modulus of the imaginary part of a complex value x.
[0045] The sliding average is also used, and the sliding window length is 1 second, that is, the average of the frequency domain energy values of all frames within 1 second.
[0046] Using the above eigenvalues has the following advantages:
[0047] 1) Since each eigenvalue is the input of other algorithms, for example,
[0048] (1) The score can be obtained directly.
[0049] (2) mic_rms is the energy of the first signal and can also be used in another energy-based filtering algorithm.
[0050] (3) output_rms, which can also be used in another energy-based filtering algorithm mentioned in (2).
[0051] (4)rate is used together with mic_rms in (2) and output_rms in (3) for energy filtering.
[0052] (5) max_sum, applied to an energy filtering algorithm different from that mentioned in (2). If the energy of the first signal is very small, the first signal is most likely not the wearer's speech, so it is filtered out.
[0053] In other words, these eigenvalues do not require additional computational overhead. They already exist and can be directly used as eigenvalues of the decision tree, avoiding large computational overhead.
[0054] 2) In addition, the above eigenvalues all have certain physical meanings and are not randomly put together, which speeds up the training process of the decision tree.
[0055] The above recording data and feature values are sorted to obtain the data shown in Table 2 below.
[0056] Table 2
[0057]
[0058] The results determined by the feature values of Table 2 above may include: TRUE: represents that this data is wake-up by the wearer; this is extracted from audio data including wake-up words emitted by multiple different wearers of the wearable device.
[0059] FALSE: Indicates that this data is a false wake-up by a non-wearer and does not wake up. This is extracted from the audio data containing the wake-up word emitted by multiple different non-wearers of the wearable device.
[0060] Step S206, fitting multiple feature values according to the first training sample set to generate a decision tree.
[0061] The decision tree is a machine learning method. It is a tree structure in which each internal node represents a judgment on a feature, each branch represents the output of a judgment result, and finally each leaf node represents a classification result.
[0062] The decision tree generation algorithms include information gain algorithm (Iterative Dichotomiser 3, ID3), C4.5 and classification and regression tree algorithm (Classification And Regression Tree, CART) and so on.
[0063] CART is the most common decision tree. The difference between it and ID3 is the node division standard. CART uses the Gini index, while ID3 uses information entropy. Compared with ID3, C4.5 introduces pruning, which means that some branches are removed without reducing or slightly reducing the accuracy, thus reducing the size and depth of the tree and enhancing robustness.
[0064] Exemplarily, the decision tree structure generated by CART is intuitive and easy to understand and explain. The decision tree in the embodiment of the present application can adopt CART.
[0065] The above method provided in the embodiment of the present application counts the audio data including the wake-up word emitted by a certain number of people when they are wearing wearable devices and not wearing wearable devices, then extracts feature values from the audio data, fits a decision tree based on these feature values, and uses the decision tree to infer whether the audio data collected by the wearable device is a false wake-up by the non-wearer, thereby achieving the technical effect of reducing the number of false wake-ups of the wearable device by the non-wearer and improving the user experience.
[0066] According to an optional embodiment of the present application, step S206 can be implemented by the following method: S11, starting from the root node of the decision tree, calculating the Gini coefficients corresponding to different values of multiple eigenvalues in turn according to the first training sample set, wherein the Gini coefficient is used to characterize the classification purity of each eigenvalue when the value is used as the root node to divide the first training sample set into wake-up samples and non-wake-up samples; S12, selecting the eigenvalue with the smallest Gini coefficient as the root node of the decision tree.
[0067] It should be noted that in a decision tree, the root node is the topmost node of the tree, and it is the starting point of the entire decision tree. The root node contains the initial set of all training samples, and it has no parent node. Starting from the root node, the data set is divided into different subsets according to certain features, and each subset corresponds to a child node of the root node.
[0068] For example, assume that there are three eigenvalues, namely eigenvalue 1, eigenvalue 2, and eigenvalue 3. When determining the root node, each eigenvalue may have multiple values to be selected, and the Gini coefficients of eigenvalue 1, eigenvalue 2, and eigenvalue 3 under different values may be calculated respectively, and then the eigenvalue with the smallest Gini coefficient is selected from these Gini coefficients as the root node of the decision tree.
[0069] For example, eigenvalue 1 has 10 values to be selected. Exemplarily, these values can be spaced at fixed step lengths, or can be set according to high probability values in experience, which is not limited in this application. The Gini coefficient of eigenvalue 1 is calculated separately under each value to be selected, and 10 Gini coefficients corresponding to eigenvalue 1 are obtained. The same is true for eigenvalue 2 and eigenvalue 3, which will not be described in detail. Finally, the value of the eigenvalue with the smallest Gini coefficient is selected from these Gini coefficients as the root node. For example, the Gini coefficient of eigenvalue 2 is the smallest when it takes value a, then the eigenvalue 2 value a is taken as the root node.
[0070] By using the Gini coefficient in the above steps S11 to S12, a feature value with the best data division effect can be selected as the root node of the decision tree.
[0071] In a possible implementation, the above S11 may include: S111, for a value of one of the eigenvalues, classifying the above first training sample set according to the value of the eigenvalue, the classification including awakening type and false awakening type; S112, when all the samples in the false awakening type are true false awakening samples, calculating the Gini coefficient of the samples of the awakening type as the Gini coefficient of the value of the eigenvalue.
[0072] Optionally, S112 may include: S1121, determining the proportion of real false awakening samples and real awakening samples in the awakening type samples; S1122, determining the sum of squares of the proportions of real false awakening samples and real awakening samples;
[0073] S1123, determining the difference between 1 and the sum of squares as the Gini coefficient corresponding to the value of the above eigenvalue.
[0074] Exemplarily, assuming that there are multiple eigenvalues, each eigenvalue can have multiple values, the value of one of the eigenvalues can be used as a classification condition to classify the first training sample set into awakening type samples and false awakening type samples. When the false awakening type samples are all true false awakening samples (i.e., the samples are false awakening samples of non-wearers), the Gini coefficient of the value of the above eigenvalue is calculated according to the Gini coefficient of the corresponding awakening type sample. Specifically, the Gini coefficient corresponding to the value of the above eigenvalue can be calculated according to the proportion of true awakening samples (i.e., the samples are true wearer awakening samples) and true false awakening samples (i.e., the samples are true non-wearer awakening samples) in the awakening type samples.
[0075] For example, there are 7 samples in the first training sample set, of which 2 samples are wearer awakening samples and 5 samples are non-wearer false awakening samples. When calculating the Gini coefficient of the value a of eigenvalue 1, the classification condition is determined by the value a of eigenvalue 1. For example, when the value of eigenvalue 1 is less than or equal to a, it is a non-wearer false awakening sample. The samples in the first training sample set are classified according to this classification condition. There are 3 samples among the samples classified as false awakening types, and these 3 samples are all true false awakening samples (that is, the samples are true non-wearer false awakening samples). The corresponding awakening type samples include 4 samples, of which 2 are wearer awakening samples and 2 are non-wearer awakening samples, and the Gini coefficient is 0.5. Therefore, it can be obtained that the Gini coefficient of the value a of eigenvalue 1 is 0.5.
[0076] For example, the calculation formula of the Gini coefficient can be Gini(D)=1-∑(Pk 2 ), where Pk is the proportion of samples of the kth category, k = 1, 2. For example, assuming that the classification condition is determined by the value a of the eigenvalue 1, and the awakening type sample set D is obtained by the classification condition, where the proportions of true false awakening samples and true awakening samples are P1 and P2, then the Gini coefficient corresponding to the value a of the eigenvalue 1 is:
[0077] Gini(D)=1-P1 2 -P2 2 .
[0078] The root node of the decision tree is determined above, and the child nodes under the root node can be determined next. Optionally, the embodiment of the present application proposes that S206 can also include: S21, determining the real false awakening samples identified after classification based on the determined nodes in the decision tree, wherein the determined nodes include the determined root nodes and the determined first N-level child nodes, and N is an integer greater than or equal to 0 and less than 5; S22, removing the real false awakening samples in the awakening samples from the first training sample set to obtain a second training sample set; S23, determining the N+1-level child nodes based on the second training sample set. In an optional implementation, the above step S23 may include: S231, determining one or more candidate feature values, the one or more candidate feature values being feature values that are not used as the determined nodes among the multiple feature values; S232, calculating the Gini coefficients corresponding to different values of one or more candidate feature values in turn according to the second training sample set; S233, selecting the value of the candidate feature value with the smallest Gini coefficient as the N+1-level child node.
[0079] It should be noted that the value of the node level N can be determined according to the feature values included in the first training sample set for generating the decision tree, for example, N is an integer greater than or equal to 0 and less than 5.
[0080] For example, a decision tree is generated using feature values 1-5. The first training sample set includes 100 samples, and the determined nodes include a root node judged using feature 1 and a first-level child node judged using feature 2. 30 non-wearer false awakening samples can be accurately identified from 100 samples using feature 1 and feature 2. Then, these 30 wearer awakening samples are true false awakening samples. When determining the second-level child nodes, these 30 true false awakening samples can be removed from the above 100 samples, so that a second training sample set including 70 awakening samples can be obtained. The second-level child nodes are further determined from features 3-5 using these 70 samples. And so on to determine the N+1-th level child nodes.
[0081] It should also be noted that the determined nodes refer to the root nodes and child nodes at all levels that have been determined in the decision tree (for example, the root nodes determined by calculating the Gini coefficient above). The first training sample set includes the wearer wake-up speech samples and the non-wearer wake-up speech samples.
[0082] It is understandable that the solution disclosed in the embodiment of the present application can be executed when the device is initially started, that is, the device is pre-configured with multiple samples of wake-up speech and non-wake-up speech emitted by non-wearers. After the initial startup, the user (wearer) is guided to enter multiple wake-up speech samples and non-wake-up speech samples, thereby obtaining the wake-up sample of the embodiment of the present application, and then generating a decision tree based on the wake-up sample. The decision tree obtained in this way can be personalized for specific users, and the obtained decision tree has better performance.
[0083] The solution disclosed in the embodiment of the present application can be executed before the device leaves the factory, that is, the decision tree generated by the solution is directly installed in the device. This implementation method is simpler to operate and easy to implement.
[0084] The generation process of the decision tree proposed in this application is illustrated below with reference to specific examples.
[0085] This example proposes a decision tree method using the awakening samples shown in Table 3. As shown in Table 3, the awakening samples include samples 1 to 7, each of which corresponds to the value of feature 1 to feature 3, and each sample corresponds to the result of awakening / not awakening. In Table 3, the results of sample 1 and sample 4 are that the wearer wakes up quietly, awakening, and the rest of the samples are mistakenly awakened by non-wearers, not awakening.
[0086] Table 3
[0087] Wake-up sample Eigenvalue 1 Eigenvalue 2 Eigenvalue 3 Result (wake-up / false wake-up) Sample 1 40 20000 100 wake Sample 2 78 23000 0 False wake-up Sample 3 13 0 120 False wake-up Sample 4 30 20000 95 wake Sample 5 12 0 240 False wake-up Sample 6 34 5000 50 False wake-up Sample 7 10 30000 160 False wake-up
[0088] Traverse all the features (feature 1, feature 2, feature 3) in Table 3 to generate the root node and child nodes. If a certain value of a certain feature can correctly distinguish the samples to the greatest extent, then use this feature for judgment. To judge whether a certain feature is suitable for distinction, we can assume that the value of a certain feature is used as a judgment condition. Based on this judgment condition, the samples can be distinguished into awakening type samples and false awakening type samples. These two types of samples are located on two branches. The ideal state is that one branch is full of awakening samples and the other branch is full of false awakening samples. In practice, there are very few completely correct classifications. Incorrect sample data will exist in each branch. The amount of incorrect sample data is represented by the Gini coefficient, which represents the purity of the data set. The smaller the value of the Gini coefficient, the higher the classification purity of the training sample set into awakening samples and false awakening samples, that is, the better the classification based on this feature.
[0089] In this example, the root node can be determined by calculating the Gini coefficients of eigenvalue 1, eigenvalue 2, and eigenvalue 3 at different values through Table 3. Assuming that the Gini coefficient corresponding to eigenvalue 2 taking a value of 5000 is the smallest, then eigenvalue 2 taking a value of 5000 can be used as the root node of the decision tree, such as Figure 3 For the first-level node shown in the figure, in the specific calculation, the eigenvalue 2 value less than or equal to 5000 can be used as the classification condition of the false awakening type, and the 7 samples corresponding to the eigenvalue 2 (that is, samples=7) are divided into 3 false awakening type samples (corresponding to sample 3, sample 5, sample 6 in Table 3) and 4 awakening type samples (corresponding to sample 1, sample 2, sample 4, sample 7 in Table 3), and the 3 false awakening type samples are all true false awakening samples, and the corresponding awakening type samples include 2 true false awakening samples (corresponding to sample 2 and sample 7 in Table 3) and 2 true awakening samples (corresponding to sample 1 and sample 4 in Table 3), so Figure 3 In the value = [2, 2], the Gini coefficient corresponding to the eigenvalue 2 of 5000 is 0.5, and class = false awakening indicates that the classification result is false awakening.
[0090] Furthermore, the True branch corresponds to the real false awakening samples identified after classification based on the root node (corresponding to sample 3, sample 5, and sample 6 in Table 3), the Gini coefficient is 0, samples = 3, value = [3, 0], and class = false awakening. When the FALSE branch continues to determine the second-level node, the above three real false awakening samples are removed from the seven samples, and the remaining four samples, namely the second training sample set (corresponding to sample 1, sample 2, sample 4, and sample 7 in Table 3), are calculated based on the remaining four samples. The Gini coefficients corresponding to different values of eigenvalue 1 and eigenvalue 3 are respectively calculated, and the eigenvalue with the smallest Gini coefficient is selected as the second-level node. Assuming that the Gini coefficient corresponding to the eigenvalue 3 value of 50 is the smallest, then the eigenvalue 2 value of 50 can be used as the second-level node of the decision tree, such as Figure 3 In the second level shown in the figure, in the specific calculation, the eigenvalue 3 value less than 50 can be used as the classification condition of the false awakening type, and the 4 samples corresponding to the eigenvalue 3 (that is, samples=4) are divided into 1 false awakening type sample (corresponding to sample 2 in Table 3) and 3 awakening type samples (corresponding to sample 1, sample 4, and sample 7 in Table 3), and the 1 false awakening type sample is a true false awakening sample, and the corresponding awakening type samples include 1 true false awakening sample (corresponding to sample 7 in Table 3) and 2 true awakening samples (corresponding to sample 1 and sample 4 in Table 3). Therefore Figure 3 In the value = [1, 2], the Gini coefficient corresponding to the eigenvalue 2 of 50 is 0.444, and class = false awakening indicates that the classification result is false awakening.
[0091] Furthermore, the True branch corresponds to the real false awakening sample identified after classification based on the second-level node (corresponding to sample 2 in Table 3), the Gini coefficient is 0, samples = 1, value = [1, 0], class = false awakening. When the FALSE branch continues to determine the third-level node, the above-mentioned 1 real false awakening sample is removed from the 4 samples, and the remaining 3 samples, namely the third training sample set (corresponding to sample 1, sample 4, and sample 7 in Table 3), are calculated based on the remaining 3 samples. The Gini coefficients corresponding to different values of eigenvalue 1 are respectively calculated, and the eigenvalue with the smallest Gini coefficient is selected as the third-level node. Assuming that the Gini coefficient corresponding to the eigenvalue 1 value of 10 is the smallest, then the eigenvalue 1 value of 10 can be used as the third-level node of the decision tree, such as Figure 3For the third-level node shown in the figure, in the specific calculation, the eigenvalue 1 value less than or equal to 10 can be used as the classification condition of the false awakening type, and the three samples corresponding to the eigenvalue 1 (that is, samples=3) are divided into one false awakening type sample (corresponding to sample 7 in Table 3) and two awakening type samples (corresponding to samples 1 and 4 in Table 3), and the one false awakening type sample is a true false awakening sample, and the corresponding awakening type samples only include two true awakening samples (corresponding to samples 1 and 4 in Table 3). Therefore Figure 3 In the value = [0, 2], the Gini coefficient corresponding to the eigenvalue 1 of 10 is 0, and class = false awakening indicates that the classification result is false awakening.
[0092] Furthermore, the True branch corresponds to the real false awakening sample identified after classification based on the third-level node (corresponding to sample 7 in Table 3), the Gini coefficient is 0, samples=1, value=[1,0], class=false awakening, and the FALSE branch corresponds to 2 real awakening samples, the Gini coefficient is 0, samples=2, value=[0,2], class=awakening.
[0093] In some other optional embodiments of the present application, executing step S204 to extract the values of multiple feature values of each audio data in the training data includes the following steps:
[0094] S31, performing echo cancellation processing on each audio data in the training data, and calculating a wake-up confidence value of each audio data after the echo cancellation processing;
[0095] S32, performing spatial enhancement processing on each audio data after the echo cancellation processing, and performing time domain energy calculation on each audio data after the spatial enhancement processing and each audio data before the spatial enhancement processing, respectively, to obtain the time domain root mean square value of the original audio data after the audio enhancement and the time domain root mean square value of the original audio data;
[0096] S33, determining a ratio of a time domain root mean square value of the original audio data after audio enhancement to a time domain root mean square value of the original audio data;
[0097] S34, performing frequency domain energy calculation on each audio data before spatial enhancement processing to obtain a value of the frequency domain energy mean of the original audio data.
[0098] Through the above steps S31 to S34, echo cancellation, spatial enhancement, time domain and frequency domain energy calculation, etc. are performed on the collected audio data, so that high-quality feature values can be determined, further improving the accuracy of the decision tree.
[0099] It should be noted that the above-mentioned echo cancellation is an important technology in the front-end processing of voice communication. The basic idea of echo cancellation is to estimate the characteristic parameters of the echo path, generate a simulated echo path, obtain a simulated echo signal, subtract the echo signal from the received signal, and realize echo cancellation.
[0100] Audio data spatial enhancement refers to a processing method for audio data in the field of audio signal processing, which aims to improve or enhance the quality, clarity or listening experience of the audio.
[0101] Audio data spatial enhancement technology mainly involves using dedicated audio transmission channels and advanced audio codec algorithms, as well as noise reduction processing during transmission to improve the quality of audio transmission and user experience. This technology aims to extract useful speech signals from the noisy background, suppress or reduce noise interference, and ensure the clarity and intelligibility of audio signals.
[0102] The calculation of time domain energy involves a basic concept in signal processing, that is, the energy of a signal is related to its change over time. When calculating the time domain energy, the amplitude of the signal is usually squared and then summed. In this process, the sampling rate and sampling interval of the signal must also be considered. The calculation of time domain energy can be achieved by summing the squared amplitude of the signal and multiplying it by the sampling interval (1 / sampling frequency).
[0103] Frequency domain energy calculation usually refers to the process of performing energy analysis on the frequency domain representation of a signal in the field of signal processing. In the time domain, the energy of a discrete signal can be calculated by summing the squares of its amplitudes. When the signal is converted to the frequency domain (for example, through Fourier transform), its energy can also be calculated. The calculation of frequency domain energy can be achieved by integrating or summing the square of the modulus of the signal's spectral representation over the frequency.
[0104] The decision tree fitting is usually implemented in the R&D stage of wearable devices, and all wearable devices use the same decision tree and parameters. In the later stage, for more accurate reasoning, the decision tree can be calibrated using the wearer's recordings according to the different buyers of the wearable device, thereby improving the accuracy of the decision tree.
[0105] In a possible implementation, the present application also provides a method for processing audio data applicable to a wearable device. Figure 4 is a flowchart of a method for processing audio data applied to a wearable device according to an embodiment of the present application, such as Figure 4 As shown, the method comprises the following steps:
[0106] Step S402: Acquire audio data collected by a microphone.
[0107] When executing step S402, the wearable device continuously records and collects 3 channels of recording data, namely, channel 1, channel 2 and reference signal. Channel 1 is the wearer's speech signal, channel 2 is the non-wearer, i.e., the surrounding environment recording, and channel 3 is the reference signal, i.e., the sound played by the wearable device. The reference signal can be used to perform echo cancellation on channel 1 and channel 2, thereby generating more accurate features, thereby improving the recognition performance of the decision tree.
[0108] Step S404, processing the acquired audio data to obtain multiple eigenvalues, including: wake-up confidence, time domain root mean square of original audio data, time domain root mean square of original audio data after audio enhancement, ratio of the time domain root mean square of original audio data after audio enhancement to the time domain root mean square of original audio data, and frequency domain energy mean of original audio data.
[0109] In this step, echo cancellation, spatial enhancement, and time domain and frequency domain energy calculation are performed on the three signals to obtain the five eigenvalues mentioned above: "score", "output_rms", "mic_rms", "rate" and "max_sum".
[0110] Step S406: Process the multiple feature values using a decision tree to determine whether to wake up the wearable device, wherein the decision tree is generated using the above method.
[0111] Five feature values are obtained from the current frame of data, and the five feature values are input into the decision tree. After the decision tree determines, the result is whether the audio in this frame is spoken by the wearer or non-wearer. If it is a non-wearer speaking, the wake-up is ignored. If it is a wearer speaking, it is considered a normal wake-up and the voice assistant application continues to start.
[0112] Figure 5 is a flowchart of another method for processing audio data applied to a wearable device according to an embodiment of the present application. Figure 5 As shown, steps S1-S3 are the decision tree generation stage, including: data preparation, feature selection and decision tree fitting, that is, Figure 2 The illustrated embodiment comprises several steps.
[0113] After fitting the decision tree, the next step is to use the decision tree inference stage to infer whether the current speaker is the wearer. The trigger of the inference process is the wake-up event, which means that the inference process is only executed once after the wake-up is successful, not continuously.
[0114] like Figure 5 As shown, steps S4-S6 are the decision tree reasoning stage, including: recording, audio processing and decision tree judgment.
[0115] The above method provided in the embodiment of the present application improves the accuracy of judgment because it infers whether the current speaking voice is from a non-wearer or a wearer based on a decision tree.
[0116] In the embodiment of the present application, a portion of sample data is reserved as a test set to compare the effects of the direct threshold method and the decision tree method. Direct search for the best threshold method: wearer wake-up rate: 65.0%, non-wearer interception rate: 66%, decision tree method: wearer wake-up rate: 65.0%, non-wearer interception rate: 84.14634146341463%. Compared with directly searching for the best threshold value, the threshold value obtained by the decision tree algorithm on the same data will be better than the direct search for the best threshold value.
[0117] An embodiment of the present application also provides a wearable device, including: a processor, and a memory for storing a program, wherein the program includes instructions, and when the instructions are executed by the processor, the processor executes the method in any of the above embodiments.
[0118] The embodiment of the present application also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program executable by the at least one processor, and the computer program is used to enable the electronic device to perform the method of the embodiment of the present application when executed by the at least one processor.
[0119] An embodiment of the present application also provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method of the embodiment of the present application.
[0120] The embodiment of the present application also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method of the embodiment of the present application.
[0121] refer to Figure 6 , the structural block diagram of the electronic device that can be used as the server or client of the embodiment of the present application will now be described, which is an example of the hardware device that can be applied to various aspects of the present application. The electronic device is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples, and are not intended to limit the implementation of the present application described and / or required herein.
[0122] like Figure 6As shown, the electronic device includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0123] Multiple components in the electronic device are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 can be any type of device that can input information to the electronic device, and the input unit 606 can receive input digital or character information, and generate key signal input related to user settings and / or function control of the electronic device. The output unit 607 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 608 can include but is not limited to a disk, an optical disk. The communication unit 609 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0124] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a CPU, a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of the present application may be implemented as a computer program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via a ROM 602 and / or a communication unit 609. In some embodiments, the computing unit 601 may be configured to perform the above method in any other appropriate manner (e.g., by means of firmware).
[0125] The computer program for implementing the method of the embodiment of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0126] In the context of the present application embodiment, machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable signal medium can include but is not limited to electronic, magnetic, optical, electromagnetic or infrared systems, devices or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0127] It should be noted that the term "including" and its variations used in the embodiments of the present application are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of the present application are illustrative and not restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0128] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0129] The various steps described in the method implementation methods provided in the embodiments of the present application can be performed in different orders and / or in parallel. In addition, the method implementation methods may include additional steps and / or omit the steps shown. The scope of protection of the present application is not limited in this respect.
[0130] The term "embodiment" in this specification refers to specific features, structures or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. The various embodiments in this specification are described in a related manner, and the same or similar parts between the various embodiments refer to each other. In particular, for the device, equipment, and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment.
[0131] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A method for generating a decision tree, comprising: Acquire training data, wherein the training data includes: audio data including a wake-up word emitted by a plurality of different wearers of the wearable device and audio data including the wake-up word emitted by a plurality of different non-wearers of the wearable device; Extracting multiple eigenvalues of each audio data in the training data as a first training sample set, wherein the multiple eigenvalues include: wake-up confidence, a time-domain root mean square of the original audio data, a time-domain root mean square of the original audio data after audio enhancement, a ratio of the time-domain root mean square of the original audio data after audio enhancement to the time-domain root mean square of the original audio data, and a frequency-domain energy mean of the original audio data; A plurality of feature values are fitted according to the first training sample set to generate a decision tree.
2. The method according to claim 1, wherein fitting multiple feature values according to the first training sample set to generate a decision tree comprises: Starting from the root node of the decision tree, the Gini coefficients corresponding to different values of the multiple eigenvalues are calculated in sequence according to the first training sample set, wherein the Gini coefficient is used to characterize the classification purity of the first training sample set being divided into awakening samples and non-awakening samples when the value of each eigenvalue is used as the root node; The value of the eigenvalue with the smallest Gini coefficient is selected as the root node of the decision tree.
3. The method according to claim 2, wherein the Gini coefficients corresponding to different values of the plurality of characteristic values are calculated in sequence according to the first training sample set, comprising: For a value of one of the characteristic values, classify the first training sample set according to the value of the characteristic value, wherein the classification includes a wake-up type and a false wake-up type; In the case that all samples in the false awakening type are true false awakening samples, the Gini coefficient of the samples of the awakening type is calculated as the Gini coefficient of the value of the characteristic value.
4. The method according to claim 3, calculating the Gini coefficient of the sample of the wake-up type as the Gini coefficient of the value of the characteristic value, comprising: Determine the ratio of true false awakening samples to true awakening samples in the samples of the awakening type; Determine the sum of squares of the proportions of the true false awakening samples and the true awakening samples; The difference between 1 and the square sum is determined as the Gini coefficient corresponding to the value of the eigenvalue.
5. The method according to claim 2, wherein fitting multiple feature values according to the first training sample set to generate a decision tree comprises: Determine a real false wakeup sample identified after classification based on the determined nodes in the decision tree, wherein the determined nodes include a determined root node and determined first N-level child nodes, where N is an integer greater than or equal to 0 and less than 5; Removing true false awakening samples from the awakening samples from the first training sample set to obtain a second training sample set; An N+1th level child node is determined based on the second training sample set.
6. The method according to claim 5, determining the N+1th level child node based on the second training sample set, comprising: Determine one or more candidate feature values, wherein the one or more candidate feature values are feature values that are not used as the determined nodes among the multiple feature values; Calculate the Gini coefficients corresponding to different values of one or more candidate feature values in sequence according to the second training sample set; The value of the candidate feature value with the smallest Gini coefficient is selected as the N+1th level child node.
7. The method according to claim 1, obtaining training data comprises: Collecting audio data including the wake-up word emitted by multiple different wearers of the wearable device multiple times; The audio data including the wake-up word emitted by multiple different non-wearers of the wearable device are collected multiple times from different angles.
8. The method according to claim 1, extracting the values of multiple feature values of each audio data in the training data, comprising: Performing echo cancellation processing on each audio data in the training data, and calculating a wake-up confidence value of each audio data after the echo cancellation processing; Performing spatial enhancement processing on each audio data after the echo cancellation processing, and performing time domain energy calculation on each audio data after the spatial enhancement processing and each audio data before the spatial enhancement processing, respectively, to obtain the time domain root mean square value of the original audio data after the audio enhancement and the time domain root mean square value of the original audio data; Determine a ratio of a time domain root mean square value of the original audio data after audio enhancement to a time domain root mean square value of the original audio data; Frequency domain energy calculation is performed on each audio data before spatial enhancement processing to obtain a value of the frequency domain energy mean of the original audio data.
9. A method for processing audio data applied to a wearable device, comprising: Get the audio data collected by the microphone; Processing the acquired audio data to obtain multiple eigenvalues, the multiple eigenvalues including: wake-up confidence, a time domain root mean square of the original audio data, a time domain root mean square of the original audio data after audio enhancement, a ratio of the time domain root mean square of the original audio data after audio enhancement to the time domain root mean square of the original audio data, and a frequency domain energy mean of the original audio data; The multiple feature values are processed using a decision tree to determine whether to wake up the wearable device, wherein the decision tree is generated using the method described in any one of claims 1 to 8.
10. A wearable device comprising: A processor, and a memory storing a program, the program comprising instructions which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Speech wake-up method and system, electronic equipment and computer readable storage medium
CN110265036A
Method and device for improving awakening performance
CN110517670A
Audio processing method and device, computer equipment and storage medium
CN111710346A
Self-adaptive voice endpoint detection method and detection circuit
CN113470623A
Technique for training a phonetic decision tree with limited phonetic exceptional terms
US20080319753A1