Sound event detection method, device, electronic device and storage medium

Through the target convolutional neural network model and semi-supervised learning, combined with feature encoders and adaptive window size filters, the problem of poor detection results of sound event detection methods in complex application scenarios is solved, and detection accuracy and flexibility are improved. It reduces the cost of manual annotation.

CN115240647BActive Publication Date: 2024-10-22NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210699407.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-20
Publication Date
2024-10-22
Estimated Expiration
2042-06-20

AI Technical Summary

Technical Problem

Existing sound event detection methods have poor detection results in complex application scenarios, especially due to the lack of data sets, environmental noise and overlap of sound events, resulting in low detection accuracy. In addition, existing methods have problems with low detection accuracy, which have not yet been effectively solved. plan.

Method used

A target convolutional neural network model is used for sound event detection. Two convolutional neural network models are trained using unlabeled data and weakly labeled data through semi-supervised learning, combined with feature encoders, embedding-level attention layers and adaptive window size filtering. device to improve the accuracy and flexibility of detection results.

Benefits of technology

It improves detection accuracy and flexibility when facing complex problems and changing environments, enhances detection capabilities for complex application scenarios, and reduces manual labeling costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115240647B_ABST
    Figure CN115240647B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a sound event detection method, device, electronic device and storage medium. The method uses a target convolutional neural network model to detect sound events, and improves the ability of two convolutional neural network models to learn alternately through semi-supervised learning, and uses a filter with an adaptive window size to post-process the output prediction probability result of the target convolutional neural network model, thereby finally detecting the result. Through the present invention, the technical problem that the sound event detection method in the related art has poor detection effect in complex application scenarios is solved, and the technical effect of improving flexibility, adaptability and detection accuracy when facing complex problems and changing environments is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of speech recognition technology, and in particular to a sound event detection method, device, electronic equipment and storage medium. Background Art

[0002] Sound event detection is the task of detecting and classifying segments with specific semantics in audio clips. Sound event detection is a very practical technology with broad application prospects in the fields of medical care, manufacturing, transportation, safety monitoring, agriculture, forestry, animal husbandry and fishery, water conservancy, environment and public facilities management, identity recognition, military, etc. With the development of deep learning, research in this field has made great progress, but the development is still in its early stages and still faces many challenges. First, there is a lack of data sets. In order to ensure the accuracy of sound event detectors, a large amount of data with timestamps and event labels is usually required for training. However, such annotations with event labels and timestamps are usually generated by manual annotation, which is costly. Therefore, how to use data without timestamps as much as possible to reduce the workload of manual annotation while ensuring the accuracy of recognition results is a major problem in this field. Second, environmental noise. Due to the complexity and diversity of the environment, audio in real scenes often contains large noise, which will have a negative impact on the detection effect. Third, the overlap of sound events. In the task of multi-sound event detection, two or more events can be detected at the same time at each moment. Overlap causes aliasing in different event regions in the spectrogram, making it difficult to detect all events at the same time. In addition, due to the complexity and variability of audio clips extracted from real scenes, existing sound event detection methods still have some shortcomings, such as low detection accuracy.

[0003] To address the above-mentioned problems, no effective solutions have been proposed yet. Summary of the invention

[0004] The embodiments of the present invention provide a sound event detection method, device, electronic device and storage medium to at least solve the technical problem that the sound event detection method in the related art has poor detection effect in complex application scenarios.

[0005] According to one aspect of an embodiment of the present invention, a sound event detection method is provided, comprising: obtaining a Mel feature map of each audio segment, and extracting a feature vector from the Mel feature map and inputting it into a target convolutional neural network model, wherein each audio segment is divided into T frames of equal length, and the target convolutional neural network model is obtained by training a first convolutional neural network model and a second convolutional neural network model based on semi-supervised learning using unlabeled data and weakly labeled data of multiple audio segments; converting the feature vector into a high-level feature representation based on a feature encoder, wherein the high-level feature representation is as follows: X = {x1, ..., xT}, where T represents the number of frames of the audio clip, and the high-level feature corresponding to the t-th frame in X is represented as x t , t∈[1,T], x t The dimension is c, where c represents the number of types of sound events; an attention vector is obtained based on the embedding-level attention layer, where the attention vector is the x corresponding to X for each sound event category. t Assign different weights; obtain a contextual representation of each sound event category, wherein the contextual representation is the product of a high-level feature representation of each frame and a corresponding weight; input the contextual representation into a classifier to obtain a segment-level prediction probability, and determine a segment-level prediction result based on the segment-level prediction probability; determine a frame-level prediction result based on the segment-level prediction result and the frame-level prediction probability; post-process the segment-level prediction result and / or the frame-level prediction result based on a filter of an adaptive window size to obtain a final detection result.

