Acoustic scene classification model training method, device, intelligent terminal and storage medium

By slicing and expanding the characteristic signal of the sample audio, combined with the improved residual neural network, the over-fitting and delay problems of the existing acoustic scene classification methods are solved, the classification accuracy and response speed are improved, and it is suitable for complex environments Acoustic scene classification.

CN114627895BActive Publication Date: 2024-10-22AI TING ZHI NENG KE JI (SHEN ZHEN) YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210319713.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-29
Publication Date
2024-10-22
Estimated Expiration
2042-03-29

AI Technical Summary

Technical Problem

Existing acoustic scene classification methods are prone to over-fitting problems, have a single classification angle, low accuracy, large model size, and high classification delay, making it difficult to effectively classify in complex living and working environments.

Method used

By slicing and expanding the characteristic signal of the sample audio, the improved residual neural network is input for training, the logarithmic mel spectrum features are extracted, and the improved residual neural network model is used for acoustic scene classification.

Benefits of technology

It improves the accuracy of the model's classification results, reduces the size of the input signal, and improves the response speed, making acoustic scene classification more accurate and efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114627895B_ABST
    Figure CN114627895B_ABST
Patent Text Reader

Abstract

The present invention discloses an acoustic scene classification model training method, device, intelligent terminal and storage medium, the method comprising: obtaining training data; extracting the first characteristic signal of the sample audio, and slicing and expanding the first characteristic signal to obtain a second characteristic signal; inputting the second characteristic signal into the acoustic scene classification model, and outputting a predicted acoustic scene category; wherein the acoustic scene classification model is obtained by improving the residual neural network; training the acoustic scene classification model according to the predicted acoustic scene category and the true label to obtain a trained acoustic scene classification model. In the embodiment of the present invention, the characteristic signal of the sample audio is sliced ​​and expanded, so that the input sample signal size is reduced and the response speed is improved; the sample signal is input into the improved residual neural network for training, so that the classification result accuracy of the model is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of acoustic technology, and in particular to an acoustic scene classification model training method, device, intelligent terminal and storage medium. Background Art

[0002] Acoustic scene classification is widely used in daily life. The so-called acoustic scene classification (ASC) refers to the process of analyzing the acoustic content contained in the audio and then identifying the acoustic scene corresponding to the audio.

[0003] The current acoustic scene classification method is prone to overfitting problems during the acoustic scene classification process, and the classification angle is relatively single. The acoustic scene classification effect is poor and cannot be effectively classified in complex living and working environments. The accuracy is low, the model size is large, and the classification delay is high.

