Alarm sound recognition method and device, and alarm sound recognition model training method
By acquiring the Mel-frequency cepstral coefficients of the input speech and extracting time-frequency features using a deep separable convolutional neural network, the problem of existing technologies being unable to adapt to diverse alarm scenarios is solved, achieving flexible alarm sound recognition and cost reduction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BESTECHNIC SHANGHAI CO LTD
- Filing Date
- 2023-12-22
- Publication Date
- 2026-07-07
AI Technical Summary
Existing alarm sound detection technologies cannot flexibly adapt to diverse alarm scenarios and are limited to detecting only a single type of alarm sound.
By obtaining the Mel frequency cepstral coefficients of the input speech, the time-frequency features of the target are extracted using two-dimensional and one-dimensional deep separable convolutional neural networks. Combined with fully connected layers and activation functions, it is determined whether the input speech contains alarm sounds.
It enables the recognition of various alarm sounds, adapts to more diverse alarm scenarios, reduces the requirements for hardware computing power, and lowers costs.
Smart Images

Figure CN117746890B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of sound recognition, and more specifically, to an alarm sound recognition method and apparatus, a training method for an alarm sound recognition model, an electronic device, and a computer-readable storage medium. Background Technology
[0002] Alarm detection plays a vital role in modern society, not only helping to promptly detect emergencies and protect people's lives, but also serving as a key component of monitoring systems to ensure public safety and social order. Furthermore, in the industrial sector, alarm detection can be used to monitor equipment operating status and prevent accidents. Overall, alarm detection is crucial for safety and monitoring efficiency in various fields, contributing to the protection of people's lives and property.
[0003] However, existing alarm sound detection technologies are limited to detecting a single type of alarm sound and cannot flexibly adapt to diverse alarm scenarios. Summary of the Invention
[0004] The purpose of this application is to provide an alarm sound recognition method and device, an alarm sound recognition model training method, an electronic device, and a computer-readable storage medium that can flexibly adapt to various alarm scenarios.
[0005] In a first aspect, embodiments of this application provide an alarm sound recognition method, comprising: acquiring Mel frequency cepstral coefficients of input speech; acquiring target time-frequency features of the input speech based on the Mel frequency cepstral coefficients; and determining whether the input speech contains an alarm sound based on the target time-frequency features.
[0006] Compared with the prior art, the alarm sound recognition method provided in this application first obtains the Mel frequency cepstral coefficients of the input speech, and then obtains the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients. By extracting and analyzing the time-frequency features of the input speech, it is determined whether the input speech contains an alarm sound, which can realize the recognition of various alarm sounds, thereby adapting to more diverse alarm scenarios.
[0007] In an optional embodiment, obtaining the target time-frequency features of the input speech based on the Mel-frequency cepstral coefficients includes: inputting the Mel-frequency cepstral coefficients into a two-dimensional deep separable convolutional neural network (DSN) to obtain a first time-frequency feature output by the DSN; performing pooling processing on the first time-frequency feature to obtain a first time-domain feature; inputting the first time-domain feature into a one-dimensional deep separable convolutional neural network (DSN) to obtain a second time-domain feature output by the one-dimensional DSN; and obtaining the target time-frequency features based on the second time-domain feature and the first time-frequency feature. Using both two-dimensional and one-dimensional deep separable convolutional neural networks to extract the target time-frequency features requires less computational power, which is beneficial for deployment on low-computing-power devices, reducing the hardware computational requirements and thus lowering costs.
[0008] In an optional embodiment, obtaining the target time-frequency feature based on the second time-domain feature and the first time-frequency feature includes: copying the second time-domain feature h times in the frequency domain dimension to obtain a copied feature, where h is the size of the frequency domain dimension of the time-frequency feature; splicing the copied feature and the first time-frequency feature to form a spliced feature; and determining the target time-frequency feature based on the spliced feature.
[0009] In an optional embodiment, determining the target time-frequency feature based on the concatenated features includes: using the concatenated features as the target time-frequency feature; or, using the two-dimensional deep separable convolutional neural network to obtain a second time-frequency feature of the input speech based on the concatenated features; performing pooling processing on the third time-frequency feature to obtain a third time-domain feature; using the one-dimensional deep separable convolutional neural network to obtain a fourth time-domain feature based on the third time-domain feature; and obtaining the target time-frequency feature based on the fourth time-domain feature and the second time-frequency feature. Repeatedly extracting features from the concatenated features as new input data to obtain the target time-frequency feature improves the effectiveness of the target time-frequency feature.
[0010] In an optional embodiment, the step of splicing the copy feature and the time-frequency feature to form the splicing feature includes: adding the copy feature and the first time-frequency feature pixel by pixel to form the splicing feature.
[0011] In an optional embodiment, determining whether the input speech contains an alarm sound based on the target time-frequency features includes: inputting the target time-frequency features into a fully connected layer to obtain the output parameters of the fully connected layer; inputting the output parameters into an activation function to obtain the probability value output by the activation function; determining that the input speech contains the alarm sound when the probability value is greater than or equal to a preset probability threshold; and determining that the input speech does not contain the alarm sound when the probability value is less than the preset probability threshold.
[0012] In an optional embodiment, before inputting the target time-frequency feature into the fully connected layer, the alarm sound recognition method further includes: compressing the number of channels of the target time-frequency feature using a preset convolutional neural network; inputting the target time-frequency feature into the fully connected layer includes: inputting the target time-frequency feature with the compressed number of channels into the fully connected layer. Using a preset convolutional neural network to compress the number of channels of the target time-frequency feature can reduce the number of parameters of the target time-frequency feature input into the fully connected layer, reduce computational requirements, and thus reduce costs.
[0013] In an optional embodiment, obtaining the Mel frequency cepstral coefficients of the input speech includes: obtaining the amplitude spectrum of the input speech; squaring the amplitude spectrum and processing it through a Mel filter bank to obtain Mel filter bank processing parameters; taking the logarithm of the Mel filter bank processing parameters and performing a discrete cosine transform to obtain the Mel frequency cepstral coefficients.
[0014] Secondly, embodiments of this application provide an alarm sound recognition device, comprising: a Mel frequency cepstral coefficient acquisition module, the Mel frequency cepstral coefficient acquisition module being used to acquire the Mel frequency cepstral coefficients of input speech; and an alarm sound recognition module, the alarm sound recognition module being used to acquire the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients, and to determine whether the input speech contains an alarm sound based on the target time-frequency features.
[0015] Thirdly, embodiments of this application provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the aforementioned alarm sound recognition method.
[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which is executed by a processor to implement the aforementioned alarm sound recognition method.
[0017] Compared with existing technologies, the alarm sound recognition method and apparatus, alarm sound recognition model training method, electronic device, and computer-readable storage medium provided in this application first obtain the Mel-frequency cepstral coefficients of the input speech, and then obtain the target time-frequency features of the input speech based on the Mel-frequency cepstral coefficients. By extracting and analyzing the time-frequency features of the input speech, it is determined whether the input speech contains an alarm sound, thus enabling the recognition of various alarm sounds and adapting to more diverse alarm scenarios. The use of two-dimensional deep separable convolutional neural networks and one-dimensional deep separable convolutional neural networks to extract the target time-frequency features reduces the hardware computing power requirements, thereby reducing costs. Furthermore, using a preset convolutional neural network to compress the number of channels of the target time-frequency features can reduce the number of parameters of the target time-frequency features input to the fully connected layer, further reducing computing power requirements and thus further reducing costs. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the alarm sound recognition method provided in Embodiment 1 of this application;
[0020] Figure 2 This is a schematic diagram of the process for obtaining the Mel frequency cepstral coefficients of the input speech in the alarm sound recognition method provided in some embodiments of this application;
[0021] Figure 3 This is a flowchart illustrating the process of obtaining the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients in the alarm sound recognition method provided in some embodiments of this application.
[0022] Figure 4 This is a schematic diagram illustrating the process of obtaining the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients in an alarm sound recognition method provided in a specific embodiment of this application.
[0023] Figure 5 This is a schematic diagram illustrating the process of determining whether an input voice contains an alarm sound based on the time-frequency characteristics of the target in the alarm sound recognition method provided in some embodiments of this application.
[0024] Figure 6 This is a flowchart illustrating the process of determining whether an input voice contains an alarm sound based on the time-frequency characteristics of the target in an alarm sound recognition method provided in other embodiments of this application.
[0025] Figure 7 This is a schematic diagram of the alarm sound recognition device provided in Embodiment 2 of this application;
[0026] Figure 8 A schematic diagram of the model structure of the alarm sound recognition model provided in some embodiments of this application;
[0027] Figure 9 This is a schematic diagram of the structure of the electronic device provided in Embodiment 3 of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0029] Therefore, the following detailed description of embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the present application.
[0030] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0031] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0032] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.
[0033] Embodiment 1 of this application provides an alarm sound recognition method, such as Figure 1 As shown, it includes:
[0034] Step S101: Obtain the Mel frequency cepstral coefficients of the input speech.
[0035] Step S102: Obtain the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients.
[0036] Step S103: Determine whether the input voice contains an alarm sound based on the target time-frequency characteristics.
[0037] Compared with the prior art, the alarm sound recognition method provided in Embodiment 1 of this application firstly obtains the Mel frequency cepstral coefficients of the input speech, then obtains the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients, and determines whether the input speech contains an alarm sound by extracting and analyzing the time-frequency features of the input speech. This enables the recognition of various alarm sounds, thereby adapting to more diverse alarm scenarios.
[0038] In step S101, the input voice is the voice segment that needs to be recognized as an alarm sound. Specifically, it can be the ambient voice collected by the alarm sound recognition device. For example, the alarm sound recognition device can continuously collect ambient voice, and at preset time intervals, use the ambient voice segment collected within the preset time interval as the input voice for alarm sound recognition.
[0039] Furthermore, in some embodiments of this application, such as Figure 2 As shown, obtaining the Mel frequency cepstral coefficients of the input speech can specifically include:
[0040] Step S201: Obtain the amplitude spectrum of the input speech.
[0041] In this step, the input speech can be framed and windowed before being subjected to a Fast Fourier Transform to obtain the amplitude spectrum of the input speech.
[0042] Step S202: After squaring the amplitude spectrum, process it through a Mel filter bank to obtain the Mel filter bank processing parameters.
[0043] Step S203: After taking the logarithm of the parameters of the Mel filter bank, perform a discrete cosine transform to obtain the Mel frequency cepstral coefficients.
[0044] In step S102, as Figure 3 As shown, obtaining the target time-frequency features of input speech based on Mel frequency cepstral coefficients can specifically include:
[0045] Step S301: Input the Mel frequency cepstral coefficients into a two-dimensional deep separable convolutional neural network to obtain the first time-frequency feature output by the two-dimensional deep separable convolutional neural network.
[0046] In this step, the two-dimensional deep separable convolutional neural network is a type of convolutional neural network, and it uses deep separable convolution as its basic operation. Deep separable convolution decomposes traditional convolution into two parts: channel-wise convolution and pointwise convolution. In the channel-wise convolution stage, each channel of the input Mel-frequency cepstral coefficients is processed by a convolution kernel, and the outputs of all kernels are then concatenated to obtain the final output. Pointwise convolution is actually a 1×1 convolution, with a kernel size of 1×1×M, where M is the number of channels in the channel-wise convolution output information. Therefore, each kernel in pointwise convolution weights and combines the channel-wise convolution output information in the channel direction to generate a new output. In the embodiments of this application, the output of pointwise convolution is the first time-frequency feature of the input speech.
[0047] Step S302: Perform pooling processing on the first time-frequency feature to obtain the first time-domain feature.
[0048] In this step, pooling is a commonly used operation in deep learning. It is used to reduce the size of the feature map and extract relevant information that is robust to the input features. Pooling is performed on the feature map by dividing it into non-overlapping regions and then pooling each region to obtain the pooled feature values. Common pooling operations include max pooling and average pooling. Max pooling selects the maximum value in each region as the pooling result for that region, while average pooling calculates the average of the feature values in each region as the pooling result. The main function of pooling is to reduce the size of the feature map, thereby reducing the number of parameters and computational cost, while also exhibiting translation invariance and partial scale invariance. In the embodiments of this application, the feature map is the first time-frequency feature, and the feature values are the first time-domain feature.
[0049] Step S303: Input the first temporal feature into a one-dimensional deep separable convolutional neural network to obtain the second temporal feature output by the one-dimensional deep separable convolutional neural network.
[0050] In this step, the structure of the one-dimensional deep separable convolutional neural network is roughly the same as that of the two-dimensional deep separable convolutional neural network in step S301 above. It also includes two parts: channel-wise convolution and point-wise convolution. The difference is that the one-dimensional deep separable convolutional neural network is used to process one-dimensional data, and its window and convolution kernel are one-dimensional, while the two-dimensional deep separable convolutional neural network is used to process two-dimensional data, and its window and convolution kernel are two-dimensional.
[0051] In the embodiments of this application, the Mel frequency cepstral coefficients are two-dimensional data, so they are processed using a two-dimensional depthwise separable convolutional neural network, while the first time-domain feature obtained after pooling is one-dimensional data, so it is processed using a one-dimensional depthwise separable convolutional neural network.
[0052] Step S304: Obtain the target time-frequency features based on the second time-domain features and the first time-frequency features.
[0053] In this step, the second time-domain feature can be copied h times in the frequency domain to obtain the copied feature, where h is the size of the frequency domain dimension of the time-frequency feature; the copied feature and the first time-frequency feature are spliced together to form the spliced feature, and the target time-frequency feature is determined based on the spliced feature.
[0054] In some embodiments of this application, the splicing of the copy feature and the time-frequency feature is formed by splicing the copy feature and the first time-frequency feature pixel by pixel to form the splicing feature.
[0055] Please refer to Figure 4 ,like Figure 4 The diagram shown is a schematic representation of the process of obtaining the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients in an alarm sound recognition method provided in a specific embodiment of this application.
[0056] like Figure 4 As shown, after the Mel-frequency cepstral coefficients are input into a two-dimensional deep separable convolutional neural network (DSN), the DSN outputs a first time-frequency feature, where w is the time-domain dimension of the first time-frequency feature, h is the frequency-domain dimension of the first time-frequency feature, and c is the number of channels of the first time-frequency feature. The first time-frequency feature is then pooled to obtain a first time-domain feature. After inputting the first time-domain feature into a one-dimensional deep separable convolutional neural network (DSN), the one-dimensional deep separable convolutional neural network outputs a second time-domain feature. The second time-domain feature is then copied h times in the frequency-domain dimension to obtain a copied feature. The copied feature and the first time-frequency feature have a one-to-one correspondence structure. The copied feature and the first time-frequency feature can be added pixel-by-pixel to form a concatenated feature.
[0057] In some embodiments of this application, the concatenated features can be directly used as the target time-frequency features. In other embodiments, the concatenated features can be used as input data and input again into a two-dimensional deep separable convolutional neural network (DCNN). The DCNN obtains the second time-frequency features of the input speech based on the concatenated features. Then, the third time-frequency features are pooled again to obtain the third time-domain features. The third time-domain features are then input into a one-dimensional deep separable convolutional neural network (DCNN) to obtain the fourth time-domain features. The fourth time-domain features are copied h times in the frequency domain to obtain new copied features. These new copied features are then concatenated with the second time-frequency features to form a new concatenated feature. After obtaining the new concatenated features, they can be used as the target time-frequency features as needed, or the new concatenated features can be input into the two-dimensional deep separable convolutional neural network again and repeated a set number of times to obtain the final concatenated features as the target time-frequency features. Repeatedly extracting features from the concatenated features as new input data to obtain the target time-frequency features improves the effectiveness of the target time-frequency features.
[0058] Compared with existing technologies, the embodiments of this application use two-dimensional deep separable convolutional neural networks and one-dimensional deep separable convolutional neural networks to extract target time-frequency features, which has lower requirements for computing power, making it easier to deploy on low-computing-power devices, reducing the requirements for hardware computing power, and thus reducing costs.
[0059] It is understood that the aforementioned use of two-dimensional deep separable convolutional neural networks and one-dimensional deep separable convolutional neural networks to extract target time-frequency features is merely an example of extracting target time-frequency features in some embodiments of this application and does not constitute a limitation. In some other embodiments of this application, other neural network structures such as recurrent neural networks, adversarial neural networks, and graph neural networks can also be used, and the specific selection can be made flexibly according to actual needs.
[0060] In some embodiments of this application, such as Figure 5 As shown, in step S103, determining whether the input speech contains an alarm sound based on the target time-frequency characteristics can specifically be as follows:
[0061] Step S501: Input the target time-frequency features into the fully connected layer and obtain the output parameters of the fully connected layer.
[0062] Step S502: Input the output parameters into the activation function and obtain the probability value output by the activation function.
[0063] Step S503: Determine that the input voice contains an alarm sound when the probability value is greater than or equal to a preset probability threshold, and determine that the input voice does not contain an alarm sound when the probability value is less than the preset probability threshold.
[0064] Furthermore, in some embodiments of this application, such as Figure 6 As shown, in step S103, determining whether the input speech contains an alarm sound based on the target time-frequency characteristics can specifically be as follows:
[0065] Step S601: Compress the number of channels of the target time-frequency features using a preset convolutional neural network.
[0066] Step S602: Input the target time-frequency features after channel compression into the fully connected layer to obtain the output parameters of the fully connected layer.
[0067] Step S603: Input the output parameters into the activation function and obtain the probability value output by the activation function.
[0068] Step S604: Determine that the input voice contains an alarm sound when the probability value is greater than or equal to a preset probability threshold, and determine that the input voice does not contain an alarm sound when the probability value is less than the preset probability threshold.
[0069] Compared with existing technologies, using a pre-defined convolutional neural network to compress the number of channels of the target time-frequency features can reduce the number of parameters of the target time-frequency features input to the fully connected layer, reduce computing power requirements, and further reduce costs.
[0070] Embodiment 2 of this application provides an alarm sound recognition device, such as Figure 7 As shown, it includes: a Mel frequency cepstral coefficient acquisition module 701, which is used to acquire the Mel frequency cepstral coefficients of the input speech; and an alarm sound recognition module 702, which is used to acquire the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients, and determine whether the input speech contains an alarm sound based on the target time-frequency features.
[0071] Compared with the prior art, in the alarm sound recognition device provided in Embodiment 2 of this application, the Mel frequency cepstral coefficient acquisition module 701 first acquires the Mel frequency cepstral coefficient of the input speech, and then the alarm sound recognition module 702 acquires the target time-frequency features of the input speech based on the Mel frequency cepstral coefficient. By extracting and analyzing the time-frequency features of the input speech, it is determined whether the input speech contains an alarm sound, which can realize the recognition of various alarm sounds, thereby adapting to more diverse alarm scenarios.
[0072] In the embodiments of this application, an alarm sound recognition model can be run in the alarm sound recognition module 702, such as... Figure 8As shown, the alarm sound recognition model can include a two-dimensional deep separable convolutional neural network layer 801, a pooling layer 802, a one-dimensional deep separable convolutional neural network layer 803, a splicing layer 804, and a fully connected layer 805. In practical applications, various alarm sounds such as baby cries, buzzers, car horns, smoke alarms, fire truck sounds, ambulance sounds, police car sounds, explosion sounds, and train whistles can be used as training data to train the alarm sound recognition model. The trained alarm sound recognition model can then be used for alarm sound recognition.
[0073] In embodiments of this application, the alarm sound recognition module 702 is further configured to input the Mel frequency cepstral coefficients into a two-dimensional deep separable convolutional neural network to obtain a first time-frequency feature output by the two-dimensional deep separable convolutional neural network; perform pooling processing on the first time-frequency feature to obtain a first time-domain feature; input the first time-domain feature into a one-dimensional deep separable convolutional neural network to obtain a second time-domain feature output by the one-dimensional deep separable convolutional neural network; and obtain a target time-frequency feature based on the second time-domain feature and the first time-frequency feature.
[0074] In the embodiments of this application, the alarm sound recognition module 702 is further configured to copy the second time-domain feature N times in the frequency domain dimension to obtain the copied feature, where N is the size of the frequency domain dimension of the time-frequency feature; splice the copied feature and the first time-frequency feature to form a spliced feature, and determine the target time-frequency feature based on the spliced feature.
[0075] In embodiments of this application, the alarm sound recognition module 702 is further configured to use the spliced features as the target time-frequency features; or, use a two-dimensional deep separable convolutional neural network to obtain the second time-frequency features of the input speech based on the spliced features; perform pooling processing on the third time-frequency features to obtain the third time-domain features; use a one-dimensional deep separable convolutional neural network to obtain the fourth time-domain features based on the third time-domain features; and obtain the target time-frequency features based on the fourth time-domain features and the second time-frequency features.
[0076] In the embodiments of this application, the alarm sound recognition module 702 is further used to add the copy feature and the first time-frequency feature pixel by pixel to form a splicing feature.
[0077] In the embodiments of this application, the alarm sound recognition module 702 is further configured to input the target time-frequency features into the fully connected layer to obtain the output parameters of the fully connected layer; input the output parameters into the activation function to obtain the probability value output by the activation function; determine that the input speech contains an alarm sound when the probability value is greater than or equal to a preset probability threshold; and determine that the input speech does not contain an alarm sound when the probability value is less than the preset probability threshold.
[0078] In the embodiments of this application, the alarm sound recognition module 702 is further used to compress the number of channels of the target time-frequency features using a preset convolutional neural network, and input the target time-frequency features after channel compression into a fully connected layer.
[0079] In the embodiments of this application, the Mel frequency cepstral coefficient acquisition module 701 is further used to acquire the amplitude spectrum of the input speech; after squaring the amplitude spectrum, it is processed by the Mel filter bank to obtain the Mel filter bank processing parameters; after taking the logarithm of the Mel filter bank processing parameters, a discrete cosine transform is performed to obtain the Mel frequency cepstral coefficients.
[0080] Embodiment 3 of this application relates to an electronic device, such as... Figure 9 As shown, it includes: at least one processor 901; and a memory 902 communicatively connected to at least one processor 901; wherein the memory 902 stores instructions executable by at least one processor 901, the instructions being executed by at least one processor 901 to enable at least one processor 901 to perform the alarm sound recognition method in the above embodiments.
[0081] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0082] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0083] Embodiment 4 of this application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the method embodiments described above.
[0084] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0085] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for recognizing alarm sounds, characterized in that, include: Obtain the Mel-frequency cepstral coefficients of the input speech; The target time-frequency features of the input speech are obtained based on the Mel frequency cepstral coefficients. Determine whether the input speech contains an alarm sound based on the target time-frequency characteristics; The step of obtaining the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients includes: The Mel frequency cepstral coefficients are input into a two-dimensional deep separable convolutional neural network to obtain the first time-frequency feature output by the two-dimensional deep separable convolutional neural network; The first time-frequency feature is pooled to obtain the first time-domain feature; The first temporal feature is input into a one-dimensional deep separable convolutional neural network to obtain the second temporal feature output by the one-dimensional deep separable convolutional neural network; The target time-frequency features are obtained based on the second time-domain features and the first time-frequency features.
2. The alarm sound recognition method according to claim 1, characterized in that, The step of obtaining the target time-frequency features based on the second time-domain features and the first time-frequency features includes: The second time-domain feature is copied h times in the frequency domain to obtain the copied feature, where h is the size of the frequency domain dimension of the time-frequency feature; The copied feature and the first time-frequency feature are spliced together to form a spliced feature, and the target time-frequency feature is determined based on the spliced feature.
3. The alarm sound recognition method according to claim 2, characterized in that, Determining the target time-frequency features based on the splicing features includes: Use the splicing features as the target time-frequency features; or... The two-dimensional deep separable convolutional neural network is used to obtain the second time-frequency features of the input speech based on the splicing features; The second time-frequency feature is pooled to obtain the third time-domain feature; The one-dimensional depthwise separable convolutional neural network is used to obtain the fourth temporal feature based on the third temporal feature; The target time-frequency feature is obtained based on the fourth time-domain feature and the second time-frequency feature.
4. The alarm sound recognition method according to claim 2, characterized in that, The process of splicing the replication feature and the time-frequency feature to form the splicing feature includes: The copy feature and the first time-frequency feature are added pixel by pixel to form the splicing feature.
5. The alarm sound recognition method according to claim 1, characterized in that, Determining whether the input speech contains an alarm sound based on the target time-frequency characteristics includes: The target time-frequency features are input into the fully connected layer to obtain the output parameters of the fully connected layer; The output parameters are input into an activation function to obtain the probability value output by the activation function. When the probability value is greater than or equal to a preset probability threshold, it is determined that the input voice contains the alarm sound. When the probability value is less than the preset probability threshold, it is determined that the input voice does not contain the alarm sound.
6. The alarm sound recognition method according to claim 5, characterized in that, Before inputting the target time-frequency features into the fully connected layer, the alarm sound recognition method further includes: The number of channels of the target time-frequency features is compressed using a preset convolutional neural network; The step of inputting the target time-frequency features into the fully connected layer includes: The target time-frequency features, after channel number compression, are input into the fully connected layer.
7. The alarm sound recognition method according to any one of claims 1 to 6, characterized in that, The acquisition of the Mel-frequency cepstral coefficients of the input speech includes: Obtain the amplitude spectrum of the input speech; The amplitude spectrum is squared and then processed by a Mel filter bank to obtain the Mel filter bank processing parameters. The Mel frequency cepstral coefficients are obtained by taking the logarithm of the processing parameters of the Mel filter bank and then performing a discrete cosine transform.
8. An alarm sound recognition device, characterized in that, include: A Mel-frequency cepstral coefficient acquisition module, which is used to acquire the Mel-frequency cepstral coefficients of the input speech; An alarm sound recognition module is used to obtain the target time-frequency features of the input speech based on the Mel frequency cepstral coefficients, and to determine whether the input speech contains an alarm sound based on the target time-frequency features. The alarm sound recognition module is specifically used to input the Mel frequency cepstral coefficients into a two-dimensional deep separable convolutional neural network to obtain the first time-frequency feature output by the two-dimensional deep separable convolutional neural network; to perform pooling processing on the first time-frequency feature to obtain a first time-domain feature; to input the first time-domain feature into a one-dimensional deep separable convolutional neural network to obtain the second time-domain feature output by the one-dimensional deep separable convolutional neural network; and to obtain the target time-frequency feature based on the second time-domain feature and the first time-frequency feature.
9. An electronic device, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the alarm sound recognition method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by a processor to implement the alarm sound recognition method according to any one of claims 1 to 7.