[0006] Optionally, the weight is expressed as follows: Among them, a ct represents x with dimension c t The corresponding weights, represents the trainable vector, b c represents the trainable bias and k represents the dimension of X.

[0007] Optionally, the expression represented by the context is as follows: Among them, h c represents x with dimension c t The corresponding context representation, a ct represents x with dimension c t The corresponding weight, k represents the dimension of X, t∈[1,T].

[0008] Optionally, determining a fragment-level prediction result based on the fragment-level prediction probability includes: judging whether the fragment-level prediction probability is greater than or equal to a first prediction threshold; when the fragment-level prediction probability is greater than or equal to the first prediction threshold, obtaining the fragment-level prediction result that a sound event exists in the audio fragment; and when the fragment-level prediction probability is less than the first prediction threshold, obtaining the fragment-level prediction result that no sound event exists in the audio fragment.

[0009] Optionally, determining the frame level prediction result based on the fragment level prediction result and the frame level prediction probability includes: judging whether a target value is greater than or equal to a second prediction threshold, wherein the target value is the product of the fragment level prediction result and the frame level prediction probability; if the target value is greater than or equal to the second prediction threshold, then the frame level prediction result is that there is a sound event in the target frame of the audio fragment; if the target value is less than the second prediction threshold, then the frame level prediction result is that there is no sound event in the target frame of the audio fragment.

[0010] Optionally, the expression of the adaptive window size is as follows: S win =duration avg *β, where S win Indicates the adaptive window size, duration avg represents the average duration of each event category, and β represents a predetermined parameter.

[0011] Optionally, the fragment-level prediction results and / or the frame-level prediction results are post-processed by a filter based on an adaptive window size to obtain a final detection result. The method also includes: manually annotating the detection results in the final detection result that are less than or equal to a preset confidence level to obtain an annotated result; integrating the annotated result with the final detection result based on the Fisher criterion and calculating a new attention weight; and adjusting the target convolutional neural network model according to the new attention weight.

[0012] According to another aspect of an embodiment of the present invention, a sound event detection device is also provided, including: a first processing unit, used to obtain a Mel feature map of each audio segment, and extract a feature vector from the Mel feature map to input into a target convolutional neural network model, wherein each of the audio segments is divided into T frames of equal length, and the target convolutional neural network model is obtained by training a first convolutional neural network model and a second convolutional neural network model based on semi-supervised learning using unlabeled data and weakly labeled data of multiple audio segments; a second processing unit, used to convert the feature vector into a high-level feature representation based on a feature encoder, wherein the high-level feature representation is as follows: X = {x1, ..., x T}, where T represents the number of frames of the audio clip, and the high-level feature corresponding to the t-th frame in X is represented as x t , t∈[1,T],x t The dimension is c, where c represents the number of types of sound events; a third processing unit is used to obtain an attention vector based on the embedding level attention layer, wherein the attention vector is the x corresponding to X in each sound event category tAssign different weights; a fourth processing unit, used to obtain a contextual representation of each sound event category, wherein the contextual representation is the product of a high-level feature representation of each frame and a corresponding weight; a fifth processing unit, used to input the contextual representation into a classifier to obtain a fragment-level prediction probability, and determine a fragment-level prediction result based on the fragment-level prediction probability; a sixth processing unit, used to determine a frame-level prediction result based on the fragment-level prediction result and the frame-level prediction probability; a seventh processing unit, used to post-process the fragment-level prediction result and / or the frame-level prediction result based on a filter with an adaptive window size to obtain a final detection result.

[0013] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute any one of the method steps described above.

[0014] According to another aspect of an embodiment of the present invention, a storage medium is further provided, wherein the storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute any one of the method steps described above.