[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide an acoustic scene classification model training method in view of the above-mentioned defects of the prior art, aiming to solve the problems of low accuracy, large model size and high classification delay in the acoustic scene classification method in the prior art.

[0006] The technical solution adopted by the present invention to solve the problem is as follows:

[0007] In a first aspect, an embodiment of the present invention provides a method for training an acoustic scene classification model, wherein the method comprises:

[0008] Acquire training data, wherein the training data includes sample audio and real labels corresponding to the sample audio;

[0009] Extracting a first characteristic signal of the sample audio, and slicing and expanding the first characteristic signal to obtain a second characteristic signal; inputting the second characteristic signal into an acoustic scene classification model, and outputting a predicted acoustic scene category through the acoustic scene classification model; wherein the acoustic scene classification model is obtained by improving a residual neural network;

[0010] The acoustic scene classification model is trained according to the predicted acoustic scene category and the true label to obtain a trained acoustic scene classification model.

[0011] In one implementation, the step of obtaining training data includes:

[0012] Acquiring an acoustic scene category; wherein the acoustic scene category is divided based on an audio frequency domain energy distribution state.

[0013] In one implementation, extracting the first characteristic signal of the sample audio includes:

[0014] Resampling the sample audio to obtain a first audio;

[0015] Convert the first audio into a first digital signal, and perform normalization processing on the first digital signal to obtain a second digital signal;

[0016] The frequency domain features of the second digital signal are acquired based on a logarithmic Mel spectrum method to obtain a first feature signal of the sample audio; wherein the logarithmic Mel spectrum adopts a plurality of Mel filter banks.

[0017] In one implementation, slicing and expanding the first characteristic signal to obtain the second characteristic signal includes:

[0018] Slicing the first characteristic signal to obtain a plurality of sub-characteristic signals;

[0019] Dividing the plurality of sub-characteristic signals into a plurality of groups to obtain a plurality of first signal groups;

[0020] Secondarily grouping the plurality of the first signal groups to obtain a plurality of second signal groups; wherein each of the second signal groups has an overlapping signal of a preset length;

[0021] Based on the true label, labeling a plurality of the second signal groups;

[0022] Randomly disrupting the order of the marked plurality of second signal groups to obtain a plurality of third signal groups;

[0023] Several of the third signal groups are batched to obtain a second characteristic signal.

[0024] In one implementation, the acoustic scene classification model includes: a first convolutional layer, a maximum pooling layer, a plurality of improved residual modules, a second convolutional layer, a third convolutional layer, and a fourth convolutional layer;

[0025] The step of inputting the second feature signal into an acoustic scene classification model and outputting a predicted acoustic scene category through the acoustic scene classification model comprises:

[0026] Inputting the second feature signal into the first convolution layer to obtain a first convolution graph;

[0027] Inputting the first convolutional map into the maximum pooling layer to obtain a second convolutional map;

[0028] Inputting the second convolution map into each improved residual module in sequence to obtain a third convolution map;

[0029] The third convolutional map is sequentially input into the second convolutional layer, the third convolutional layer and the fourth convolutional layer to obtain a predicted acoustic scene category.

[0030] In one implementation, the improved residual module includes an improved residual layer and a first residual layer; wherein the improved residual layer includes a second residual layer and a linear processing module; the linear processing module consists of a convolutional layer and a normalization layer, and is used to perform a linear transformation on the input of the improved residual layer.

[0031] In a second aspect, an embodiment of the present invention further provides an acoustic scene classification model training device, wherein the device comprises:

[0032] A training data acquisition module, used to acquire training data, wherein the training data includes sample audio and true labels corresponding to the sample audio;

[0033] A predicted acoustic scene category acquisition module, used to extract a first characteristic signal of the sample audio, and obtain a second characteristic signal by slicing and expanding the first characteristic signal; input the second characteristic signal into an acoustic scene classification model, and output a predicted acoustic scene category through the acoustic scene classification model;

[0034] An acoustic scene classification model acquisition module is used to adjust the model parameters of the acoustic scene classification model according to the predicted acoustic scene category and the true label, and continue to execute the step of inputting the second feature signal into the acoustic scene classification model until the preset training conditions are met to obtain a trained acoustic scene classification model.

[0035] In a third aspect, an embodiment of the present invention further provides an acoustic scene classification method, wherein the method comprises:

[0036] Acquire audio to be classified, and extract a first feature of the audio;

[0037] The first feature is input into a trained acoustic scene classification model to obtain an acoustic scene category corresponding to the audio to be classified; wherein the trained acoustic scene classification model is the acoustic scene classification model described in any one of claims 1-6.

[0038] In a fourth aspect, an embodiment of the present invention further provides an intelligent terminal comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include a method for executing an acoustic scene classification model training method as described in any one of the above items.

[0039] In a fifth aspect, an embodiment of the present invention further provides a non-temporary computer-readable storage medium, which, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the acoustic scene classification model training method as described in any one of the above.

[0040] Beneficial effects of the present invention: The embodiment of the present invention first obtains training data, wherein the training data includes sample audio and real labels corresponding to the sample audio; then extracts a first feature signal of the sample audio, and slices and expands the first feature signal to obtain a second feature signal; inputs the second feature signal into an acoustic scene classification model, and outputs a predicted acoustic scene category through the acoustic scene classification model; wherein the acoustic scene classification model is obtained by improving the residual neural network; finally, the acoustic scene classification model is trained according to the predicted acoustic scene category and the real label to obtain a trained acoustic scene classification model; it can be seen that in the embodiment of the present invention, the feature signal of the sample audio is sliced ​​and expanded, so that the size of the input sample signal is reduced and the response speed is improved; the sample signal is input into the improved residual neural network for training, so that the classification result of the model is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] 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 only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 A schematic diagram of the flow chart of the acoustic scene classification model training method provided in an embodiment of the present invention.

[0043] Figure 2 A schematic diagram of the Simplify-ResNet model structure provided in an embodiment of the present invention.

[0044] Figure 3 A schematic structural diagram of an improved residual unit provided in an embodiment of the present invention.

[0045] Figure 4 A schematic diagram of the network error rate after training and verification using a residual network provided in an embodiment of the present invention.

[0046] Figure 5 A diagram showing the network training effect of the present invention provided in an embodiment of the present invention.

[0047] Figure 6A functional block diagram of an acoustic scene classification model device provided in an embodiment of the present invention.

