Sound event detection method based on dual-branch discriminant feature neural network

Through the dual-branch discriminative feature network model, combined with the channel attention mechanism and CNN-Transformer, the problem of long tail and difficulty in distinguishing between categories in sound event detection is solved, and the accuracy of the classification task and model generalization performance are improved.

CN114881212BInactive Publication Date: 2024-09-06TIANJIN UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202210490907.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2024-09-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing sound event detection technology ignores the data distribution and characteristics of the data set in the classification task, resulting in increased recognition difficulty, misleading results and reduced classification accuracy, especially facing long-tail problems and difficulty in distinguishing between categories.

Method used

A dual-branch discriminative feature network model is designed. Through dual-branch sampling, feature extraction, dual-branch feature fusion and loss fusion, a CNN-Transformer model based on the channel attention mechanism is used, combined with uniform sampling and inverse sampling, and gradually reduces the The hyperparameter λ performs feature fusion, balances classifier weights, focuses on the features of uniform sampling and inverse sampling branches, and extracts more discriminative features.

Benefits of technology

It effectively solves the problem of long tail and difficulty in distinguishing between categories, improves the accuracy of classification tasks for sound event detection, and obtains better model generalization performance and prediction effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114881212B
    Figure CN114881212B
Patent Text Reader

Abstract

The invention discloses a sound event detection method based on a dual-branch discriminant feature neural network, including: extracting features from a data set containing a sound signal to obtain a data set of a log-mel spectrogram, and dividing it into a training set, a test set, and a validation set; establishing a dual-branch discriminant feature network model, the dual-branch discriminant feature network model includes dual-branch sampling, feature extraction, dual-branch feature fusion and loss fusion: the test set and the validation set are used as inputs of the trained model, and the output of the model is the result of the sound event detection of the data set, including the sound event category contained in the audio and the start and end time of the event. The present invention obtains the discriminant features of the tail class and the difficult-to-distinguish category by means of dual-branch discriminant feature fusion, and balances the category weights of the classifier to a certain extent, thereby improving the effect of sound event detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the design and application of a neural network model, and in particular to the application of a dual-branch discriminant feature neural network model. Background Art

[0002] In recent years, with the development of network technology, a large amount of audio data has emerged, and people have found that sound event detection technology can bring great help to human life. Sound events refer to some specific useful information contained in audio. For example, the sound of a car horn contains information about the car approaching, the sound of the alarm contains information about possible dangerous events around, and the sound of wind and rain contains information about the weather environment. The recognition of this information is very useful for human life.

[0003] In current research, researchers generally divide the sound event detection task into two subtasks: sound event classification and sound event localization. Sound event localization is generally achieved based on frame-level sound event classification. Therefore, the effect of sound event classification becomes an important determinant of the effect of sound event detection, so the classification task in sound event detection has important research value. The research in the field of sound event detection is relatively well developed, while there are still many challenges in the field of image recognition. First of all, sound event detection studies sound signals, which have various forms and are very random. Secondly, in real life, there will be multiple sound events in an audio, so the situation faced by sound event detection becomes very complicated, and the difficulty of recognition will increase significantly. In addition, because there was no large, complete and reliable data set in the early stage of sound event detection, the development of sound event detection was greatly restricted.

[0004] With the emergence of AudioSet and its sub-datasets for sound event detection in the fields of autonomous driving, smart home, and smart monitoring, people have gradually discovered that real-life sound datasets have data imbalance, high similarity between data categories, and multiple labels. However, current research on sound event detection has ignored these difficult classification phenomena caused by the data distribution and data characteristics of the dataset in terms of classification. These imaginations will increase the recognition difficulty of the model and produce misleading results, thereby reducing the accuracy of the classification task in sound event detection. How to improve the model, cater to the data distribution characteristics of the dataset, and improve the accuracy of the classification task in sound event detection is a shortcoming of the current existing sound event detection technology. Summary of the invention