[0015] In an embodiment of the present invention, a Mel feature map of each audio clip is obtained, and a feature vector is extracted from the Mel feature map and input into a target convolutional neural network model, wherein each audio clip is divided into T frames of equal length, and the target convolutional neural network model is obtained by training a first convolutional neural network model and a second convolutional neural network model respectively using unlabeled data and weakly labeled data of multiple audio clips based on semi-supervised learning; the feature vector is converted into a high-level feature representation based on a feature encoder, wherein the high-level feature representation is as follows: X = {x1, ..., x T}, where T represents the number of frames in the audio clip, and the high-level feature corresponding to the t-th frame in X is represented as x t , t∈[1,T], x t The dimension is c, where c represents the number of sound event types; the attention vector is obtained based on the embedding-level attention layer, where the attention vector is the corresponding x in X for each sound event category. tAssign different weights; obtain the contextual representation of each sound event category, wherein the contextual representation is the product of the high-level feature representation of each frame and the corresponding weight; input the contextual representation into the classifier to obtain the segment-level prediction probability, and determine the segment-level prediction result according to the segment-level prediction probability; determine the frame-level prediction result according to the segment-level prediction result and the frame-level prediction probability; post-process the segment-level prediction result and / or the frame-level prediction result based on the filter of adaptive window size to obtain the final detection result. That is to say, the embodiment of the present invention adopts the target convolutional neural network model for sound event detection, and improves the ability of the two convolutional neural network models to learn alternately through semi-supervised learning, and uses the filter of adaptive window size to post-process the output prediction probability result of the target convolutional neural network model, thereby obtaining the final detection result, thereby solving the technical problem that the sound event detection method in the related art has poor detection effect in complex application scenarios, and achieves the technical effect of improving flexibility, adaptability and detection accuracy when facing complex problems and changing environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0017] Figure 1 A flow chart of a sound event detection method provided by an embodiment of the present invention;

[0018] Figure 2 A framework diagram of human-machine collaborative sound event detection provided by an embodiment of the present invention;

[0019] FIG3( a ) is a schematic diagram of a PT-model provided in an embodiment of the present invention;

[0020] FIG3( b ) is a schematic diagram of a PS-model provided in an embodiment of the present invention;

[0021] FIG3( c ) is a schematic diagram of a CNN module provided in an embodiment of the present invention;

[0022] Figure 4 A framework diagram of a convolutional neural network model provided by an embodiment of the present invention;

[0023] Figure 5 A schematic diagram of a sound event detection device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second" and the like in the specification, claims and drawings of the present invention are used to distinguish different objects rather than to limit a specific order.

[0026] According to one aspect of an embodiment of the present invention, a sound event detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.

[0027] Figure 1 A flow chart of a sound event detection method provided by an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0028] Step S102, obtaining a Mel feature map of each audio clip, and extracting a feature vector from the Mel feature map and inputting it into a target convolutional neural network model, wherein each audio clip is divided into T frames of equal length, and the target convolutional neural network model is obtained by training a first convolutional neural network model and a second convolutional neural network model respectively based on semi-supervised learning using unlabeled data and weakly labeled data of multiple audio clips;

[0029] The above Mel feature map can be transformed into a feature vector using Fourier transform.

[0030] It should be noted that the first convolutional neural network model and the second convolutional neural network model are different types of models, and an embedding-level attention layer is respectively provided in the two models. Optionally, the first convolutional neural network model can be a PT-model, and the second convolutional neural network model can be a PS-model. Traditional sound event detection methods usually complete two sub-goals in one model, so it is necessary to determine a suitable compression scale to weigh the performance of the two sub-tasks of audio annotation and boundary detection, which limits the boundary detection capability of the system. The present invention uses two different models to execute the two sub-goals respectively. The PT-model has a larger sequence sampling amount and a smaller trainable parameter, and has better performance in audio annotation. The PS-model has a smaller sequence sampling amount, can see more detailed information, and has better performance in boundary detection. And an end-to-end semi-supervised learning method is used to alternately improve the learning ability of the two models, improve the training speed, and reduce the training cost.

[0031] Step S104: converting the feature vector into a high-level feature representation based on the feature encoder, wherein the high-level feature representation is as follows: X = {x1, ..., x T}, where T represents the number of frames in the audio clip, and the high-level feature corresponding to the t-th frame in X is represented as x t , t∈[1,T], x t The dimension is c, where c represents the number of types of sound events;

