Sound event detection method, electronic device, storage medium and chip
The audio is reverse-diffused through the diffusion process of the generative model, which solves the problem of low accuracy of sound event detection in the existing technology, achieves more efficient and accurate detection results, and improves user experience.
Patent Information
- Application Number
- CN202410491015.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-04-23
AI Technical Summary
The accuracy of sound event detection in the existing technology is low, resulting in poor user experience, especially when dealing with noise and multiple types of sound scenes.
The diffusion process of the generative model is used for sound event detection, and the audio to be detected is denoised multiple times through the reverse diffusion model to gradually improve the clarity of the audio signal, thus improving the accuracy of the detection results.
Significantly improves the accuracy and efficiency of sound event detection, especially in noise and multi-type sound scenarios, improving user experience.
Smart Images

Figure CN118098275B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and more specifically, to a sound event detection method, electronic device, storage medium and chip. Background Art
[0002] The purpose of acoustic event detection (AED) is to detect the event of interest to the user in the audio (i.e., the target sound event), as well as the location of the target sound event in the audio (i.e., the start and end time of the target sound event). Currently, AED has been widely used in various application scenarios, such as detecting the sound of abnormal equipment failure, the sound of a crying baby, the sound of an accident scene, the sound of an impact, etc. Therefore, the research on acoustic event detection has extremely important social significance.
[0003] Therefore, how to improve the accuracy of sound event detection results has become an urgent problem to be solved. Summary of the invention
[0004] The present application provides a sound event detection method, electronic device, storage medium and chip, which can improve the accuracy of sound event detection results and improve user experience.
[0005] In a first aspect, a sound event detection method is provided, the method comprising: an electronic device obtains audio to be detected; the electronic device uses a sound event detection model to perform M denoising processes on the audio to be detected to obtain a sound event detection result, wherein the sound event detection result includes an audio segment in the audio to be detected that belongs to each type of target audio event in N types of target audio events, and a position of the audio segment in the audio to be detected, and M is a positive integer; wherein the input of the first denoising process is the audio to be detected, and the output of the Mth denoising process is the sound event detection result; when M is an integer greater than 1, the input of the i-th denoising process is the output of the i-1th denoising process, and i is a positive integer greater than 1.
[0006] The sound event detection model is a neural network model obtained through training. The sound event detection model performs M denoising processes on the audio to be detected, that is, the reasoning process of the sound event detection model. This process can be understood as the reverse diffusion process in the diffusion model.
[0007] There is no specific limitation on the number of M denoising processes, that is, M is a positive integer. Exemplarily, each denoising process in the M denoising processes is used to remove Gaussian noise.
[0008] The N types of target audio events may be preset N types of audio events, and each type of target audio event in the N types of target audio events refers to the type of audio event that the user needs to identify from the audio (e.g., the audio to be detected). The type of each type of target audio event in the N types of target audio events is not specifically limited and can be set according to actual scenarios.
[0009] The position of the audio segment in the audio to be detected is used to indicate the time period of the audio segment in the audio to be detected, and the time period indicates the time period from the start time to the end time of the sound event corresponding to the audio segment.
[0010] In the above technical solution, the electronic device uses the sound event detection model to gradually denoise the audio to be detected as noise audio and finally convert it into a sound event detection result (i.e., the result of the last denoising process output). The audio obtained after each denoising process is used as the input audio for the next denoising process to perform the next denoising process. The audio obtained by each denoising process has a certain degree of similarity with the audio before the denoising process, so that the final sound event detection result is more accurate. In summary, the sound event detection method provided in the embodiment of the present application can improve the accuracy of the sound event detection results and improve the user experience.
[0011] In a possible implementation, when N is equal to 1, the audio to be detected is the original audio to be detected; when N is an integer greater than 1, the audio to be detected is the audio obtained by splicing N original audios to be detected.
[0012] In the above technical solution, the electronic device can flexibly obtain the audio to be detected based on the original audio to be detected according to the number of N types of target audio events (i.e., the value of N), thereby meeting the needs of users in different sound event recognition scenarios and further improving the user experience.
[0013] In another possible implementation, the sound event detection model is used to perform denoising processing on the audio to be detected M times to obtain a sound event detection result, including: using the sound event detection model, based on conditional information, performing denoising processing on the audio to be detected M times to obtain a sound event detection result, wherein the conditional information includes information determined based on the audio to be detected.
[0014] The above-mentioned sound event detection model is used to denoise the data to be processed based on conditional information. The sound event detection model can be understood as a conditional diffusion model.
[0015] In the above technical scheme, when the electronic device uses the sound event detection model to perform denoising on the audio to be detected each time, the information determined based on the audio to be detected is used as a condition, so that the sound event detection result obtained after the last denoising process is more consistent with the sound event actually recorded in the audio to be detected, which can further improve the accuracy of the sound event detection result and further improve the user experience.
[0016] In another possible implementation, the condition information specifically includes the audio to be detected and the number of times of denoising processing. It should be understood that the condition information here is only for illustration and does not constitute any limitation.
[0017] In another possible implementation, an electronic device obtains audio to be detected, including: the electronic device performs scene recognition on the obtained initial audio to be detected, and determines that the audio scene of the initial audio to be detected is a first audio scene, wherein the initial audio to be detected is audio in the time domain; the electronic device performs de-redundancy processing on the initial audio to be detected according to the first audio scene to obtain audio to be detected, wherein the sound event corresponding to the audio to be detected belongs to the sound event corresponding to the first audio scene.
[0018] The initial audio to be detected is the audio in the time domain, and accordingly, the processed audio to be detected is also the audio in the time domain. It should be understood that the initial audio to be detected is the collected audio obtained by the device collecting the sound in the environment, that is, the initial audio to be detected refers to the audio that has not been processed in any way, and the meaning of the initial audio to be detected hereinafter is the same as here.
[0019] In the above technical solution, after the electronic device obtains the initial audio to be detected, it does not use the sound event detection model to perform M denoising processes on the initial audio to be detected, but first performs redundancy removal processing on the initial audio to be detected based on the first audio scene of the initial audio to be detected, which can effectively reduce the data volume of the obtained audio to be detected. Afterwards, the electronic device performs M denoising processes on the audio to be detected. On the one hand, the computing power of the scene recognition algorithm used by the electronic device is extremely small (i.e., the computing speed is fast), and the accuracy rate is high, and redundancy removal processing can be quickly implemented. On the other hand, since the data volume of the audio to be detected is small, when the electronic device uses the sound event detection model to perform M denoising processes on the audio to be detected, it is conducive to the rapid convergence of the sound event detection model. This method can further improve the efficiency of the sound event detection results and further improve the user experience while ensuring the accuracy of the sound event detection results.
[0020] In another possible implementation, an electronic device obtains audio to be detected, including: the electronic device performs scene recognition on the acquired time domain signal of the initial audio to be detected, and determines that the audio scene of the time domain signal of the initial audio to be detected is a first audio scene; performs Fourier transform processing on the time domain signal of the initial audio to be detected to obtain a frequency domain signal of the initial audio to be detected; and performs de-redundancy processing on the frequency domain signal of the initial audio to be detected according to the first audio scene to obtain the audio to be detected, wherein the sound event corresponding to the audio to be detected belongs to the sound event corresponding to the first audio scene.
[0021] The time domain signal of the initial audio to be detected and the frequency domain signal of the initial audio to be detected are audio of the same audio in different domains (for example, time domain or frequency domain).
[0022] In the above technical solution, the electronic device first transforms the acquired time domain signal of the initial audio to be detected into the frequency domain signal of the initial audio to be detected, and the audio features of the frequency domain signal of the initial audio to be detected are more obvious than the audio features of the time domain signal of the initial audio to be detected. Afterwards, the electronic device performs de-redundancy processing on the frequency domain signal of the initial audio to be detected with obvious audio features, which can avoid erroneously removing the sound events corresponding to the first audio scene in the frequency domain signal of the initial audio to be detected, so that the frequency domain signal of the audio to be detected obtained after de-redundancy processing is more accurate. Further, after the electronic device performs M times of denoising processing on the frequency domain signal of the audio to be detected, the sound event detection result obtained is also more accurate. In addition, the computing power of the scene recognition algorithm adopted by the electronic device is extremely small, and the accuracy rate is high, and de-redundancy processing can be quickly realized. In summary, this method can improve the efficiency and accuracy of the sound event detection results while ensuring the accuracy of the sound event detection results, and further improve the user experience.
[0023] In another possible implementation, the electronic device obtains audio to be detected, including: the electronic device performs Fourier transform processing on the acquired time domain signal of the initial audio to be detected to obtain the frequency domain signal of the initial audio to be detected, so as to obtain the audio to be detected, wherein the audio to be detected is the frequency domain signal of the initial audio to be detected.
[0024] In the above technical solution, the electronic device first transforms the acquired time domain signal of the initial audio to be detected into the frequency domain signal of the initial audio to be detected (i.e., the audio to be detected), and the audio features of the frequency domain signal of the initial audio to be detected are more obvious than the audio features of the time domain signal of the initial audio to be detected. Afterwards, the electronic device performs M times of denoising on the frequency domain signal of the initial audio to be detected (i.e., the audio to be detected), which can further improve the accuracy of the sound event detection result and further improve the user experience.
[0025] In another possible implementation manner, the audio to be detected is an initial audio to be detected.
[0026] In the above technical solution, the audio to be detected is the collected audio obtained by the device collecting the sound in the environment, that is, the audio to be detected refers to the audio that has not been processed in any way. The electronic device uses the trained sound event detection model to gradually denoise the audio to be detected as noise audio (that is, M denoising processes) and finally converts it into a sound event detection result (that is, the result of the last denoising process output). The audio obtained after each denoising process is used as the input audio for the next denoising process for the next denoising process. The audio obtained by each denoising process has a certain similarity with the audio before the denoising process, so that the final sound event detection result is more accurate. In summary, the sound event detection method provided in the embodiment of the present application can improve the accuracy of the sound event detection results and improve the user experience.
[0027] In another possible implementation, before the electronic device uses the sound event detection model to perform M denoising processes on the audio to be detected to obtain the sound event detection result, the method also includes: the electronic device obtains a labeled audio based on the original audio to be trained, wherein the original audio to be trained includes L audio clips, each audio clip corresponds to at least one type of audio event, the labeled audio includes N first audios corresponding to N types of target audio events, the audio clip in each first audio belongs to the target audio event of the corresponding type, the audio clip in each first audio corresponding to each type of target audio event is the first audio clip, the first audio clip is the audio clip belonging to the corresponding type of target audio event in the L audio clips, the position of the first audio clip in each first audio represents the position of the first audio clip in the original audio to be trained, and L is a positive integer; the electronic device performs T noise addition processes on the labeled audio to obtain T first noisy audio clips, wherein each first noisy audio clip The audio is obtained by performing a noise addition process on the second noisy audio corresponding to each first noisy audio, the second noisy audio inputted into the first noise addition process is the label audio, the first noisy audio outputted from the Tth noise addition process is the audio to be trained, and the audio to be trained includes N original audios to be trained; when T is an integer greater than 1, the second noisy audio inputted into the jth noise addition process is the output of the j-1th noise addition process, and j is a positive integer greater than 1; the electronic device uses the initial sound event detection model to perform T denoising processes on the audio to be trained to obtain a third noisy audio corresponding to each second noisy audio, wherein the sum of the number of noise addition processes performed on each second noisy audio and the number of denoising processes performed on the third noisy audio corresponding to each second noisy audio is T; the electronic device adjusts the parameters of the initial sound event detection model according to the difference between each second noisy audio and the third noisy audio corresponding to each second noisy audio, to obtain a sound event detection model.
[0028] The above labeled audio can be recorded as data , the audio to be trained can be recorded as data .data , ,…, It can be understood as T first noise-added audios, and the T first noise-added audios and the label audios can be used as training labels. Each training sample includes data as training audio (i.e. the audio to be trained) and the data as the label audio ,data It refers to the data After Th times of noise addition, the electronic device uses the initial sound event detection model to detect the training audio in each training sample. The number of times the denoising process is performed is equal to h, h=1,2,…,T.
[0029] For example, the original audio to be trained is Figure 1 Taking the audio shown in (1) as an example, and N equals 3, the above labeled audio can be Figure 4A The audio shown in (1) includes three audios (i.e., an example of N first audios) corresponding to three sound event types (i.e., an example of N types of target audio events), wherein the audio segment corresponding to time period 1 in the sound event type of a baby crying among the three audios is an example of the above-mentioned first audio segment, and no audio is recorded in the audio corresponding to the sound event type of a dog barking and the audio corresponding to the sound event type of a cat meowing among the three audios.
[0030] In the above technical solution, the electronic device constructs multiple training samples based on T first noised frequencies obtained by performing noise processing (i.e., forward diffusion) on the label audio constructed from the original audio to be trained, and the multiple training labels corresponding to the multiple training samples are used to represent a distribution from an audio distribution of the label audio to a distribution of the audio to be trained (including N original audio to be trained). The sound event detection model obtained after training the initial sound event detection model based on the multiple training samples has a strong generalization ability, that is, the sound event detection model has a strong ability to correctly understand and predict new and unseen data when denoising the data, thereby improving the robustness of the sound event detection model. Compared with the sound event detection model used as a discriminant model in traditional technology, the sound event detection model used as a generative model by the electronic device in this application has higher robustness and accuracy, thereby improving the accuracy of the sound event detection results and improving the user experience.
[0031] In another possible implementation, the sound event detection model includes a noise addition module and a noise removal module, the initial sound event detection model includes a noise addition module and an initial noise removal module, and: the electronic device performs T noise addition processing on the label audio to obtain T first noised audios, including: the electronic device uses the noise addition module to perform T noise addition processing on the label audio to obtain T first noised audios; the electronic device uses the initial sound event detection model to perform T noise removal processing on the training audio to obtain a third noised audio corresponding to each second noised audio, including: the electronic device uses the initial noise removal module to perform T noise removal processing on the training audio to obtain a third noised audio corresponding to each second noised audio; the electronic device adjusts the parameters of the initial sound event detection model according to the difference between each second noised audio and the third noised audio corresponding to each second noised audio to obtain the sound event detection model, including: the electronic device adjusts the parameters of the initial noise removal module according to the difference between each second noised audio and the third noised audio corresponding to each second noised audio to obtain the noise removal module, so as to obtain the sound event detection model.
[0032] In the above technical scheme, the sound event detection model and the initial sound event detection model are both diffusion models. Compared with the sound event detection model as a discriminant model in traditional technology, the sound event detection model provided in the present application as a generative model has higher robustness and accuracy, thereby improving the accuracy of the sound event detection results and improving the user experience.
[0033] In another possible implementation, the electronic device uses a sound event detection model to perform denoising on the audio to be detected M times to obtain a sound event detection result, including: the electronic device uses a denoising module to perform denoising on the audio to be detected M times to obtain a sound event detection result.
[0034] In the above technical solution, the electronic device uses the sound event detection model as a generative model to identify the audio to be detected. Since the sound event detection model of the generative model has high robustness and accuracy, it can improve the accuracy of the sound event detection results and improve the user experience.
[0035] In a second aspect, a sound event detection device is provided, wherein the sound event detection device is used to execute any one of the sound event detection methods in the first aspect.
[0036] In a third aspect, an electronic device is provided, comprising a unit for executing any one of the sound event detection methods in the first aspect. The electronic device may be a terminal device or a chip in the terminal device. The electronic device may include an input unit and a processing unit.
[0037] When the electronic device is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may further include a memory for storing computer program code, and when the processor executes the computer program code stored in the memory, the terminal device executes any one of the sound event detection methods in the first aspect.
[0038] When the electronic device is a chip in a terminal device, the processing unit may be a processing unit inside the chip, and the input unit may be an output interface, a pin or a circuit, etc.; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the sound event detection methods in the first aspect.
[0039] In a possible implementation, a memory is used to store computer program codes; a processor executes the computer program codes stored in the memory, and when the computer program codes stored in the memory are executed, the processor is used to execute any one of the sound event detection methods in the first aspect.
[0040] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed by an electronic device, the electronic device executes any one of the sound event detection methods in the first aspect.
[0041] In a fifth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by an electronic device, the electronic device executes any one of the sound event detection methods in the first aspect.
[0042] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0043] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be realized without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in specific embodiments that do not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 It is a schematic diagram of an audio signal obtained based on an original audio signal provided in an embodiment of the present application.
[0046] Figure 2 It is a schematic diagram of an audio signal obtained based on an original audio signal provided in an embodiment of the present application.
[0047] Figure 3 It is a schematic diagram of an audio signal obtained based on an original audio signal provided in an embodiment of the present application.
[0048] Figure 4A It is a schematic diagram of an audio signal obtained based on an original audio signal provided in an embodiment of the present application.
[0049] Figure 4B It is a schematic diagram of an audio signal obtained based on an original audio signal provided in an embodiment of the present application.
[0050] Figure 5 It is a schematic diagram of an application scenario provided by an embodiment of the present application.
[0051] Figure 6 It is a schematic diagram of an audio to be detected provided in an embodiment of the present application.
[0052] Figure 7 is the above Figure 6A schematic diagram of the sound event detection result corresponding to the audio to be detected is shown.
[0053] Fig. 8A It is a schematic diagram of an application scenario provided by an embodiment of the present application.
[0054] Figure 8B It is a schematic diagram of an application scenario provided by an embodiment of the present application.
[0055] Fig. 9 It is a schematic diagram of a forward diffusion process and a reverse diffusion process provided in an embodiment of the present application.
[0056] Fig.10 It is a schematic diagram of a forward diffusion process and an inference process (reverse diffusion process) of a sound event detection model provided in an embodiment of the present application.
[0057] Fig.11 It is a schematic diagram of a forward diffusion process and an inference process (reverse diffusion process) of a sound event detection model provided in an embodiment of the present application.
[0058] Fig.12 It is a schematic diagram of the principle of a sound event detection model training method provided in an embodiment of the present application.
[0059] Fig.13 It is a schematic flowchart of a sound event detection model training method provided in an embodiment of the present application.
[0060] Fig.14 It is a schematic flow chart of a sound event detection method provided in an embodiment of the present application.
[0061] Fig.15 It is a schematic flow chart of a sound event detection method provided in an embodiment of the present application.
[0062] Fig.16 It is a schematic diagram of a sound event detection method provided in an embodiment of the present application.
[0063] Fig.17 It is a schematic diagram of a sound event detection device provided in an embodiment of the present application.
[0064] Fig.18 It is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0066] The terms "first", "second", etc. in the specification, claims and drawings of this application are used to distinguish different objects, and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the definition of "first" or "second" features may explicitly or implicitly include one or more of the features.
[0067] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0068] In the embodiments of the present application, audio signals are also referred to as audio or audio streams, which are not specifically limited. Audio signals can be understood as information carriers of frequency and amplitude changes of regular sound waves with voice, music and sound effects.
[0069] In the embodiments of the present application, sound event detection may also be referred to as "sound event detection" or "audio event detection", etc., which is not specifically limited in the embodiments of the present application. Sound event detection model may also be referred to as "sound event detection model" or "audio event detection model", etc., which is not specifically limited in the embodiments of the present application.
[0070] In order to better understand the embodiments of the present application, some terms or concepts involved in the embodiments of the present application are first explained. It should be understood that the present application does not specifically limit the naming of the following terms. The following terms may have other names. The renamed terms still meet the following related term explanations.
[0071] 1. Original audio signals
[0072] The original audio signal refers to an audio signal obtained by an electronic device (for example, a microphone or other sound sensor of the electronic device) collecting the sound in the environment where the electronic device is located. The original audio signal is an unprocessed audio signal.
[0073] The original audio signal may include audio sub-signals with sound and audio sub-signals without sound, and the audio sub-signals are also called audio segments. Each audio sub-signal without sound does not record a sound event, and each audio sub-signal with sound may record one or more sound events. When the original audio signal includes multiple sound events, the original audio signal may be called a mixed audio signal. There is no specific limitation on the number of audio sub-signals with sound and the number of audio sub-signals without sound included in the original audio signal, as well as the time period in which the audio sub-signals with sound and the audio sub-signals without sound are located in the original audio signal.
[0074] For example, see Figure 1 (1) shows an original audio signal with an audio duration of M (M=10) seconds. The time period 1 from the 2nd second to the 3rd second in the original audio signal records a sound event of the baby crying type, and the time periods other than the time period 1 in the original audio signal do not include any sound events.
[0075] For example, see Figure 2 The original audio signal shown in (1) has an audio duration of M (M = 10) seconds, and Figure 1 The difference between (1) is that Figure 2 The original audio signal shown in (1) includes two types of sound events located in two different time periods, namely, a baby crying type sound event is recorded in time period 1 from the 2nd second to the 3rd second of the original audio signal, and a dog barking type sound event is recorded in time period 2 from the 7th second to the 9th second, and the original audio signal does not include any sound events in time periods other than time period 1 and time period 2.
[0076] For example, see Figure 3 The original audio signal shown in (1) has an audio duration of M (M = 10) seconds, and Figure 2 The difference between (1) is that Figure 3 The original audio signal shown in (1) includes two time periods, and two different types of sound events are recorded in one time period, that is, the time period 1 from the 2nd second to the 3rd second in the original audio signal records a baby crying type sound event and a dog barking type sound event, and the time period 3 from the 6th second to the 9th second records a dog barking type sound event, and the time periods other than the time period 1 and the time period 3 in the original audio signal do not include any sound events.
[0077] In the present application, the sound event detection task corresponds to N sound event types (also called N types of target audio events), that is, the purpose of the sound event detection task is to detect an audio segment belonging to each of the N sound event types from a segment of an audio signal to be detected, where N is a positive integer.
[0078] In some implementations, when N is a positive integer greater than 1, N original audio signals need to be serially spliced to obtain a serially spliced audio signal corresponding to the original audio signal. Serial splicing can be understood as connecting multiple audio signals in series to form a continuous audio signal data stream.
[0079] For example, the above Figure 1 For example, the original audio signal shown in (1) in FIG. 1 and the acoustic event detection task corresponds to 3 (N=3) acoustic event types. For the serially spliced audio signal corresponding to the original audio signal, see Figure 1 The original audio signals shown in (2) correspond to the concatenated audio signals.
[0080] For example, the above Figure 2 For example, the original audio signal shown in (1) in FIG. 1 and the acoustic event detection task corresponds to 3 (N=3) acoustic event types. For the serially spliced audio signal corresponding to the original audio signal, see Figure 2 The original audio signals shown in (2) correspond to the concatenated audio signals.
[0081] For example, the above Figure 3 For example, the original audio signal shown in (1) in FIG. 1 and the acoustic event detection task corresponds to 3 (N=3) acoustic event types. For the serially spliced audio signal corresponding to the original audio signal, see Figure 3 The original audio signals shown in (2) correspond to the concatenated audio signals.
[0082] 2. Constructed audio signal corresponding to the original audio signal
[0083] The constructed audio signal corresponding to the original audio signal is an audio signal obtained by performing preset processing on the original audio signal according to N sound event types corresponding to the sound event detection task, wherein the preset processing includes: obtaining N soundless audio signals corresponding to the N sound event types one by one according to the N sound event types corresponding to the sound event detection task and the audio duration M of the original audio signal, and the audio duration of each soundless audio signal is the same as the audio duration M of the original audio signal; copying the events corresponding to each sound event in the N sound event types recorded in the original audio signal to the soundless audio signal corresponding to each sound event type, to obtain N audio signals corresponding to the N sound event types one by one, wherein at least one of the N audio signals records sound, and the sound recorded by each audio signal is located in a time period of each audio signal, which is the same as the time period of the sound in the original audio signal; and determining the N audio signals as the constructed audio signals corresponding to the original audio signals.
[0084] For example, Figure 1 The original audio signal shown in (1) and the acoustic event detection task corresponding to 3 (N=3) acoustic event types (i.e., baby crying, dog barking, and cat meowing) are taken as examples. The constructed audio signal corresponding to the original audio signal can be found in Figure 1 The audio signal shown in (3) is Figure 1 In the original audio signal shown in (1), a baby crying type sound event is recorded in the time period 1 from the 2nd second to the 3rd second, and the time periods other than the time period 1 in the original audio signal do not include any sound events. Based on this, Figure 1 The audio signal corresponding to the original audio signal shown in (3) includes three audio signals corresponding to the three sound event types (the audio duration is M (M=10) seconds), and only the time period 1 from the 2nd second to the 3rd second of the audio signal corresponding to the sound event type of baby crying records the sound event of baby crying.
[0085] For example, Figure 2 The original audio signal shown in (1) and the acoustic event detection task corresponding to 3 (N=3) acoustic event types (i.e., baby crying, dog barking, and cat meowing) are taken as examples. The constructed audio signal corresponding to the original audio signal can be found in Figure 2 The audio signal shown in (3) is Figure 2 In the original audio signal shown in (1), a baby crying type sound event is recorded in the time period 1 from the 2nd second to the 3rd second, and a dog barking type sound event is recorded in the time period 2 from the 7th second to the 9th second, and the time periods other than the time period 1 and the time period 2 in the original audio signal do not include any sound events. Based on this, Figure 2 The audio signal corresponding to the original audio signal shown in (3) includes three audio signals corresponding to the three sound event types (audio duration is M (M=10) seconds), among which, the sound event of a baby crying is recorded in time period 1 from the 2nd second to the 3rd second in the audio signal corresponding to the sound event type of a baby crying, and the sound event of a dog barking is recorded in time period 2 from the 7th second to the 9th second in the audio signal corresponding to the sound event type of a dog barking.
[0086] For example, Figure 3 The original audio signal shown in (1) and the acoustic event detection task corresponding to 3 (N=3) acoustic event types (i.e., baby crying, dog barking, and cat meowing) are taken as examples. The constructed audio signal corresponding to the original audio signal can be found in Figure 3 The audio signal shown in (3) is Figure 3In the original audio signal shown in (1), the time period 1 from the 2nd to the 3rd second records a baby crying type sound event and a dog barking type sound event, and the time period 3 from the 6th to the 9th second records a dog barking type sound event, and the time periods other than the time period 1 and the time period 3 in the original audio signal do not include any sound events. Based on this, Figure 3 The audio signal corresponding to the original audio signal shown in (3) includes three audio signals corresponding to the three sound event types (audio duration is M (M=10) seconds), among which, the sound event of a baby crying is recorded in time period 1 from the 2nd second to the 3rd second of the audio signal corresponding to the sound event type of a baby crying, and the sound event of a dog barking is recorded in time period 2 from the 2nd second to the 3rd second of the audio signal corresponding to the sound event type of a dog barking, as well as in time period 3 from the 6th second to the 9th second.
[0087] In the present application, according to the sound event detection task corresponding to N sound event types (N is a positive integer), it is necessary to concatenate the constructed audio signals corresponding to the above-mentioned original audio signals to obtain a concatenated audio signal of the constructed audio signals corresponding to the original audio signals.
[0088] For example, Figure 4A Schematic diagram of a serially spliced audio signal of a constructed audio signal corresponding to an original audio signal provided in an embodiment of the present application. Figure 1 For example, the constructed audio signal corresponding to the original audio signal shown in (3) of FIG. 1 is a concatenated audio signal of the constructed audio signal corresponding to the original audio signal. Figure 4A In (1). Figure 2 For example, the constructed audio signal corresponding to the original audio signal shown in (3) of FIG. 1 is a concatenated audio signal of the constructed audio signal corresponding to the original audio signal. Figure 4A (2) in the above. Figure 3 For example, the constructed audio signal corresponding to the original audio signal shown in (3) of FIG. 1 is a concatenated audio signal of the constructed audio signal corresponding to the original audio signal. Figure 4A in (3).
[0089] It should be noted that, in the above, N sound event types are taken as 3 sound event types, and these 3 sound event types include the sound event type of a baby crying, the sound event type of a dog barking, and the sound event type of a cat meowing. Optionally, the N sound event types in the above may include other types of sound event types, and the number of other types of sound event types and each sound event type are not specifically limited, and can be set according to actual needs. For example, N can also be, but is not limited to, equal to 1, 2, 4 or 7, etc.
[0090] Exemplarily, the N sound event types mentioned above may include 7 (N=1) sound event types, and these 7 sound event types include the sound event type of dog barking, the sound event type of cat meowing, the sound event type of guitar sound, the sound event type of whistle sound, the sound event type of horn sound, the sound event type of baby crying sound and the sound event type of alarm sound. Based on this, the constructed audio signal corresponding to the original audio signal can be referred to Figure 4B The audio signals shown in (1) or (2) are different in that the types of sound events included in the original audio signals are different. Specifically, Figure 4B The original audio signal shown in (1) corresponds to the constructed audio signal. The associated original audio signal includes the acoustic event of a dog barking, the acoustic event of a cat meowing, the acoustic event of a guitar sound, and the acoustic event of a whistle. Figure 4B The original audio signal shown in (2) corresponds to the constructed audio signal. The associated original audio signal includes the acoustic event of a dog barking, the acoustic event of a cat meowing, and the acoustic event of multiple horn sounds.
[0091] The sound event detection method provided in the embodiment of the present application is described below.
[0092] Audio signals carry a large amount of information about the daily environment and the physical events that occur therein. They are rich in information and have unique advantages in many situations where vision, touch, and smell are not appropriate. Audio signals are generally considered to have a greater correlation with vibration signals, but audio signals are non-contact, which avoids the difficulty of collecting vibration signal data. Computer audition (CA) technology based on general audio / ambient sound is a branch of artificial intelligence (AI) in the audio field. It is directly aimed at all aspects of social and economic life and has many applications in many fields such as medical care, manufacturing, transportation, security, warehousing, agriculture, forestry, animal husbandry, water conservancy, environment and public facilities management, construction, mining, daily life, identity recognition, etc. It is a very practical technology.
[0093] In some application scenarios, users need to perform sound event detection on audio signals to detect the target sound events that users are interested in in the audio signals, and detect the position of the target sound events in the audio stream (i.e., the start and end time of the target sound event). In traditional technology, sound event detection is performed on the audio to be detected based on a discriminant model to obtain a sound event detection result. This traditional discriminant model cannot generate new data, that is, the discriminant model can only predict the output based on the given input, which makes the discriminant model less robust. In addition, since the traditional discriminant model only focuses on the relationship between input and output, and does not consider the inherent structure of the data, the model training stage has very high requirements on the data quality of the training data to ensure the robustness of the discriminant model obtained by training as much as possible. In other words, in some scenarios where the data quality of the training data is average, the robustness of the discriminant model obtained by training based on the training data with poor data quality is poor. In summary, based on the discriminant model with poor robustness in the traditional technology, the sound event detection result has the problem of poor accuracy, which leads to poor user experience.
[0094] Therefore, there is an urgent need for a sound event detection method to improve the accuracy of sound event detection results, thereby improving user experience.
[0095] In view of the above technical problems, the embodiments of the present application provide a sound event detection method, an electronic device, a storage medium and a chip. The method includes: an electronic device obtains audio to be detected; the electronic device uses a sound event detection model as a generative model to perform M denoising processes on the audio to be detected to obtain a sound event detection result, wherein the sound event detection result includes an audio segment belonging to each type of target audio event in N types of target audio events in the audio to be detected, and the position of the audio segment in the audio to be detected, and the sound event detection model is a neural network model obtained through training, and M is a positive integer; wherein the input of the first denoising process is the audio to be detected, and the output of the Mth denoising process is the sound event detection result; when M is an integer greater than 1, the input of the i-th denoising process is the output of the i-1th denoising process, and i is a positive integer greater than 1. This method can improve the accuracy of the sound event detection results and improve the user experience.
[0096] The sound event detection method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices (for example, smart watches), audio devices (for example, headphones or smart speakers, etc.), vehicle-mounted devices, augmented reality (AR) or virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks and personal digital assistants (PDA). The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0097] The following describes application scenarios to which the sound event detection method provided in the embodiment of the present application is applicable. It should be understood that the application scenario 1 and the application scenario 2 described below are only for illustration and do not constitute any limitation to the embodiment of the present application.
[0098] Application scenario 1
[0099] Figure 5 Schematic diagram of an application scenario of the sound event detection method provided in the embodiment of the present application. Figure 5 The illustrated application scenario includes at least one client 510 and at least one server 520 , wherein each client 510 is connected to each server 520 via a wireless network or a wired network.
[0100] The client 510 is used to collect the sound in the environment and send the collected audio to be detected to the server 520. Figure 5 The client 510 shown may generally refer to one of a plurality of terminals, or a set of a plurality of terminals, which is not specifically limited in the embodiment of the present application.
[0101] The sound recorded in the audio to be detected may correspond to one or more sound events, that is, one or more corresponding sound events are recorded in the sound. Each sound event is not specifically limited. For example, each sound event may be, but is not limited to, any of the following sound events: a dog barking event, a cat meowing event, a baby crying event, a keyboard tapping event, a collision event, a door knocking event, a voice event, or a doorbell event, etc. The audio to be detected can be understood as the original audio signal recorded above. For the content not described in detail here, please refer to the introduction to the original audio signal above.
[0102] For example, the audio to be detected collected by the client 510 can be as follows: Figure 6 The audio to be detected is shown.
[0103] There is no specific limitation on the method for collecting the audio to be detected by the client 510. For example, the client 510 can collect the sound in the environment where the client 510 is currently located through a speaker to obtain the audio to be detected. For example, the client 510 can also interact with other clients to use the audio obtained from other clients as the audio to be detected.
[0104] The server 520 is used to perform a sound event detection method on the audio to be detected obtained from the client 510 to obtain a sound event detection result, wherein the sound event detection result includes whether the sound recorded in the audio to be detected belongs to a certain sound event type among N sound event types, and the time period (i.e., position) when the sound recorded in the audio to be detected is located in the audio to be detected. Afterwards, the server 520 can also return the obtained sound event detection result of the audio to be detected to the client 510. Figure 5 The server 520 shown may be at least one of a computing device, multiple computing devices, a cloud computing platform, and a virtualization center, and the embodiments of the present application do not specifically limit this.
[0105] In the present application, the presentation form of the above-mentioned sound event detection results is not specifically limited. In some implementations, N audio signals corresponding to N sound event types are used to represent the above-mentioned sound event detection results, wherein the i-th audio signal among the N audio signals records sound #, which means that the sound # recorded in the audio to be detected belongs to the sound event type corresponding to the i-th audio signal, and the time period of the sound # recorded in the i-th audio signal represents the time period in which the sound # is located in the audio to be detected, i=1,2,…,N. When no sound is recorded in an audio signal among the N audio signals, it means that the sound recorded in the audio to be detected does not belong to the sound event of the type corresponding to the audio signal.
[0106] For example, the audio to be detected collected by the client 510 and received by the server 520 is Figure 6 For example, the server 520 performs sound event detection on the audio to be detected (the audio duration is 10 seconds). The sound event detection result obtained by the server 520 is shown in FIG. Figure 7The sound event detection result shown in FIG. 1 includes three audio signals corresponding to three sound event types (the audio duration of each audio signal is 10 seconds), the first audio signal corresponds to the sound event type of a baby crying, the second audio signal corresponds to the sound event type of a dog barking, and the third audio signal corresponds to the sound event type of a cat meowing. The sound event of a baby crying is recorded from the 2nd to the 4th second in the first audio signal corresponding to the sound event type of a baby crying; the sound event of a dog barking is recorded from the 7th to the 9th second in the second audio signal corresponding to the sound event type of a dog barking; and the sound event of a cat meowing is not recorded in the third audio signal corresponding to the sound event type of a cat meowing.
[0107] It should be understood that the above Figure 5 The application scenarios shown are for illustration only and do not constitute any limitation on the application scenarios to which the sound event detection method provided in the embodiments of the present application is applicable. Figure 5 The application scenario shown may also include a larger number of clients and a larger number of servers.
[0108] Application scenario 2
[0109] The difference between application scenario 2 and application scenario 1 is that application scenario 2 involves an electronic device, which collects sounds in the environment, and performs a sound event detection method on the collected audio. Optionally, the sound event detection result obtained by the electronic device performing sound event detection on the collected audio can be sent to other electronic devices other than the electronic device, so as to push the sound event detection result to users of other electronic devices.
[0110] For example, taking the electronic device in application scenario 2 as a smart speaker, Fig. 8A The interaction process shown by the solid arrow in FIG is a specific application scenario of the above application scenario 2. Fig. 8A , the smart speaker 810 located in the user's bedroom can run the sound event detection method provided by the embodiment of the present application in the background after being powered on. After the smart speaker 810 collects the sound in the bedroom environment (the sound includes the sound of a baby crying) to obtain the audio to be detected, the smart speaker 810 executes the sound event detection method on the audio to be detected to obtain a sound event detection result. Afterwards, the smart speaker 810 can push the sound event detection result to the mobile phone 830 of the user of the smart speaker 810, and display the sound event detection result on the interface of the user's mobile phone 830 to remind the user in the kitchen that the baby is crying, such as Fig. 8AThe interface of the mobile phone 830 shown pushes the sound event detection result obtained by the smart speaker 810 to the user with a card 831. The smart speaker 810 can collect the sound in the bedroom environment at a preset time interval or in real time, and there is no limit on the audio duration of the collected audio to be detected. The audio duration can be set according to user needs. For example, the audio duration can be but not limited to 30 seconds or 1 minute.
[0111] It should be understood that the above Fig. 8A The application scenarios shown are for illustration only and do not constitute any limitation on the application scenarios to which the sound event detection method provided in the embodiments of the present application is applicable. Fig. 8A The cloud server 820 may also be included. The smart speaker 810 sends the collected audio to be detected to the cloud server 820. The cloud server 820 performs a sound event detection method on the audio to be detected, and sends the obtained sound event detection result to the mobile phone 830, so that the mobile phone 830 displays the sound event detection result. The interaction between the cloud server 820, the smart speaker 810 and the mobile phone 830 can be seen in Fig. 8A As shown by the dotted arrow in .
[0112] For example, taking the electronic device in application scenario 2 as a mobile phone, Figure 8B It is a schematic diagram of a user interface of a mobile phone applicable to application scenario 2 of the sound event detection method provided in an embodiment of the present application.
[0113] See also Figure 8B , Figure 8B (1) in the figure shows an application desktop 840 provided by the mobile phone. The application desktop 840 includes multiple applications, including an application icon 841 of application 1. The type of application 1 is not specifically limited. For example, application 1 can be, but is not limited to, a video, chat, or conference application. After the user clicks the application icon 841 of application 1 in the application desktop 840, the mobile phone can display the interface of application 1. The interface of application 1 can include one or more function controls, and the one or more function controls include a sound event detection control for executing the sound event detection method provided in the embodiment of the present application, such as Figure 8B The interface 850 shown in (2) shows the acoustic event detection control 851. After the user clicks the acoustic event detection control 851, the mobile phone displays the interface of the sound event detection. The user can import the audio to be detected by clicking the audio import control in the interface, such as Figure 8BIn the interface 860 shown in (3), the audio import control 861 is used to import the audio to be detected 862, which is an audio obtained by splicing two original audios to be detected. Next, the user can select the detection control 863 to make the mobile phone perform the sound event detection method provided by the present application on the audio to be detected 862 shown in the interface 860. Afterwards, the interface of the sound event detection can display the sound event detection result, such as Figure 8B The sound event detection result 880 is displayed in the interface 870 shown in (4).
[0114] It should be understood that the above Figure 8B The application scenarios shown are for illustration only and do not constitute any limitation on the application scenarios to which the sound event detection method provided in the embodiments of the present application is applicable.
[0115] The following is an introduction to the sound event detection model involved in the sound event detection method provided in the embodiment of the present application.
[0116] In the sound event detection method provided in the embodiment of the present application, the sound event detection model and the initial sound event detection model can be understood as diffusion models (DFfusion models). The sound event detection model is a target sound event detection model obtained after training the initial sound event detection model. The target sound event detection model is a trained neural network model (such as a deep neural network (DNN)). In the present application, the process of processing the audio to be detected using the sound event detection model can be understood as the reverse diffusion process in the diffusion model, that is, the process of performing sound event detection on the audio to be detected using the sound event detection model, which refers to the process of denoising (removing Gaussian noise) on the audio to be detected using the sound event detection model. The training samples in the training data set used to train the initial sound event detection model are obtained based on the forward diffusion process in the diffusion model.
[0117] The framework of the diffusion model may adopt a denoising diffusion probabilistic model (DDPM), a score-based generative model (SGM) or a stochastic differential equation (SDE), etc., without any specific limitation.
[0118] 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.
[0119] The forward diffusion process can also be called forward diffusion process or diffusion process. The backward diffusion process can also be called inverse diffusion process, reverse inverse diffusion process, abstraction process or denoising process. In the forward diffusion process, the Markov chain of samples is generated by slowly adding noise. In the backward diffusion process, the Markov chain of samples is generated by slowly removing noise.
[0120] 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.
[0121] For data , in the forward diffusion process, in the tth step of the T-step forward diffusion process, to the data 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 , ,…, .data is pure noise. In the forward diffusion process, the step index t can represent the number of iterations.
[0122] For example, Fig. 9 As shown in (1), for 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.
[0123] like Fig. 9 As shown in (1) in the figure, the reverse diffusion process is opposite to the forward diffusion process, and the noise is gradually removed. In the reverse diffusion process, the parameter t can be understood as the remaining number of iterations. , after T steps, the data obtained in each step are , , …, .
[0124] like Fig. 9 As shown in (2) in the figure, 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.
[0125] like Fig. 9 As shown in (3) in the figure, 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. It can be understood that Fig. 9 The diffusion process shown in (3) is the diffusion process involved in the embodiments of the present application.
[0126] In some implementations, the forward diffusion process can be expressed as:
[0127]
[0128] in, Representation data The expression at time t is Indicates conditions, 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.
[0129] The mean of a Gaussian distribution According to the conditions , the step index t and the normalization constant used to represent the number of iterations OK. The mean of the Gaussian distribution It can be expressed as:
[0130]
[0131] The standard deviation of the Gaussian distribution The number of steps used to represent the number of iterations can be indexed by t, 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:
[0132]
[0133] Fundamentally, the diffusion model works by corrupting noisy data by continuously adding Gaussian noise. , and then learn to recover the data by reversing this process of gradually increasing noise. The randomly sampled noise is denoised multiple times to remove Gaussian noise using the diffusion model, and data can be generated through the reverse diffusion process.
[0134] The data obtained from the forward diffusion process are , ,…, It can be used to train the diffusion model. That is, the data obtained in the forward diffusion process can be used as a training data set to train the initial diffusion model to obtain a sound event detection model. The reverse diffusion process can be understood as the inference process of the diffusion model. In the reverse diffusion process, the step index t can be understood as the remaining number of iterations. Start by gradually removing data The noise in the data Restore to original data .
[0135] In the embodiment of the present application, data that conforms to an audio signal distribution can be transmitted through a forward diffusion process. Convert to data that conforms to another audio signal distribution ,in, to It can be understood as an intermediate distribution from the one audio signal distribution to the other audio signal distribution. Fig. 9 For example, the distribution shown in (3) is The distribution of can be the distribution of the audio signal B, that is, the domain of the noisy speech signal. The distribution of may be the distribution of the audio signal A, that is, the clean speech signal domain. In the embodiment of the present application, the initial diffusion model may also be referred to as an initial sound event detection model.
[0136] The training process of the diffusion model can be simply understood as the process of gradually removing Gaussian noise from pure noise data through neural network learning.
[0137] data It can also be called label denoising frequency, data Also called training audio. Data , ,…, It can be understood as T first noise-added audios, and the T first noise-added audios and the label-de-noised audios can be used as training labels. Each training sample includes data as training audio and as tag audio , using the initial diffusion model to train the audio in each training sample The number of times the denoising process is performed is equal to h, h=1,2,…,T.
[0138] It should be understood that the initial diffusion model is used for the training audio in each training sample. The number of times the denoising process is performed (h) and the labeled audio in each training sample The sum of the number of noise addition processes (Th) is equal to T, where the label audio The number of times of noise addition refers to the frequency of noise removal for this label. Add noise to get the label audio Denoising the label The number of times noise is added. The initial diffusion model is used to train the audio data The audio obtained by performing h denoising processes can be called the predicted audio Afterwards, based on the data of the training audio in each training sample The corresponding predicted audio And the labeled audio in each training sample The difference between the initial diffusion model is used to adjust the initial diffusion model to obtain a trained initial diffusion model. In the embodiment of the present application, the trained initial diffusion model can also be called a sound event detection model.
[0139] For example, taking T=3, t=2, and h=1 as an example, the training samples include as training audio and as tag audio , using the initial diffusion model to train the audio The result after one denoising process , then, according to and The differences between them adjust the model parameters of the initial diffusion model.
[0140] Optionally, during the back-diffusion process, the input to the diffusion model includes, in addition to the data , and may also include conditions. The conditions may include information for indicating the step index t, and may also include information based on noise data. In this implementation, the diffusion model can be called a conditional diffusion model.
[0141] The following is a schematic diagram of the architecture of the forward diffusion process and the reverse diffusion process provided by the embodiments of the present application.
[0142] Fig.10 FIG. 1 is a schematic diagram of a forward diffusion process and a reverse diffusion process provided in an embodiment of the present application. Fig.10 In the example, the forward diffusion model performs the forward diffusion process, and the reverse diffusion model (such as the sound event detection model or the initial sound event detection model) performs the reverse diffusion process. It should be noted that the forward diffusion process (i.e., the noise addition process) satisfies certain mathematical laws, and the reverse diffusion process (denoising process) is learned using a neural network. In other words, the forward diffusion model corresponding to the forward diffusion process can be a model constructed according to certain data laws, that is, the process of obtaining the forward diffusion model may not involve the model training step.
[0143] For example, Fig.10 As shown, in the forward diffusion process, the audio signal A is subjected to the noise addition process as described above based on the forward diffusion model 101 to obtain the noise-added frequency signal of the audio signal A. In the inference process (reverse diffusion process) of the sound event detection model 102, the sound event detection model 102 (reverse diffusion model) is used to perform denoising on the audio to be detected to obtain the sound event detection result.
[0144] In one example, the above Fig.10 The audio signal A, the noisy audio signal of the audio signal A and the audio signal to be detected are all audio signals in the time domain.
[0145] In another example, the above Fig.10 The audio signal A, the noise-added frequency signal of the audio signal A, and the audio signal to be detected are all frequency-domain audio signals. In this implementation, if the original audio signal acquired by the electronic device is a time-domain audio signal, the electronic device also needs to perform the transformation processing (such as Fourier transformation processing) as described above to obtain the frequency-domain audio signal of the original audio signal. Afterwards, the audio signal A as the frequency domain is obtained based on the frequency-domain audio signal of the original audio signal.
[0146] Fig.11 It is a schematic diagram of another architecture of the forward diffusion process and the architecture of the reverse diffusion process provided by the embodiment of the present application. It can be understood that, Fig.11 Shown architecture and the above Fig.10 The difference of the architecture shown is that the architecture adds a pre-processing module 1101, a scene recognition module 1102, a redundancy removal module 1103 and a post-processing module 1105. Optionally, Fig.11Other modules (such as storage modules) may also be included. Other modules may be configured according to actual needs and are not specifically limited thereto.
[0147] Please see Fig.11 The architecture of the forward diffusion process shown in (1) includes a pre-processing model 1101, a scene recognition module 1102, a redundancy removal module 1103, a forward diffusion model 1104 and a post-processing model 1105.
[0148] The pre-processing module 1101 is used to convert the audio in the time domain into the audio in the frequency domain. Fig.11 As shown in (1), after receiving the time domain signal of the audio signal A (referred to as the audio signal A), the pre-processing model 1101 performs Fourier transform processing on the audio signal A to obtain the frequency domain signal of the audio signal A (referred to as the audio signal A').
[0149] There is no specific limitation on the Fourier transform processing, which can be selected according to actual needs. For example, the Fourier transform processing performed by the pre-processing module 1101 can be, but is not limited to, short-time Fourier transform (STFT).
[0150] The scene recognition module 1102 is used to perform scene recognition processing on the received original audio signal to obtain the target audio scene corresponding to the audio to be detected. Afterwards, the scene recognition module 1102 sends the obtained target audio scene to the de-redundancy module 1103. Correspondingly, the de-redundancy module 1103 receives the target audio scene.
[0151] The type of the acoustic event included in the target audio scene is related to the target audio scene, and the type of the acoustic event included in the target audio scene is not specifically limited.
[0152] Exemplarily, when the target audio scene is a road, the audio to be detected may include at least one of the following audio: audio of a whistle, audio of an alarm, audio of a collision, or audio of a car passing by, etc. When the target audio scene is a subway, the audio to be detected may include at least one of the following audio: audio of a train passing by or audio of a car collision, etc. When the target audio scene is a home, the audio to be detected includes at least one of the following audio: audio of a vacuum cleaner vacuuming, audio of a washing machine washing, audio of dishes colliding, a signal of a baby crying, or a signal of a faucet dripping, etc. When the target audio scene is an office, the original audio signal may include at least one of the following audio: audio of a phone ringing, audio of a keyboard sound, or audio of a meeting invitation sound, etc.
[0153] In the present application, there is no specific limitation on the way in which the scene recognition module 1102 performs scene recognition processing on the original audio signal. For example, the scene recognition module 1102 may, but is not limited to, use an existing scene recognition neural network model to perform scene recognition processing on the received original audio signal.
[0154] The de-redundancy module 1103 is used to perform de-redundancy processing on the audio signal A' output by the pre-processing module 1101 according to the target audio scene of the original audio signal obtained by the scene recognition module 1102, so as to obtain the audio signal A' after the de-redundancy processing, wherein the de-redundancy processing includes: setting the audio signal corresponding to the sound event type included in the audio signal A' and not belonging to the target audio scene as an audio signal without sound. It can be understood that after the de-redundancy module 1103 performs de-redundancy processing on the audio signal A', the obtained audio signal A' after the de-redundancy processing only includes the audio of the sound event type possessed by the target audio scene of the original audio. In other words, the audio signal A' after the de-redundancy processing does not include the audio of the sound event type that does not exist in the target audio scene of the original audio.
[0155] Exemplarily, the audio signal A' obtained by the scene recognition module 1102 is continued as Figure 2 As an example, the audio signal shown in (2) in FIG. 1 is used as an example. When the redundancy removal module 1103 determines that the original audio signal does not include Figure 2 In the case where (2) shows the acoustic event type corresponding to the audio sub-signal 2, the de-redundancy module 1103 Figure 2 After performing redundancy removal processing on the audio shown in (2), the audio signal A' after redundancy removal processing is obtained. Figure 2 The audio signal shown in (1).
[0156] The pre-processing module 1101 , the scene recognition module 1102 and the redundancy removal module 1103 can be understood as modules for performing data pre-processing.
[0157] The forward diffusion model 1104 is used to perform noise processing on the de-redundant audio signal A', or perform noise processing on the de-redundant audio signal A' based on the original audio signal to obtain a noisy frequency signal of the de-redundant audio signal A'. In one example, the noise processing may be Gaussian noise processing.
[0158] The post-processing model 1105 is used to convert the frequency domain audio signal into the time domain audio signal, that is, to display the obtained audio signal in the form of a time domain audio signal. Fig.11As shown in (1), after the post-processing model 1105 receives the noisy frequency signal of the de-redundant audio signal A' output by the forward diffusion model 1104 (i.e., the frequency domain signal of the noisy frequency signal of the de-redundant audio signal A), the post-processing model 1105 can perform Fourier transform processing on the signal to obtain the noisy frequency signal of the de-redundant audio signal A (i.e., the time domain signal of the noisy frequency signal of the de-redundant audio signal A).
[0159] In one example, when the pre-processing module 1101 described above adopts STFT, the post-processing model 1105 may also adopt STFT.
[0160] Please see Fig.11 The architecture of the reasoning process (backward diffusion process) of the sound event detection model shown in (2) of FIG. 1 includes a pre-processing model 1101, a scene recognition module 1102, a de-redundancy module 1103, a sound event detection model 1106, and a post-processing model 1105. Optionally, the architecture of the reasoning process (backward diffusion process) of the sound event detection model may also include Fig.11 Other modules other than the modules shown in (2) can be configured according to actual needs and are not specifically limited thereto.
[0161] It should be noted that Fig.11 The pre-processing module 1101, the scene recognition module 1102 and the de-redundancy module 1103 shown in (2) are respectively Fig.11 The pre-processing module 1101, the scene recognition module 1102 and the de-redundancy module 1103 shown in (1) are the same. The functions of each module not described in detail here can be found in the above Fig.11 The relevant description in (1) in .
[0162] like Fig.11 As shown in (2), the pre-processing module 1101 converts the time domain signal of the audio signal to be detected (recorded as the audio signal to be detected #1) into the frequency domain signal of the audio signal to be detected (recorded as the audio signal to be detected #2), and then sends the audio signal to be detected #2 to the de-redundancy module 1103. After that, after the de-redundancy module 1103 receives the target audio scene obtained after the scene recognition module 1102 performs scene recognition on the audio signal to be detected #1, the de-redundancy module 1103 performs de-redundancy processing on the audio signal to be detected #2 obtained in the above steps based on the target audio scene, and obtains the de-redundant audio signal to be detected #2. The sound event detection model 1106 processes the de-redundant audio signal to be detected #2 obtained from the de-redundancy module 1103 to obtain a sound event detection result.
[0163] It should be understood that the above Fig.11This is only for illustration and does not constitute any limitation to the embodiments of the present application. Fig.11 The illustrated architecture may also not include the pre-processing model 1101 and / or the post-processing module 1105. For example, in some other implementations, the above Fig.11 The illustrated architecture may not include the scene recognition module 1102 and the redundancy removal module 1103 indicated by the dotted line.
[0164] The following is an introduction to the model training method of the sound event detection model provided in the embodiment of the present application.
[0165] For example, Fig.12 is a schematic diagram of the principle of a sound event detection model provided in an embodiment of the present application, Fig.13 A flowchart of a sound event detection model training method provided in the embodiment of the present application is provided. Fig.12 and Fig.13 , the training method of the sound event detection model provided in the embodiment of the present application is introduced.
[0166] Fig.13 is a schematic flow chart of a sound event detection model training method provided in an embodiment of the present application. The diffusion process (i.e., the forward diffusion process and the reverse diffusion process) involved in the model training method provided in an embodiment of the present application is the above Fig.10 The diffusion process shown in FIG. 1 does not involve the conversion process of the time domain audio signal and the frequency domain audio signal, nor does it involve the scene recognition process and the de-redundancy process. It should be understood that the electronic device is based on Fig.11 The diffusion process shown in Figure 2 is used to train the initial sound event detection model. Fig.13 The training principles provided are the same, the difference is that the input data when training the model is different. The execution subject of the method provided in the embodiment of the present application can be an electronic device, or a software / hardware module in the electronic device that can perform audio processing. For the sake of convenience, the following embodiment takes electronic device A as an example. For example, the electronic device A can be but is not limited to Fig.18 An electronic device 100 is shown.
[0167] For example, Fig.13 As shown, the sound event detection model training method includes steps S1310 to S1370, and steps S1310 to S1370 are respectively introduced in detail below.
[0168] In step S1310, electronic device A obtains Z audio signals A corresponding to the Z original audio signals one by one according to the Z original audio signals, wherein each audio signal A is a concatenated audio signal of a constructed audio signal corresponding to the corresponding original audio signal, and Z is a positive integer.
[0169] When Z is a positive integer greater than 1, the Z original audio signals may be Z different audio signals, and the audio durations of the Z original audio signals may be the same or different.
[0170] The method in which the electronic device A processes each original audio signal to obtain the audio signal A corresponding to each original audio signal is the same, and the method in which the electronic device A processes the original audio signal to obtain the audio signal A is taken as an example for description below.
[0171] In one example, electronic device A obtains audio signal A based on an original audio signal, including: electronic device A obtains N soundless audio signals corresponding to N sound event types one by one according to N sound event types corresponding to the sound event detection task and the audio duration M of the original audio signal, wherein the audio duration of each soundless audio signal is the same as the audio duration M of the original audio signal; electronic device A copies the sound corresponding to each sound event type in the N sound event types recorded in the original audio signal to the soundless audio signal corresponding to each sound event type, to obtain N audio signals corresponding to the N sound event types (constructed audio signals corresponding to the original audio signals), wherein at least one of the N audio signals records sound, and the sound recorded by each audio signal is located in a time period of each audio signal, which is the same as the time period of the original audio signal; electronic device A connects the N audio signals in series to obtain audio signal A.
[0172] For example, when the original audio signal is Figure 1 In the audio signal shown in (1), the audio signal A is Figure 4A The audio signal shown in (1) is shown in FIG. For example, when the original audio signal is Figure 2 In the audio signal shown in (1), the audio signal A is Figure 4A The audio signal shown in (2) is shown in FIG. For example, when the original audio signal is Figure 3 In the audio signal shown in (1), the audio signal A is Figure 4A The audio signal shown in (3) .
[0173] Optionally, when the original audio signal is a time domain audio signal and the audio signal A is a frequency domain audio signal, before the electronic device A obtains N soundless audio signals corresponding to the N sound event types one by one according to the N sound event types corresponding to the sound event detection task and the audio duration M of the original audio signal, it also includes: the electronic device A converts the time domain audio signal of the original audio signal into the frequency domain audio signal of the original audio signal.
[0174] In step S1320, electronic device A uses the forward diffusion model to perform T noise addition processes on the Z audio signals A respectively, and obtains T noisy audio signals of each audio signal A, wherein the audio signal obtained by the last noise addition process corresponding to each audio signal A is the audio signal B corresponding to each audio signal A (the serially spliced audio signal corresponding to the original audio signal).
[0175] The forward diffusion model is used to perform noise addition processing, that is, the forward diffusion model can also be called a noise addition module.
[0176] The audio signal obtained by the last noise addition process corresponding to each audio signal A refers to the audio signal obtained after performing T noise addition processes on each audio signal A, and the audio signal is a serially spliced audio signal corresponding to the original audio signal.
[0177] The T noise-added audio signals of each audio signal A include , ,…, , , T is a positive integer. Specifically, Yes (Each audio signal A) is subjected to Gaussian noise processing to obtain a noisy audio signal, Yes The noisy frequency signal obtained by performing Gaussian noise processing, and so on, ..., Yes The noisy frequency signal obtained by performing Gaussian noise processing is is the audio signal B corresponding to each audio signal A.
[0178] The process in which electronic device A performs T noise addition processing on each audio signal A using the forward diffusion model can be understood as the forward diffusion process of the diffusion model. For details not described in detail here, please refer to the above Fig. 9 The forward diffusion process shown in (3) and Fig.10 Related description in .
[0179] In step S1330 , electronic device A constructs a training data set according to each audio signal A and T noisy audio signals of each audio signal A, wherein the training data set includes T training samples corresponding to each audio signal A.
[0180] The training data set includes T training samples corresponding to each audio signal A, that is, the training data set includes Z training samples corresponding to the audio signal A. training samples.
[0181] The T training samples corresponding to each audio signal A correspond to the T noisy audio signals corresponding to each audio signal A. The jth training sample among the T training samples corresponding to each audio signal A includes the jth training audio and the jth label audio, wherein the jth training audio is the audio signal B corresponding to each audio signal A (that is, the training audio in each training sample is the audio signal B), and the jth label audio is the j-1th noisy audio signal among the T noisy audio signals of each audio signal A, j=1,2,…,T. It should be understood that the position order of the noisy audio signal in the jth training sample in the T noisy audio signals of each audio signal A is not limited, and the above description is only based on the example that the noisy audio signal in the jth training sample is located in the jth noisy audio signal among the T noisy audio signals of each audio signal A. Optionally, the noisy audio signal in the jth training sample can be other noisy audio signals among the T noisy audio signals of each audio signal A except the jth noisy audio signal.
[0182] For example, taking T equal to 4 as an example, the T noise-added audio signals of the audio signal A include , , and The training data set may include 4 training samples, wherein the first training sample includes as training audio , and as the tag audio ; The second training sample includes as training audio , and as the tag audio ; The third training sample includes as training audio , and as the tag audio The fourth training sample includes as training audio , and as the tag audio .
[0183] In step S1340, in the s-th iterative processing, electronic device A uses the initial sound event detection model to perform T denoising processes on the audio signal B corresponding to the s-th audio signal A to obtain T predicted denoised audio signals corresponding to the s-th audio signal A, s=1, 2,…, Z.
[0184] In the embodiment of the present application, during each iterative processing, the electronic device A performs denoising processing on the audio signal B corresponding to one audio signal A among the Z audio signals A. Optionally, during each iterative processing, the electronic device A performs denoising processing on the audio signal B corresponding to multiple audio signals A among the Z audio signals A.
[0185] The initial sound event detection model performs T denoising processes on the audio signal B corresponding to the s-th audio signal A, and the sum of the number of denoising processes corresponding to the j-th label audio in the j-th training sample associated with the predicted denoised audio signal corresponding to the j-th training audio corresponding to the s-th audio signal A is equal to T, and the number of denoising processes corresponding to the j-th label audio refers to the number of times denoising is performed on the s-th audio signal A.
[0186] In some implementations, T is equal to 4. In the above step S1340, when the electronic device A performs denoising processing on the audio signal B corresponding to the s-th audio signal A for 4 times, the number of noise addition processing corresponding to the j-th labeled audio in the j-th training sample corresponding to the s-th audio signal A is zero. At this time, the j-th labeled audio is the audio obtained by performing zero noise addition processing on the audio signal A, that is, the j-th audio signal is the audio signal A; when the electronic device A performs denoising processing on the audio signal B corresponding to the s-th audio signal A for 3 times, the number of noise addition processing corresponding to the j-th labeled audio in the j-th training sample is zero. At this time, the j-th labeled audio is the audio obtained by performing zero noise addition processing on the audio signal A. The labeled audio is the audio obtained by performing one noise addition process on the audio signal A; when the electronic device A performs two denoising processes on the audio signal B corresponding to the s-th audio signal A, the number of noise addition processes corresponding to the j-th labeled audio in the j-th training sample is zero, and at this time, the j-th labeled audio is the audio obtained by performing two noise addition processes on the audio signal A; when the electronic device A performs one denoising process on the audio signal B corresponding to the s-th audio signal A, the number of noise addition processes corresponding to the j-th labeled audio in the j-th training sample is zero, and at this time, the j-th labeled audio is the audio obtained by performing three noise addition processes on the audio signal A.
[0187] Optionally, in the s-th iterative processing, electronic device A uses the initial sound event detection model to perform T denoising processes on the audio signal B corresponding to the s-th audio signal A to obtain T predicted denoised audio signals corresponding to the s-th audio signal A, including: in the s-th iterative processing, electronic device A uses the original audio signal as a training condition, and uses the initial sound event detection model to perform T denoising processes on the audio signal B corresponding to the s-th audio signal A to obtain T predicted denoised audio signals corresponding to the s-th audio signal A.
[0188] It should be noted that, in the embodiment of the present application, the relationship between the initial sound event detection model in the above step S1340 and the forward diffusion model in the above step S1320 is not specifically limited.
[0189] In one example, the initial sound event detection model and the forward diffusion model can be two different modules located in the same diffusion model, wherein the initial sound event detection model is an initial denoising module in the diffusion model, and the forward diffusion model is a noise adding module in the diffusion model, and the noise adding module can be obtained without training. Correspondingly, the sound event detection model and the forward diffusion model in step S1370 below can be two different modules located in the same diffusion model, wherein the sound event detection model is a denoising module in the diffusion model, and the forward diffusion model is a noise adding module in the diffusion model.
[0190] In another example, the initial sound event detection model and the forward diffusion model may be two different modules located in two different diffusion models (diffusion model A and diffusion model B), wherein the initial sound event detection model is an initial denoising module in diffusion model A, and the forward diffusion model is a noise adding module in diffusion model B, and the noise adding module may not be obtained through training. Accordingly, the sound event detection model and the forward diffusion model in step S1370 below are two different modules located in the same diffusion model, respectively, the sound event detection model is a denoising module in diffusion model A, and the forward diffusion model B is a noise adding module in the diffusion model.
[0191] In step S1350, electronic device A adjusts the parameters of the initial sound event detection model according to the difference between the predicted jth denoised audio signal corresponding to the jth training audio in the jth training sample corresponding to the sth audio signal A and the jth labeled audio in the jth training sample.
[0192] The difference between the predicted j-th denoised audio signal corresponding to the j-th training audio in the j-th training sample and the j-th label audio in the j-th training sample can be represented by a loss value of a loss function, and the loss function is not specifically limited. For example, the loss function can be, but is not limited to, a square loss function or an absolute value loss function.
[0193] It can be understood that the above steps 1240 and 1250 are the first iteration process of training the initial sound event detection model.
[0194] In step S1360, electronic device A determines whether a training stop condition is satisfied.
[0195] The method for electronic device A to determine whether the training stop condition is met is not specifically limited. In one example, electronic device A determines whether the training stop condition is met after executing the s-th iteration process according to the preset training stop condition. The preset training stop condition is not specifically limited. For example, the preset training stop condition may be that the iteration time after the s-th iteration process meets the preset iteration time, the number of iterations after the s-th iteration process meets the preset number of iterations, the iteration result after the s-th iteration process meets the preset iteration requirement, or the user actively triggers the stop of the iteration process after the s-th iteration process.
[0196] In the above step S1360, if the training stop condition is not met, the electronic device A updates s to s+1 and continues to perform the s+1th (i.e., the next iteration) iteration processing (i.e., the above step S1340 and the above step S1350, s=s+1). The s+1th audio signal A when the electronic device A performs the s+1th iteration processing and the sth audio signal A when the electronic device A performs the sth iteration processing may be two different audio signals.
[0197] When the training stop condition is met, electronic device A executes step S1370.
[0198] In step S1370, when the training stop condition is met, electronic device A ends the model training and determines the initial sound event detection model obtained by the current training as the sound event detection model.
[0199] For example, Fig.12 It shows that electronic device A performs the above Fig.13 The flowchart of the sound event detection model training process provided is as follows: Fig.12 The training process shown is based on the above Fig.10 Optionally, the electronic device A can also be based on the above Fig.13 The sound event detection model training method provided is based on the above Fig.11 The illustrated architecture is described as an example and will not be described in detail here.
[0200] It should be understood that the above Fig.13 The model training method shown is for illustration only and does not constitute any limitation on the training process of the sound event detection model provided in the embodiment of the present application.
[0201] In the embodiment of the present application, after the electronic device A trains the initial sound event detection model, the sound event detection model obtained (the trained initial sound event detection model) is a generative model, that is, the sound event detection model has high robustness, and the robustness of the sound event detection model refers to the ability of the sound event detection model to remain stable and accurate in the face of data disturbances, noise or other interference. Therefore, denoising the audio to be detected based on the sound event detection model with high robustness is conducive to improving the accuracy of the sound event detection results obtained, thereby improving the user experience.
[0202] The following is an introduction to the sound event detection method provided in the embodiment of the present application.
[0203] Fig.14 is a schematic flow chart of a sound event detection method provided in an embodiment of the present application. It can be understood that, Fig.14 The sound event detection model in the sound event detection method provided is based on the above Fig.13 The training method provided (the training method is based on the above Fig.10 The sound event detection model obtained by the architecture provided by the present invention is described by taking the input and output of the sound event detection model as an example. The execution subject of the method provided by the embodiment of the present application can be an electronic device, or a software / hardware module capable of audio processing in the electronic device. For the sake of convenience, the following embodiment takes electronic device A as an example. For example, the electronic device can be, but is not limited to, Fig.18 An electronic device 100 is shown.
[0204] For example, Fig.14 As shown, the sound event detection model training method includes steps S1410 to S1430, and steps S1410 to S1430 are respectively introduced in detail below.
[0205] In step S1410, the sensor of electronic device A collects the audio signal to be detected #1.
[0206] The sensor of the electronic device A collects the audio signal to be detected #1 which is an audio signal in the time domain.
[0207] In step S1420, electronic device A performs Fourier transform on the audio signal to be detected #1 to obtain the audio signal to be detected #2.
[0208] The audio signal to be detected #2 is an audio signal in the frequency domain. It is understandable that in the embodiment of the present application, the sound included in the identification audio signal #1 and the identification audio signal #2 is the same, the difference is that the two audio signals are audio signals in two different domains (time domain or frequency domain).
[0209] In step S1430, electronic device A uses the sound event detection model to perform denoising on the audio signal #2 to be detected to obtain a sound event detection result.
[0210] For example, the audio signal #1 to be detected in step S1410 may be Figure 6 The sound event detection result in step S1430 may be Figure 7 The sound event detection results are shown.
[0211] It should be understood that the above Fig.14 The model training method shown is based on the above Fig.13 The training method provided (the training method is based on the above Fig.10 The description is given by taking an example in which the input and output of the sound event detection model obtained by the sound event detection model (the architecture provided) are frequency domain audio signals, and the audio signal #1 to be detected collected by the sensor of electronic device A is a time domain signal. Optionally, in other implementations, when the input and output of the sound event detection model are time domain audio signals, and the audio signal #1 to be detected collected by the sensor of electronic device A is a time domain signal, after electronic device A executes the above step S1410, it may not execute the Fourier transform of the above step S1420, that is, directly use the sound event detection model to denoise the audio signal #1 to be detected to obtain the sound event detection result.
[0212] In the embodiment of the present application, the sound event detection model (the trained initial sound event detection model) used by electronic device A to perform the sound event detection task is a generative model, that is, the sound event detection model has high robustness, and the robustness of the sound event detection model refers to the ability of the sound event detection model to remain stable and accurate in the face of data disturbances, noise or other interference. Therefore, after electronic device A performs denoising on the audio to be detected based on the highly robust sound event detection model, the sound event detection result obtained is highly accurate, thereby improving the user experience.
[0213] Fig.15 is a schematic flow chart of a sound event detection method provided in an embodiment of the present application. It can be understood that, Fig.15 The sound event detection model in the sound event detection method provided is based on the above Fig.13 The training principles provided and the above Fig.11The sound event detection model obtained by training the initial sound event detection model is introduced by taking the input and output of the sound event detection model as an example. The execution subject of the method provided in the embodiment of the present application can be an electronic device, or a software / hardware module capable of audio processing in the electronic device. For the sake of convenience, the following embodiment takes electronic device A as an example. For example, the electronic device can be, but is not limited to, Fig.18 An electronic device 100 is shown.
[0214] For example, Fig.15 As shown, the sound event detection model training method includes steps S1510 to S1550, and steps S1510 to S1550 are respectively introduced in detail below.
[0215] In step S1510, the sensor of electronic device A collects the audio signal to be detected #1.
[0216] In step S1520, electronic device A performs Fourier transform on the audio signal to be detected #1 to obtain the audio signal to be detected #2.
[0217] The above-mentioned step S1510 and step S1520 are respectively the same as the above-mentioned step S1410 and step S1420. For the contents not described in detail here, please refer to the description of the above-mentioned step S1410 and step S1420.
[0218] In step S1530, electronic device A performs scene recognition on the audio signal to be detected #1 to obtain the audio scene of the audio signal to be detected #1.
[0219] The method by which the electronic device A performs scene recognition on the audio signal #1 to be detected is not specifically limited. For example, the electronic device may perform scene recognition on the audio signal #1 to be detected according to an existing scene recognition algorithm.
[0220] It should be noted that the above steps S1520 and S1530 are steps performed after the electronic device A performs the above step S1510, and the execution order of the above steps S1520 and S1530 performed by the electronic device A is not specifically limited. For example, after the electronic device A performs step S1510, it can first perform step S1520 and then perform step S1530. For example, after the electronic device A performs step S1510, it can first perform step S1530 and then perform step S1520.
[0221] In step S1540, electronic device A performs redundancy removal processing on the audio signal to be detected #2 according to the audio scene of the audio signal to be detected #1, to obtain the audio signal to be detected #2 after the redundancy removal processing.
[0222] The method for electronic device A to perform redundancy removal processing in step S1540 can be found in the above Fig.11 The method in which the de-redundancy module 1103 performs de-redundancy processing on the audio #2 to be detected as shown in (2) will not be described in detail here.
[0223] In step S1550, electronic device A uses the sound event detection model to perform denoising on the audio signal to be detected #2 after the redundancy removal processing to obtain a sound event detection result.
[0224] It should be understood that the above Fig.15 The sound event detection method provided is only illustrative and does not constitute any limitation to the sound event detection method provided in this application.
[0225] In the embodiment of the present application, the sound event detection model (trained initial sound event detection model) used by the electronic device A to perform the sound event detection task is a generative model, that is, the sound event detection model has high robustness, and the robustness of the sound event detection model refers to the ability of the sound event detection model to remain stable and accurate in the face of data disturbances, noise or other interference. In addition, the above-mentioned sound event detection model is a model obtained by training the initial sound event detection model using a training data set, and the initial input data of the initial sound event detection model is the frequency domain signal of the de-redundant audio signal A (the de-redundant audio signal A'), and the frequency domain signal of the de-redundant audio signal A is an audio signal obtained by performing Fourier transform on the audio signal A, and removing the sound in the audio scene that is not the original audio signal corresponding to the audio signal A from the transformed audio signal, so that the data quality of the training sample is improved, thereby further improving the robustness of the sound event detection model. Therefore, after electronic device A uses the sound event detection model with the above-mentioned characteristics to perform denoising on the audio signal to be detected #2 after de-redundancy processing (i.e., the audio signal obtained after Fourier transform and de-redundancy processing of the collected audio signal to be detected #1), the sound event detection result obtained is more accurate, thereby further improving the user experience.
[0226] Another sound event detection method provided by an embodiment of the present application is introduced below.
[0227] Fig.16 Schematic diagram of a sound event detection method provided in an embodiment of the present application. The execution subject of the method provided in an embodiment of the present application can be an electronic device, or a software / hardware module in the electronic device that can perform audio processing. For the sake of convenience, the following embodiments are described by taking an electronic device as an example. For example, the electronic device can be, but is not limited to, Fig.18 An electronic device 100 is shown.
[0228] For example, Fig.16 As shown, the sound event detection method includes step S1610 and step S1620. The following takes the electronic device executing the sound event detection method as an example to introduce step S1610 and step S1620 in detail.
[0229] In step S1610, the electronic device obtains audio to be detected.
[0230] The audio to be detected can be understood as any audio signal used to detect a sound event. The audio to be detected can also be called an audio signal to be detected, a sound signal to be detected, a sound signal to be detected, an audio signal to be detected or an audio stream, without specific limitation. The audio to be detected will be described by way of example below, and will not be described in detail here.
[0231] In step S1620, the electronic device uses the sound event detection model to perform M denoising processes on the audio to be detected to obtain a sound event detection result, wherein the sound event detection result includes audio clips in the audio to be detected that belong to each of N types of target audio events, and the positions of the audio clips in the audio to be detected, and M is a positive integer; wherein the input of the first denoising process is the audio to be detected, and the output of the Mth denoising process is the sound event detection result; when M is an integer greater than 1, the input of the i-th denoising process is the output of the i-1th denoising process, and i is a positive integer greater than 1.
[0232] The sound event detection model is a neural network model obtained through training. The process of the electronic device using the sound event detection model to detect the audio to be detected (M times of denoising) can be understood as the reverse diffusion process in the diffusion model. Exemplarily, the process of the electronic device using the sound event detection model to detect the audio to be detected can be the above Fig.10 The inference process of the sound event detection model shown in (2) in FIG. 1 . In the embodiment of the present application, the sound event detection model can be obtained by training the initial sound event detection model. The model training process will be described in detail below and will not be repeated here.
[0233] The sound event detection result includes the audio clips in the audio to be detected that belong to each type of target audio event in the N types of target audio events, and the position of the audio clip in the audio to be detected. Each type of target audio event in the N types of target audio events refers to the type of audio event that the user is concerned about, that is, the task of sound event detection needs to identify the audio clips of the audio to be detected that belong to each type of target audio event. In some embodiments, the N types of target audio events are preset N types of audio events. For example, the electronic device can determine the preset N types of audio events based on the parameters input by the user. For another example, the electronic device can determine the preset N types of audio events based on the historical data stored in the electronic device. The position of the audio clip in the audio to be detected is used to represent the time period of the audio clip in the audio to be detected.
[0234] In the embodiment of the present application, the audio to be detected is obtained based on the original audio to be detected. Specifically, when N is equal to 1, the audio to be detected is the original audio to be detected; when N is an integer greater than 1, the audio to be detected is the audio obtained by splicing N original audios to be detected.
[0235] For example, taking N equal to 3 as an example, the above Figure 6 The audio to be detected shown is a specific example of the audio to be detected in the above implementation. Figure 6 The original audio to be detected shown is a specific example of the original audio to be detected in the above implementation.
[0236] There is no specific limitation on the number of M denoising processes, that is, M is a positive integer. For example, M may be, but is not limited to, equal to 1, 2, 3, 5, or 6. In some implementations, each denoising process in the M denoising processes is a denoising process for removing Gaussian noise.
[0237] Optionally, the electronic device uses a sound event detection model to perform denoising processing on the audio to be detected M times to obtain a sound event detection result, including: the electronic device uses a sound event detection model to perform denoising processing on the audio to be detected M times based on conditional information to obtain a sound event detection result, wherein the conditional information includes information determined based on the audio to be detected.
[0238] The above-mentioned condition information includes information determined based on the audio to be detected, and the content of the condition information is not specifically limited. In one example, the above-mentioned condition information specifically includes the audio to be detected and the number of denoising processes. In another example, the above-mentioned condition information specifically includes the characteristics of the audio to be detected and the number of denoising processes, for example, the characteristics of the audio to be detected include but are not limited to the position of the audio segment where the sound exists in the audio to be detected.
[0239] In an embodiment of the present application, the audio to be detected is obtained based on the initial audio to be detected, and the initial audio to be detected is the audio obtained by the device collecting the sound in the environment. Generally speaking, the initial audio to be detected obtained by the device collecting the sound in the environment is a time domain audio. The following introduces four implementation methods (i.e., implementation method 1, implementation method 2, implementation method 3 and implementation method 4) provided by the present application for obtaining the audio to be detected based on the initial audio to be detected.
[0240] Implementation method 1
[0241] In implementation method one, the electronic device obtains audio to be detected, including: the electronic device performs scene recognition on the obtained initial audio to be detected, and determines that the audio scene of the initial audio to be detected is a first audio scene, wherein the initial audio to be detected is audio in the time domain; the electronic device performs de-redundancy processing on the initial audio to be detected according to the first audio scene to obtain audio to be detected, wherein the sound event corresponding to the audio to be detected belongs to the sound event corresponding to the first audio scene.
[0242] The initial audio to be detected is an audio in the time domain, and accordingly, the processed audio to be detected is also an audio in the time domain.
[0243] The electronic device performs de-redundancy processing on the initial audio to be detected according to the first audio scene, so that the sound event corresponding to the audio to be detected obtained after the de-redundancy processing belongs to the sound event corresponding to the first audio scene. It can be understood that the de-redundancy processing is used to remove the sound events that do not correspond to the first audio scene in the initial audio to be detected, or to remove the sound events that have a small correlation with the sound events corresponding to the first audio scene in the initial audio to be detected, and no specific limitation is made to this. In one example, the electronic device removes the sound events that do not correspond to the first audio scene in the initial audio to be detected, which can be understood as the electronic device sets the audio signal of the sound event that does not correspond to the first audio scene in the initial audio to be detected to zero. It should be understood that the audio duration of the initial audio to be detected before the initial audio to be detected is de-redundant and the audio duration of the audio to be detected obtained after the initial audio to be detected is de-redundant are the same.
[0244] The electronic device performs redundancy removal processing on the initial audio to be detected (time domain signal), that is, the electronic device sets the audio signal of the sound event in the initial audio to be detected that does not belong to the audio scene of the initial audio to be detected to zero.
[0245] There is no specific limitation on the relationship between the audio type of the audio signal of the sound event in the initial audio to be detected that does not belong to the audio scene of the initial audio to be detected and the N types of target audio events, that is, the audio type of the audio signal of the sound event in the initial audio to be detected that does not belong to the audio scene of the initial audio to be detected belongs to at least one type of target audio event in the N types of target audio events, or the audio type of the audio signal of the sound event in the initial audio to be detected that does not belong to the audio scene of the initial audio to be detected does not belong to at least one type of target audio event in the N types of target audio events, and there is no specific limitation on this. It should be understood that the understanding of the de-redundancy processing of the initial audio to be detected by the electronic device involved below can refer to the description here.
[0246] There is no specific limitation on the type and number of sound events corresponding to the first audio scene, and they can be set according to actual needs. For example, taking the first audio scene as an office, the sound events corresponding to the first audio scene may include the following sound events: phone ringing, keyboard sound, or meeting invitation sound. For example, taking the first audio scene as a home scene, the sound events corresponding to the first audio scene may include the following sound events: vacuum cleaner vacuuming sound, washing machine washing sound, dishes colliding sound, baby crying sound, water heater running sound, TV sound, and faucet dripping sound.
[0247] In the above implementation method 1, after the electronic device obtains the initial audio to be detected, it does not perform the above step S1620 on the obtained initial audio to be detected, but first performs de-redundancy processing on the initial audio to be detected based on the first audio scene of the determined initial audio to be detected, so that the data volume of the audio to be detected obtained after the de-redundancy processing becomes smaller. Afterwards, the electronic device performs the above step S1620 on the audio to be detected obtained after the de-redundancy processing, which effectively reduces the calculation amount of the sound event detection model. On the one hand, the computing power of the scene recognition algorithm adopted by the electronic device is extremely small, and the accuracy rate is high, and the initial audio to be detected can be quickly de-redundantly processed. On the other hand, compared with the electronic device directly using the initial audio to be detected before de-redundancy processing to perform the above S1620, the electronic device uses the audio to be detected obtained after the de-redundancy processing to perform the above S1620. Since the data volume of the audio to be detected is small, it is conducive to the rapid convergence of the sound event detection model. While ensuring the accuracy of the sound event detection result, the efficiency of the sound event detection result can also be improved.
[0248] Implementation method 2
[0249] In the second implementation method, the electronic device obtains the audio to be detected, including: the electronic device performs scene recognition on the acquired time domain signal of the initial audio to be detected, and determines that the audio scene of the time domain signal of the initial audio to be detected is the first audio scene; the electronic device performs Fourier transform processing on the time domain signal of the initial audio to be detected to obtain the frequency domain signal of the initial audio to be detected; the electronic device performs de-redundancy processing on the frequency domain signal of the initial audio to be detected according to the first audio scene to obtain the audio to be detected, wherein the sound event corresponding to the audio to be detected belongs to the sound event corresponding to the first audio scene.
[0250] It should be understood that the difference between the above-mentioned implementation method 2 and the above-mentioned implementation method 1 is that in the above-mentioned implementation method 2, after the time domain audio of the acquired initial audio to be detected is transformed, the frequency domain audio of the initial audio to be detected obtained after the transformation is de-redundant, that is, the above-mentioned implementation method 2 performs de-redundant processing on the initial audio to be detected in the frequency domain, while the above-mentioned implementation method 1 performs de-redundant processing on the initial audio to be detected in the time domain.
[0251] The time domain signal of the initial audio to be detected and the frequency domain signal of the initial audio to be detected are audio of the same audio in different domains (for example, time domain or frequency domain).
[0252] The above-mentioned Fourier transform processing is used to transform the initial audio signal to be detected in the time domain into the initial audio signal to be detected in the frequency domain. There is no specific limitation on the Fourier transform processing, which can be selected according to actual needs. For example, the Fourier transform processing performed by the electronic device can be, but is not limited to, short-time Fourier transform (STFT). Optionally, the above-mentioned Fourier transform processing can also be replaced by other processing methods, as long as the other processing methods can satisfy the requirements of transforming the time domain signal into the frequency domain signal.
[0253] For example, the above Fig.15 The sound event detection method shown is a specific example of the above-mentioned implementation method 2. Fig.15 The audio signal to be detected #1 shown is an example of the time domain signal of the initial audio to be detected in the above implementation mode 2. Fig.15 The audio signal to be detected #2 shown is an example of the frequency domain signal of the initial audio to be detected (ie, the audio to be detected) in the above implementation mode 2. Fig.15 The audio scene of the audio signal to be detected #1 is an example of the first audio scene in the above implementation mode 2. Fig.15 The audio signal to be detected #2 after de-redundancy processing is an example of the audio to be detected in the above implementation mode 2. For details not described in detail here, please refer to the above Fig.15 Description in .
[0254] In the above-mentioned implementation method 2, the electronic device first transforms the acquired initial audio to be detected in the time domain into the initial audio to be detected in the frequency domain, so that the audio features of the initial audio to be detected in the frequency domain are more obvious. Afterwards, the electronic device performs redundancy removal processing on the initial audio to be detected in the frequency domain, which can avoid erroneously removing the sound events corresponding to the first audio scene in the initial audio to be detected in the frequency domain, so that the audio to be detected in the frequency domain obtained after the redundancy removal processing is more accurate. Further, after the electronic device performs the above-mentioned step S1620 on the audio to be detected, the sound event detection result obtained is also more accurate. In addition, the computing power of the scene recognition algorithm adopted by the electronic device is extremely small, and the accuracy rate is high, and the initial audio to be detected can be quickly de-redundantly processed. In summary, in the above-mentioned implementation method 2, while ensuring the accuracy of the sound event detection result, the efficiency of the sound event detection result and the accuracy of the sound event detection result can be improved.
[0255] Implementation method three
[0256] In implementation method three, the electronic device obtains the audio to be detected, including: the electronic device performs Fourier transform processing on the time domain signal of the initial audio to be detected to obtain the frequency domain signal of the initial audio to be detected, so as to obtain the audio to be detected, wherein the audio to be detected is the frequency domain signal of the initial audio to be detected.
[0257] The method in which the electronic device performs Fourier transform processing on the time domain signal of the initial audio to be detected to obtain the frequency domain signal of the initial audio to be detected is the same as the method in the above-mentioned implementation method 2, and will not be repeated here.
[0258] For example, the above Fig.14 The sound event detection method shown is a specific example of the above-mentioned implementation method three. Fig.14 The audio signal to be detected #1 shown is an example of the time domain signal of the initial audio to be detected in the above implementation mode 3. Fig.14 The audio signal to be detected #2 shown is an example of the frequency domain signal of the initial audio to be detected (ie, the audio to be detected) in the above implementation mode 3. For details not described in detail here, please refer to the above Fig.14 Description in .
[0259] In the above implementation method 3, the electronic device first transforms the acquired initial audio to be detected in the time domain into the initial audio to be detected in the frequency domain, so that the audio features of the initial audio to be detected in the frequency domain are more obvious. Afterwards, the electronic device performs the above step S1620 on the initial audio to be detected in the frequency domain, which can further improve the accuracy of the sound event detection result.
[0260] Implementation method 4
[0261] In implementation manner 4, the audio to be detected is the initial audio to be detected.
[0262] In the above-mentioned implementation methods 1 to 4, the electronic device obtains the audio to be detected by performing initial detection audio, and the initial audio to be detected is the collected audio obtained by the device collecting the sound in the environment, that is, the initial audio to be detected refers to the audio that has not been processed in any way.
[0263] Optionally, before the electronic device executes any one of the above-mentioned implementation methods 1 to 4, the electronic device may also execute the step of obtaining the initial audio to be detected, and the manner in which the electronic device obtains the initial audio to be detected is not specifically limited. In one example, the audio sensor of the electronic device collects the sound in the scene where the electronic device is located to obtain the audio to be detected. In another example, the electronic device interacts with other electronic devices to obtain the audio to be detected collected by the other electronic devices, and the audio to be detected collected by the other electronic devices refers to the audio obtained by the other electronic devices collecting the sound in the environment where the other electronic devices are located.
[0264] The above describes the process of an electronic device using a trained sound event detection model to infer the audio to be detected. The following describes the process of the electronic device training the initial sound event model to obtain a sound event detection model before executing the above step S1620. The sound event detection model is a trained initial sound event model.
[0265] Optionally, before the electronic device uses the sound event detection model to perform M denoising processes on the audio to be detected to obtain the sound event detection result, the electronic device can also perform the following model training steps: the electronic device obtains a labeled audio based on the original audio to be trained, wherein the original audio to be trained includes L audio clips, each audio clip corresponds to at least one type of audio event, the labeled audio includes N first audios corresponding to N types of target audio events, the audio clip in each first audio belongs to the target audio event of the corresponding type, the audio clip in each first audio corresponding to each type of target audio event is the first audio clip, the first audio clip is the audio clip belonging to the corresponding type of target audio event in the L audio clips, the position of the first audio clip in each first audio represents the position of the first audio clip in the original audio to be trained, and L is a positive integer; the electronic device performs T noise addition processes on the labeled audio to obtain T first noisy audio clips, wherein each first added The noisy audio is obtained by performing a noisy process on the second noisy audio corresponding to each first noisy audio, the second noisy audio input for the first noisy process is the label audio, the first noisy audio output for the Tth noisy process is the audio to be trained, and the audio to be trained includes N original audios to be trained; when T is an integer greater than 1, the second noisy audio input for the jth noisy process is the output of the j-1th noisy process, and j is a positive integer greater than 1; the electronic device uses the initial sound event detection model to perform T denoising processes on the audio to be trained to obtain a third noisy audio corresponding to each second noisy audio, wherein the sum of the number of noisy processes performed on each second noisy audio and the number of denoising processes performed on the third noisy audio corresponding to each second noisy frequency is T; the electronic device adjusts the parameters of the initial sound event detection model according to the difference between each second noisy audio and the third noisy audio corresponding to each second noisy frequency to obtain the sound event detection model.
[0266] For example, a specific example of a model training method for a sound event detection model obtained by the electronic device performing model training on the initial sound event detection model can be found in the above Fig.13 The model training method provided is as follows: Fig.13 The original audio signal in the provided method is a specific example of the original audio signal to be trained in the above implementation. Fig.13 The T audio signals A in the provided method are a specific example of the T first noise-added audio signals in the above implementation. Fig.13 Each audio signal A in the provided method is a specific example of the label audio in the above implementation. Fig.13 The audio signal B corresponding to each audio signal A in the provided method is a specific example of the audio to be trained in the above implementation. For details not described in detail here, please refer to the above Fig.13 Description in .
[0267] The above-mentioned original audio to be trained includes L audio clips, and each audio clip corresponds to at least one type of audio event. The original audio to be trained can be audio obtained by the device collecting sounds in the environment, or the original audio to be trained can be audio obtained by the device collecting sounds in the environment and performing preset processing (for example, Fourier transform processing and / or de-redundancy processing), and there is no specific limitation on this. Each of the L audio clips included in the original audio to be trained has sound recorded in it. Optionally, the original audio to be trained can also include silent clips without sound. In addition, there is no limitation on the number of audio clips included in the original audio to be trained and the audio duration of the original audio to be trained.
[0268] Exemplarily, the original audio to be trained may be, but is not limited to, Figure 1 In (1), Figure 2 (1) or Figure 3 The original audio signal is shown in (1).
[0269] The relationship between the at least one type of audio event and the N types of target audio events is not specifically limited. For example, the at least one type of audio event may be at least one type of audio event among the N types of target audio events. For another example, the at least one type of audio event does not belong to the N types of target audio events.
[0270] The above-mentioned labeled audio is the audio obtained by processing the original audio to be trained according to N types of target audio events. Specifically, as described above, the original audio to be trained includes L audio clips, each audio clip corresponds to at least one type of audio event, the labeled audio includes N first audios corresponding to the N types of target audio events, the audio clip in each first audio belongs to the target audio event of the corresponding type, the audio clip in each first audio corresponding to each type of target audio event is the first audio clip, the first audio clip is the audio clip belonging to each corresponding type of target audio event in the L audio clips, and the position of the first audio clip in each first audio represents the position of the first audio clip in the original audio to be trained. It should be understood that when N is an integer greater than 1, the labeled audio includes N first audios. In some implementations, the labeled audio is the audio obtained by serially splicing the N first audios.
[0271] The position of the first audio segment in each first audio refers to the time period of the first audio segment in each first audio. Similarly, the position of the first audio segment in the original audio to be trained refers to the time period of the first audio segment in the original audio to be trained.
[0272] The audio segment in each first audio corresponding to each type of target audio event is the first audio segment, and the first audio segment is the audio segment belonging to each corresponding type of target audio event among the L audio segments. In the case where the type of the audio event corresponding to the L audio segments belongs to at least one type of target audio event among the N types of target audio events, the first audio segment in the first audio event corresponding to the at least one type of target audio event records one or more audio segments belonging to the first type of target audio event among the L audio segments. In the case where the type of the audio event corresponding to the L audio segments does not belong to at least one type of target audio event among the N types of target audio events, the first audio segment corresponding to the at least one type of target audio event does not record any audio, and then the first audio corresponding to the at least one type of target audio event will not record any audio either.
[0273] For example, the original audio to be trained is Figure 1 The audio shown in (1) is taken as an example, and N is equal to 3. The audio to be trained is Figure 1 The audio shown in (2) in the figure is labeled based on the original audio to be trained. Figure 4A The audio shown in (1) includes three audios (i.e., an example of N first audios) corresponding to three sound event types (i.e., an example of N types of target audio events), wherein the audio segment corresponding to time period 1 in the sound event type of a baby crying among the three audios is an example of the above-mentioned first audio segment, and no audio is recorded in the audio corresponding to the sound event type of a dog barking and the audio corresponding to the sound event type of a cat meowing among the three audios.
[0274] The number of the audios to be trained in the above implementation can be one or more, which is not specifically limited. When the number of the audios to be trained in the above implementation is multiple, the multiple audios to be trained can be multiple different audios to be trained, or the multiple audios to be trained can also be multiple identical audios to be trained.
[0275] The above-mentioned audio to be trained includes N original audio to be trained, and the number of the original audio to be trained included in the audio to be trained is the same as the value of the N types of target audio events, and the N types of target audio events are the types of sound events that the user expects to recognize. It should be understood that in some implementations, when N is an integer greater than 1, the audio to be trained is the audio obtained by concatenating the N original audio to be trained.
[0276] In one example, when N is equal to 1, that is, when the sound event type that the user expects to recognize is a type 1 target event type, the audio to be trained is the original audio to be trained.
[0277] For example, N=1, the original audio to be trained is Figure 1Taking the audio shown in (1) as an example, the audio to be trained is Figure 1 For example, with N=1, the original audio to be trained is Figure 2 Taking the audio shown in (1) as an example, the audio to be trained is Figure 2 For example, with N=1, the original audio to be trained is Figure 3 Taking the audio shown in (1) as an example, the audio to be trained is Figure 3 The audio shown in (1).
[0278] In another example, when N is an integer greater than 1, that is, when the sound event type that the user expects to identify is a multi-category target event type, the audio to be trained is the audio obtained by splicing N original audios to be trained.
[0279] For example, with N=3, the original audio to be trained is Figure 1 Taking the audio shown in (1) as an example, the audio to be trained is Figure 1 For example, with N=3, the original audio to be trained is Figure 2 Taking the audio shown in (1) as an example, the audio to be trained is Figure 2 For example, with N=3, the original audio to be trained is Figure 3 Taking the audio shown in (1) as an example, the audio to be trained is Figure 3 The audio is shown in (2).
[0280] In the above implementation, the process of the electronic device performing T times of noise processing on the tag audio can be understood as the forward diffusion process of the diffusion model, which refers to the forward diffusion process from data that conforms to an audio signal distribution. (i.e. labeled audio) to data that conforms to the distribution of another audio signal (i.e. the audio to be trained), where: to It can be understood as an intermediate state distribution from the one audio signal distribution to the other audio signal distribution. Each noise addition process performed by the electronic device on the tag audio for T times can be a Gaussian noise addition process.
[0281] For example, the forward diffusion process in the above implementation can be seen in Fig. 9 The forward diffusion process shown in (3) is as follows, where the label audio can be Fig. 9 (3) shows , the audio to be trained can be Fig. 9 (3) shows , here about Fig. 9 For details not described in (3) above, please refer to Fig. 9The description in will not be repeated here.
[0282] The sum of the number of times each second noisy audio has been noisy processed and the number of times the third noisy audio corresponding to each second noisy audio has been denoised is T. In some implementations, the number of times each second noisy audio has been noisy is Th, and the number of times each third noisy audio has been denoised is h, where h=1, 2, …, T. It should be understood that when h is equal to T, the number of times each second noisy audio has been noisy is 0, that is, each second noisy audio is an audio obtained by performing 0 times of noisy processing on the label audio, that is, each second noisy audio is a label audio.
[0283] Exemplary, the above combined Fig. 9 In the diffusion process method provided in the embodiment of the present application, the labeled audio in each training sample can be a specific example of each of the above-mentioned second noisy audio; the predicted audio corresponding to the training audio in the above diffusion process method can be a specific example of the third noisy audio corresponding to each of the above-mentioned second noisy audio; the initial diffusion model in the above diffusion process method can be a specific example of the above-mentioned initial sound event detection model; the trained initial diffusion model in the above diffusion process method can be a specific example of the above-mentioned sound event detection model. For the contents not described in detail here, please refer to the above. Fig. 9 Related description in .
[0284] The electronic device adjusts the parameters of the initial sound event detection model according to the difference between each second noise frequency and the third noise frequency corresponding to each second noise frequency, so as to obtain the sound event detection model. The difference between each second noise frequency and the third noise frequency corresponding to each second noise frequency can be calculated by a loss function, so that the difference can be represented by a loss value. There is no specific limitation on the function type of the loss function, and it can be set according to user needs or actual scenarios. For example, the loss function can be, but is not limited to, a square loss function or an absolute value loss function.
[0285] In some implementations, the electronic device adjusts the parameters of the initial sound event detection model according to the difference between each second noise frequency and the third noise frequency corresponding to each second noise frequency to obtain the sound event detection model, including: the electronic device adjusts the parameters of the initial sound event detection model according to the difference between each second noise frequency and the third noise frequency corresponding to each second noise frequency, and when the training stop condition is met, the model training is terminated, and the sound event detection model determined by the initial audio event detection model obtained by the current training is used. The training stop condition is not specifically limited and can be flexibly set according to user needs or application scenarios. For example, the training stop condition can be but is not limited to at least one of the following conditions: the current training time exceeds the preset training time, the current training iteration number exceeds the preset training number, the user actively triggers the stop of model training, or the difference between the output results of two consecutive iterations of the model is less than a preset threshold.
[0286] In an embodiment of the present application, when the electronic device uses the sound event detection model to infer the audio to be detected, the audio to be detected is obtained based on the initial audio to be detected, and the above describes that the electronic device obtains the audio to be detected based on any one of the four implementation methods. Correspondingly, an embodiment of the present application also provides four implementation methods (implementation method A, implementation method B, implementation method C and implementation method D) for the electronic device to obtain the original audio to be trained based on the initial audio to be trained. The initial audio to be trained is the audio obtained by the device collecting sounds in the environment. Generally speaking, the initial audio to be trained obtained by the device collecting sounds in the environment is a time domain audio.
[0287] Implementation A corresponding to the above implementation A
[0288] In implementation method A, the electronic device obtains the original audio to be trained, including: the electronic device performs scene recognition on the acquired time domain signal of the initial audio to be trained, and determines that the audio scene of the time domain signal of the initial audio to be trained is the second audio scene; the electronic device performs de-redundancy processing on the time domain signal of the initial audio to be trained according to the second audio scene to obtain the original audio to be trained, wherein the sound event corresponding to the original audio to be trained belongs to the sound event corresponding to the second audio scene.
[0289] The initial audio to be trained is an audio in the time domain, and accordingly, the processed audio to be trained is also an audio in the time domain.
[0290] The principle of the electronic device performing de-redundancy processing on the time domain signal of the initial audio to be trained is the same as the principle of the electronic device performing de-redundancy processing on the initial audio to be detected in the above implementation method 1. For the contents not described in detail here, please refer to the description in the above implementation method 1.
[0291] In the above implementation method A, after the electronic device obtains the initial audio to be trained, it does not directly use the initial sound event detection model to perform the training process described above on the training samples obtained based on the initial audio to be trained, but first performs redundancy processing on the initial audio to be trained based on the second audio scene of the determined initial audio to be trained, so that the data volume of the original audio to be trained obtained after the redundancy processing becomes smaller. Afterwards, the electronic device uses the training samples obtained based on the original audio to be trained obtained after the redundancy processing to perform the training process described above. On the one hand, the computing power of the scene recognition algorithm adopted by the electronic device is extremely small (i.e., the computing speed is fast), the accuracy is high, and the initial audio to be trained can be quickly de-redundant. On the other hand, compared with the electronic device directly using the training samples obtained based on the initial audio to be trained before the redundancy processing to perform the training process described above, the electronic device uses the training samples obtained based on the original audio to be trained obtained after the redundancy processing to perform the training process described above. Since the data volume of the original audio to be trained is small, the data volume of the training audio and the label audio in the training samples obtained based on the original audio to be trained is also reduced, which is conducive to the rapid convergence of the initial sound event detection model. In summary, when the initial sound event detection model is trained based on the training samples obtained from the original audio to be trained obtained by the above implementation method A, the efficiency of model training can be improved.
[0292] Implementation B corresponding to Implementation 2 above
[0293] In implementation method B, the electronic device obtains the original audio to be trained, including: the electronic device performs scene recognition on the acquired time domain signal of the initial audio to be trained, and determines that the audio scene of the time domain signal of the initial audio to be trained is the second audio scene; the electronic device performs Fourier transform processing on the time domain signal of the initial audio to be trained to obtain the frequency domain signal of the initial audio to be trained; the electronic device performs de-redundancy processing on the frequency domain signal of the initial audio to be trained according to the second audio scene to obtain the original audio to be trained, wherein the sound event corresponding to the original audio to be trained belongs to the sound event corresponding to the second audio scene.
[0294] In the above implementation method B, the electronic device first transforms the acquired initial audio to be trained in the time domain into the initial audio to be trained in the frequency domain, so that the audio features of the initial audio to be trained in the frequency domain are more obvious. Afterwards, the electronic device performs redundancy removal processing on the initial audio to be trained in the frequency domain, which can avoid mistakenly removing the sound events corresponding to the second audio scene in the initial audio to be trained in the frequency domain, so that the original audio to be trained in the frequency domain obtained after the redundancy removal processing is more accurate. Further, after the electronic device performs the model training steps described above on the training samples obtained based on the original audio to be trained in the frequency domain, the sound event detection model obtained is also more accurate. In addition, the computing power of the scene recognition algorithm adopted by the electronic device is extremely small, and the accuracy rate is high, and the initial audio to be trained can be quickly de-redundant. In summary, the initial sound event detection model is trained based on the training samples obtained from the original audio to be trained in the frequency domain obtained by the above implementation method B, so that the accuracy of the sound event detection model obtained after training is high, and the efficiency of model training is improved.
[0295] Implementation C corresponding to Implementation 3 above
[0296] In implementation method C, the electronic device obtains the original audio to be trained, including: the electronic device performs Fourier transform processing on the acquired time domain signal of the initial audio to be trained to obtain the frequency domain signal of the initial audio to be trained, so as to obtain the original audio to be trained, wherein the original audio to be trained is the frequency domain signal of the initial audio to be trained.
[0297] In the above implementation C, the electronic device first transforms the acquired initial audio to be trained in the time domain into the initial audio to be trained in the frequency domain, so that the audio features of the initial audio to be trained in the frequency domain are more obvious. Afterwards, the electronic device trains the initial sound event detection model based on the training samples obtained from the initial audio to be trained in the frequency domain (i.e., the original audio to be trained) to obtain the sound event detection model, so that the accuracy of the trained sound event detection model can be improved.
[0298] Implementation D corresponding to Implementation 4 above
[0299] In implementation manner D, the audio to be trained may also be N initial audios to be trained.
[0300] The original audio to be trained in the above implementations A to D and the audio to be detected in the above text may be the same audio or different audios, and there is no specific limitation on this. The number of the original audio to be trained in the above implementations A to D may be one or more. When the number of the original audio to be trained in the above implementations A to D is one or more, the electronic device uses the initial sound event detection model for each original audio to be trained in the same process, and the details can be referred to the model training steps in the above text.
[0301] In some implementations, the sound event detection model includes a noise addition module and a noise removal module, the initial sound event detection model includes a noise addition module and an initial noise removal module, and the electronic device performs T noise addition processing on the label audio to obtain T first noised audios, including: the electronic device uses the noise addition module to perform T noise addition processing on the label audio to obtain T first noised audios; the electronic device uses the initial sound event detection model to perform T noise removal processing on the training audio to obtain a third noised audio corresponding to each second noised audio, including: the electronic device uses the initial noise removal module to perform T noise removal processing on the training audio to obtain a third noised audio corresponding to each second noised audio; the electronic device adjusts the parameters of the initial sound event detection model according to the difference between each second noised audio and the third noised audio corresponding to each second noised audio to obtain the sound event detection model, including: the electronic device adjusts the parameters of the initial noise removal module according to the difference between each second noised audio and the third noised audio corresponding to each second noised audio to obtain the noise removal module, so as to obtain the sound event detection model.
[0302] In the above implementation method, the initial sound event detection model and the sound event detection model are both diffusion models, the noise addition modules in these two models are the same, and the denoising module in the sound event detection model is a module obtained by training the initial denoising model in the initial sound event detection model based on the training samples obtained by the noise addition module, thereby obtaining the sound event detection model.
[0303] Exemplarily, the above sound event detection model is used as Fig.10 Taking the sound event detection model 102 shown in (2) as an example, the denoising module in the sound event detection model 102 is used to perform Fig.10 The reasoning process shown in (2) is Fig.10 The model 102 shown in FIG. 1 may also include Fig.10 The forward diffusion model 101 shown in (1) is a specific example of the noise adding module, that is, the forward diffusion model 101 is used to perform the T times noise adding process mentioned above.
[0304] In some implementations, the electronic device uses a sound event detection model to perform denoising on the audio to be detected M times to obtain a sound event detection result, including: the electronic device uses a denoising module to perform denoising on the audio to be detected M times to obtain a sound event detection result.
[0305] It should be understood that the above Fig.16 The sound event detection method shown is for illustration only and does not constitute any limitation to the sound event detection method provided in the present application.
[0306] In an embodiment of the present application, the electronic device uses a trained sound event detection model (i.e., a diffusion model) to gradually denoise the audio to be detected as noise audio and finally convert it into a sound event detection result (i.e., the result of the last denoising process output). The audio obtained after each denoising process is used as the input audio for the next denoising process for the next denoising process. The audio obtained after each denoising process has a certain degree of similarity with the audio before the denoising process, so that the final sound event detection result is more accurate. In summary, the sound event detection method provided in the embodiment of the present application can improve the accuracy of the sound event detection results and improve the user experience.
[0307] Combination of the above Figures 1 to 16 , describes in detail the application scenario of the sound event detection method of the embodiment of the present application, the training method of the sound event detection model involved in the sound event detection method and the sound event detection method, and will combine the following Fig.17 and Fig.18 , describes the device embodiments and electronic devices of the present application in detail. It should be understood that the sound event detection device in the embodiments of the present application can execute the various methods of the aforementioned embodiments of the present application (for example, the sound event detection method, the sound event detection model training method), that is, the specific working process of the following various products can refer to the corresponding process in the aforementioned method embodiments.
[0308] Fig.17 is a schematic diagram of a sound event detection device provided in an embodiment of the present application. For example, Fig.17 The sound event detection device 1700 shown includes a processing unit 1710. The function of the processing unit 1710 is described below.
[0309] The processing unit 1710 is used to obtain the audio to be detected; the processing unit 1710 is also used to: use the sound event detection model to perform M denoising processes on the audio to be detected to obtain a sound event detection result, wherein the sound event detection result includes an audio segment in the audio to be detected that belongs to each type of target audio event in N types of target audio events, and the position of the audio segment in the audio to be detected, and M is a positive integer; wherein the input of the first denoising process is the audio to be detected, and the output of the Mth denoising process is the sound event detection result; when M is an integer greater than 1, the input of the i-th denoising process is the output of the i-1th denoising process, and i is a positive integer greater than 1.
[0310] In a possible implementation, when N is equal to 1, the audio to be detected is the original audio to be detected; when N is an integer greater than 1, the audio to be detected is the audio obtained by splicing N original audios to be detected.
[0311] In another possible implementation, the processing unit 1710 is also used to: utilize the sound event detection model, based on condition information, perform the M denoising processes on the audio to be detected to obtain the sound event detection result, wherein the condition information includes information determined based on the audio to be detected.
[0312] In another possible implementation, the condition information specifically includes the audio to be detected and the number of times of denoising processing.
[0313] In another possible implementation, the processing unit 1710 is also used to: perform scene recognition on the acquired initial audio to be detected, and determine that the audio scene of the initial audio to be detected is a first audio scene, wherein the initial audio to be detected is audio in the time domain; and perform de-redundancy processing on the initial audio to be detected according to the first audio scene to obtain the audio to be detected, wherein the sound event corresponding to the audio to be detected belongs to the sound event corresponding to the first audio scene.
[0314] In another possible implementation, the processing unit 1710 is also used to: perform scene recognition on the acquired time domain signal of the initial audio to be detected, and determine that the audio scene of the time domain signal of the initial audio to be detected is the first audio scene; perform Fourier transform processing on the time domain signal of the initial audio to be detected to obtain the frequency domain signal of the initial audio to be detected; and perform de-redundancy processing on the frequency domain signal of the initial audio to be detected according to the first audio scene to obtain the audio to be detected, wherein the sound event corresponding to the audio to be detected belongs to the sound event corresponding to the first audio scene.
[0315] In another possible implementation, the processing unit 1710 is also used to: perform Fourier transform processing on the acquired time domain signal of the initial audio to be detected to obtain the frequency domain signal of the initial audio to be detected, so as to obtain the audio to be detected, wherein the audio to be detected is the frequency domain signal of the initial audio to be detected.
[0316] In another possible implementation, the processing unit 1710 is further used to: obtain a labeled audio based on the original audio to be trained, wherein the original audio to be trained includes L audio clips, each audio clip corresponds to at least one type of audio event, and the labeled audio includes N first audios corresponding to the N types of target audio events, the audio clip in each first audio belongs to the target audio event of the corresponding type, the audio clip in each first audio corresponding to each type of target audio event is the first audio clip, the first audio clip is the audio clip belonging to the corresponding type of target audio event in the L audio clips, the position of the first audio clip in each of the first audios represents the position of the first audio clip in the original audio to be trained, and L is a positive integer; perform T noise addition processing on the labeled audio to obtain T first noise-added audios, wherein each first noise-added audio is a second noise-added audio corresponding to each first noise-added audio. The audio is obtained by performing noise processing, the second noise-added audio input for the first noise-added processing is the label audio, the first noise-added audio output for the Tth noise-added processing is the audio to be trained, and the audio to be trained includes N original audios to be trained; when T is an integer greater than 1, the second noise-added audio input for the jth noise-added processing is the output for the j-1th noise-added processing, and j is a positive integer greater than 1; the audio to be trained is subjected to T denoising processing using the initial sound event detection model to obtain a third noise-added audio corresponding to each second noise-added audio, wherein the sum of the number of noise-added processings performed on each second noise-added audio and the number of denoising processings performed on each third noise-added audio corresponding to the second noise-added audio is T; and the parameters of the initial sound event detection model are adjusted according to the difference between each second noise-added audio and each third noise-added audio corresponding to the second noise-added audio, so as to obtain the sound event detection model.
[0317] In another possible implementation, the sound event detection model includes a noise addition module and a denoising module, the initial sound event detection model includes the noise addition module and the initial denoising module, and; the processing unit 1710 is also used to: use the noise addition module to perform the T noise addition processing on the label audio to obtain the T first noisy audios; use the initial denoising module to perform the T denoising processing on the audio to be trained to obtain the third noisy audio corresponding to each second noisy audio; adjust the parameters of the initial denoising module according to the difference between each second noisy audio and each third noisy audio corresponding to the second noisy audio, obtain the denoising module, and obtain the sound event detection model.
[0318] In another possible implementation, the processing unit 1710 is further configured to: utilize the denoising module to perform the denoising process M times on the audio to be detected to obtain the sound event detection result.
[0319] It should be noted that the above-mentioned sound event detection device 1700 is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0320] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.
[0321] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0322] Fig.18 1 is a schematic diagram of the hardware 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.
[0323] It is to be understood that the hardware 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 certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0324] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. For example, the processor 110 is used to execute the sound event detection method in the embodiment of the present application.
[0325] 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.
[0326] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and an application required for at least one function (such as an image playback function, etc.). The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0327] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information. For example, the process of rendering YUV data in the embodiment of the present application can be implemented by a GPU.
[0328] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or more display screens 194. For example, in the embodiments of the present application, Figure 8B The interfaces shown are all displayed by the monitor.
[0329] The present application also provides a computer program product, which, when executed by an electronic device, implements the method of any method embodiment in the present application.
[0330] The computer program product may be stored in a memory, for example, a program, which is finally converted into an executable target file that can be executed by an electronic device after preprocessing, compiling, assembling and linking.
[0331] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by an electronic device, the method of any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.
[0332] The present application also provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes a method of any method embodiment in the present application.
[0333] In this application, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0334] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0335] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0336] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0337] 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 merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, 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.
[0338] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0339] 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.
[0340] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present 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 sound event detection method, characterized in that: The method comprises: Get the audio to be detected; Using the sound event detection model, the audio to be detected is subjected to M denoising processes to obtain a sound event detection result, wherein the sound event detection result includes an audio segment in the audio to be detected that belongs to each type of target audio event in N types of target audio events, and a position of the audio segment in the audio to be detected, where M is a positive integer; The input of the first denoising process is the audio to be detected, and the output of the Mth denoising process is the sound event detection result; when M is an integer greater than 1, the input of the i-th denoising process is the output of the i-1th denoising process, and i is a positive integer greater than 1; Wherein, the sound event detection model is a neural network model obtained by training the initial sound event detection model; Before performing M denoising processes on the audio to be detected using the sound event detection model to obtain a sound event detection result, the method further includes: Obtain a labeled audio according to the original audio to be trained, wherein the original audio to be trained includes L audio clips, each audio clip corresponds to at least one type of audio event, the labeled audio includes N first audios corresponding to the N types of target audio events, the audio clip in each first audio belongs to the target audio event of the corresponding type, the audio clip in each first audio corresponding to each type of target audio event is the first audio clip, the first audio clip is the audio clip belonging to the corresponding type of target audio event among the L audio clips, the position of the first audio clip in each of the first audios represents the position of the first audio clip in the original audio to be trained, and L is a positive integer; Perform T times of noise addition processing on the label audio to obtain T first noise-added audios, wherein each first noise-added audio is obtained by performing noise addition processing on the second noise-added audio corresponding to each first noise-added audio, the second noise-added audio input to the first noise addition processing is the label audio, and the first noise-added audio output from the Tth noise addition processing is the audio to be trained, and the audio to be trained includes N original audios to be trained; when T is an integer greater than 1, the second noise-added audio input to the jth noise addition processing is the output of the j-1th noise addition processing, and j is a positive integer greater than 1; Using the initial sound event detection model, perform T denoising processes on the audio to be trained to obtain a third noisy audio corresponding to each second noisy audio, wherein the sum of the number of denoising processes performed on each second noisy audio and the number of denoising processes performed on the third noisy audio corresponding to each second noisy audio is T; According to the difference between each of the second noisy frequencies and the third noisy frequencies corresponding to each of the second noisy frequencies, the parameters of the initial sound event detection model are adjusted to obtain the sound event detection model.
2. The method according to claim 1, characterized in that: When N is equal to 1, the audio to be detected is the original audio to be detected; When N is an integer greater than 1, the audio to be detected is audio obtained by splicing N original audios to be detected.
3. The method according to claim 1 or 2, characterized in that: The method of performing M denoising processes on the audio to be detected by using the sound event detection model to obtain a sound event detection result includes: The sound event detection model is used to perform the M denoising processes on the audio to be detected based on condition information to obtain the sound event detection result, wherein the condition information includes information determined based on the audio to be detected.
4. The method according to claim 3, characterized in that The condition information specifically includes the audio to be detected and the number of times of denoising processing.
5. The method according to claim 1 or 2, characterized in that: The step of obtaining the audio to be detected includes: Performing scene recognition on the acquired initial audio to be detected, and determining that the audio scene of the initial audio to be detected is a first audio scene, wherein the initial audio to be detected is audio in the time domain; According to the first audio scene, de-redundancy processing is performed on the initial audio to be detected to obtain the audio to be detected, wherein the sound event corresponding to the audio to be detected belongs to the sound event corresponding to the first audio scene.
6. The method according to claim 1 or 2, characterized in that: The step of obtaining the audio to be detected includes: Performing scene recognition on the acquired time domain signal of the initial audio to be detected, and determining that the audio scene of the time domain signal of the initial audio to be detected is a first audio scene; Performing Fourier transform processing on the time domain signal of the initial audio to be detected to obtain the frequency domain signal of the initial audio to be detected; According to the first audio scene, redundancy removal processing is performed on the frequency domain signal of the initial audio to be detected to obtain the audio to be detected, wherein the sound event corresponding to the audio to be detected belongs to the sound event corresponding to the first audio scene.
7. The method according to claim 1 or 2, characterized in that: The step of obtaining the audio to be detected includes: Performing Fourier transform processing on the acquired time domain signal of the initial audio to be detected to obtain the frequency domain signal of the initial audio to be detected, so as to obtain the audio to be detected, wherein the audio to be detected is the frequency domain signal of the initial audio to be detected.
8. The method according to claim 1 or 2, characterized in that: The sound event detection model includes a noise adding module and a noise removing module, the initial sound event detection model includes the noise adding module and the initial noise removing module, and; The step of performing T noise addition processing on the label audio to obtain T first noise addition audios includes: Using the noise adding module to perform the T noise adding processes on the label audio to obtain the T first noise adding audios; The method of performing T denoising processes on the audio to be trained by using the initial sound event detection model to obtain a third noisy audio corresponding to each second noisy audio comprises: Using the initial denoising module to perform the T denoising processes on the audio to be trained, so as to obtain a third noisy audio corresponding to each of the second noisy audios; The step of adjusting the parameters of the initial sound event detection model according to the difference between each of the second noisy frequencies and the third noisy frequencies corresponding to each of the second noisy frequencies to obtain the sound event detection model comprises: According to the difference between each of the second noisy frequencies and the third noisy frequencies corresponding to each of the second noisy frequencies, the parameters of the initial denoising module are adjusted to obtain the denoising module, so as to obtain the sound event detection model.
9. The method according to claim 8, characterized in that The method of performing M denoising processes on the audio to be detected by using the sound event detection model to obtain a sound event detection result includes: The denoising module is used to perform the denoising process M times on the audio to be detected to obtain the sound event detection result.
10. An electronic device, characterized in that: It comprises one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer programs, and when the one or more processors execute the computer programs, the electronic device executes the method as described in any one of claims 1-9.
11. A chip system, the chip system is applied to electronic equipment, the chip system comprises one or more processors, characterized in that: The processor is used to call computer instructions so that the electronic device executes the method as described in any one of claims 1-9.
12. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 9.