[0005] In order to solve the above technical problems, the present invention proposes a sound event detection method based on a dual-branch discriminant feature network, which solves the long-tail problem and the problem of difficulty in distinguishing between categories through a dual-branch network. The dual-branch discriminant feature network model designed mainly includes dual-branch sampling, feature extraction, dual-branch feature fusion and loss fusion. The data set is uniformly sampled and inversely sampled as the input of the two branches of the model. A CNN-Transformer model based on a channel attention mechanism that fuses semantic features and spatial features is used to obtain more discriminative features of sound events in a more instructive manner. The features of the two branches are fused by the hyperparameter λ that gradually decreases with the learning process, and the weight of the classifier is better balanced on the basis of maintaining the extraction of discriminant features. As a result, the model pays more attention to the uniform sampling branch in the representation learning stage of the learning process, and gradually pays attention to the inverse sampling branch in the subsequent classification learning stage. In this branch fusion method, in terms of feature learning of the model, the general features are first paid attention to and then the features related to the categories of the latter two branches are paid attention to, so that the extracted features are more discriminative to the latter two branches. Thus, the long-tail problem and the problem of difficulty in distinguishing between categories are solved at the same time.

[0006] The present invention proposes a sound event detection method based on a dual-branch discriminant feature neural network, comprising the following steps:

[0007] Step 1: Data preprocessing: Extract features from the data set containing the sound signal to obtain a data set of log-mel spectrograms, and divide it into a training set, a test set, and a validation set according to a certain ratio;

[0008] Step 2: Establish a dual-branch discriminant feature network model, which includes dual-branch sampling, feature extraction, dual-branch feature fusion and loss fusion: the steps are as follows:

[0009] 2-1) Perform uniform sampling and inverse sampling on the training set to obtain training samples for the two branches;

[0010] 2-2) Using a CNN-Transformer model based on a channel attention mechanism to fuse semantic features and spatial features, the sound event features of the training samples of the two branches obtained in step 2-1) are extracted to obtain the features of the two branches;

[0011] 2-3) Using the hyperparameter that gradually decreases with the learning process, the features of the two branches obtained in step 2-2) are fused, and the loss functions of the two branches are calculated according to the fused features. The parameters of the model are modified by back propagation according to the loss function to complete the training of the model;

[0012] Step 3: Use the test set and validation set as input to the trained model. The output of the model is the result of sound event detection in the data set, including the sound event category contained in the audio and the start and end time of the event.

[0013] Furthermore, the sound event detection method of the present invention includes:

[0014] In the step 1, when extracting the log-mel spectrogram, all audio clips are converted to mono and resampled to 32kHz; then the spectrogram is extracted using a Hanning window with 1024 samples and a short-time Fourier transform of 320 samples, so that the spectrogram generates 100 frames within 1 second.

[0015] In the step 1, the data set of the log-mel spectrogram is divided into a training set, a test set, and a validation set in a ratio of 8:1:1 commonly used in deep learning, or can be divided as needed;

[0016] In step 2-1), set the training set D = {(x1, y1) ... (x n ,y n )}, where n is the number of samples in the training set; (x k ,y k ), and k∈(1,…n), represents the input of the sample and the label corresponding to the sample; in the uniform sampling, each sample in the training set is sampled once with the same probability within a training period, and the probability of sampling the samples in the training set is The uniformly sampled sample input and the label corresponding to the sample are recorded as (x u ,y u ); In the reverse sampling, samples in the training set D are sampled based on the inverse of the number of categories, and the sampling probability of each category is as follows:

[0017]

[0018] In formula (1), p i represents the probability of sampling the i-th class, n i represents the number of samples of the i-th class, c represents the number of training set categories; the inverse sample input and the label corresponding to the sample are recorded as (x r ,y r ); The sample inputs of the two branches and the labels corresponding to the samples include (x u ,y u ) and (x r ,y r ).

[0019] In step 2-2), a CNN-Transformer model is used to first extract the frame-level features of the log-mel spectrogram through a CNN network, and then use Transformer to model the relationship between frames and extract the time domain features of the log-mel spectrogram; based on the sample inputs of the two branches obtained in step 2-1) and the labels (x u ,y u ) and (x r ,y r ) The two branch features extracted are f u and f r .