[0032] Step S106, obtaining an attention vector based on the embedding level attention layer, wherein the attention vector is the x corresponding to X in each sound event category t Assign different weights;

[0033] In an optional implementation, the above weight is expressed as follows: Among them, a ct represents x with dimension c t The corresponding weights, represents the trainable vector, b c represents the trainable bias and k represents the dimension of X.

[0034] Step S108, obtaining a context representation of each sound event category, wherein the context representation is the product of the high-level feature representation of each frame and the corresponding weight;

[0035] In an optional implementation, the expression represented by the above context is as follows: Among them, h c represents x with dimension c t The corresponding context representation, a ct represents x with dimension c tThe corresponding weight, k represents the dimension of X, t∈[1,T].

[0036] Step S110, inputting the context representation into a classifier to obtain a segment-level prediction probability, and determining a segment-level prediction result according to the segment-level prediction probability;

[0037] In an optional embodiment, the fragment-level prediction result is determined according to the fragment-level prediction probability, including: judging whether the fragment-level prediction probability is greater than or equal to a first prediction threshold; when the fragment-level prediction probability is greater than or equal to the first prediction threshold, the fragment-level prediction result is that there is a sound event in the audio fragment; when the fragment-level prediction probability is less than the first prediction threshold, the fragment-level prediction result is that there is no sound event in the audio fragment.

[0038] Step S112, determining a frame-level prediction result according to the segment-level prediction result and the frame-level prediction probability;

[0039] In an optional embodiment, the frame-level prediction result is determined based on the fragment-level prediction result and the frame-level prediction probability, including: judging whether a target value is greater than or equal to a second prediction threshold, wherein the target value is the product of the fragment-level prediction result and the frame-level prediction probability; if the target value is greater than or equal to the second prediction threshold, the frame-level prediction result is that a sound event exists in the target frame of the audio fragment; if the target value is less than the second prediction threshold, the frame-level prediction result is that no sound event exists in the target frame of the audio fragment.

[0040] It should be noted that the first prediction threshold and the second prediction threshold can be set according to the needs of the application scenario and are not limited here. In addition, the frame-level prediction result and the segment-level prediction result are 1 when there is a sound event or 0 when there is no sound event.

[0041] Step S114, post-processing the segment-level prediction result and / or the frame-level prediction result based on the filter of the adaptive window size to obtain a final detection result.

[0042] In an optional implementation, the expression of the adaptive window size is as follows: win =duration avg *β, where S win Indicates adaptive window size, duration avg represents the average duration of each event category, and β represents a predetermined parameter, which can be 0.2, 0.3, 0.5, etc.

[0043] In the above embodiment of the present invention, a target convolutional neural network model is used to detect sound events, and semi-supervised learning is used to improve the ability of the two convolutional neural network models to learn alternately. A filter with an adaptive window size is used to post-process the output prediction probability result of the target convolutional neural network model, thereby obtaining the final detection result. This solves the technical problem that the sound event detection method in the related art has poor detection effect in complex application scenarios, and achieves the technical effect of improving flexibility, adaptability and detection accuracy when facing complex problems and changing environments.

[0044] In an optional embodiment, the fragment-level prediction results and / or frame-level prediction results are post-processed by a filter based on an adaptive window size to obtain a final detection result. The method further includes: manually annotating the detection results in the final detection result that are less than or equal to a preset confidence level to obtain an annotated result; integrating the annotated result with the final detection result based on the Fisher criterion, and calculating a new attention weight; and adjusting the target convolutional neural network model according to the new attention weight.

[0045] It should be noted that traditional sound event detection has great limitations under complex conditions. Considering that the recognition results of the machine in real-life scenarios cannot achieve the expected performance, it is necessary to make full use of human intelligence to fine-tune the recognition results of the machine to obtain better performance. In the above-mentioned embodiment of the present invention, some low-confidence detection results are manually annotated, and the feedback information is integrated and calculated according to the Fisher criterion, and the parameters in the target convolutional neural network model are fine-tuned, which further improves the detection accuracy.

[0046] An optional embodiment of the present invention is described in detail below.

[0047] An optional embodiment of the present invention provides a method for detecting sound events based on human-machine collaboration, which improves flexibility and adaptability when facing complex problems and changing environments by combining human intelligence with machine intelligence.