[0048] Figure 7 This is a block diagram of the internal structure principle of the intelligent terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The present invention discloses an acoustic scene classification model training method, device, intelligent terminal and storage medium. In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0050] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0051] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0052] In the prior art, acoustic scene classification is currently implemented mainly through the following two methods: the first is an acoustic scene classification method based on traditional machine learning, specifically, using traditional machine learning models, such as support vector machines (SVMs) models, Gaussian mixture models (GMMs), hidden Markov models (HMMs), etc. to fit the acoustic features in the audio to obtain the acoustic scene corresponding to the audio. The second is an acoustic scene classification method based on deep learning, specifically, using deep neural network models, such as recurrent neural network (RNNs) models, convolutional neural network (CNNs) models, etc. to perform acoustic scene classification on audio. Practice has found that the current acoustic scene classification method relies more on existing models. The current acoustic scene classification method is more prone to overfitting problems in the acoustic scene classification process (overfitting means that the gap between the training error and the test error is too large. That is, the model complexity is higher than the actual problem. The model performs well on the training set, but performs poorly on the test set. The model "memorizes" the training set (remembers the properties or characteristics of the training set that are not applicable to the test set), does not understand the rules behind the data, and has poor generalization ability) and the problem of single classification briefing, which makes the existing acoustic scene classification method have low accuracy, large model size, and high classification delay.

[0053] In order to solve the problems of the prior art, the present embodiment provides an acoustic scene classification model training method, device, intelligent terminal and storage medium. By slicing and expanding the characteristic signal of the sample audio, the input sample signal size is reduced and the response speed is improved; the sample signal is input into the improved residual neural network for training, so that the classification result of the model is more accurate. In the specific implementation, the training data is first obtained, wherein the training data includes the sample audio and the real label corresponding to the sample audio; then the first characteristic signal of the sample audio is extracted, and the first characteristic signal is sliced ​​and expanded to obtain the second characteristic signal; the second characteristic signal is input into the acoustic scene classification model, and the acoustic scene classification model outputs the predicted acoustic scene category; wherein the acoustic scene classification model is obtained by improving the residual neural network; finally, the acoustic scene classification model is trained according to the predicted acoustic scene category and the real label to obtain a trained acoustic scene classification model.

[0054] Exemplary Methods

[0055] This embodiment provides an acoustic scene classification model training method, which can be applied to acoustic smart terminals. Figure 1 As shown, the method includes:

[0056] Step S100: acquiring training data, wherein the training data includes sample audio and real labels corresponding to the sample audio;

[0057] Specifically, the training data comes from public open source data sets. A batch of data can also be collected according to actual needs, and then the data is further screened and optimized. For example, data that does not meet the characteristics of this scene is eliminated, and data with particularly obvious human voice characteristics is also eliminated. Then the data is reclassified according to the defined classification scene. The real label is the real acoustic scene category corresponding to the sample audio.

[0058] In one implementation, the present invention classifies acoustic scenes in the preparation work done before obtaining training data. The existing classification methods are divided into "airport", "shopping center", "subway station", "street sidewalk", "square", "street with a small amount of traffic", "tram", "bus", "subway", "park", etc.; there are also classification methods that are divided into: "quiet environment", "noisy environment", "music environment", "speech environment"; the classification part of the present invention is refined and extracted and reclassified according to specific work and life scenes, and the scene categories are divided into 6 categories: "rail transportation vehicle internal environment", "engine transportation vehicle internal environment", "outdoor crowded environment", "vehicle crowded environment", "indoor crowded environment", "relatively quiet environment", and the categories can be expanded according to actual needs. The division basis of these 6 types of scenes can be the energy distribution state of the audio frequency domain, or the concentrated distribution range of the energy in the audio frequency domain. This division method is to divide the same type of acoustic performance together. The acoustic scene mainly focuses on the acoustic features, and it is more practical to distinguish the scene classification in an environment with significant acoustic features, so that it can be used in real life scenes, and the accuracy of classification is improved. Compared with event detection for classification, this classification is more in line with the daily environment. Event detection is only a single event (such as the sound of glass breaking or dog barking) that happened at that moment. It is just an instantaneous event and cannot represent the acoustic characteristics of the current environment. The six basic environment classifications of the present invention can basically cover the work, life and learning environments that most people can access. Therefore, it is universal and can be implemented in actual projects.

[0059] In this way, each sample audio corresponds to one of the six types of acoustic scenes.

[0060] After getting the training data, you can execute Figure 1The following steps are shown: S200, extracting a first characteristic signal of the sample audio, and slicing and expanding the first characteristic signal to obtain a second characteristic signal; inputting the second characteristic signal into an acoustic scene classification model, and outputting a predicted acoustic scene category through the acoustic scene classification model; wherein the acoustic scene classification model is obtained by improving a residual neural network;