[0020] Based on the traditional CNN-Transformer, the present invention improves the CNN structure through the channel attention mechanism, so that the feature extraction module can extract discriminative features, thereby solving the problem of difficulty in distinguishing between categories. The CNN network structure is divided into four layers, and the extracted features gradually deepen with the increase in the number of layers; the first layer extracts relatively shallow features, and the fourth layer extracts relatively deep features; the CNN network is a bottom-up structure, that is, the features extracted by the fourth layer guide the feature extraction of the third layer, and the features extracted by the third layer guide the feature extraction of the second layer, and so on. The present invention guides the screening of discriminative features based on the channel attention mechanism module, so as to achieve the purpose of deep features guiding shallow features to select their more discriminative features;

[0021] In step 2-3), based on the features f of the two branches obtained in step 2-2), u and f r ; Use the hyperparameter λ to fuse the features of the two branches as follows:

[0022] z=λf u +(1-λ)f r (2)

[0023] In formula (2), f u and f r Represent the features extracted by the two branches respectively, and λ is shown in formula (3):

[0024]

[0025] In formula (3), T represents the current epoch, T max Represents the maximum epoch set for the training model; the loss functions of the two branches are fused using the hyperparameter λ, as shown below:

[0026] L=λL u (p,y u )+(1-λ)Lr (p,y r ) (4)

[0027] In formula (4), the value of λ is determined by formula (3), p is the result obtained by sigmoid activation of z in formula (2), and L u and L r are the loss functions of the two branches respectively.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] The dual-branch discriminant feature network simultaneously solves the problems of long tail and difficulty in distinguishing between categories in the existing sound event detection dataset. Compared with the existing technology, it has better prediction effect and can obtain modeling results with better globality and generalization performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 Model diagram of the dual-branch discriminant network designed by the present invention;

[0031] Figure 2 It is a structural diagram of a CNN model based on a channel attention mechanism of the present invention;

[0032] Figure 3 It is a design flow chart of the present invention;

[0033] Figure 4 It is a schematic diagram of the attention mechanism adopted by the model of the present invention;

[0034] Figure 5 It is the output effect diagram of the present invention. DETAILED DESCRIPTION

[0035] In order to better understand the technical solution of the present invention, the present invention is described in detail below with reference to the accompanying drawings and specific implementation methods.

[0036] The present invention proposes a design concept of a sound event detection method based on a dual-branch discriminant feature network, which simultaneously solves the long-tail problem and the problem of difficulty in distinguishing between categories through a dual-branch network.

[0037] like Figure 1As shown, the model designed in the present invention mainly includes three parts: sampling, feature extraction and branch fusion. The data set is uniformly sampled and inversely sampled as the input of the two branches of the model. A CNN-Transformer model based on a channel attention mechanism that fuses deep and shallow features is used to obtain more discriminative features of sound events. The principle of extracting discriminative features in this model is that the shallow features of the model are rich in spatial features but lack the guidance of semantic features, while the deep features of the model have strong semantic information but lack more refined spatial information. Therefore, the channel attention mechanism is used to enable the deep features to use the semantic information they carry to guide the selection of shallow feature spatial information, thereby combining the advantages of the two features to obtain more discriminative features and solve the problem of difficulty in distinguishing between categories. The branch fusion part fuses the features of the two branches through the hyperparameter λ that gradually decreases with the learning process, thereby balancing the weights of the classifier. Thereby solving both the long tail problem and the problem of difficulty in distinguishing between categories.

[0038] The following describes the sound event detection method based on the three-branch feature fusion neural network of the present invention using the DCASE2017 task four dataset as research material. Figure 2 As shown, the following steps are included:

[0039] Step 1, data preprocessing: extract features from the data set containing the sound signal to obtain a data set of log-mel spectrograms, which includes 51172 training data, 488 test data and 1100 validation data, and the data contains 17 classes; the size of the Mini-batch is set to 64 for each training, and the binary cross entropy loss function is used. The learning rate is 0.0001, and 100 epochs are trained. The classification evaluation score adopts the F-score classification scoring standard. When extracting the log-mel spectrogram, all audio clips are converted to mono and resampled to 32kHz; then the spectrogram is extracted using a Hanning window with 1024 samples and a short-time Fourier transform of 320 samples, so that the spectrogram generates 100 frames in 1 second.