[0048] Figure 2 A framework diagram of human-machine collaborative sound event detection provided by an embodiment of the present invention, such as Figure 2As shown in the figure, the specific process combined with the framework diagram is as follows: first, two convolutional neural network (CNN) models with embedding-level attention layers are used to process weakly labeled sound event detection, and semi-supervised learning with end-to-end guided learning is used to improve the ability of the two models to learn alternately. A set of filters with adaptive window sizes are used to post-process the output prediction probability of the model, and an interactive human-computer interaction sound event detection annotation interface is developed based on HTML and JavaScript technology. The annotator selects samples from the candidate fragments, and finally the model is adjusted and optimized based on the results of machine recognition and manual annotation feedback to achieve the complementary advantages of humans and machines and further improve the detection accuracy.

[0049] Among them, the above two models are PT-model and PS-model, which are trained using unlabeled data and weakly labeled data of audio clips.

[0050] Figure 3(a) is a schematic diagram of the PT-model provided by an embodiment of the present invention. As shown in Figure 3(a), the Mel feature map is processed through a normalization layer, a CNN module, a CNN module, a pooling layer, a dropout layer, a CNN module, a CNN module, a pooling layer, a dropout layer, a CNN module, a CNN module, a pooling layer, a dropout layer, a CNN module, a CNN module, a pooling layer, a dropout layer, a CNN module, a CNN module, an attention layer and an aggregation layer, so that the frame-level prediction probability and the fragment-level prediction probability can be obtained.

[0051] Figure 3(b) is a schematic diagram of the PS-model provided by an embodiment of the present invention. As shown in Figure 3(b), the feature vector passes through a normalization layer, a CNN module, a pooling layer, a CNN module, a pooling layer, a CNN module, a pooling layer, an attention layer and an aggregation layer, so that the frame-level prediction probability and the fragment-level prediction probability can be obtained.

[0052] Figure 3(c) is a schematic diagram of a CNN module provided in an embodiment of the present invention. As shown in Figure 3(c), the CNN module includes a Relu activation layer, a normalization layer and a CNN, wherein the normalization layer is arranged between the Relu activation layer and the CNN.

[0053] Figure 4 A framework diagram of a convolutional neural network model provided by an embodiment of the present invention, such as Figure 4 As shown, the specific steps combined with the framework diagram are as follows:

[0054] Step 1: Get the Mel feature map of each input audio clip, divide each audio clip into T frames of equal length, extract the feature vector and input it into the convolutional neural network model.

[0055] Step 2: The feature encoder converts the feature vector into a high-level feature representation through a series of convolution operations, which is represented as follows:

[0056] X={x1,…,x T}

[0057] Where T represents the number of frames of the audio clip. Assume x T The dimension is c, where c is the number of types of sound events.

[0058] Step 3: Get the attention vector through the embedding-level attention layer. The expression is as follows:

[0059]

[0060] Where c is the dimension of the vector in the high-level feature representation X, is a trainable vector, b c is a trainable bias. The attention vector is the corresponding x in X for each sound event category t Assigning different weights makes the model process each frame differently.

[0061] Step 4: Input the fully connected layer to obtain the contextual representation of each sound event category, which is calculated by multiplying the high-level feature representation of each frame by the corresponding weight.

[0062]

[0063] From the formula, we can see that x t The more important it is, the higher the corresponding weight.

[0064] Step 5: Input the context representation into the classifier to obtain the segment-level prediction probability. f(X) is the segment-level probability, and α is the prediction threshold. When the prediction probability is greater than or equal to α, it is considered that a sound event exists in the segment; otherwise, it is considered that the sound event does not exist in the segment. The expression is as follows:

[0065]

[0066] Step 6: Multiply the segment-level prediction result by the frame-level prediction probability to obtain the frame-level prediction result, f′ t (X) is the frame-level prediction probability, and β is the threshold of the prediction probability, for example, β is 0.3.

[0067]

[0068] If and only if φ c When the value of (X) is 1, the frame-level prediction result may be 1.

[0069] Step 7: Post-process the frame-level prediction results and / or the fragment-level prediction results using a set of filters with adaptive window sizes to obtain the final detection results. Post-processing can effectively filter out some noise and eliminate some short and messy outputs. The calculation formula for the window size is:

[0070] S win =duration avg *β

[0071] Among them, duration avg β is a parameter that represents the average duration of each event category.

[0072] Step 8: Use the guided learning semi-supervised learning framework to make the two neural network models PS-model and PT-model learn alternately. Assume that x j is the training input with index j, s j and t j Input x for PS-model and PT-model j The segment-level prediction probability, y j Enter x for weak tag j The corresponding true value, label training process is as follows:

[0073] Before the sth round of iterations, if the input x j It is weakly labeled data, and the true value of the label is used to calculate the loss function to update the network weights. The loss function is as follows:

[0074] L supervised = J(y j ,s j )+J(y j ,t j )

[0075] Here, cross entropy is used as the loss function J. If x j It belongs to unlabeled data. Since the audio labeling performance of PT-model is better than that of PS-model, PS-model can be improved by the following loss:

[0076] L unsupervised = J(φ c (t k ),s k )

[0077] At the beginning of training, due to the poor performance of PS-model, PT-model is simply updated using supervised loss, while PS-model is updated under the guidance of PT-model and supervised loss to prevent PS-model from being affected by the noisy labels generated by PT-model. After several stages of training, the performance of PS-model on audio tagging has been greatly improved, and PT-model is stable enough to be fine-tuned using unsupervised loss, with the following loss function:

[0078] L′ unsupervised = J(φ c (s j ),t j )

[0079] Before the s-round iteration, the loss function used is as follows:

[0080] L before =L supervised +L unsupervised

[0081] After s rounds of iterations, the loss function used is as follows:

[0082] L before =L before +a·L′ unsupervised

[0083] Step 9: Feedback some of the less reliable machine output results to the annotators for manual judgment and correction, integrate the manual annotations with the machine output results based on the Fisher criterion, and use the final feedback to adjust and optimize the model.

[0084] The integration strategy is as follows:

[0085]

[0086] Among them, f i p and f i n are the sum of the number of positive and negative marks of the ith feature vector in the audio clip, std() is the standard deviation, p is the positive mark, and n is the negative mark. Then the attention vector a(i) is adjusted according to w(i), and the new attention weight y(i) is calculated as:

[0087]

[0088] Among them, τ is a free parameter and q is a fixed parameter used to normalize w(i) and a(i).

[0089] According to another aspect of the embodiments of the present invention, a sound event detection device is provided. Figure 5 A schematic diagram of a sound event detection device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the sound event detection device includes: a first processing unit 502, a second processing unit 504, a third processing unit 506, a fourth processing unit 508, a fifth processing unit 510, a sixth processing unit 512 and a seventh processing unit 514. The sound event detection device is described in detail below.

[0090] A first processing unit 502 is used to obtain a Mel feature map of each audio clip, and extract a feature vector from the Mel feature map to input into a target convolutional neural network model, wherein each audio clip is divided into T frames of equal length, and the target convolutional neural network model is obtained by training a first convolutional neural network model and a second convolutional neural network model respectively based on semi-supervised learning using unlabeled data and weakly labeled data of multiple audio clips;

[0091] The second processing unit 504 is connected to the first processing unit 502 and is used to convert the feature vector into a high-level feature representation based on the feature encoder, wherein the high-level feature representation is as follows: X = {x1, ..., x T}, where T represents the number of frames in the audio clip, and the high-level feature corresponding to the t-th frame in X is represented as x t , t∈[1,T],x t The dimension is c, where c represents the number of types of sound events;

[0092] The third processing unit 506 is connected to the second processing unit 504 and is used to obtain an attention vector based on the embedding level attention layer, wherein the attention vector is the x corresponding to X of each sound event category. t Assign different weights;

[0093] A fourth processing unit 508, connected to the third processing unit 506, for obtaining a context representation of each sound event category, wherein the context representation is a product of a high-level feature representation of each frame and a corresponding weight;

[0094] a fifth processing unit 510, connected to the fourth processing unit 508, configured to input the context representation into the classifier, obtain the segment-level prediction probability, and determine the segment-level prediction result according to the segment-level prediction probability;

[0095] a sixth processing unit 512, connected to the fifth processing unit 510, configured to determine a frame-level prediction result according to the segment-level prediction result and the frame-level prediction probability;