[0061] Specifically, the sample audio is a video signal and cannot be directly input into the model. It is necessary to extract the first characteristic signal from the sample audio. In practice, the size of the first characteristic signal extracted once is too large, resulting in a low response speed of the model. In order to solve this problem, the present application slices and expands the first characteristic signal to obtain a second characteristic signal, and then inputs the second characteristic signal into the acoustic scene classification model. At this time, the size of the second characteristic signal is small, and the response speed of the model is improved. In this embodiment, the acoustic scene classification model is obtained by improving the residual neural network, which can be a deletion of the traditional residual neural network or an adjustment of the traditional residual neural network. There is no specific limitation. The acoustic scene classification model of the present invention makes the acoustic scene classification more accurate.

[0062] In one implementation, the extracting the first characteristic signal of the sample audio includes the following steps: resampling the sample audio to obtain a first audio; converting the first audio into a first digital signal, and normalizing the first digital signal to obtain a second digital signal; obtaining the frequency domain features of the second digital signal based on a logarithmic Mel spectrum to obtain the first characteristic signal of the sample audio; wherein the logarithmic Mel spectrum uses several Mel filter groups.

[0063] Specifically, the sampling rate of the resampling is 16K, and the sample audio is sampled at a sampling rate of 16K to obtain the first audio, and then the data of the WAV file of the first audio is converted into a first digital signal that can be used as a network model input, and then the first digital signal is normalized to obtain a second digital signal; wherein, the normalization process is to convert a number into a decimal between (0, 1). After obtaining the second digital signal, the frequency domain characteristics of the audio signal are obtained by the log Mel Filter Bank (LMFB) method in the prior art, that is, the first characteristic signal of the sample audio. The log Mel Spectrum is a prior art and will not be repeated here. The log Mel Spectrum of the sample audio can characterize the acoustic signal characteristics of the target audio; the log Mel Spectrum is composed of a Mel filter bank. The Mel filter bank is a group of nonlinearly distributed filter banks, the Mel filter banks are densely distributed in the low-frequency part, and sparsely distributed in the high-frequency part. The distribution difference of the Mel filter bank at high and low frequencies can better meet the auditory characteristics of the human ear. The method of logarithmic Mel spectrum obtains the frequency domain characteristics of the speech signal, wherein the specific parameters are: the short-time Fourier window length is 1024 sampling points, the frame shift is 500 sampling points, the window length is consistent with the FFT window length, the number of filter groups is 40, the highest frequency is 8k, the minimum frequency is 50, the index of the amplitude spectrum is 2 (power spectrum), starting from the center, and the window method is a Hamming window (hann). In this embodiment, the logarithmic Mel spectrum uses 40 filter groups, and the filter group is a Mel filter group, so that the size of the extracted first characteristic signal is reduced, which can further reduce the parameters of the model, reduce the size of the device, and reduce the delay.

[0064] In one implementation, slicing and expanding the first characteristic signal to obtain the second characteristic signal includes the following steps: slicing the first characteristic signal to obtain a number of sub-characteristic signals; dividing the sub-characteristic signals into a number of groups to obtain a number of first signal groups; performing secondary grouping on the first signal groups to obtain a number of second signal groups; wherein each second signal group has an overlapping signal of a preset length; labeling the second signal groups based on the true label; randomly disrupting the order of the labeled second signal groups to obtain a number of third signal groups; and batching the third signal groups to obtain a second characteristic signal.

[0065] Specifically, the first characteristic signal is sliced, such as processing each 10-second audio segment into 320 arrays of digital signals, so that the size of the sliced ​​sub-characteristic signals is smaller, and then the sub-characteristic signals are divided into several groups to obtain several first signal groups; such as dividing the sub-characteristic signals into 16 first signal groups with 20 arrays as a group; then the first signal groups are secondary grouped to obtain several second signal groups; wherein, there are overlapping signals of preset lengths between each second signal group; such as numbering the first signal groups into Group 1, Group 2, Group 3... in chronological order, splicing Group 1 and Group 2 in sequence into a second signal group numbered 1, then splicing Group 2 and Group 3 in sequence into a second signal group numbered 2, and so on, to obtain 15 separate second signal groups. The second signal group with serial number 1 and the second signal group with serial number 2 have overlapping signal group 2, and so on, the second signal group with serial number 2 and the second signal group with serial number 3 have overlapping signal group 3...Since the real label is the real acoustic scene category corresponding to the sample audio, and there are six real acoustic scene categories, the six real acoustic scene categories can be marked, such as marking "railway vehicle interior environment" as 0, "engine vehicle interior environment" as 1, "outdoor crowded environment" as 2, "vehicle crowded environment" as 3, "indoor crowded environment" as 4, and "relatively quiet environment" as 5. Several second signal groups are obtained by processing sample audio, so the labels of several second signal groups are consistent with the labels of sample audio. After marking several second signal groups, randomly disrupt the order of several marked second signal groups to obtain several third signal groups; finally, batch the several third signal groups to obtain second feature signals, store the second feature signals, and use the data loader to load the stored data for standby. Randomly shuffling and data augmentation operations on the dataset can further improve the accuracy and generalization ability of the classification method.