[0040] Step 2: Establish a dual-branch discriminant feature network model, which includes dual-branch sampling, feature extraction, dual-branch feature fusion and loss fusion: the steps are as follows:

[0041] 2-1) Perform uniform sampling and inverse sampling on the training set to obtain training samples for the two branches;

[0042] First, set the training set D = {(x1, y1)...(x n ,y n )}, where n is the number of samples in the training set; (x k ,yk ), and k∈(1,…n), representing the input of the sample and the label corresponding to the sample.

[0043] In the uniform sampling, each sample in the training set is sampled once with the same probability within a training period. The probability of sampling samples in the training set is The input sample of each epoch obtained by this sampling method and the label (x u ,y u ).

[0044] In the inverse sampling, the present invention proposes a method for sampling samples in the training set D based on the inverse of the number of categories. The specific sampling probability of each category is as follows:

[0045]

[0046] In the formula, p i represents the probability of sampling the i-th class, n i represents the number of samples of the i-th class, and c represents the number of categories in the training set; the input sample of each epoch obtained by this sampling method and the label corresponding to the sample are (x r ,y r ).

[0047] So far, we have obtained the sample inputs of the two branches and the labels corresponding to the samples, including (x u ,y u ) and (x r ,y r )

[0048] 2-2) This step uses CNN-Transformer to extract the deep features of the data. CNN-Transformer combines the advantages of CNN and Transformer. It first extracts the frame-level features of the log-mel spectrogram through CNN, and then uses Transformer to model the relationship between frames and extract the time domain features of the log-mel spectrogram.

[0049] The present invention uses a 9-layer CNN to extract frame-level features of the time-spectrogram. The 9-layer CNN consists of 4 convolution blocks, each of which consists of 2 convolution layers with a kernel size of 3×3. Batch normalization and ReLU nonlinear functions are used after each convolution layer. After passing through 4 convolution blocks, the features are mapped to 64, 128, 256 and 512 dimensions respectively. And after each convolution block, a 2×2 average pooling method is applied to extract high-level features. The time domain features of the features extracted by CNN are further extracted in the form of a Transformer encoder.

[0050] like Figure 3 As shown, the present invention divides the CNN network structure into four layers, and the features extracted gradually deepen as the number of layers increases; that is, the first layer extracts relatively shallow features, and the fourth layer extracts relatively deep features. The CNN model for extracting discriminant features proposed in the present invention is a bottom-up structure. That is, through the channel attention mechanism, the features extracted by the fourth layer guide the feature extraction of the third layer, and the features extracted by the third layer guide the feature extraction of the second layer, and so on.

[0051] like Figure 4 The channel attention mechanism used in the present invention is shown as follows. Assume that the shallow feature used in the present invention is f s , the deep feature is f d .f s and f d First, through a 1*1 convolution layer, the number of channels of the two features is uniformly adjusted to 256, and then the two features are fused by concatenation to obtain feature f c .

[0052] Then f c Global pooling is performed to integrate feature information to make the features more compact within the class. Then, the number of feature channels is adjusted from 512 to 256 through a convolutional block with two 1*1 convolutional layers and one relu layer, and f is optimized. c Makes it more conducive to classification.

[0053] f c The channel weight coefficient α is obtained through the sigmoid function.

[0054] α=Sigmoid(f c )

[0055] Combine α with the shallow feature f s The result of multiplication is f D That is, the deep features guide the discriminative features in the shallow features extracted.

[0056] f D =αf s

[0057] As shown in the following formula, the discriminant feature f D and deep features f d The addition is a deeper feature with more discriminative characteristics, which takes into account spatial information such as semantic information.

[0058] f=f D +f d

[0059] Finally, based on the sample input of the two branches obtained in step 2-1) and the labels corresponding to the samples (x u,y u ) and (x r ,y r ) The two branch features extracted are f u and f r .

[0060] 2-3) The features f of the two branches obtained in step 2-2) are transformed using the hyperparameter λ which gradually decreases with the learning process u and f r Fusion is performed. The loss functions of the two branches are calculated based on the fused features, and the parameters of the model are modified by back propagation according to the loss function to complete the model training. The specific process is:

[0061] Feature fusion: The features of the two branches are fused using the hyperparameter λ as shown below:

[0062] z=λf u +(1-λ)f r

[0063] Among them, f u and f r Represent the features extracted by the two branches respectively, and λ is shown in the following formula;

[0064]

[0065] Among them, T represents the current epoch, T max Represents the maximum epoch set for the training model.

[0066] This feature fusion method enables the model to pay more attention to the common features of the dataset when learning local features in the early stage of feature learning, and pay more attention to the features of the tail class when learning category-related features in the later stage.

[0067] Loss function fusion: The loss functions of the two branches are fused using the hyperparameter λ as follows:

[0068] L=λL u (p,y u )+(1-λ)L r (p,y r )

[0069] The value of λ is given by Determined by, p is the formula z = λf u +(1-λ)f r The result obtained by sigmoid activation of z, L u and L r are the loss functions of the two branches respectively.

[0070] In the present invention, the above loss function fusion method enables the neural network to gradually shift from focusing on feature learning to classifier learning during the learning process, and ensures that the two branches with different targets can be continuously updated during the entire training process to avoid mutual influence between the two processes. The hyperparameter λ decreases with the increase of epochs in training, which makes the loss focus on the uniform sampling branch first and then the inverse sampling branch. This branch fusion method enables the model to balance the weight of the classifier while maintaining the model's learning of discriminative features in feature learning. The model is able to extract the discriminative features of the tail class and the difficult-to-classify class, and to a certain extent improves the weight of the tail class in the classifier, promoting the classification learning of the model.

[0071] The mini-batch size is set to 64 each time the model is trained, the binary cross entropy loss function is used, the learning rate is 0.0001, and the training is performed for 100 epochs. The classification evaluation score adopts the F-score classification scoring standard.

[0072] Step 3: For the test set and validation set in the DCASE2017 Task 4 dataset, the above-trained dual-branch discriminant feature network model is used to obtain the corresponding 17 output probabilities, and the output of each category is traversed. When the predicted probability exceeds 0.30, it is considered that the audio contains this type of audio. The corresponding multiple sound event detection results are obtained.

[0073] The output of the model is the result of the sound event detection of the data set, including the sound event category contained in the audio and the start and end time of the event. Figure 5 The following figure shows the prediction results of the model for the audio clip "Y8TSHxF4Bepo_20.000_308.000.wav" in the validation set, which is a 10-second multi-label clip. Figure 5 It can be seen intuitively that the model proposed in the present invention can detect that the audio contains three event categories: skateboard, screaming and bus. Figure 5 It can be seen that the model proposed in the present invention can detect the starting time of the three types of events: skateboard, scream and bus.

[0074] The comparison of the sound event detection classification results of the dual-branch discriminant fusion network model and the single-branch CNN-Transformer network model trained with the same training set is shown in Table 1, where the classification results are the F1 accuracy of each category.

[0075]

[0076] From Table 1, we can see that the classification effect of the tail classes in the data set, such as the car alarm class and the reverse beep class, has been improved. At the same time, we can see that the difficult classification in the data set, such as the passing car class, has also been improved. This proves that the dual-branch discriminant feature network improves the model's ability to extract discriminative features of the tail class and the difficult-to-distinguish class, and effectively solves the problem of difficult distinction between classes.

[0077] Although the present invention has been described above in conjunction with the accompanying drawings, the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can make many modifications without departing from the purpose of the present invention, all of which are within the protection of the present invention.

Claims

1. A sound event detection method based on a dual-branch discriminant feature neural network, characterized in that: The following steps are involved: Step 1: Data preprocessing: Extract features from the data set containing the sound signal to obtain a data set of log-mel spectrograms, and divide it into a training set, a test set, and a validation set according to a certain ratio; Step 2: Establish a dual-branch discriminant feature network model, which includes dual-branch sampling, feature extraction, dual-branch feature fusion and loss fusion: the steps are as follows: 2-1) Perform uniform sampling and inverse sampling on the training set to obtain training samples for the two branches; 2-2) Using a CNN-Transformer model based on a channel attention mechanism to fuse semantic features and spatial features, the sound event features of the training samples of the two branches obtained in step 2-1) are extracted to obtain the features of the two branches; 2-3) Using the hyperparameter that gradually decreases with the learning process, the features of the two branches obtained in step 2-2) are fused, and the loss functions of the two branches are calculated according to the fused features. The parameters of the model are modified by back propagation according to the loss function to complete the training of the model; Step 3: Use the test set and validation set as input to the trained model. The output of the model is the result of sound event detection in the data set, including the sound event category contained in the audio and the start and end time of the event.