[0096] The seventh processing unit 514 is connected to the sixth processing unit 512, and is used to post-process the segment-level prediction result and / or the frame-level prediction result based on a filter of an adaptive window size to obtain a final detection result.

[0097] In the above embodiment of the present invention, the sound event detection device adopts a target convolutional neural network model to detect sound events, and improves the ability of the two convolutional neural network models to learn alternately through semi-supervised learning, and uses a filter with an adaptive window size to post-process the output prediction probability result of the target convolutional neural network model, thereby finally detecting the result, thereby solving the technical problem that the sound event detection method in the related technology has poor detection effect in complex application scenarios, and achieving the technical effect of improving flexibility, adaptability and detection accuracy when facing complex problems and changing environments.

[0098] It should be noted here that the above-mentioned first processing unit 502, second processing unit 504, third processing unit 506, fourth processing unit 508, fifth processing unit 510, sixth processing unit 512 and seventh processing unit 514 correspond to steps S102 to S114 in the method embodiment, and the examples and application scenarios implemented by the above-mentioned modules are the same as those of the corresponding steps, but are not limited to the contents disclosed in the above-mentioned method embodiment.

[0099] In an optional implementation, the above weight is expressed as follows: Among them, a ct represents x with dimension c t The corresponding weights, represents the trainable vector, b c represents the trainable bias and k represents the dimension of X.

[0100] In an optional implementation, the expression represented by the above context is as follows: Among them, h c represents x with dimension c t The corresponding context representation, a ct represents x with dimension c t The corresponding weight is t∈[1,T].

[0101] In an optional embodiment, the fifth processing unit 510 includes: a first judgment subunit, used to judge whether the fragment-level prediction probability is greater than or equal to a first prediction threshold; a first processing subunit, used to obtain a fragment-level prediction result that there is a sound event in the audio fragment when the fragment-level prediction probability is greater than or equal to the first prediction threshold; and a second processing subunit, used to obtain a fragment-level prediction result that there is no sound event in the audio fragment when the fragment-level prediction probability is less than the first prediction threshold.

[0102] In an optional embodiment, the above-mentioned sixth processing unit 512 includes: a second judgment subunit, used to judge whether the target value is greater than or equal to a second prediction threshold, wherein the target value is the product of the fragment-level prediction result and the frame-level prediction probability; a third processing subunit, used to obtain the frame-level prediction result that there is a sound event in the target frame of the audio fragment when the target value is greater than or equal to the second prediction threshold; and a fourth processing subunit, used to obtain the frame-level prediction result that there is no sound event in the target frame of the audio fragment when the target value is less than the second prediction threshold.

[0103] In an optional implementation, the expression of the adaptive window size is as follows: win =duration avg *β, where S win Indicates adaptive window size, duration avg represents the average duration of each event category, and β represents a predetermined parameter.

[0104] In an optional embodiment, the above-mentioned device also includes: an eighth processing unit, wherein the eighth processing unit includes: a fifth processing subunit, used to post-process the fragment-level prediction results and / or frame-level prediction results based on a filter of an adaptive window size to obtain a final detection result, and manually annotate the detection results in the final detection result that are less than or equal to a preset confidence to obtain an annotated result; a sixth processing subunit, used to integrate the annotated results with the final detection results based on the Fisher criterion, and calculate a new attention weight; and adjust the target convolutional neural network model according to the new attention weight.

[0105] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute any one of the above method steps.

[0106] According to another aspect of an embodiment of the present invention, a storage medium is further provided. The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute any one of the above method steps.

[0107] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0108] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0109] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. 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 units or modules, which can be electrical or other forms.

[0110] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0111] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0112] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0113] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A sound event detection method, characterized in that: include: Obtain a Mel feature map of each audio clip, and extract a feature vector from the Mel feature map and input it into a target convolutional neural network model, wherein each audio clip is divided into T frames of equal length, and the target convolutional neural network model is obtained by training a first convolutional neural network model and a second convolutional neural network model respectively based on semi-supervised learning using unlabeled data and weakly labeled data of multiple audio clips; The feature vector is converted into a high-level feature representation based on a feature encoder, wherein the high-level feature representation is as follows: X={x1,…,x T } Where T represents the number of frames of the audio clip, and the high-level feature corresponding to the t-th frame in X is represented as x t , t∈[1,T],x t The dimension is c, where c represents the number of types of sound events; The attention vector is obtained based on the embedding level attention layer, where the attention vector is the x corresponding to X for each sound event category. t Assign different weights; Obtaining a contextual representation of each sound event category, wherein the contextual representation is a product of a high-level feature representation of each frame and a corresponding weight; Inputting the context representation into a classifier to obtain a segment-level prediction probability, and determining a segment-level prediction result according to the segment-level prediction probability; Determining a frame-level prediction result according to the segment-level prediction result and the frame-level prediction probability; The segment-level prediction result and / or the frame-level prediction result are post-processed based on a filter with an adaptive window size to obtain a final detection result.