[0066] In one implementation, the acoustic scene classification model includes: a first convolutional layer, a maximum pooling layer, several improved residual modules, a second convolutional layer, a third convolutional layer and a fourth convolutional layer; the step of inputting the second feature signal into the acoustic scene classification model and outputting a predicted acoustic scene category through the acoustic scene classification model includes the following steps: inputting the second feature signal into the first convolutional layer to obtain a first convolutional map; inputting the first convolutional map into the maximum pooling layer to obtain a second convolutional map; inputting the second convolutional map into each improved residual module in turn to obtain a third convolutional map; inputting the third convolutional map into the second convolutional layer, the third convolutional layer and the fourth convolutional layer in turn to obtain a predicted acoustic scene category.

[0067] In this embodiment, the acoustic scene classification model is improved by using the classic residual neural network (Resnet) in the convolutional neural network (CNNs) to obtain a simplified Resnet neural network model, which is called Simplify-ResNet-CNN in the present invention. Figure 2As shown, the input of the acoustic scene classification model is 1 channel, and the input dimension of the present invention is 40*W, W can be determined according to one's own needs, and W used in an example of the present invention is 40. The acoustic scene classification model includes: a first convolutional layer, a maximum pooling layer, several improved residual modules, a second convolutional layer, a third convolutional layer and a fourth convolutional layer; the specific structure of the model can be adjusted and is also within the scope of protection. The first convolutional layer, the second convolutional layer, the third convolutional layer and the fourth convolutional layer are all two-dimensional convolutional layers. The convolution feature extraction layer in the first convolutional layer is a two-dimensional convolution, the convolution kernel (kernel) is 1x1, the number of padding 0 (pad) is 2, that is, two circles of 0 need to be filled around the input feature, the sliding step (stride) is 1, the number of input channels is 1, and the number of output channels is 4. There is a normalization processing layer and an activation processing layer in the first convolutional layer, and then a maximum two-dimensional pooling process is performed, the input channel is 3, the output is 1, and the number of padding 0 (pad) is 1. Then the first convolution layer and the first pooling layer are normalized. The convolution kernel of the second convolution layer is 3x3, the number of padding 0s is (0,3), the number of input channels is 32, and the number of output channels is 64. The convolution kernel of the third convolution layer is 1x1, the number of input channels is 64, and the number of output channels is 128. The convolution kernel of the fourth convolution layer is 1x1, the number of input channels is 128, and the number of output channels is 6. In addition, the acoustic scene classification model also includes a Softmax process, which maps the output of multiple neurons to the (0,1) interval as a probability output, which is used for multiple classifications. In practice, there are four improved residual modules (ResBlockPlus modules), and the input channel of the first ResBlockPlus in each improved residual module is 4, and the output channel is 8; the input channel of the second ResBlockPlus is 8, and the output channel is 16; the input channel of the third ResBlockPlus is 16, and the output channel is 32; the input channel of the fourth ResBlockPlus is 32, and the output channel is 32. When the second feature signal is input into the acoustic scene classification model, the second feature signal is sequentially input into the first convolution layer, the maximum pooling layer, and each improved residual module, the second convolution layer, the third convolution layer, the fourth convolution layer and the Softmax layer are input in order, and six acoustic scene category probability values ​​corresponding to each second feature signal are output, and the acoustic scene category corresponding to the largest probability value is the predicted acoustic scene category of the second feature signal. The acoustic scene classification model of the present invention has improvements in size, computing performance and accuracy.

[0068] In one implementation, the improved residual module includes an improved residual layer and a first residual layer; wherein the improved residual layer includes a second residual layer and a linear processing module; the linear processing module consists of a convolutional layer and a normalization layer, and is used to perform a linear transformation on the input of the improved residual layer.

[0069] Specifically, the classic residual block has two layers, as shown below:

[0070]

[0071] Among them, σ represents the nonlinear function ReLU, and then through a shortcut and the second ReLU, the output y is obtained:

[0072]

