Wake-up word recognition method, model training method and electronic device
Through the combination of diffusion model and voiceprint features, the problem of poor robustness of wake word recognition in the existing technology is solved, the wake word can be accurately recognized from noisy speech signals, the accuracy and applicability of recognition are improved, and it is suitable for Various device structures.
Patent Information
- Application Number
- CN202410490100.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-04-23
AI Technical Summary
Wake word recognition methods in the existing technology have poor robustness and cannot effectively and accurately identify wake words from noisy speech signals. Moreover, they are limited by sound source separation and device structure, and lack applicability and flexibility.
The diffusion model is used for wake word recognition. The text features of the preset wake words are used as constraints through the target diffusion model, and the reverse diffusion process is performed to separate signal segments that contain wake words and signal segments that do not contain wake words to achieve accurate recognition of speech signals. , and combined with voiceprint features for verification to improve the security and versatility of identification.
It improves the accuracy and robustness of wake word recognition, avoids the problems of incomplete sound source separation and audio quality damage, is suitable for various device structures, and improves the user wake-up experience and the overall performance of the system.
Smart Images

Figure CN118098235B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically to a wake-up word recognition method, a model training method, and an electronic device. Background Art
[0002] With the rapid development of voice recognition technology, many electronic devices are equipped with voice assistant applications (APPs). Voice assistant APPs can interact with users through voice, including but not limited to receiving and responding to users' voice commands, conducting intelligent conversations with users, and answering questions instantly.
[0003] The voice assistant app is generally in a dormant state. If voice interaction is required, the voice assistant app must be woken up first, that is, the voice assistant app must be switched from a dormant state to a working state. Common ways to wake up the voice assistant app include: touch wakeup, power button wakeup, voice wakeup, etc. Among them, voice wakeup refers to the pre-set wakeup word. After the electronic device receives the wakeup word input by the user through voice, it switches the voice assistant app from a dormant state to a working state. Voice wakeup can free the user's hands and greatly improve the efficiency of human-computer interaction.
[0004] The recognition of wake-up words is an important step in voice wake-up. However, the wake-up word recognition method in the related art has the problem of poor robustness. Summary of the invention
[0005] The present application provides a wake-up word recognition method, a model training method, and an electronic device, which can enhance the robustness of wake-up word recognition.
[0006] In a first aspect, the present application provides a wake-up word recognition method, which is executed by an electronic device, and the method includes: after collecting a sound signal, obtaining a voice signal to be recognized from the sound signal; copying the voice signal to be recognized to obtain a voice copy signal; splicing the voice signal to be recognized and the voice copy signal to obtain an input signal; using the input signal as the input of a target diffusion model, using the text features of a preset wake-up word as constraints of the target diffusion model, performing a reverse diffusion process, and obtaining an output signal, the output signal including a first signal segment and a second signal segment, the first signal segment being used to store the voice signal that meets the constraints in the voice signal to be recognized, and the second signal segment being used to store the voice signal that does not meet the constraints in the voice signal to be recognized; determining whether the voice signal to be recognized contains a preset wake-up word based on the first signal segment.
[0007] The wake-up word recognition method provided in the first aspect of the present application has at least the following beneficial effects:
[0008] 1) This method uses a diffusion model to identify wake-up words. As a high-quality generation model, the diffusion model generates high-quality speech signals with good listening experience. Therefore, the target diffusion model can accurately identify the wake-up word speech signal from the noisy speech signal, thereby improving the accuracy of wake-up word recognition.
[0009] 2) This method does not need to perform sound source separation when recognizing wake-up words, and there will be no problems such as incomplete sound source separation and audio quality damage. Therefore, the speech signal recognized by the target diffusion model is of high quality and has a good listening experience.
[0010] 3) The target diffusion model is an overall model rather than a model that is trained and used in blocks, so it has excellent overall performance and good robustness.
[0011] 4) The target diffusion model does not involve a separate speech enhancement processing module and is not limited by electronic equipment components, such as the number and position of microphones. It can be applied to sound signals collected by devices of various structures. Therefore, the model and the method have good versatility and robustness.
[0012] In a possible implementation, the output signal is a speech signal without noise.
[0013] In other words, the speech signal recognized by the target diffusion model is a clean speech signal with high quality and good listening experience, which improves the user's wake-up experience.
[0014] In one possible implementation, based on the first signal segment, determining whether the voice signal to be recognized contains a preset wake-up word includes: if it is determined that there is data in the first signal segment, determining that the voice signal to be recognized contains the preset wake-up word; if it is determined that there is no data in the first signal segment, determining that the voice signal to be recognized does not contain the preset wake-up word.
[0015] The first signal segment is used to store the voice signal that meets the constraint conditions in the voice signal to be recognized, that is, the first signal segment is used to store the voice signal whose content is the preset wake-up word. Then, by judging whether there is data in the first signal segment, it can be simply, quickly and accurately determined whether the voice signal to be recognized contains the preset wake-up word.
[0016] In one possible implementation, the method further includes: splitting the output signal to obtain a first signal segment and a second signal segment, the first signal segment and the second signal segment are equal in length, and the first signal segment is located in the first half of the output signal; and determining whether there is data in the first signal segment.
[0017] Of course, in some embodiments, the lengths of the first signal segment and the second signal segment may not be equal, and the first signal segment may be located in the second half of the output signal segment. The specific setting may depend on the signal segment length and position setting in the signal of the input model when training the target diffusion model.
[0018] In this implementation, when the first signal segment and the second signal segment are of equal length and the first signal segment is located in the first half of the output signal, it is convenient to quickly split the first signal segment and the second signal segment, thereby quickly determining whether the voice signal to be recognized contains a preset wake-up word based on the first signal segment.
[0019] In one possible implementation, the constraint conditions also include the voiceprint features of the target person; based on the first signal segment, determining whether the voice signal to be recognized contains a preset wake-up word, including: if it is determined that there is data in the first signal segment, then determining that the voice signal to be recognized contains the preset wake-up word, and the voice signal to be recognized is emitted by the target person; if it is determined that there is no data in the first signal segment, then determining that the voice signal to be recognized does not contain the preset wake-up word, or the voice signal to be recognized is not emitted by the target person.
[0020] In this implementation, in addition to the text features of the preset wake-up words, the constraints also include the voiceprint features of the target person. Through these two aspects of constraints, the reverse diffusion process of the target diffusion model is constrained, so that the output signal is classified into two categories, one is the target voice signal emitted by the target person, and the content is the wake-up word, and the other is the non-target voice signal emitted by the non-target person, or the content is not the wake-up word. In other words, this implementation can not only identify the preset wake-up words, but also identify whether the voice signal is emitted by the target person, that is, to perform voiceprint verification, thereby improving the security of the wake-up and thus improving the user experience.
[0021] In a possible implementation, the text features of the preset wake-up word are used as constraints of the target diffusion model, including: fusing the voiceprint features of the target person and the text features of the preset wake-up word to obtain fused features; and using the fused features as constraints.
[0022] In this implementation, the voiceprint features of the target person and the text features of the preset wake-up words are fused to obtain fused features. This not only reduces the number and dimensions of features and reduces the calculation complexity of the model, but also the fused features can more comprehensively describe the constraints and improve the recognition accuracy and robustness of the model.
[0023] In a possible implementation, obtaining a speech signal to be recognized from a sound signal includes: performing speech activity detection on the sound signal, and extracting the speech signal to be recognized from the sound signal.
[0024] Optionally, based on an attention mechanism, feature fusion may be performed on the target person's voiceprint features and the text features of a preset wake-up word.
[0025] The purpose of the attention mechanism is to assign different weights to different parts of the input sequence to highlight important information and improve the performance of the model. In this implementation, the attention mechanism can assign different weights to the target person's voiceprint features and the text features of the preset wake-up word to reflect the different importance of the two in wake-up word recognition, thereby improving the accuracy of the target diffusion model in recognizing the wake-up word issued by the target person (i.e., the wake-up word of the person himself).
[0026] In a possible implementation, after determining whether the voice signal to be recognized contains a preset wake-up word based on the first signal segment, the method further includes: if the voice signal to be recognized contains the preset wake-up word, waking up a preset application.
[0027] In a possible implementation, after waking up the preset application, the method further includes: setting the value of the status flag to a first value, wherein the value of the status flag is the first value indicating that the preset application is in a working state.
[0028] In a possible implementation, before copying the speech signal to be recognized to obtain the speech copy signal, the method further includes: when determining that the value of the state flag is a second value, copying the speech signal to be recognized to obtain the speech copy signal. The second value of the state flag indicates that the preset application is in a dormant state.
[0029] In one possible implementation, after collecting the sound signal and obtaining the voice signal to be recognized from the sound signal, the method also includes: when determining that the value of the status flag is a first value, identifying semantic information in the voice signal to be recognized, executing instructions according to the voice information, and / or outputting a response voice according to the voice information.
[0030] In a second aspect, the present application provides a model training method, which is executed by an electronic device, and the method includes: obtaining a sample voice signal, the sample voice signal including a first sample voice signal and a second sample voice signal, the first sample voice signal is a voice signal emitted by a sample character and the content is a sample wake-up word, the second sample voice signal is not a voice signal emitted by the sample character, and / or the content of the second sample voice signal is not the sample wake-up word; using the sample voice signal as the input of an initial diffusion model, using the text features of the sample wake-up word as the constraints of the initial diffusion model, executing a forward diffusion process, and adjusting the parameters of the initial diffusion model to obtain a target diffusion model.
[0031] Based on the target diffusion model trained by the model training method, the input can be a noisy speech signal, and after performing reverse diffusion, the output is an output signal. The output signal includes a first signal segment and a second signal segment, the first signal segment is used to store the speech signal that meets the constraint condition in the speech signal to be recognized, and the second signal segment is used to store the speech signal that does not meet the constraint condition in the speech signal to be recognized.
[0032] The model training method provided in the second aspect of the present application has at least the following beneficial effects:
[0033] 1) For the diffusion model, the constraints used in the forward diffusion process are used to constrain the diffusion process, control the direction of the model's learning ability, and make the model's learned ability highly correlated with the constraints. In this model training method, the text features of the sample wake-up words are used as constraints in the forward diffusion process to control the direction of the model's learning ability, so that the model learns a classification-like ability and divides the signal into two categories, one is the target speech signal that meets the constraints, and the other is the non-target speech signal that does not meet the constraints. In this way, the target diffusion model trained by this method can more accurately identify the wake-up word.
[0034] 2) The model training process does not require the use of sample noise, and does not need to be combined with cumbersome and complex noise scene training models. This not only simplifies the model training process, but also the obtained target diffusion model can cover various sound source scenes and has high flexibility and robustness.
[0035] 3) The model training process does not require sample noise or sound source separation, and there will be no problems such as incomplete sound source separation and audio quality damage. The speech signal recognized by the target diffusion model is of high quality and has a good listening experience.
[0036] 4) The above model training process is to train the initial diffusion model as a whole, and there is no problem of block training. Therefore, the overall performance of the trained target diffusion model is excellent and the robustness is good.
[0037] 5) The above model training process does not involve the training of the speech enhancement module and is not limited by electronic equipment devices, such as the number and position of microphones. It can be applied to sound signals collected by devices of various structures, so the model has good versatility and robustness.
[0038] In one possible implementation, the constraint condition also includes the voiceprint feature of the sample person; the text feature of the sample wake-up word is used as the constraint condition of the initial diffusion model, including: fusing the voiceprint feature of the sample person and the text feature of the sample wake-up word to obtain a sample fusion feature; and using the sample fusion feature as a constraint condition.
[0039] In this implementation, the constraints include not only the text features of the sample wake-up words, but also the voiceprint features of the sample person. Through these two constraints, the forward diffusion process of the target diffusion model is constrained, so that the model learns to divide the noisy speech signals into two categories, one is the target speech signal that meets the constraints (satisfies the text features of the sample wake-up words and the voiceprint features of the sample person), and the other is the non-target speech signal that does not meet the constraints. In other words, the target diffusion model trained in this implementation can not only recognize the preset wake-up words, but also recognize whether the voice signal is emitted by the target person, that is, perform voiceprint verification, thereby improving the security of the wake-up and thus improving the user experience.
[0040] In a possible implementation, both the first sample speech signal and the second sample speech signal are noise-free signals.
[0041] That is to say, the second sample voice signal of the first sample voice signal is a clean voice signal. In this way, the clean sample voice signal is used as the target domain signal, and the ability learned by the model is the ability to restore the noisy voice signal to a clean voice signal. In this way, when the trained target diffusion model is used for wake-up word recognition, the obtained voice signal has high quality, good listening experience, more accurate recognition, and improves the user's wake-up experience.
[0042] In a possible implementation, the first sample speech signal and the second sample speech signal have the same signal length.
[0043] The target diffusion model is obtained by training the first sample speech signal and the second sample speech signal of equal length. When the wake-up word recognition is performed later, the output signal includes the first signal segment and the second signal segment, and the first signal segment and the second signal segment are of equal length. This makes it easier to split the output signal and to determine whether the speech signal to be recognized contains the wake-up word based on the split signal segments, thereby improving the efficiency of wake-up recognition.
[0044] In a possible implementation, obtaining a sample voice signal includes: obtaining a first sample voice signal and a second sample voice signal respectively; and concatenating the first sample voice signal and the second sample voice signal to obtain a sample voice signal.
[0045] Optionally, during splicing, the first sample voice signal may be located in the first half and the second sample voice signal may be located in the second half, or the first sample voice signal may be located in the second half and the second sample voice signal may be located in the first half.
[0046] By concatenating the first sample speech signal and the second sample speech signal, a continuous sample speech signal is obtained, which makes it easier for the initial diffusion model to add Gaussian noise to the sample speech signal, thereby facilitating the model training process.
[0047] In a third aspect, the present application provides a device, which is included in an electronic device, and the device has the function of implementing the electronic device behavior in the above-mentioned first aspect and the possible implementation of the above-mentioned first aspect. The function can be implemented by hardware, or it can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, a receiving module or unit, a processing module or unit, etc.
[0048] In a fourth aspect, the present application provides an electronic device, comprising: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution of the first aspect.
[0049] In a fifth aspect, the present application provides a chip, including a processor. The processor is used to read and execute a computer program stored in a memory to perform the method in the first aspect and any possible implementation thereof.
[0050] Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.
[0051] Further optionally, the chip also includes a communication interface.
[0052] In a sixth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes any one of the methods in the technical solution of the first aspect.
[0053] In a seventh aspect, the present application provides a computer program product, which includes: a computer program code, and when the computer program code runs on an electronic device, the electronic device executes any one of the methods in the technical solution of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is a schematic diagram of an interface for enabling a voice wake-up function provided in an embodiment of the present application;
[0055] Figure 2 This is a flowchart of an example of a wake-up word recognition process in the related art;
[0056] Figure 3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0057] Figure 4 is a software structure block diagram of an electronic device provided in an embodiment of the present application;
[0058] Figure 5 This is a schematic diagram of the working principle of a diffusion model provided in an embodiment of the present application;
[0059] Figure 6 It is a schematic diagram of the principle of a training target diffusion model provided in an embodiment of the present application;
[0060] Figure 7 It is a flowchart of a model training method provided in an embodiment of the present application;
[0061] Figure 8 It is a schematic diagram of the reverse diffusion principle of an example of a target diffusion model provided in an embodiment of the present application;
[0062] Fig. 9 This is a flowchart of a wake-up word recognition method provided in an embodiment of the present application;
[0063] Fig.10 This is a schematic diagram of an interface for registering a voiceprint provided in an embodiment of the present application;
[0064] Fig.11 This is a schematic diagram of an interface for answering a wake-up call provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0066] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.
[0067] References to "one embodiment" or "some embodiments" etc. described in the specification of the present application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in the specification of the present application do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0068] First, the background and application scenarios of the embodiments of the present application are described.
[0069] At present, many electronic devices are installed with voice assistant APP. Voice assistant APP provides users with a convenient way of human-computer interaction. Users can instruct electronic devices to complete various tasks without having to do anything, such as making calls, setting alarms, sending text messages, checking messages, etc. Moreover, voice assistants can also have intelligent conversations and instant Q&A with users. Voice assistant APP greatly improves the efficiency of human-computer interaction and improves user experience.
[0070] The voice assistant APP has two states: dormant state and working state. In the dormant state, the voice assistant APP cannot interact with the user by voice, that is, it cannot respond to the user's voice commands, nor can it conduct intelligent conversations and instant questions and answers. In the working state, the voice assistant APP can interact with the user by voice. The dormant state and the working state can be switched, and the process of controlling the voice assistant APP to enter the working state from the dormant state is called waking up the voice assistant APP, or waking up the voice interaction. There can be many ways to wake up the voice assistant APP, including but not limited to touch wakeup, power button wakeup, Bluetooth device wakeup, voice wakeup, etc. The embodiments of the present application mainly relate to voice wakeup. Voice wakeup refers to the user inputting a voice signal into the electronic device, triggering the voice assistant APP to enter the working state from the dormant state.
[0071] It is understood that only when the voice wake-up function is turned on can the user wake up the voice assistant APP through voice. The voice assistant APP installed in different electronic devices may be different, and the way to turn on the voice wake-up function is also different. For example, Figure 1 Taking the electronic device as a mobile phone and the voice assistant APP as YOYO Assistant® as an example, a method for enabling the voice wake-up function is provided. Figure 1 As shown in FIG. 1 (a), the desktop of the mobile phone includes an icon 101 of the setting APP. The user clicks the icon 101 of the setting APP to open the setting APP, and the following is displayed: Figure 1The main setting interface 102 is shown in FIG. (b) of FIG. The main setting interface 102 includes a smart assistant option 103. The user clicks the smart assistant option 103 to enter the smart assistant setting interface 104, such as Figure 1 The setting interface 104 of the smart assistant includes a smart voice option 105. The user clicks the smart voice option 105 to enter the following Figure 1 The setting interface 106 of the intelligent voice as shown in FIG. (d) of FIG. The setting interface 106 of the intelligent voice includes a voice wake-up option 107. Click the voice wake-up option 107 to enter the following Figure 1 The voice wake-up setting interface 108 shown in FIG. (e) of FIG. 108 includes a voice wake-up switch 109. Clicking the voice wake-up switch 109 can control the voice wake-up function to be turned on and off. When the voice wake-up switch 109 is turned on and the voice wake-up function is turned on, the mobile phone displays the following Figure 1 Interface 111 is shown in FIG. 1 (f).
[0072] Generally, the process of realizing voice wake-up of voice assistant APP by electronic devices includes:
[0073] 1) Pre-set the wake-up word; the wake-up word can be, for example, Hello YOYO®, Hello Honor®, etc.
[0074] 2) Continuously collecting sound signals through a microphone; it is understood that the sound signals may include voice signals or non-voice signals.
[0075] 3) In the sleep state, the voice assistant APP recognizes the wake-up word; specifically, the voice assistant APP processes the sound signal to determine whether the voice signal in the sound signal contains the wake-up word; if the voice signal contains the wake-up word, the state of the voice assistant APP is switched from the sleep mode to the working state.
[0076] 4) When in working state, the voice assistant APP interacts with the user through voice; specifically, the voice assistant APP processes the voice signal, understands the instructions or semantics in the voice signal, and interacts with the user based on the instructions or semantics, such as executing instructions, answering questions, etc.
[0077] In short, in sleep mode, the voice assistant APP can perform wake-up word recognition, but cannot perform voice interaction; in working mode, the voice assistant APP can perform voice interaction but does not need to perform wake-up word recognition.
[0078] In order to improve the security of electronic devices, in some implementations, while recognizing the wake-up word, the voice assistant APP can also perform voiceprint recognition on the voice signal to determine whether the voice signal is the voice emitted by the registrant. Among them, the registrant refers to a person who has registered a voiceprint in the electronic device in advance. The registrant can be the owner of the electronic device (that is, the owner himself, referred to as myself), or a user authorized by the owner of the electronic device. When the voice assistant APP determines that the voice signal contains the wake-up word and the voice signal is the voice emitted by the registrant (also referred to as the voice signal belongs to the registrant), the state of the voice assistant APP is switched to the working state. In this embodiment, the process of triggering the voice assistant APP to wake up by the wake-up word and the registrant's voiceprint at the same time is called my wake-up word wake-up, and the process of identifying the wake-up word and voiceprint recognition is collectively referred to as my wake-up word recognition.
[0079] In the related art, the wake-up word recognition of the user is mainly implemented through three modules: speech enhancement module (also called front-end enhancement module), wake-up word recognition module and voiceprint verification module. For example, Figure 2 FIG. 1 is a flowchart of an example of a wake-up word recognition process in the related art. Figure 2 As shown, the registrant pre-registers the voiceprint, and the voiceprint verification module generates voiceprint template information based on the voiceprint registered by the user. Optionally, when the user registers the voiceprint, the electronic device can record the registered voice signal emitted by the user through the microphone, for example, the user emits a voice signal with the content of the wake-up word, and the voiceprint verification module generates voiceprint template information based on the registered voice signal. During use, the microphone collects the sound signal and inputs the collected sound signal into the voice enhancement module. The voice enhancement module enhances the voice signal in the sound signal to obtain a relatively clean voice signal (referred to as an enhanced voice signal). Among them, the enhancement processing includes but is not limited to automatic gain control, voice noise reduction, etc. Afterwards, the enhanced voice signal is input into the wake-up word recognition module. The wake-up word recognition module identifies whether the enhanced voice signal contains the wake-up word. At the same time, the enhanced voice signal is input into the voiceprint verification module. The voiceprint verification module verifies whether the enhanced voice signal belongs to the registrant based on the pre-generated voiceprint template information. If the enhanced voice signal contains the wake-up word and the enhanced voice signal belongs to the registrant, the voice assistant APP is woken up.
[0080] Among them, the speech enhancement module, the wake-up word recognition module and the voiceprint verification module are generally implemented through models. Before use, the models corresponding to the three modules need to be trained separately, that is, block training. Afterwards, the trained models are used to work together to realize the above process. However, the three modules are trained in blocks, and the model training stage cannot take into account the influence of other modules, nor the connection and integration with other modules, so the overall performance of the algorithm cannot be optimized, and the wake-up word recognition effect is poor for the person, and the robustness of the algorithm is also poor. In addition, the speech enhancement module will be restricted by the device setting during speech enhancement processing. For example, there are differences in the speech enhancement modules trained based on different numbers of microphones and microphones in different installation positions. Therefore, the speech enhancement module trained based on one device setting method is not applicable to devices with other device settings. Therefore, the wake-up word recognition method in the related art has the problem of poor versatility and flexibility. In addition, in the speech enhancement module, a separation algorithm based on a neural network (NN) is often used to achieve sound source separation, such as separation of background sound and human voice, or separation of the sound emitted by person A and the sound emitted by person B. This NN-based separation algorithm needs to match a large number of different types of separation sources (i.e., sound sources) during the training phase to enrich the training samples as much as possible, which makes the training process cumbersome and complicated. Moreover, even if different types of separation sources are used, it can still only cover some scenes, not all scenes, resulting in limited applicability and flexibility of the final speech enhancement model, and the accuracy of sound source separation is constrained by the corresponding scenes of model training, which leads to problems such as incomplete sound source separation and audio quality damage when the model is applied to scenes that are not covered.
[0081] In view of this, the embodiments of the present application provide a model training method and a wake-up word recognition method to solve the above problems.
[0082] The wake-up word recognition method and model training method provided in the embodiments of the present application can be applied to electronic devices with voice collection functions, such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), smart speakers, smart TVs, smart robots, and wearable devices. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0083] For example, Figure 31 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0084] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0085] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0086] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0087] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0088] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0089] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0090] Figure 4 1 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages.
[0091] The application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications, which are not shown in the figure.
[0092] like Figure 4 As shown, in the embodiment of the present application, the application layer may include a voice assistant APP. The voice assistant APP may include a voice activity detection (VAD) module, a voiceprint extraction module, a text feature extraction module, a feature fusion module, a target diffusion model, a judgment module, a voice interaction module, and a model training module.
[0093] The VAD module is used to detect the sound signal collected by the microphone and extract the speech signal to be recognized from the sound signal. The voiceprint extraction module is used to extract the features of the voiceprint of the registrant (also called the target person) to obtain the voiceprint features of the registrant. The text feature extraction module is used to extract the text features of the preset wake-up word to obtain the text features of the wake-up word. The feature fusion module is used to fuse the voiceprint features of the registrant and the text features of the wake-up word to obtain the fusion features. Optionally, the feature fusion module can use the attention mechanism to fuse the voiceprint features of the registrant and the text features of the wake-up word.
[0094] The target diffusion model can also be called a noise reduction model or a wake-up word recognition model, etc. It is used to take the speech signal to be recognized extracted by VAD as input, and the fusion feature as a constraint condition (also called input condition (conditioninput), condition or constraint), perform the reverse diffusion process, and obtain the output signal. The output signal includes a target signal segment (also called the first signal segment) and a non-target signal segment (also called the second signal segment).
[0095] The judgment module is used to determine whether the voice signal to be recognized contains the wake-up word according to the output signal output by the target diffusion model, and then determine whether to wake up the voice assistant APP. Specifically, if the target signal segment is not empty (that is, there is data), it means that the voice signal to be recognized contains the wake-up word, and the voice assistant APP is woken up; if the target signal segment is empty (that is, there is no data), it means that the voice signal to be recognized does not contain the wake-up word, and the voice assistant APP is not woken up.
[0096] The voice interaction module is used to respond to the user's voice commands to perform related tasks, or to have intelligent conversations, instant questions and answers with the user, etc.
[0097] The model training module is used to train the initial diffusion model to obtain the target diffusion model. The process of the model training module training the target diffusion model may include: taking the sample voice signal as the input of the initial diffusion model, taking the voiceprint features of the sample character and the text features of the sample wake-up word as the constraints of the initial diffusion model, performing a forward diffusion process on the initial diffusion model, and adjusting the parameters of the initial diffusion model to obtain the target diffusion model. Among them, the sample voice signal includes a first sample voice signal and a second sample voice signal, the first sample voice signal is a wake-up word voice signal emitted by the sample character, and the second sample voice signal is other voice signals other than the first sample voice signal, including one or more of the sound signals emitted by non-sample characters and / or non-wake-up word voice signals. The output of the target diffusion model is a voice signal containing noise (referred to as a noisy voice signal).
[0098] Optionally, in some other embodiments, the electronic device may not include a model training module, but after training the target diffusion model in other devices, the target diffusion model may be imported into the electronic device. This embodiment of the present application does not limit this.
[0099] It is understandable that each application in the application program layer can implement its function by calling related modules in the underlying layer.
[0100] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0101] like Figure 4 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0102] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0103] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0104] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0105] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0106] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0107] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0108] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0109] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0110] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0111] The system library can include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0112] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0113] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0114] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc.
[0115] A 2D graphics engine is a drawing engine for 2D drawings.
[0116] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver. Among them, the audio driver can include audio input driver and audio output driver. The audio input driver is also called microphone driver. The microphone driver is used to identify and drive the microphone and transmit the microphone input signal to the upper layer. Among them, the microphone is located in the hardware layer of the electronic device. Figure 4 Not shown in FIG.
[0117] The following embodiments of this application will be based on Figure 3 and Figure 4 Taking the electronic device with the structure shown as an example, the wake-up word recognition method and model training method provided in the embodiments of the present application are specifically explained in combination with the accompanying drawings and application scenarios.
[0118] To facilitate understanding, the diffusion model is first introduced.
[0119] The diffusion model is a deep neural network (DNN). A neural network can be composed of neural units, and a neural unit can refer to a s The output of the operation unit with the intercept 1 as input can be:
[0120] .
[0121] Where s=1, 2, ... n, n is a natural number greater than 1, W s For x s , b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer. The activation function can be a sigmoid function. A neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.
[0122] DNN can also be called a multi-layer neural network, which can be understood as a neural network with multiple hidden layers. According to the position of different layers, DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer.
[0123] The work of each layer in a deep neural network can be expressed mathematically as To describe: From a physical perspective, the work of each layer in a deep neural network can be understood as completing the transformation from input space to output space (i.e., from row space to column space of a matrix) through five operations on the input space (a set of input vectors). These five operations include: 1. Dimension increase / reduction; 2. Enlargement / reduction; 3. Rotation; 4. Translation; 5. "Bending". Operations 1, 2, and 3 are represented by Completed, the operation of 4 is done by Completed, the operation of 5 is done by The reason why the word "space" is used here is because the object being classified is not a single thing, but a class of things, and space refers to the collection of all individuals of this class of things. is a weight vector, each value in which represents the weight value of a neuron in this layer of the neural network. Determines the spatial transformation from the input space to the output space mentioned above, that is, the weight of each layer Controls how to transform space. The purpose of training a deep neural network is to finally obtain the weight matrix of all layers of the trained neural network (consisting of many layers of vectors Therefore, the training process of the neural network is essentially to learn how to control spatial transformation, more specifically to learn the weight matrix.
[0124] Therefore, DNN is simply the following linear relationship expression: ,in, is the input vector, is the output vector, is the offset vector, is the weight matrix (also called coefficient), is the activation function. Each layer is just an input vector After such a simple operation, the output vector . Due to the large number of DNN layers, the coefficient and the offset vector The number of these parameters is also relatively large. The definitions of these parameters in DNN are as follows: For example: Assume that in a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as The superscript 3 represents the coefficient The subscripts correspond to the third-layer index 2 of the output and the second-layer index 4 of the input.
[0125] In summary, the coefficient from the kth neuron in the L−1th layer to the jth neuron in the Lth layer is defined as .
[0126] It should be noted that the input layer has no Parameters. In a deep neural network, more hidden layers allow the network to better describe complex situations in the real world. Theoretically, the more parameters a model has, the higher its complexity and the greater its "capacity", which means it can complete more complex learning tasks. Training a deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (consisting of many layers of vectors). The weight matrix formed).
[0127] The framework of the diffusion model can adopt the denoising diffusion probabilistic model (DDPM), score-based generative models (SGM) or stochastic differential equation (SDE).
[0128] The model structure of the diffusion model can be a convolutional neural network, for example, a U-net, a noise conditional score network (NCSN), an upgraded version of NCSN (NCSN++), etc.
[0129] A convolutional neural network is a deep neural network with a convolutional structure. It is a deep learning architecture. A deep learning architecture refers to multiple levels of learning at different levels of abstraction through machine learning algorithms. As a deep learning architecture, CNN is a feed-forward artificial neural network in which each neuron can respond to the data input into it.
[0130] Convolutional neural networks contain a feature extractor consisting of a convolution layer and a subsampling layer. The feature extractor can be regarded as a filter, and the convolution process can be regarded as using a trainable filter to convolve an input data or convolution feature plane (feature map). The convolution layer refers to the neuron layer in the convolutional neural network that performs convolution processing on the input signal. In the convolution layer of the convolutional neural network, a neuron can only be connected to some neurons in the adjacent layers. A convolution layer usually contains several feature planes, and each feature plane can be composed of some rectangularly arranged neural units. The neural units in the same feature plane share weights, and the shared weights here are the convolution kernels. Taking the input data as an image as an example, shared weights can be understood as the way to extract image information is independent of position. The implicit principle is that the statistical information of a part of the image is the same as that of other parts. This means that the image information learned in a certain part can also be used in another part. So for all positions on the image, we can use the same learned image information. In the same convolution layer, multiple convolution kernels can be used to extract different image information. Generally speaking, the more convolution kernels there are, the richer the image information reflected by the convolution operation.
[0131] The convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights through learning during the training process of the convolutional neural network. In addition, the direct benefit of shared weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.
[0132] A convolutional neural network may include an input layer, a convolutional layer, and a neural network layer. A convolutional neural network may also include a pooling layer.
[0133] The convolution layer can include many convolution operators, also called kernels. Its role in natural language processing is equivalent to a filter that extracts specific information from the input speech or semantic information. The convolution operator can essentially be a weight matrix, which is usually predefined.
[0134] The weight values in these weight matrices need to be obtained through a lot of training in practical applications. The weight matrices formed by the weight values obtained through training can extract information from the input data, thereby helping the convolutional neural network to make correct predictions.
[0135] When a convolutional neural network has multiple convolutional layers, the initial convolutional layer often extracts more general features, which can also be called low-level features. As the depth of the convolutional neural network increases, the features extracted by the subsequent convolutional layers become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.
[0136] Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolution layer. It can be a convolution layer followed by a pooling layer, or multiple convolution layers can be followed by one or more pooling layers.
[0137] In the audio processing process, the only purpose of the pooling layer is to reduce the spatial size of the audio. The pooling layer may include an average pooling operator and / or a maximum pooling operator to sample the input audio features to obtain audio features of smaller size.
[0138] After being processed by the convolution layer / pooling layer, the convolutional neural network is not sufficient to output the required output information. Because as mentioned above, the convolution layer / pooling layer will only extract features and reduce the parameters brought by the input data. However, in order to generate the final output information (the required class information or other related information), the convolutional neural network needs to use the neural network layer to generate one or a group of outputs of the required number of classes. Therefore, the neural network layer may include multiple hidden layers and an output layer, and the parameters contained in the multiple hidden layers can be pre-trained according to the relevant training data of the specific task type. For example, the task type may include speech or semantic recognition, classification or generation, etc.
[0139] After the multiple hidden layers in the neural network layer, the last layer of the entire convolutional neural network is the output layer. The output layer has a loss function similar to the classification cross entropy, which is specifically used to calculate the prediction error. Once the forward propagation of the entire convolutional neural network is completed, the back propagation will begin to update the weight values and biases of the previously mentioned layers to reduce the loss of the convolutional neural network and the error between the result output by the convolutional neural network through the output layer and the ideal result.
[0140] It should be understood that the above introduction to the convolutional neural network is only an example of a convolutional neural network. In specific applications, the convolutional neural network can also exist in the form of other network models. For example, multiple convolutional layers / pooling layers are in parallel, and the features extracted from each layer are input to the full neural network layer for processing.
[0141] The diffusion model is a generative model that can learn to approximate unknown data distribution given independent and identically distributed sample data from the position data distribution. The use of the diffusion model involves the forward diffusion process and the reverse diffusion process.
[0142] The forward diffusion process can also be called the forward diffusion process or the diffusion process. The backward diffusion process can also be called the inference process, the reverse diffusion process, the abstraction process or the denoising process. In the forward diffusion process, the Markov chain of data is generated by gradually and orderly adding Gaussian noise to the data. In the backward diffusion process, the Markov chain of noisy data is generated by gradually removing the noise of a noisy data.
[0143] The Markov chain consists of a series of states and a series of change probabilities. The state here refers to data with different noise levels, and the change probability refers to the probability of changing from the current state to the next state, which is implemented using a change matrix.
[0144] For example, Figure 5 As shown in Figure (a), for the data , in the forward diffusion process, Gaussian noise is gradually added. Among them, the data obtained in the t-1 step is In the tth step of the T-step (total number of steps) forward diffusion process, Add a small amount of Gaussian noise to get the data ,data represents the data obtained after t steps. Where t=1,2…,T, T is a positive integer. That is, for the data , after T steps, the data obtained in each step are , , …, In the forward diffusion process, the parameter t can represent the number of steps to add Gaussian noise, or the number of iterations.
[0145] like Figure 5 As shown in Figure (a), the reverse diffusion process is the opposite of the forward diffusion process, gradually removing noise. In the reverse diffusion process, the parameter t can be understood as the number of remaining iterations. , after T steps, the data obtained in each step are , , …, .
[0146] like Figure 5 As shown in Figure (b), taking image data as an example, during the forward diffusion process, Gaussian noise is gradually added to the image data, and the image gradually becomes blurred. During the reverse diffusion process, the noise gradually decreases, and the image gradually becomes clearer until the original image data is restored.
[0147] like Figure 5 As shown in Figure (c) in Figure 1, taking audio data as an example, during the forward diffusion process, Gaussian noise is gradually added to the clean audio data, and the noise in the audio data gradually increases. During the reverse diffusion process, the noise in the audio gradually decreases until the original clean audio data is restored.
[0148] The forward diffusion process can be expressed as: .
[0149] in, Representation data The expression after the tth iteration is, Represents a constraint.
[0150] Understandably, data The data after the tth iteration can be directly based on the data Calculated, please refer to the following formula for details:
[0151] .
[0152] in, represents a Gaussian distribution, represents the mean value of the Gaussian distribution, represents the standard deviation of the Gaussian distribution, represents the variance of the Gaussian distribution, Represents the identity matrix.
[0153] The mean of a Gaussian distribution It can be calculated based on the condition y, the parameter t used to represent the number of iterations, and the normalization constant OK. The mean of the Gaussian distribution It can be expressed as:
[0154] .
[0155] The standard deviation of the Gaussian distribution It can be calculated based on the parameter t used to represent the number of iterations, the normalization constant , the preset maximum variance and the preset minimum variance OK. The standard deviation of the Gaussian distribution The square of is the variance of the Gaussian distribution. It can be expressed as:
[0156] .
[0157] According to the data The expression at time t can determine the data .
[0158] The forward diffusion process can be understood as the training process of the diffusion model. The initial diffusion model is used to process the training samples with parameters t=1, 2…, T to obtain the training denoised data, and the training denoised data and the data are compared. The difference between adjusts the parameters of the initial diffusion model. The training samples of the initial diffusion model include data , the diffusion model is the initial diffusion model after parameter adjustment.
[0159] The training denoising data can be the output of the initial diffusion model or it can be The output representation of the initial diffusion model is obtained by removing the noise.
[0160] In training denoising data is the data Based on the removal of the noise of the output representation of the initial diffusion model, the denoised data is trained and the data is compared. The difference between the initial diffusion model and the data can be understood as the difference between the output of the initial diffusion model and the output of the data. Relative data The difference between the added noise adjusts the parameters of the initial diffusion model.
[0161] According to the output and data of the initial diffusion model when t is t=1,2…,T respectively By adjusting the parameters of the initial diffusion model, we can get the difference between them, which can be expressed as:
[0162] .
[0163] in, represents the output of the initial diffusion model, Representation and Data Comparison data The noise added in is a preset constant, represents the norm, It represents the expectation of the multiple t for t=1,2…,T. The norm is usually used to measure the length or size of each vector in a vector space (or matrix).
[0164] The reverse diffusion process can be understood as the inference process of the diffusion model. The reverse diffusion process can be expressed as: .
[0165] Based on the above-mentioned forward diffusion process and reverse diffusion process expression formula, the data can be Expressed as , the data obtained after T steps of iteration Expressed as ,in, .
[0166] As a high-quality generative model, the diffusion model generates high-quality speech signals with good listening experience. Moreover, the diffusion model has good robustness.
[0167] Next, the wake-up word recognition method and model training method provided in this embodiment are described. Among them, the model training method is also the training process of the target diffusion model, and the wake-up word recognition method can be understood as the use process of the target diffusion model. For the sake of distinction, the word "sample" can be added before the name of the voice signal, wake-up word, character and other data involved in the model training process to indicate that it is the data in the model training process. It should be understood that these sample data can be essentially the same as the non-sample data involved in the model use process.
[0168] First, the training process of the target diffusion model is introduced.
[0169] For example, Figure 6 is a schematic diagram of the principle of a training target diffusion model provided in an embodiment of the present application, Figure 7 Please refer to the flowchart of a model training method provided in the embodiment of this application. Figure 6 and Figure 7 The method includes the following steps S101 to S106. The execution subject of the following steps can be Figure 4 The model training module in the figure is not repeated in the steps.
[0170] S101, obtaining a first sample voice signal without noise and a second sample voice signal without noise. The first sample voice signal is a voice signal of a sample character whose content is a sample wake-up word. The second sample voice signal is a voice signal other than the first sample voice signal.
[0171] That is to say, both the first sample voice signal and the second sample voice signal are clean voice signals. The sample person refers to a person whose voiceprint and voice signal are used for model training. The sample person can be any person. The first sample voice signal is also called a sample person wake-up word voice signal (referred to as the sample person wake-up word). The second sample voice can be a sound signal emitted by a non-sample person, and / or a voice signal whose content is a non-sample wake-up word. Specifically, the second sample voice may include a voice signal emitted by a sample person whose content is a non-sample wake-up word (also called a sample person non-wake-up word voice signal, referred to as a sample person non-wake-up word), a voice signal emitted by a non-sample person whose content is a sample wake-up word (also called a non-sample person wake-up word voice signal, referred to as a non-sample person wake-up word), and a voice signal emitted by a non-sample person whose content is a non-sample wake-up word (also called a non-sample person non-wake-up word signal, referred to as a non-sample person non-wake-up word). One or more.
[0172] Taking the sample wake-up word as "Hello YOYO" and the sample character as character A as an example, the first sample voice signal (i.e., the sample character wake-up word) is: the content of the voice signal emitted by character A is "Hello YOYO". The second sample voice signal may include at least one of the following signals: the content of the voice signal emitted by non-character A is "Hello YOYO" (i.e., the non-sample character wake-up word); the content of the voice signal emitted by character A is not "Hello YOYO" (i.e., the sample character non-wake-up word), for example, the content of the voice signal emitted by character A is "The weather is very good today"; the content of the voice signal emitted by non-character A is not "Hello YOYO" (i.e., the non-sample character non-wake-up word), for example, the content of the voice signal emitted by character B is "The weather is very good today".
[0173] Optionally, the lengths of the first sample speech signal and the second sample speech signal are equal.
[0174] S102: Concatenate the first sample speech signal and the second sample speech signal to obtain a sample speech signal.
[0175] In the embodiment of the present application, voice signal splicing can be understood as connecting multiple voice signal segments together to form a continuous voice data stream.
[0176] Optionally, the length of the first sample voice signal may be the same as or different from the length of the second sample voice signal. Taking the example that the lengths of the first sample voice signal and the second sample voice signal are the same, the first sample voice signal and the second sample voice signal may be expressed as [N, 1], where N represents the length of the voice signal. Then, the first sample voice signal and the second sample voice signal may be expressed as [2N, 1] after being spliced. Optionally, the length of the voice signal may be expressed by time length, or by the number of sampling points. When the length of the voice signal is expressed by time length, the unit of the voice signal (i.e., the unit of N) may be, for example, seconds (s). When the length of the voice signal is expressed by the number of sampling points, the unit of the voice signal (i.e., the unit of N) may be, for example, Hertz (Hz).
[0177] S103: extracting the voiceprint of the sample registration voice signal emitted by the sample person, and obtaining the voiceprint feature of the sample person.
[0178] Optionally, the sample registration voice signal may or may not contain the sample wake-up word. When the sample registration voice signal contains the sample wake-up word, the extracted voiceprint feature is more accurate, and the target diffusion model obtained when it is subsequently used as a constraint for model training is more accurate, thereby improving the accuracy of wake-up word recognition.
[0179] Optionally, voiceprint feature extraction may be performed using mel frequency cepstral coefficients (MFCC), x-vector algorithm, or j-vector algorithm, etc. The embodiment of the present application does not limit the algorithm for voiceprint feature extraction.
[0180] S104: extract text features of the sample wake-up word text to obtain text features of the sample wake-up word.
[0181] Optionally, text feature extraction can be performed using the word to vector method.
[0182] S105: Fusing the voiceprint features of the sample person and the text features of the sample wake-up word to obtain sample fusion features.
[0183] Optionally, the voiceprint features of the sample person and the text features of the sample wake-up word can be feature fused based on the attention mechanism. The attention mechanism is a mechanism used to process sequence data in deep learning. The purpose of the attention mechanism is to assign different weights to different parts of the input sequence to highlight important information and improve the performance of the model. In this embodiment, different weights can be assigned to the voiceprint features of the sample person and the text features of the sample wake-up word through the attention mechanism to reflect the different importance of the two in the recognition of the sample wake-up word, thereby improving the accuracy of the final target diffusion model in recognizing the sample person's wake-up word.
[0184] S106, taking the sample speech signal as the input of the initial diffusion model, taking the sample fusion feature as the constraint condition of the initial diffusion model, executing the forward diffusion process through the initial diffusion model, and adjusting the parameters of the initial diffusion model to obtain the target diffusion model.
[0185] Specifically, the initial diffusion model gradually and orderly adds Gaussian noise to the sample speech signal, and constrains the forward diffusion process through sample fusion features, and finally outputs a noisy sample signal. The noisy sample signal includes a first noisy speech signal and a second noisy speech signal. The first noisy speech signal is a speech signal obtained by adding Gaussian noise to the first sample speech signal. The second noisy speech signal is a speech signal obtained by adding Gaussian noise to the second sample speech signal. Here, the sample speech signal input by the initial diffusion model can be understood as the target domain signal ultimately required by the target diffusion model, or as a target distribution. The signal output by the initial diffusion model is a noisy speech signal, or as a noisy distribution. In other words, the initial diffusion model transforms the target distribution into a noisy distribution. In this process, the initial diffusion model learns the ability to restore the noisy speech signal to the target domain signal, and finally obtains the target diffusion model. It should be understood that in this embodiment, the model learning a certain "ability" can be understood as the model gradually adjusting the weight matrix of the neural network to a target weight matrix. Under this target weight matrix, the model has this "ability" (that is, the corresponding function).
[0186] It can be understood that when the lengths of the first sample speech signal and the second sample speech signal are equal, the lengths of the first noisy speech signal and the second noisy speech signal are also equal.
[0187] In this embodiment, on the one hand, a clean sample speech signal is used as the target domain signal, so the ability learned by the model is the ability to restore the noisy speech signal to a clean speech signal. Therefore, the target diffusion model is used for wake-up word recognition, and the obtained speech signal has high quality, good listening experience, more accurate recognition, and improves the user's wake-up experience. On the other hand, for the diffusion model, the constraints used in the forward diffusion process are used to constrain the diffusion process, control the direction of the model learning ability, and make the ability learned by the model highly correlated with the constraints. In this embodiment, the sample fusion feature is used as a constraint in the forward diffusion process to control the direction of the model learning ability, so that the model learns a capability similar to classification, and divides the signal into two categories, one is the target speech signal that meets the constraints, and the other is the non-target speech signal that does not meet the constraints. In this way, the target diffusion model can more accurately identify the wake-up word issued by the registrant (that is, perform personal wake-up word recognition). In summary, the target diffusion model obtained by the above model training method can accurately identify clean speech signals containing personal wake-up words from noisy signals, and the model has good accuracy and robustness.
[0188] It can be seen from the above description that the model training method provided in this embodiment also has the following beneficial effects:
[0189] 1) The above model training process only requires a clean first sample speech signal, a second sample speech signal, a sample character's voiceprint text feature, and a sample wake-up word text feature. The entire process does not require the use of sample noise, and does not require the combination of cumbersome and complex noise scene training models. This not only simplifies the model training process, but also the obtained target diffusion model can cover various sound source scenes, with high flexibility and robustness.
[0190] 2) The above model training process does not require sample noise or sound source separation, and there will be no problems such as incomplete sound source separation and audio quality damage. The speech signal recognized by the target diffusion model is of high quality and good listening experience.
[0191] 3) The above model training process is to train the initial diffusion model as a whole, and there is no problem of block training. Therefore, the overall performance of the trained target diffusion model is excellent and the robustness is good.
[0192] 4) The above model training process does not involve the training of the speech enhancement module and is not limited by electronic equipment devices, such as the number and position of microphones. It can be applied to sound signals collected by devices of various structures, so the model has good versatility and robustness.
[0193] It is understandable that, although the first sample voice signal and the second sample voice signal are taken as clean voice signals in the above embodiment for illustration, in actual applications, the first sample voice signal and the second sample voice signal may also be noisy voice signals. However, compared with the noisy voice signal, the target diffusion model obtained by training based on the clean voice signal, in the subsequent wake-up word recognition process, the output voice signal is cleaner, of better quality, and has a better sense of hearing, which improves the wake-up accuracy and thus improves the user experience.
[0194] Optionally, in the process of training the target diffusion model, multiple sample person voice signals, multiple groups of sample speech signals, multiple groups of sample fusion features, etc. can be used to repeat the above forward diffusion process a large number of times, which can further enhance the robustness of the target diffusion model.
[0195] Next, the process of using the target diffusion model to perform wake-up word recognition is explained.
[0196] For example, Figure 8 is a schematic diagram of the reverse diffusion principle of a target diffusion model provided in an embodiment of the present application, Fig. 9 This is a flowchart of a wake-up word recognition method provided in an embodiment of the present application. Please refer to Figure 8 and Fig. 9 , the method comprising:
[0197] S201. In response to the user's operation of registering a voiceprint, the microphone of the electronic device collects the registration voice signal entered by the registrant, and sends the registration voice signal to the voiceprint extraction module in the voice assistant APP.
[0198] The registration voice signal refers to the voice signal recorded by the registrant into the electronic device.
[0199] For details, see Fig.10 , taking YOYO Assistant® as an example, continue Figure 1 In Figure (f), users can Fig.10 Click the "Re-enter wake-up word" option in the interface 111 shown in Figure (a) to enter Fig.10 FIG. 1001 is a wake-up word input interface shown in FIG. 1002 . It can be understood that if the user has not input the wake-up word into the electronic device, Fig.10 The “Re-enter wake-up word” option in the interface 111 shown in FIG. 7 (a) may also be displayed as an “enter wake-up word” option.
[0200] Users can Fig.10 The wake-up word input interface 1001 shown in FIG. (b) and the related voice prompts are used to input the wake-up word multiple times. After the wake-up word is successfully input, the electronic device may display the following Fig.10The user clicks the completion control 1003 in the interface 1002, and the interface returns to Fig.10 The interface 111 shown in FIG. (a) in FIG. 111. In the above voiceprint registration process, the person who issues the wake-up word is called the registrant.
[0201] It should be understood that Fig.10 In the description, the content of the registration voice signal entered by the registrant is taken as the wake-up word as an example. In actual applications, the user can also enter sound signals with other contents. There is no limitation on this, as long as the voiceprint features of the registrant can be extracted from them.
[0202] S202. The voiceprint extraction module in the voice assistant APP extracts the voiceprint features (also called voiceprint template information) of the registrant from the registered voice signal.
[0203] In steps S201 and S202, the user inputs a registration voice signal into the electronic device, and the voice assistant APP extracts the voiceprint features of the registrant based on the registration voice signal, which is called the registration voiceprint.
[0204] The process of the voiceprint extraction module extracting the voiceprint features of the registrant from the registration voice signal may be similar to the above step S103 and will not be described in detail.
[0205] Optionally, after the voiceprint extraction module extracts the voiceprint features of the registrant, the voiceprint features of the registrant can be stored in a memory in the electronic device for use in subsequent wake-up word recognition. In addition, when the user re-registers the voiceprint, the voiceprint extraction module can re-extract the voiceprint features according to the above steps S201 and S202, and overwrite the voiceprint features stored in the memory with the re-extracted voiceprint features, that is, update the voiceprint features of the registrant.
[0206] S203: The text feature extraction module extracts features from the wake-up word text to obtain text features of the wake-up word.
[0207] The wake-up word here refers to the wake-up word preset by the voice assistant APP or set by the user in actual use. Generally, for a certain voice assistant APP, its wake-up word is unique and fixed. The text feature extraction module can perform feature extraction on the text of the wake-up word, obtain the text feature of the wake-up word, and save the text feature of the wake-up word to the memory of the electronic device.
[0208] In some possible implementations, the voice assistant APP may also provide the user with the function of changing or selecting a wake-up word. In this case, the text feature extraction module may extract text features based on the text of the wake-up word changed or selected by the user, obtain the text features of the wake-up word, and update the text features of the wake-up word in the memory of the electronic device.
[0209] The method of extracting the wake-up word by the text feature extraction module is similar to the above step S104 and will not be repeated here.
[0210] S204: The feature fusion module obtains the voiceprint feature of the registrant from the voiceprint extraction module, and obtains the text feature of the wake-up word from the text feature extraction module.
[0211] Optionally, the feature fusion module can directly obtain the voiceprint features of the registrant from the voiceprint extraction module, or obtain the voiceprint features of the registrant from the memory. Alternatively, when the voiceprint features of the registrant change, the voiceprint extraction module can send the changed voiceprint features to the feature fusion module. The same is true for obtaining the text features of the wake-up word. This embodiment of the application is not limited to this.
[0212] S205. The feature fusion module fuses the voiceprint feature of the registrant and the text feature of the wake-up word to obtain a fused feature.
[0213] The process of fusing the voiceprint features of the registrant with the text features of the wake-up word is similar to the above step S105 and will not be repeated here.
[0214] The above steps S201 to S205 describe the process of determining the fusion feature. The fusion feature will be used as a constraint condition of the target diffusion model each time the wake-up word is recognized. Optionally, the above steps S201 to S205 can be triggered when the user re-registers the voiceprint, or when the wake-up word text changes. The fusion feature obtained from each execution can be stored in a preset path, and the fusion feature is obtained from the preset path when the subsequent target diffusion model recognizes the wake-up word.
[0215] The following steps S206 to S215 illustrate the process of identifying the wake-up word issued by the registrant (ie, the wake-up word of the registrant). Optionally, when the voice assistant APP is in a dormant state, the following process can be executed in a loop.
[0216] S206: The microphone of the electronic device collects sound signals.
[0217] It should be understood that the sound signal may include a voice signal or a non-voice signal. For example, the sound signal may include a voice signal emitted by a person, a sound output by a TV, a sound of a car horn, a silent stream, etc.
[0218] In a specific example, a sound signal received by a microphone includes: a sound signal from person C with the content "It may rain tomorrow, remember to bring an umbrella", a sound signal of music played by a mobile phone, a silent stream, and a sound signal from person D with the content "Hello YOYO". These sound signals are all noisy signals.
[0219] S207. The microphone transmits the sound signal to the VAD module in the voice assistant APP at the application layer.
[0220] Specifically, the microphone of the electronic device can continuously collect sound signals and transmit the collected sound signals to the microphone driver of the kernel layer. The microphone driver transmits the sound signals to the VAD module in the voice assistant APP.
[0221] S208 , the VAD module detects the sound signal and extracts the speech signal (referred to as the speech signal to be recognized) from the sound signal.
[0222] Specifically, the VAD module can detect and process a sound signal collected by the microphone at regular intervals. On the one hand, the VAD module can filter out long periods of silence in the sound signal; on the other hand, the VAD module identifies the speech signal segment and the non-speech signal segment in the sound signal, extracts the speech signal segment from the sound signal, and obtains the speech signal to be recognized.
[0223] Taking the example of the sound signal given in step S206, the VAD module detects the sound signal, and the extracted speech signal to be recognized may include: the sound signal emitted by character C with the content "It may rain tomorrow, remember to bring an umbrella", and the sound signal emitted by character D with the content "Hello YOYO".
[0224] It is understandable that the speech signal to be recognized may be a noisy speech signal. For example, the voice signal of the above character C, which says "It may rain tomorrow, remember to bring an umbrella", may contain keyboard tapping sounds or background sounds such as car horns.
[0225] S209. When the VAD module determines that the voice assistant APP is in a dormant state, the VAD module copies the voice signal to be recognized to obtain a voice copy signal.
[0226] The length and signal frequency of the voice replica signal are the same as the voice signal to be recognized. The voice replica signal can be understood as another segment of the voice signal to be recognized, but they are named differently to distinguish them.
[0227] Continuing with the above example, the above voice signal to be recognized is copied, and the obtained voice copy signal may also include: the voice signal of character C with the content "It may rain tomorrow, remember to bring an umbrella", and the voice signal of character D with the content "Hello YOYO".
[0228] Optionally, the VAD module can obtain the status of the voice assistant APP through the value of a preset flag bit, a preset status parameter, etc. For example, when the value of the preset status flag bit is determined to be false, the status of the voice assistant APP is determined to be a dormant state, and when the value of the status flag bit is determined to be true, the status of the voice assistant APP is determined to be a working state. This embodiment of the application is not limited to this.
[0229] Optionally, if the VAD module determines that the voice assistant APP is in working state, the VAD module can input the voice signal to be recognized into the voice interaction module, and the voice interaction module processes the recognition module to perform voice interaction with the user. This branch is not described in detail here.
[0230] S210 , the VAD module concatenates the speech signal to be recognized and the speech replication signal to obtain an input signal.
[0231] The splicing process of the speech signal to be recognized and the speech reproduction signal is similar to the splicing process in the above step S102, and will not be described in detail.
[0232] S211, the VAD module inputs the input signal into the target diffusion model.
[0233] S212, the target diffusion model takes the input signal as its input, takes the fusion feature determined by the feature fusion module as a constraint condition, performs a reverse diffusion process, and obtains an output signal. The output signal is a signal without noise, and the output signal includes a target signal segment and a non-target signal segment.
[0234] As described in the above embodiment, the target diffusion model has the following capabilities: restoring the noisy speech signal to a clean speech signal, and dividing the speech signal into two parts, one of which is the target speech signal that meets the constraint conditions, and the other is the non-target speech signal. Therefore, the input signal is input into the target diffusion model, and the fusion feature obtained by fusing the voiceprint feature of the registrant and the text feature of the wake-up word is used as the constraint condition. Then, the target diffusion model can restore the noisy input signal to a clean speech signal, and divide the speech signal into two parts, which correspond to the target signal segment and the non-target signal segment, respectively. Among them, the target signal segment is the signal segment where the target speech signal that meets the constraint conditions is located, that is, the signal segment where the speech signal with the content of the wake-up word emitted by the registrant (that is, the wake-up word signal of the registrant) is located; the non-target signal segment is the signal segment where the non-target speech signal that does not meet the constraint conditions is located, that is, the signal segment where other speech signals other than the wake-up word speech signal of the registrant are located.
[0235] It can be understood that the target signal segment and the non-target signal segment may be empty (i.e., no data exists) or may not be empty (i.e., data exists), depending on whether the input signal contains the corresponding voice signal. If the input signal does not contain a voice signal with the content of the wake-up word emitted by the registrant, then the target signal segment in the signal output by the target diffusion model is empty. If the input signal contains a voice signal with the content of the wake-up word emitted by the registrant, then the target signal segment in the signal output by the target diffusion model is not empty. The same is true for the non-target signal segment.
[0236] S213: The target diffusion model sends the output signal to the judgment module.
[0237] S214, the judgment module judges whether the target signal segment in the output signal is empty; if not, execute step S215; if it is empty, return to execute step S206 when the microphone collects a sound signal next time.
[0238] It should be noted that, during the target diffusion model training process, when the lengths of the first sample speech signal and the second sample speech signal are equal, the lengths of the first noisy speech signal and the second noisy speech signal are equal, and when the lengths of the speech signal to be recognized and the speech replication signal are equal, the lengths of the target signal segment and the non-target signal segment are also equal.
[0239] In addition, the positions of the target signal segment and the non-target signal segment in the output signal are not limited. Specifically, they may depend on the positions of the first sample voice signal and the second sample voice signal in the sample voice signal obtained by splicing during the training of the target diffusion model. In some embodiments, in the sample voice signal, when the first sample voice signal is located in the first half of the sample voice signal and the second sample voice signal is located in the second half of the sample voice signal, the target signal segment may be located in the first half of the output signal, and the non-target signal segment may be located in the second half of the output signal. In other embodiments, in the sample voice signal, when the second sample voice signal is located in the first half of the sample voice signal and the first sample voice signal is located in the first half of the sample voice signal, the non-target signal segment may be located in the first half of the output signal, and the target signal segment may be located in the second half of the output signal.
[0240] Optionally, the judgment module can split the output signal segment to obtain a target signal segment and a non-target signal segment. Afterwards, it is determined whether the target signal segment is empty. For example, if the length of the target signal segment is 60 sampling points, and the target signal segment is located in the first half of the output signal, the judgment module can split the signal corresponding to the first to 30 sampling points in the output signal to obtain the target signal segment.
[0241] S215. The judgment module sends a wake-up instruction to the voice interaction module; the wake-up instruction is used to wake up the voice interaction module so that the voice assistant APP enters a working state.
[0242] If the target signal segment is not empty, it means that there is a voice signal with the wake-up word sent by the registrant in the voice signal to be recognized, which meets the conditions for waking up the voice assistant APP, thus triggering the voice assistant APP to enter the working state.
[0243] Optionally, after receiving the wake-up command, the voice interaction module can output a response voice such as "I am here" or "How can I help you?" and display a corresponding interface, such as Fig.11 As shown, in order to respond to the user's wake-up and improve the user experience.
[0244] Optionally, before, after or at the same time as sending a wake-up command to the voice interaction module, the judgment module can also modify the value of a preset mark bit or the value of a preset state parameter to indicate that the state of the voice assistant APP has changed to a working state. In this way, it is convenient for each module to know the working state of the voice assistant APP and trigger different modules to respond to user requests according to the working state. For example, when the VAD module extracts the voice signal to be recognized in the sound signal next time, it can determine that the voice assistant APP is in a working state based on the modified mark bit or the value of the modified state parameter, and thus input the voice signal to be recognized into the voice interaction module for processing.
[0245] Optionally, if the judgment module determines that the target signal segment is empty, it means that there is no voice signal with the content of the wake-up word sent by the registrant in the voice signal to be recognized, and it does not meet the conditions for waking up the voice assistant APP, so the voice assistant APP continues to be in a dormant state. In this case, the sound signal obtained this time, as well as the voice signal to be recognized, the output signal, etc. obtained in the process can be discarded, and the wake-up word recognition is ended. The next time the microphone receives the sound signal, continue to follow the process shown in steps S206 to S215 above to perform wake-up word recognition again.
[0246] The wake-up word recognition method provided in this embodiment has at least the following beneficial effects:
[0247] 1) This method uses a diffusion model to identify wake-up words. As a high-quality generation model, the diffusion model generates high-quality and pleasant-sounding speech signals. Therefore, the target diffusion model can accurately identify the wake-up word speech signal sent by the registrant from the noisy speech signal, that is, accurately identify the wake-up word of the registrant.
[0248] 2) The speech signal recognized by the target diffusion model is a clean speech signal with high quality and good listening experience, which improves the user's wake-up experience.
[0249] 3) This method does not need to perform sound source separation when recognizing wake-up words, and there will be no problems such as incomplete sound source separation and audio quality damage. Therefore, the speech signal recognized by the target diffusion model is of high quality and has a good listening experience.
[0250] 4) The target diffusion model is an overall model rather than a model that is trained and used in blocks, so it has excellent overall performance and good robustness.
[0251] 5) The target diffusion model does not involve a separate speech enhancement processing module and is not limited by electronic equipment components, such as the number and position of microphones. It can be applied to sound signals collected by devices of various structures. Therefore, the model and the method have good versatility and robustness.
[0252] It should be understood that in the above model training method and wake-up word recognition method, the voiceprint feature and the text feature of the wake-up word are fused as the constraint condition of the diffusion model. In other possible implementations, feature fusion may not be performed, and the voiceprint feature and the text feature of the wake-up word may be used as two constraints respectively.
[0253] In addition, the above-mentioned model training method and wake-up word recognition method involve identifying the content sent by the registrant as a wake-up word (i.e., identifying the wake-up word of the registrant). In some other possible implementations, only the wake-up word may be recognized. Specifically, different from the above-mentioned embodiment, in the model training method, only the text features of the sample wake-up word are used as constraints in the forward diffusion process, and in the wake-up word recognition method, only the text features of the wake-up word are used as constraints in the reverse diffusion process.
[0254] The above describes in detail the examples of the wake-up word recognition method and model training method provided in the embodiments of the present application. It is understandable that in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the present application.
[0255] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0256] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0257] The electronic device provided in this embodiment is used to execute the above-mentioned wake-up word recognition method or model training method, and thus can achieve the same effect as the above-mentioned implementation method.
[0258] In the case of an integrated unit, the electronic device may further include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device to execute stored program codes and data, etc. The communication module may be used to support the electronic device to communicate with other devices.
[0259] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.
[0260] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 3 Device of the structure shown.
[0261] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the wake-up word recognition method or model training method of any of the above embodiments.
[0262] An embodiment of the present application also provides a computer program product. When the computer program product runs on a computer, the computer executes the above-mentioned related steps to implement the wake-up word recognition method or model training method in the above-mentioned embodiment.
[0263] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the wake-up word recognition method or the model training method in the above-mentioned method embodiments.
[0264] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0265] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0266] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0267] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0268] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0269] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0270] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A wake-up word recognition method, the method being executed by an electronic device, characterized in that: The method comprises: After the sound signal is collected, a speech signal to be recognized is obtained from the sound signal; Copying the speech signal to be recognized to obtain a speech copy signal; splicing the speech signal to be recognized and the speech replica signal to obtain an input signal; The input signal is used as the input of the target diffusion model, the text feature of the preset wake-up word is used as the constraint condition of the target diffusion model, and a reverse diffusion process is performed to obtain an output signal, wherein the output signal includes a first signal segment and a second signal segment, the first signal segment is used to store the speech signal that meets the constraint condition in the speech signal to be recognized, and the second signal segment is used to store the speech signal that does not meet the constraint condition in the speech signal to be recognized; According to the first signal segment, it is determined whether the voice signal to be recognized contains the preset wake-up word.
2. The method according to claim 1, characterized in that The determining, according to the first signal segment, whether the to-be-recognized voice signal includes the preset wake-up word includes: If it is determined that data exists in the first signal segment, determining that the voice signal to be recognized contains the preset wake-up word; If it is determined that no data exists in the first signal segment, it is determined that the voice signal to be recognized does not include the preset wake-up word.
3. The method according to claim 2, characterized in that The method further comprises: Splitting the output signal to obtain the first signal segment and the second signal segment, the first signal segment and the second signal segment are equal in length, and the first signal segment is located in the first half of the output signal; A determination is made as to whether data is present in the first signal segment.
4. The method according to claim 1, characterized in that: The constraint conditions also include the target person's voiceprint features; The determining, according to the first signal segment, whether the to-be-recognized voice signal includes the preset wake-up word includes: If it is determined that data exists in the first signal segment, it is determined that the voice signal to be recognized contains the preset wake-up word, and the voice signal to be recognized is emitted by the target person; If it is determined that no data exists in the first signal segment, it is determined that the voice signal to be recognized does not contain the preset wake-up word, or the voice signal to be recognized is not emitted by the target person.
5. The method according to claim 4, characterized in that The using the text features of the preset wake-up words as the constraint conditions of the target diffusion model includes: Fusing the target person's voiceprint features with the text features of the preset wake-up word to obtain a fused feature; The fusion feature is used as the constraint condition.
6. The method according to any one of claims 1 to 5, characterized in that The obtaining of the to-be-recognized speech signal from the sound signal comprises: Perform voice activity detection on the sound signal to extract the voice signal to be recognized from the sound signal.
7. A model training method, the method being executed by an electronic device, characterized in that: The method comprises: Acquire a sample voice signal, wherein the sample voice signal includes a first sample voice signal and a second sample voice signal, wherein the first sample voice signal is a voice signal emitted by a sample character and the content is a sample wake-up word, and the second sample voice signal is not a voice signal emitted by the sample character, and / or the content of the second sample voice signal is not the sample wake-up word; The sample speech signal is used as the input of the initial diffusion model, the text features of the sample wake-up word are used as the constraints of the initial diffusion model, a forward diffusion process is performed, and the parameters of the initial diffusion model are adjusted to obtain a target diffusion model.
8. The method according to claim 7, characterized in that The constraint condition also includes the voiceprint feature of the sample person; The using the text features of the sample wake-up words as the constraint conditions of the initial diffusion model includes: Performing feature fusion on the voiceprint feature of the sample person and the text feature of the sample wake-up word to obtain a sample fusion feature; The sample fusion feature is used as the constraint condition.
9. The method according to claim 7, characterized in that: The first sample speech signal and the second sample speech signal are both noise-free signals.
10. The method according to claim 7, characterized in that The signal lengths of the first sample speech signal and the second sample speech signal are equal.
11. The method according to any one of claims 7 to 10, characterized in that The step of obtaining a sample voice signal comprises: Respectively acquiring the first sample speech signal and the second sample speech signal; The first sample speech signal and the second sample speech signal are concatenated to obtain a sample speech signal.
12. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method as claimed in any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, and when the instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 11.
Citation Information
Patent Citations
Audio signal generation method and device, model training method and device, equipment and medium
CN116072098A
Model training method and related equipment thereof
CN116312489A
Diffusion Models Having Improved Accuracy and Reduced Consumption of Computational Resources
US20230267315A1