2. The method according to claim 1, characterized in that The expression of the weight is as follows: Among them, a ct represents x with dimension c t The corresponding weight, represents the trainable vector, b c represents the trainable bias and k represents the dimension of X.

3. The method according to claim 1, characterized in that The expression represented by the context is as follows: Among them, h c represents x with dimension c t The corresponding context representation, a ct represents x with dimension c t The corresponding weight, k represents the dimension of X, t∈[1,T].

4. The method according to claim 1, characterized in that: Determining a segment-level prediction result according to the segment-level prediction probability includes: Determining whether the segment-level prediction probability is greater than or equal to a first prediction threshold; When the segment-level prediction probability is greater than or equal to the first prediction threshold, the segment-level prediction result is obtained as that a sound event exists in the audio segment; When the segment-level prediction probability is less than the first prediction threshold, the segment-level prediction result is that there is no sound event in the audio segment.

5. The method according to claim 1, characterized in that Determining a frame-level prediction result according to the segment-level prediction result and the frame-level prediction probability includes: Determining whether a target value is greater than or equal to a second prediction threshold, wherein the target value is a product of the segment-level prediction result and the frame-level prediction probability; In the case that the target value is greater than or equal to the second prediction threshold, the frame-level prediction result is obtained as that a sound event exists in the target frame of the audio segment; When the target value is less than the second prediction threshold, the frame-level prediction result is that there is no sound event in the target frame of the audio segment.

6. The method according to claim 1, characterized in that The expression of the adaptive window size is as follows: S win =duration avg *b Among them, S win Indicates the adaptive window size, duration avg represents the average duration of each event category, and β represents a predetermined parameter.

7. The method according to any one of claims 1 to 6, characterized in that Post-processing the segment-level prediction result and / or the frame-level prediction result based on a filter of an adaptive window size to obtain a final detection result, the method further comprising: Manually marking the test results that are less than or equal to a preset confidence level in the final test results to obtain a marking result; Integrate the annotation result with the final detection result based on the Fisher criterion and calculate a new attention weight; The target convolutional neural network model is adjusted according to the new attention weights.

8. A sound event detection device, characterized in that: include: A first processing unit is used to obtain a Mel feature map of each audio clip, and extract a feature vector from the Mel feature map to input into a target convolutional neural network model, wherein each audio clip is divided into T frames of equal length, and the target convolutional neural network model is obtained by training a first convolutional neural network model and a second convolutional neural network model respectively based on semi-supervised learning using unlabeled data and weakly labeled data of multiple audio clips; The second processing unit is configured to convert the feature vector into a high-level feature representation based on a feature encoder, wherein the high-level feature representation is as follows: X={x1,…,x T } Where T represents the number of frames of the audio clip, and the high-level feature corresponding to the t-th frame in X is represented as x t , t∈[1,T],x t The dimension is c, where c represents the number of types of sound events; The third processing unit is used to obtain an attention vector based on the embedding level attention layer, wherein the attention vector is the x corresponding to X in each sound event category. t Assign different weights; a fourth processing unit, configured to obtain a context representation of each sound event category, wherein the context representation is a product of a high-level feature representation of each frame and a corresponding weight; a fifth processing unit, configured to input the context representation into a classifier to obtain a segment-level prediction probability, and determine a segment-level prediction result according to the segment-level prediction probability; a sixth processing unit, configured to determine a frame-level prediction result according to the segment-level prediction result and the frame-level prediction probability; The seventh processing unit is used to post-process the fragment-level prediction result and / or the frame-level prediction result based on a filter with an adaptive window size to obtain a final detection result.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method steps described in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method steps described in any one of claims 1 to 7.