[0073] The residual block often needs more than two layers, and a single-layer residual block (y=W1x+x) cannot play an improvement role. The present invention takes into account the need to change the input and output dimensions (such as changing the number of channels), and can perform a linear transformation Ws on x during the shortcut, as shown in the following formula:

[0074]

[0075] Based on the above theory, Figure 3As shown, the embodiment of the present invention improves the residual module. The improved residual module includes an improved residual layer and a first residual layer. The first residual layer includes a first convolution layer and a second convolution layer. The convolution feature extraction layer in the first convolution layer is a two-dimensional convolution, the convolution kernel is 3x3, the number of padding 0s is 1, that is, a circle of 0s needs to be filled around the input feature, the sliding step length is 1, and the number of channels is an input parameter. There is a normalization processing layer and an activation processing layer in the first convolution layer; the convolution feature extraction layer in the second convolution layer is a two-dimensional convolution, the convolution kernel is 3x3, the number of padding 0s is 1, that is, two circles of 0s need to be filled around the input feature, the sliding step length is 1, and the number of channels is an input parameter. There is a normalization processing layer in the second convolution layer. Then the first convolution layer and the second convolution layer are serialized, and the serialized result is added to the input to obtain the final input. Compared with the structure of the first residual layer, the improved residual layer has an additional linear processing module. The linear processing module performs a linear transformation on the input and then adds it. The processing flow includes but is not limited to the following operations: two-dimensional convolution on the input, the convolution kernel (kernel) is 1x1, the sliding step (stride) is 1, and other parameters set the convolution behavior according to different settings, and then perform a normalization process. The signal processing of the improved residual module is to first process the input with the improved residual layer, and then process the result through the first residual layer. In practice, the improved residual module can flexibly increase or decrease the input and output parameters and the number of residual blocks, and there is no restriction here. The network error rate after the residual network is trained and verified is as follows: Figure 4 shown.

[0076] After obtaining the predicted acoustic scene category, we can perform the following Figure 1 The following steps are shown: S300, training the acoustic scene classification model according to the predicted acoustic scene category and the true label to obtain a trained acoustic scene classification model.

[0077] Specifically, for each sample audio, the goal is to approximate the predicted acoustic scene category to the true label through the acoustic scene classification model. In this process, the parameters of the acoustic scene classification model are continuously adjusted and the step of inputting the second feature signal into the acoustic scene classification model is continued until the preset training conditions are met, such as the loss function meets the preset requirements or the number of training times reaches the preset number of times, so as to obtain a trained acoustic scene classification model. In this embodiment, the batch size of the data input is 64, the optimizer uses stochastic gradient descent (SGD), the learning rate is 0.01, the loss function is cross entropy (CrossEntropyLoss), and iterates 30 epochs. The training effect is as follows: Figure 5 shown.

[0078] The accuracy of the Simplify-ResNet inference model training set is 96.28%, and the accuracy of the test set is 84.35%. The accuracy calculation formula is:

[0079] Accuracy = number of correct inferences / total number X 100%

[0080] (g) How to use the Simplify-ResNet model and on which devices or equipment to use it:

[0081] To make the trained model smaller and the computational inference faster, you can also perform model compression quantization, model pruning, and knowledge distillation.

[0082] It can also be used on devices or equipment with relatively large memory and computing power, including but not limited to mobile phones, personal PCs, servers, etc. It can be directly deployed using the current mainstream PyTorch Lightning and Tensorflow Lite reasoning frameworks. After obtaining the digital signal of the target audio, resampling and normalization are performed, and then the logarithmic Mel spectrum features are extracted, and the 1*40*40 dimension is used as input (the processing steps and parameters are consistent with the training data processing steps and parameters). If the model is quantized, the input data also needs to be quantized. Running the model on the above reasoning framework will eventually get a classification number among the 6 categories.

[0083] The present invention has the characteristics of small size and low computing power requirement, and is more suitable for deployment on a microprocessor. The specific process is as follows:

[0084] First, use C language or assembly code to build an inference engine according to the specific model structure. The inference engine needs to be optimized through the platform chip arithmetic instructions. When the inference engine is running, the model parameter file is loaded into the inference engine in binary form; the processing method of the target audio is consistent with the above deployment. After processing, the required input data is obtained, and the data is input into the above inference engine as a parameter, and then compiled to generate an executable file, which is burned to the corresponding microcontroller platform for operation.

[0085] The acoustic scene classification model training method of the present invention has low latency, small size, can distinguish acoustic scenes in complex environments, and the classification categories can be expanded.

[0086] The comparison results between the acoustic scene classification model and other acoustic scene classification models are shown in the following table.