2. The sound event detection method according to claim 1, characterized in that: In the step 1, when extracting the log-mel spectrogram, all audio clips are converted to mono and resampled to 32kHz; then, a Hanning window with 1024 samples and a short-time Fourier transform with 320 samples are used to extract the spectrogram, so that 100 frames of the spectrogram are generated within 1 second.

3. The sound event detection method according to claim 2, characterized in that: In the step 1, the data set of the log-mel spectrogram is divided into a training set, a test set and a validation set in a ratio of 8:1:

1.

4. The sound event detection method according to claim 1, characterized in that: In step 2-1), set the training set D = {(x1, y1) ... (x n ,y n )}, where n is the number of samples in the training set; (x k ,y k ), and k∈(1,…n), represents the input of the sample and the label corresponding to the sample; In the uniform sampling, each sample in the training set is sampled once with the same probability within a training period. The probability of sampling samples in the training set is The uniformly sampled sample input and the label corresponding to the sample are recorded as (x u ,y u ); In the inverse sampling, samples in the training set D are sampled based on the inverse of the number of categories, and the sampling probability of each category is as follows: In formula (1), p i represents the probability of sampling the i-th class, n i represents the number of samples of the i-th class, c represents the number of training set categories; the inverse sample input and the label corresponding to the sample are recorded as (x r ,y r ); The sample inputs of the two branches and the labels corresponding to the samples include (x u ,y u ) and (x r ,y r ).

5. The sound event detection method according to claim 1, characterized in that: In the step 2-2), a CNN-Transformer model is used to first extract frame-level features of the log-mel spectrogram through a CNN network, and then a Transformer is used to model the relationship between frames and extract time-domain features of the log-mel spectrogram; Based on the sample input of the two branches obtained in step 2-1) and the labels corresponding to the samples (x u ,y u ) and (x r ,y r ) The two branch features extracted are f u and f r .

6. The sound event detection method according to claim 5, characterized in that: The CNN network structure is divided into four layers, and the features extracted gradually deepen as the number of layers increases; the first layer extracts relatively shallow features, and the fourth layer extracts relatively deep features; the CNN network is a bottom-up structure, that is, the features extracted by the fourth layer guide the feature extraction of the third layer, and the features extracted by the third layer guide the feature extraction of the second layer, and so on; The channel attention mechanism is used to guide the screening of discriminative features, so that deep features can guide shallow feature selection.

7. The sound event detection method according to claim 1, characterized in that: In step 2-3), based on the features f of the two branches obtained in step 2-2), u and f r ; Use the hyperparameter λ to fuse the features of the two branches as follows: z=λf u +(1-λ)f r (2) In formula (2), f u and f r Represent the features extracted by the two branches respectively, and λ is shown in formula (3): In formula (3), T represents the current epoch, T max Represents the maximum epoch set for the training model; The loss functions of the two branches are fused using the hyperparameter λ as follows: L=λL u (p,y u )+(1-λ)L r (p,y r ) (4) In formula (4), the value of λ is determined by formula (3), p is the result obtained by sigmoid activation of z in formula (2), and L u and L r are the loss functions of the two branches respectively.

Citation Information

Patent Citations

  • Remote sensing image scene classification method based on multi-branch convolutional neural network fusion

    CN110443143A

  • High-recall-rate weak-annotation sound event detection method

    CN112036477A

  • Image processing method and device, computer equipment and storage medium

    CN113256621A

  • Few-sample target detection method based on singular value decomposition feature enhancement

    CN113971815A

  • Method and apparatus for recognition of sound events based on convolutional neural network

    US20200302949A1