[0087]

[0088]

[0089] The memory computing power requirement of the present invention is very small, the latency is also improved, the accuracy is higher, and it is more suitable for use in devices including but not limited to hearing aids and wearable devices.

[0090] Exemplary Devices

[0091] like Figure 6 As shown in , an embodiment of the present invention provides an acoustic scene classification model training device, which includes a training data acquisition module 401, a predicted acoustic scene category acquisition module 402 and an acoustic scene classification model acquisition module 403: the training data acquisition module 401 is used to acquire training data, wherein the training data includes sample audio and real labels corresponding to the sample audio;

[0092] The predicted acoustic scene category acquisition module 402 is used to extract a first characteristic signal of the sample audio, and obtain a second characteristic signal by slicing and expanding the first characteristic signal; input the second characteristic signal into an acoustic scene classification model, and output a predicted acoustic scene category through the acoustic scene classification model;

[0093] The acoustic scene classification model acquisition module 403 is used to adjust the model parameters of the acoustic scene classification model according to the predicted acoustic scene category and the true label, and continue to execute the step of inputting the second feature signal into the acoustic scene classification model until the preset training conditions are met to obtain a trained acoustic scene classification model.

[0094] An embodiment of the present invention further provides an acoustic scene classification method, characterized in that the method comprises the following steps:

[0095] H100, obtaining audio to be classified, and extracting a first feature of the audio;

[0096] H200, inputting the first feature into a trained acoustic scene classification model to obtain an acoustic scene category corresponding to the audio to be classified;

[0097] Specifically, the audio to be classified can be obtained first, and then the first feature of the audio can be obtained through the logarithmic Mel spectrum method, and then the first feature can be input into the trained acoustic scene classification model. Since the acoustic scene classification model achieves a very high classification accuracy after training, the acoustic scene category corresponding to the audio to be classified can be obtained through the trained acoustic scene classification model.

[0098] At present, acoustic scene classification technology has been applied in many fields such as ecological environment monitoring, intelligent public safety monitoring, speech recognition technology, automated assisted driving, voice calls, hearing aids, etc.

[0099] Based on the above embodiments, the present invention further provides an intelligent terminal, whose principle block diagram can be shown as follows: Figure 7 As shown. The intelligent terminal includes a processor, a memory, a network interface, a display screen, and a temperature sensor connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an acoustic scene classification model training method is implemented. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the intelligent terminal is pre-set inside the intelligent terminal to detect the operating temperature of the internal device.

[0100] Those skilled in the art will understand that Figure 7 The schematic diagram in the figure is only a block diagram of a part of the structure related to the scheme of the present invention, and does not constitute a limitation on the smart terminal to which the scheme of the present invention is applied. The specific smart terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0101] In one embodiment, a smart terminal is provided, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include instructions for performing the following operations:

[0102] Acquire training data, wherein the training data includes sample audio and real labels corresponding to the sample audio;

[0103] Extracting a first characteristic signal of the sample audio, and slicing and expanding the first characteristic signal to obtain a second characteristic signal; inputting the second characteristic signal into an acoustic scene classification model, and outputting a predicted acoustic scene category through the acoustic scene classification model; wherein the acoustic scene classification model is obtained by improving a residual neural network;

[0104] The acoustic scene classification model is trained according to the predicted acoustic scene category and the true label to obtain a trained acoustic scene classification model.

[0105] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0106] In summary, the present invention discloses an acoustic scene classification model training method, device, intelligent terminal and storage medium, the method comprising: obtaining training data; extracting the first characteristic signal of the sample audio, and slicing and expanding the first characteristic signal to obtain a second characteristic signal; inputting the second characteristic signal into the acoustic scene classification model, and outputting a predicted acoustic scene category; wherein the acoustic scene classification model is obtained by improving the residual neural network; training the acoustic scene classification model according to the predicted acoustic scene category and the true label to obtain a trained acoustic scene classification model. In the embodiment of the present invention, the input sample signal size is reduced and the response speed is improved by slicing and expanding the characteristic signal of the sample audio; the sample signal is input into the improved residual neural network for training, so that the classification result of the model is more accurate.

[0107] Based on the above embodiments, the present invention discloses an acoustic scene classification model training method. It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, it can be improved or transformed according to the above description. All these improvements and transformations should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for training an acoustic scene classification model, It is characterized in that The method comprises: Acquire training data, wherein the training data includes sample audio and real labels corresponding to the sample audio; Extracting a first characteristic signal of the sample audio, and slicing and expanding the first characteristic signal to obtain a second characteristic signal; inputting the second characteristic signal into an acoustic scene classification model, and outputting a predicted acoustic scene category through the acoustic scene classification model; wherein the acoustic scene classification model is obtained by improving a residual neural network; Training the acoustic scene classification model according to the predicted acoustic scene category and the true label to obtain a trained acoustic scene classification model; The obtaining of the second characteristic signal by slicing and expanding the first characteristic signal comprises: Slicing the first characteristic signal to obtain a plurality of sub-characteristic signals; Dividing the plurality of sub-characteristic signals into a plurality of groups to obtain a plurality of first signal groups; Secondarily grouping the plurality of the first signal groups to obtain a plurality of second signal groups; wherein each of the second signal groups has an overlapping signal of a preset length; Based on the true label, labeling a plurality of the second signal groups; Randomly disrupting the order of the marked plurality of second signal groups to obtain a plurality of third signal groups; Several of the third signal groups are batched to obtain a second characteristic signal.

2. The acoustic scene classification model training method according to claim 1, It is characterized in that The step of obtaining training data includes: Acquiring an acoustic scene category; wherein the acoustic scene category is divided based on an audio frequency domain energy distribution state.

3. The acoustic scene classification model training method according to claim 1, It is characterized in that The extracting the first characteristic signal of the sample audio comprises: Resampling the sample audio to obtain a first audio; Convert the first audio into a first digital signal, and perform normalization processing on the first digital signal to obtain a second digital signal; The frequency domain features of the second digital signal are acquired based on a logarithmic Mel spectrum method to obtain a first feature signal of the sample audio; wherein the logarithmic Mel spectrum adopts a plurality of Mel filter banks.

4. The acoustic scene classification model training method according to claim 1, It is characterized in that The acoustic scene classification model includes: a first convolution layer, a maximum pooling layer, a plurality of improved residual modules, a second convolution layer, a third convolution layer and a fourth convolution layer; The step of inputting the second feature signal into an acoustic scene classification model and outputting a predicted acoustic scene category through the acoustic scene classification model comprises: Inputting the second feature signal into the first convolution layer to obtain a first convolution graph; Inputting the first convolutional map into the maximum pooling layer to obtain a second convolutional map; Inputting the second convolution map into each improved residual module in sequence to obtain a third convolution map; The third convolutional map is sequentially input into the second convolutional layer, the third convolutional layer and the fourth convolutional layer to obtain a predicted acoustic scene category.

5. The acoustic scene classification model training method according to claim 4, It is characterized in that The improved residual module includes an improved residual layer and a first residual layer; wherein the improved residual layer includes a second residual layer and a linear processing module; the linear processing module consists of a convolutional layer and a normalization layer, and is used to perform a linear transformation on the input of the improved residual layer.

6. An acoustic scene classification model training device, It is characterized in that The device comprises: A training data acquisition module, used to acquire training data, wherein the training data includes sample audio and true labels corresponding to the sample audio; A predicted acoustic scene category acquisition module, used to extract a first characteristic signal of the sample audio, and obtain a second characteristic signal by slicing and expanding the first characteristic signal; input the second characteristic signal into an acoustic scene classification model, and output a predicted acoustic scene category through the acoustic scene classification model; An acoustic scene classification model acquisition module, used to adjust the model parameters of the acoustic scene classification model according to the predicted acoustic scene category and the true label, and continue to execute the step of inputting the second feature signal into the acoustic scene classification model until a preset training condition is met, so as to obtain a trained acoustic scene classification model; The obtaining of the second characteristic signal by slicing and expanding the first characteristic signal comprises: Slicing the first characteristic signal to obtain a plurality of sub-characteristic signals; Dividing the plurality of sub-characteristic signals into a plurality of groups to obtain a plurality of first signal groups; Secondarily grouping the plurality of the first signal groups to obtain a plurality of second signal groups; wherein each of the second signal groups has an overlapping signal of a preset length; Based on the true label, labeling a plurality of the second signal groups; Randomly disrupting the order of the marked plurality of second signal groups to obtain a plurality of third signal groups; Several of the third signal groups are batched to obtain a second characteristic signal.

7. A method for acoustic scene classification, It is characterized in that The method comprises: Acquire audio to be classified, and extract a first feature of the audio; The first feature is input into a trained acoustic scene classification model to obtain an acoustic scene category corresponding to the audio to be classified; wherein the trained acoustic scene classification model is the acoustic scene classification model described in any one of claims 1-5.

8. An intelligent terminal, It is characterized in that The device comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include being used to execute the method according to any one of claims 1 to 5.

9. A non-transitory computer-readable storage medium, It is characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 5.