A method and device for identifying characteristic sound
By splitting and merging the sound data to be detected, the problem of low accuracy of characteristic sound recognition in the prior art is solved, and the start and end time of the characteristic sound fragments are accurately determined.
Patent Information
- Application Number
- CN201810801712.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-07-20
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2038-07-20
AI Technical Summary
When identifying characteristic sounds, the existing technology has low accuracy and cannot determine the start time and end time of the characteristic sounds.
By splitting the sound data to be detected, the unit sound data is intercepted, and the trained detection model is used to determine the probability of the characteristic sound, the characteristic sound data is marked according to the preset threshold, the continuous characteristic sound fragments are merged, and the start and end of the fragment are adjusted. time.
The accuracy of sound recognition is improved and the start and end times of characteristic sound clips are accurately determined.
Smart Images

Figure CN110751942B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for identifying characteristic sounds. Background Art
[0002] With the development of computer technology and deep learning, the analysis technology of sound features can be used to identify some characteristic sounds (coughs, cries for help or hiccups, etc.) to achieve the purpose of automatic monitoring. This monitoring method has the advantages of low cost, high efficiency, and all-round non-contact monitoring, which can reduce labor costs to a certain extent. In the prior art, the identification of characteristic sounds is generally carried out by directly judging and processing the acquired sound data to be detected. The final result is that there is a characteristic sound in the large section of sound to be detected, or there is no characteristic sound. The method of identifying characteristic sounds in the prior art not only has low recognition accuracy, but also cannot determine the start time and end time of the characteristic sound. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a method and device for identifying characteristic sounds, which can improve the accuracy of sound recognition and can further accurately determine the start time and end time of each characteristic sound segment based on the start time and end time of each unit sound data.
[0004] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for identifying a characteristic sound is provided.
[0005] The method for identifying characteristic sounds in an embodiment of the present invention includes: splitting the sound data to be detected and extracting at least one segment of unit sound data; determining the unit sound data belonging to the characteristic sound from the at least one segment of unit sound data; and merging the unit sound data belonging to the characteristic sound according to the time distance between the unit sound data to obtain a characteristic sound segment.
[0006] Optionally, the step of splitting the sound data to be detected and extracting at least one segment of unit sound data includes: splitting the sound data to be detected according to the sliding window; and extracting the unit sound data, wherein the unit sound data is the sound data included in each sliding window.
[0007] Optionally, the step of determining the unit sound data belonging to the characteristic sound from the at least one segment of unit sound data includes: determining the probability that each segment of unit sound data is the characteristic sound through a trained detection model; and marking the unit sound data belonging to the characteristic sound from the at least one segment of unit sound data according to a preset probability threshold.
[0008] Optionally, before determining the probability that each unit sound data is a characteristic sound through the trained detection model, the method further includes: obtaining labeled training data, wherein the training data labeled as 1 is a characteristic sound, and the training data labeled as 0 is a non-characteristic sound; building a network model including 3 layers of two-dimensional convolutional neural networks and two layers of fully connected layers, wherein the last fully connected layer includes neurons using a sigmoid activation function; based on the training data and the network model, training to obtain a detection model, wherein the target loss function Loss is:
[0009] Loss=-∑targets*log(predict)
[0010] Targets represents the true value, which can be 0 or 1; predict represents the predicted value.
[0011] Optionally, according to a preset probability threshold, the step of marking the unit sound data belonging to the characteristic sound from the at least one section of unit sound data comprises: determining whether the probability of the unit sound data being the characteristic sound is greater than a preset probability threshold, if so, marking the unit sound data as 1; otherwise, marking it as 0;
[0012] The step of merging the unit sound data belonging to the characteristic sound according to the time distance between them to obtain the characteristic sound segment includes: merging the unit sound data marked as 1 continuously in time order to obtain at least one preliminary characteristic sound segment.
[0013] Optionally, after merging the unit sound data marked as 1 continuously in chronological order, it also includes: judging whether the time distance between the at least one step characteristic sound segment is less than a preset distance offset; if less, merging them to obtain the characteristic sound segment.
[0014] Optionally, before splitting the sound data to be detected and extracting at least one unit sound data, the method further includes: performing emphasis processing on the sound to be detected; and performing windowing processing on the emphasized sound to be detected through a Hamming window.
[0015] Optionally, the size of the sliding window is 0.3s-0.7s, the step size of the sliding window is 70ms-85ms; and / or, the characteristic sound is a pig cough.
[0016] To achieve the above objective, according to another aspect of an embodiment of the present invention, a device for identifying characteristic sounds is provided.
[0017] The device for identifying characteristic sounds in an embodiment of the present invention includes: a unit sound data interception module, which is used to split the sound data to be detected and intercept at least one segment of unit sound data; a characteristic sound determination module, which is used to determine the unit sound data belonging to the characteristic sound from the at least one segment of unit sound data; and a characteristic sound segment determination module, which is used to merge the unit sound data belonging to the characteristic sound according to the time distance between them to obtain a characteristic sound segment.
[0018] Optionally, the unit sound data interception module is further used to split the sound data to be detected according to the sliding window; intercept the unit sound data, and the unit sound data is the sound data included in each sliding window.
[0019] Optionally, the characteristic sound determination module is further used to determine the probability that each segment of unit sound data is a characteristic sound through a trained detection model; and to mark the unit sound data belonging to the characteristic sound from the at least one segment of unit sound data according to a preset probability threshold.
[0020] Optionally, a training module is further included, which is used to obtain labeled training data, wherein the training data labeled as 1 is a characteristic sound, and the training data labeled as 0 is a non-characteristic sound; a network model including three layers of two-dimensional convolutional neural network and two layers of fully connected layers is constructed, wherein the last layer of fully connected layer contains neurons using a sigmoid activation function; based on the training data and the network model, a detection model is trained, wherein the target loss function Loss is:
[0021] Loss=-∑targets*log(predict)
[0022] Targets represents the true value, which can be 0 or 1; predict represents the predicted value.
[0023] Optionally, the characteristic sound determination module is also used to determine whether the probability that the unit sound data is a characteristic sound is greater than a preset probability threshold. If so, the unit sound data is marked as 1; otherwise, it is marked as 0; the characteristic sound segment determination module is also used to merge the unit sound data that are continuously marked as 1 in chronological order to obtain at least one preliminary characteristic sound segment.
[0024] Optionally, the characteristic sound segment determination module is further used to determine whether the time distance between the at least one segment of characteristic sound segments is less than a preset distance offset; if less, merge them to obtain the characteristic sound segment.
[0025] Optionally, a pre-processing module is further included, which is used to perform emphasis processing on the sound to be detected; and perform windowing processing on the emphasized sound to be detected through a Hamming window.
[0026] Optionally, the size of the sliding window is 0.3s-0.7s, the step size of the sliding window is 70ms-85ms; and / or, the characteristic sound is a pig cough.
[0027] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.
[0028] The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned methods for identifying characteristic sounds.
[0029] To achieve the above-mentioned purpose, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, any of the above-mentioned methods for identifying characteristic sounds is implemented.
[0030] An embodiment of the above invention has the following advantages or beneficial effects: by splitting the sound data to be detected, extracting the unit sound data, and identifying each section of the unit sound data, it is determined whether each section of the unit sound data is a characteristic sound. Finally, based on the distance between each section of the unit sound data belonging to the characteristic sound, they are merged, and the merged unit sound data constitute a characteristic sound segment. The embodiment of the present invention can not only improve the accuracy of sound recognition, but also can further accurately determine the start time and end time of each characteristic sound segment according to the start time and end time of each section of the unit sound data.
[0031] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0033] Figure 1 is a schematic diagram of the main process of the method for identifying characteristic sounds according to an embodiment of the present invention;
[0034] Figure 2 is a schematic diagram of a method for identifying a pig coughing sound according to an embodiment of the present invention;
[0035] Figure 3 is a schematic diagram of a pig coughing sound after being aggravated according to an embodiment of the present invention;
[0036] Figure 4 is a schematic diagram of a pig coughing sound after windowing according to an embodiment of the present invention;
[0037] Figure 5 is a schematic diagram of framing a pig cough sound according to an embodiment of the present invention;
[0038] Figure 6 is a schematic diagram of an 81-dimensional spectrum feature according to an embodiment of the present invention;
[0039] Figure 7 is a schematic diagram of main modules of a device for recognizing characteristic sounds according to an embodiment of the present invention;
[0040] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0041] Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0043] Figure 1 FIG. 1 is a schematic diagram of the main process of the method for identifying characteristic sounds according to an embodiment of the present invention. Figure 1 As shown, the method for identifying characteristic sounds in the embodiment of the present invention mainly includes:
[0044] Step S101: split the sound data to be detected and extract at least one unit sound data. Through this process, the sound data to be detected can be subdivided and processed, and each segment of the split data can be used as a unit sound data, or a part of the split data can be extracted as the unit sound data for subsequent detection. The sound data to be detected can be split according to the sliding window, and the unit sound data can be extracted. The unit sound data is the sound data included in each sliding window.
[0045] The size of the sliding window is 0.3s-0.7s, and the step size of the sliding window is 70ms-85ms. The sliding window is a flow control technology that can extract small segments of unit sound data from a large section of data to be processed by setting the size (size) and step size (interval) of the sliding window. For example, for a pig cough with a single duration of 0.4s to 0.6s and an interval of no more than 200ms, the size of the sliding window is set to 0.6s, and the step size of the window sliding is 80ms, which can ensure that each window contains cough information. In the subsequent detection process, the sound data contained in the sliding window can be directly processed, and the data not contained in the sliding window does not need to be processed. Through the above steps, the accuracy of recognition can be greatly improved.
[0046] Before step S101, the emphasis processing can enhance the high-frequency signal-to-noise ratio of the signal and minimize the interference information of non-characteristic sound, and the sound to be detected is emphasized; the emphasized sound to be detected is windowed by a Hamming window. Among them, the Hamming window is a method for windowing and framing speech signals, which can maintain the continuity between frames.
[0047] Step S102: Determine the unit sound data belonging to the characteristic sound from at least one unit sound data. Specifically, determine the probability of each unit sound data being the characteristic sound through the trained detection model; and mark the unit sound data belonging to the characteristic sound from at least one unit sound data according to a preset probability threshold.
[0048] For the training of the detection model, first obtain the labeled training data. The training data labeled as 1 is the characteristic sound, and the training data labeled as 0 is the non-characteristic sound. Then build a network model including 3 layers of 2D convolutional neural network and 2 layers of fully connected layers, where the last layer of fully connected layer contains neurons using sigmoid activation function. Finally, based on the training data and network model, the detection model is trained, where the target loss function Loss is:
[0049] Loss=-∑targets*log(predict)
[0050] Targets represents the true value, which can be 0 or 1; predict represents the predicted value.
[0051] The neural network parameter training adopts the SGD (Stochastic Gradient Descent, a parameter update method of the neural network) method, the batch size is 64, and the learning rate of the model decreases with the increase of epoch (when a complete data set passes through the neural network once and returns once, this process is called an epoch). When the Loss function is stable, the model training is stopped, and the model with the best performance on the validation set is selected as the final detection model. This method embodiment uses a CNN convolutional neural network to train the sound samples, and the training parameters select SGD, and the model with the best performance on the sample set is selected as the final monitoring model. Convolutional neural networks show significant advantages in feature extraction. Convolutional neural networks have unique advantages in speech recognition with their special structure of local weight sharing. Their layout is closer to actual biological neural networks. Weight sharing reduces the complexity of the network, avoids the complexity of data reconstruction in feature extraction and classification, and uses the invariance of convolution to overcome the variability in speech.
[0052] Since the sliding window length is relatively small and the number of windows is large, it is a waste of computing resources to predict only one window at a time. However, two methods can be optimized to improve the CPU computing resource utilization and increase the computing speed of the prediction stage by 50%. First, the batch method: Since the length of each sliding window is fixed, adjacent windows with an exponential multiple of 2 can be used for batch calculation, which greatly improves the computing speed. Generally, 32, 64, and 128 are selected. And, the multi-threading method: The number of threads is reasonably set according to the CPU computing resources, which effectively improves the CPU resource utilization.
[0053] Step S103: According to the time distance between the unit sound data belonging to the characteristic sound, merge them to obtain the characteristic sound segment. Since each unit sound data has a temporal sequence, based on the time series, there is a time distance between the unit sound data. For example, the start time of one unit sound data is 10:30 and the end time is 10:35, and the start time of another unit sound data is 10:40 and the end time is 10:45, then the time distance between the two unit sound data is 5 minutes. If it is preset that the unit sound data with a time distance of less than 10 minutes is to be merged, the above two unit sound data are to be merged. If these two unit sound data have been determined to be characteristic sounds, the merged segment data constitutes a characteristic sound segment.
[0054] In step S102, it can also be determined whether the probability of the unit sound data being a characteristic sound is greater than a preset probability threshold. If so, the unit sound data is marked as 1; otherwise, it is marked as 0. Then in step S103, the unit sound data that are continuously marked as 1 can be merged in chronological order to obtain at least one preliminary characteristic sound segment. The at least one preliminary characteristic sound segment is the characteristic data identified from the sound data to be detected, and since the start time and the end time of each preliminary characteristic sound segment are easy to determine, the start time and the end time of the identified characteristic data can be further determined, which is an effect that cannot be achieved by the prior art. Assuming that the probability sequence of the sliding window is [0,0,1,1,0,1,1,1,0,0,1,1], this sequence has a total of 3 segments that are continuously greater than the probability threshold 1, which are [1,1], [1,1,1,], [1,1]. Merge [1,1], [1,1,1,], [1,1] respectively to obtain three characteristic sound segments.
[0055] And after merging the unit sound data marked as 1 continuously in time order, it is determined whether the time distance between at least one segment of the characteristic sound segments is less than the preset distance offset; if less than, they are merged to obtain the characteristic sound segment. Through this process, the start time and the end time of the characteristic sound segment can be fine-tuned. For example, one characteristic sound segment is formed by merging 10 unit sound segments, and the other characteristic sound segment is formed by merging 8 unit sound segments. There is only one unit sound segment between the two characteristic sound segments (equivalent to the time distance between the two segments being less than the preset distance offset), then the two characteristic sound segments can be further synthesized to form a characteristic sound segment. This process has a fine-tuning effect on the start time and the end time of the characteristic sound segment, and the recognized result is more in line with the actual data, further improving the accuracy of recognition.
[0056] The embodiment of the present invention splits the sound data to be detected, extracts the unit sound data, and identifies each section of the unit sound data to determine whether each section of the unit sound data is a characteristic sound. Finally, based on the distance between each section of the unit sound data belonging to the characteristic sound, it is merged, and the merged unit sound data constitutes a characteristic sound segment. The embodiment of the present invention can not only improve the accuracy of sound recognition, but also accurately determine the start time and end time of each section of the characteristic sound segment according to the start time and end time of each section of the unit sound data. In addition, the unit sound data is intercepted by a sliding window method, and the CNN convolutional neural network is trained on the sound sample. The training parameter selects SGD, and the model with the best performance on the verification set is selected as the final detection model. The convolutional neural network shows significant advantages in feature extraction. The convolutional neural network has unique advantages in speech recognition with its special structure of local weight sharing. Its layout is closer to the actual biological neural network. The weight sharing reduces the complexity of the network, avoids the complexity of data reconstruction in the feature extraction and classification process, and utilizes the invariance of convolution to overcome the variability in speech.
[0057] As the pig farming industry is gradually developing in the direction of large-scale production and automated production, how to quickly and effectively monitor the frequent respiratory diseases of pigs in farming has always been a hot spot and difficulty in animal husbandry research. In general, in large-scale pig farms, one person is responsible for an average of 100 pigs. The breeders are unable to detect the coughs of sick pigs in time, resulting in the failure to detect and deal with sick pigs in time and causing the death of a large number of pigs. With the development of computer technology and deep learning, the detection and identification of pig coughs can be achieved with the help of sound feature analysis technology to achieve the purpose of automatic monitoring. This monitoring method has the advantages of low cost, high efficiency, and all-round non-contact monitoring, which can reduce labor costs to a certain extent and improve the level of farming automation. The embodiment of the present invention takes the identification of pig coughs as an example to illustrate the method of identifying characteristic sounds. Among them, Figure 2 is a schematic diagram of a method for identifying a pig coughing sound according to an embodiment of the present invention; Figure 3 is a schematic diagram of a pig coughing sound after being aggravated according to an embodiment of the present invention; Figure 4 is a schematic diagram of a pig coughing sound after windowing according to an embodiment of the present invention; Figure 5 is a schematic diagram of framing a pig cough sound according to an embodiment of the present invention; Figure 6 is a schematic diagram of 81-dimensional spectrum features according to an embodiment of the present invention.
[0058] like Figure 2 As shown, the method for identifying pig coughing sounds according to the embodiment of the present invention includes:
[0059] Step S201: Preprocess the acquired training data and the sound data to be detected. The sound data such as pig coughs and screams collected in the pig farm are preprocessed to minimize the interference information of non-cough sounds. The preprocessing steps include emphasis and frame windowing. In order to enhance the high-frequency signal-to-noise ratio of the signal, take a pig cough sound as an example, the effect of emphasis processing on the sound is as follows Figure 3 As shown in the figure, the effect of windowing the sound is as follows Figure 4 shown.
[0060] Since the sound of a pig cough is short-term stable, the role of framing is to divide a sound into audio signals of equal length. In order to prevent the omission of effective sound signals, there will be an overlapping area between two adjacent frames. The framing method is as follows: Figure 5 As shown in FIG. 1 , the frame length is 25 ms and the frame shift is 10 ms. In order to maintain the continuity between frames, the Hamming window is selected to perform windowing processing on the sound signal.
[0061] Step S202: Construct sample data. The collected training data includes pig coughs, as well as other non-coughing sounds such as noise and screams. Pigs usually cough multiple times in a row, with a single duration of 0.4s to 0.6s and an interval of no more than 200ms. According to the start and end time of the continuous cough, the pig cough is marked as 1, and other non-coughing sounds are marked as 0. The training samples are intercepted by a sliding window. The size of the sliding window is 0.6s, and the step size of the window sliding is 80ms, which ensures that each window contains pig cough information. The positive sample comes from the sound segment marked as 1, and the negative sample comes from the sound segment marked as 0. The positive sample and the negative sample constitute the sample data.
[0062] Step S203: Build a network model and training sample data to obtain a detection model. The embodiment of the present invention adopts a three-layer two-dimensional convolutional neural network and two fully connected layers. The output of the last fully connected layer contains a neuron and adopts a sigmoid activation function. In the neural network neurons, the inputs are weighted, summed, and then a function is applied. This function is the activation function. The main function of the activation function in the neural network is to provide the network with nonlinear modeling capabilities. The Sigmoid activation function is an S-type function, also known as an S-type growth curve, which can map variables between 0 and 1. And, the target loss function is the log-likelihood function, and the formula is as follows:
[0063] Loss=-∑targets*log(predict)
[0064] Among them, targets represents the true value, which is 0 or 1, and predict represents the predicted value.
[0065] The neural network parameter training adopts the SGD (Stochastic Gradient Descent) method, the batch size is 64, and the learning rate of the model decreases with the increase of epoch. When the Loss function is stable, the model training is stopped, and the model with the best performance on the validation set is selected as the final detection model. For the training of the detection model, feature selection and extraction is a crucial link in speech recognition. The quality of the features directly affects the subsequent recognition accuracy. In order to make full use of the effective information of the sound signal, the embodiment of the present invention selects 81-dimensional spectrum features as the input of the convolutional network, such as Figure 6 As shown in the figure. The 81-dimensional spectrum feature is selected as the input of the convolutional network, which not only fully utilizes the effective information of the sound signal, but also does not reduce the computational efficiency due to the large dimension. Spectrum is the abbreviation of frequency spectrum density, which is the distribution curve of frequency. Complex oscillations are decomposed into harmonic oscillations with different amplitudes and frequencies. The graph of the amplitudes of these harmonic oscillations arranged by frequency is called spectrum.
[0066] Step S204: split the sound data to be detected according to the sliding window to extract unit sound data. The training samples are extracted by sliding window, the size of the sliding window is 0.6s, and the step length of the window sliding is 80ms.
[0067] Step S205: Determine the probability value label of each unit sound data segment being a pig cough according to the detection model, wherein the value range of label is between 0 and 1, and the larger the label, the greater the probability that the unit sound data in the window is a pig cough.
[0068] Step S206: Analyze and process the label value. The present invention assumes that the sound signal that calls the detection algorithm is not less than 1s. After identification and prediction through the sliding window, a continuous time label sequence will be obtained, labels = [x1, x2, ..., x i , x n ], i∈[0,n), n is the total number of sliding windows, x i is the predicted value of a single window. Set the probability threshold threshold to determine whether the window contains a pig coughing window. The value greater than the threshold is set to 1, which is considered to be a pig coughing window, otherwise it is set to 0, and the label_mask is obtained. The formula is:
[0069]
[0070] Step S207: Merge and process to obtain pig cough sound segments, and determine the start time and end time of each pig cough sound segment. First, count the elements and indexes with continuous label_mask being 1 to determine a two-dimensional sequence, as shown below:
[0071] cough_points=[[index1,num1],…,[index i ,num i ],…,[index m ,num m ]],i∈[0,m)
[0072] Among them, index i represents the i-th characteristic sound segment, which is composed of two consecutive unit sound data with a probability greater than the probability threshold 1; num i Indicates the number of unit sound data included in the i-th characteristic sound segment, and m is the total number of segments where label_mask is continuously 1. i and num i , combined with the sliding window length and step size, the start time and end time of the cough segment can be calculated. If the interval between two segments is less than the preset offset step size, the two cough segments are merged into one, where the preset offset step size is positively correlated with the window step size. Appropriate fine-tuning of the start time and end time can improve the accuracy of the detection time.
[0073] Since the characteristic sound duration of pig cough is short, the single duration is 0.4s to 0.6s, and the interruption does not exceed 200ms, the existing technology usually uses VAD endpoint detection (Voice Activity Detection) to extract the standard or improved MFCC features (Mel-frequency cepstral coefficients) of suspected pig cough and the first-order MFCC features as the feature vector to characterize pig cough. The recognition models include dynamic time warping algorithm, vector quantization model and hidden Markov model. In 2016, Xu Yani et al. proposed to use the sound power spectral density features as the clustering center and use the improved C-means clustering algorithm to identify and classify the cough and scream of Meishan sows. Exadaktylos et al. proposed a real-time algorithm for identifying pig cough based on frequency domain signal features; C. Yongwha et al. extracted the Mel-frequency cepstral coefficient features and used support vector machines to identify pig cough. In 2017, Zhang Zhenhua et al. proposed a scheme for identifying pig dry cough and wet cough based on the hidden Markov model with Mel-frequency cepstral coefficients and their first-order differences as feature parameters. The above existing methods for pig cough recognition basically rely on traditional speech recognition methods, which have poor noise resistance and generalization capabilities. The algorithm based on vector technology is the simplest and is a typical template matching algorithm. When encountering a large number of samples or different durations of the same sound, the recognition rate of vector quantization will be much lower; the dynamic regularization algorithm can solve the matching problem of the same sound with different durations, and the amount of calculation is also small, but it is too dependent on the accuracy of endpoint detection and requires a large number of template samples. Since each recognition requires re-matching the template, the recognition is time-consuming and inefficient; the hidden Markov model is widely used in speech recognition, but it requires complex parameter tuning, sufficient data is required for training in the early stage, and the model has a large amount of calculation.
[0074] The embodiment of the present invention can extract all the pig coughing sounds included in a large segment by setting the size of the sliding window (e.g., 0.6s) and the step size of the sliding window (e.g., 80ms). In addition, the embodiment of the present invention implements a method for identifying pig coughing sounds based on deep learning of CNN convolutional neural network for the business scenario of monitoring pig respiratory diseases in farms, effectively improving the accuracy of pig coughing sound recognition, and providing the start and end time points of coughing sounds. Since the sliding window length is relatively small and the number of windows is relatively large, it is a waste of computing resources to predict only one window at a time. It can be optimized in two ways, which improves the CPU computing resource utilization and the calculation speed of the prediction stage by 50%. Among them, the Batch method: Since the length of each sliding window is fixed, adjacent windows with an exponential multiple of 2 can be used for batch calculation, which greatly improves the calculation speed, and is generally selected as 32, 64, and 128. And, the Multi-threading method: The number of threads is reasonably set for the CPU computing resources, which effectively improves the CPU resource utilization.
[0075] The method for identifying pig coughing sounds in an embodiment of the present invention predicts the sound fragments through a trained model, analyzes and processes the sound fragments according to the generated labels sequence, and then uses the predicted value and time index to calculate the start and end time of the coughing. This algorithm has high accuracy in identifying coughing sounds, high resource utilization, and high speed. It can not only solve the problem of low efficiency of manual diagnosis in the prevention and control of epidemic diseases in large pig farms, but also can intelligently identify pig coughing sounds, timely warn and treat, reduce labor costs, and provide practical value for the prevention and treatment of animal husbandry diseases.
[0076] Figure 7 is a schematic diagram of main modules of a device for recognizing characteristic sounds according to an embodiment of the present invention, such as Figure 7 As shown, the device 700 for identifying characteristic sounds according to the embodiment of the present invention includes a unit sound data interception module 701 , a characteristic sound determination module 702 and a characteristic sound segment determination module 703 .
[0077] The unit sound data interception module 701 is used to split the sound data to be detected and intercept at least one section of unit sound data. The unit sound data interception module is also used to split the sound data to be detected according to the sliding window; intercept the unit sound data, and the unit sound data is the sound data included in each sliding window. The size of the sliding window is 0.3s-0.7s, and the step size of the sliding window is 70ms-85ms; and / or the characteristic sound is a pig cough.
[0078] The characteristic sound determination module 702 is used to determine the unit sound data belonging to the characteristic sound from at least one section of unit sound data. The characteristic sound determination module is also used to determine the probability of each section of unit sound data being a characteristic sound through the trained detection model; and mark the unit sound data belonging to the characteristic sound from at least one section of unit sound data according to a preset probability threshold.
[0079] The device for identifying characteristic sounds in an embodiment of the present invention further includes a training module for obtaining labeled training data, wherein the training data labeled as 1 is a characteristic sound, and the training data labeled as 0 is a non-characteristic sound; a network model including three layers of two-dimensional convolutional neural networks and two layers of fully connected layers is constructed, wherein the last fully connected layer includes neurons using a sigmoid activation function; based on the training data and the network model, a detection model is obtained by training, wherein the target loss function Loss is:
[0080] Loss=-∑targets*log(predict)
[0081] Targets represents the true value, which can be 0 or 1; predict represents the predicted value.
[0082] The characteristic sound segment determination module 703 is used to merge the unit sound data belonging to the characteristic sound according to the time distance between them to obtain the characteristic sound segment. The characteristic sound determination module is also used to determine whether the probability of the unit sound data being the characteristic sound is greater than a preset probability threshold. If so, the unit sound data is marked as 1; otherwise, it is marked as 0; the characteristic sound segment determination module is also used to merge the unit sound data marked as 1 in a time sequence to obtain at least one preliminary characteristic sound segment. The characteristic sound segment determination module is also used to determine whether the time distance between at least one step characteristic sound segment is less than a preset distance offset; if less, they are merged to obtain the characteristic sound segment.
[0083] The device for identifying characteristic sounds in the embodiment of the present invention further includes a preprocessing module, which is used to perform emphasis processing on the sound to be detected; and to perform windowing processing on the emphasized sound to be detected through a Hamming window.
[0084] The embodiment of the present invention splits the sound data to be detected, extracts the unit sound data, and identifies each section of the unit sound data to determine whether each section of the unit sound data is a characteristic sound. Finally, based on the distance between each section of the unit sound data belonging to the characteristic sound, it is merged, and the merged unit sound data constitutes a characteristic sound segment. The embodiment of the present invention can not only improve the accuracy of sound recognition, but also accurately determine the start time and end time of each section of the characteristic sound segment according to the start time and end time of each section of the unit sound data. In addition, the unit sound data is intercepted by a sliding window method, and the CNN convolutional neural network is trained on the sound sample. The training parameter selects SGD, and the model with the best performance on the verification set is selected as the final detection model. The convolutional neural network shows significant advantages in feature extraction. The convolutional neural network has unique advantages in speech recognition with its special structure of local weight sharing. Its layout is closer to the actual biological neural network. The weight sharing reduces the complexity of the network, avoids the complexity of data reconstruction in the feature extraction and classification process, and utilizes the invariance of convolution to overcome the variability in speech.
[0085] Figure 8 An exemplary system architecture 800 is shown to which the method for identifying characteristic sounds or the apparatus for identifying characteristic sounds according to the embodiments of the present invention may be applied.
[0086] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0087] Users can use terminal devices 801, 802, and 803 to interact with server 805 through network 804 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 801, 802, and 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0088] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0089] The server 805 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 801, 802, and 803. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results to the terminal device.
[0090] It should be noted that the method for identifying characteristic sounds provided in the embodiment of the present invention is generally executed by the server 805 , and accordingly, the device for identifying characteristic sounds is generally set in the server 805 .
[0091] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0092] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0093] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0094] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0095] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.
[0096] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0097] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0098] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, may be described as: a processor includes a module for obtaining unit sound data interception, a characteristic sound determination module, and a characteristic sound segment determination module. The names of these modules do not constitute limitations on the modules themselves in certain cases. For example, the unit sound data interception module may also be described as a "module for splitting the sound data to be detected and intercepting at least one segment of unit sound data".
[0099] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: splitting the sound data to be detected and intercepting at least one unit sound data; determining the unit sound data belonging to the characteristic sound from at least one unit sound data; merging the unit sound data belonging to the characteristic sound according to the time distance between the unit sound data to obtain the characteristic sound segment.
[0100] The embodiment of the present invention splits the sound data to be detected, extracts the unit sound data, and identifies each section of the unit sound data to determine whether each section of the unit sound data is a characteristic sound. Finally, based on the distance between each section of the unit sound data belonging to the characteristic sound, the unit sound data are merged, and the merged unit sound data constitute a characteristic sound segment. The embodiment of the present invention can not only improve the accuracy of sound recognition, but also can further accurately determine the start time and end time of each characteristic sound segment according to the start time and end time of each section of the unit sound data.
[0101] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for identifying characteristic sounds, characterized in that: include: Splitting the sound data to be detected and extracting at least one unit of sound data; Determining unit sound data belonging to a characteristic sound from the at least one piece of unit sound data; According to the time distance between the unit sound data belonging to the characteristic sound, the continuous unit sound data belonging to the characteristic sound are merged in time order to obtain the characteristic sound segment; The step of determining the unit sound data belonging to the characteristic sound from the at least one section of unit sound data comprises: determining the probability that each section of unit sound data is the characteristic sound through the trained detection model; marking the unit sound data belonging to the characteristic sound from the at least one section of unit sound data according to a preset probability threshold; According to a preset probability threshold, the step of marking the unit sound data belonging to the characteristic sound from the at least one section of unit sound data comprises: determining whether the probability of the unit sound data being the characteristic sound is greater than the preset probability threshold, if so, marking the unit sound data as 1; otherwise, marking it as 0; According to the time distance between the unit sound data belonging to the characteristic sound, the step of merging the continuous unit sound data belonging to the characteristic sound in time order to obtain a characteristic sound segment includes: merging the continuous unit sound data marked as 1 in time order to obtain at least one preliminary characteristic sound segment; judging whether the time distance between the at least one preliminary characteristic sound segment is less than a preset distance offset; if less, merging them to obtain a characteristic sound segment.
2. The method according to claim 1, characterized in that The step of splitting the sound data to be detected and extracting at least one unit sound data comprises: Split the sound data to be detected according to the sliding window; Unit sound data is cut out, where the unit sound data is the sound data included in each sliding window.
3. The method according to claim 1, characterized in that Before determining the probability of each unit sound data being a characteristic sound through the trained detection model, it also includes: Obtain labeled training data, wherein the training data labeled as 1 is a characteristic sound, and the training data labeled as 0 is a non-characteristic sound; Build a network model consisting of three layers of two-dimensional convolutional neural network and two layers of fully connected layers, where the last fully connected layer contains neurons using sigmoid activation function; Based on the training data and the network model, a detection model is trained, wherein the target loss function Loss is: Loss=-Σtargets*log(predict) Targets represents the true value, which can be 0 or 1; predict represents the predicted value.
4. The method according to claim 1, characterized in that: Before splitting the sound data to be detected and extracting at least one unit sound data, the method further includes: Performing an emphasis process on the sound to be detected; The emphasized sound to be detected is subjected to windowing processing by using a Hamming window.
5. The method according to claim 2, characterized in that: The size of the sliding window is 0.3s-0.7s, and the step size of the sliding window is 70ms-85ms; and / or, The characteristic sound is the coughing sound of a pig.
6. A device for identifying characteristic sounds, characterized in that: include: A unit sound data interception module is used to split the sound data to be detected and intercept at least one section of unit sound data; A characteristic sound determination module, used to determine unit sound data belonging to the characteristic sound from the at least one section of unit sound data; A characteristic sound segment determination module, configured to merge the continuous unit sound data belonging to the characteristic sound in time order according to the time distance between the unit sound data belonging to the characteristic sound to obtain the characteristic sound segment; The characteristic sound determination module is further used to determine the probability that each section of unit sound data is a characteristic sound through the trained detection model; and to mark the unit sound data belonging to the characteristic sound from the at least one section of unit sound data according to a preset probability threshold; The characteristic sound determination module is further used to determine whether the probability that the unit sound data is the characteristic sound is greater than a preset probability threshold, and if so, mark the unit sound data as 1; otherwise, mark it as 0; The characteristic sound segment determination module is further used to merge the unit sound data that are continuously marked as 1 in time order to obtain at least one preliminary characteristic sound segment; and determine whether the time distance between the at least one preliminary characteristic sound segment is less than a preset distance offset; If it is less than, they are merged to obtain the characteristic sound segment.
7. The device according to claim 6, characterized in that The unit sound data interception module is also used to split the sound data to be detected according to the sliding window; intercept the unit sound data, and the unit sound data is the sound data included in each sliding window.
8. The device according to claim 6, characterized in that It also includes a training module for obtaining labeled training data, wherein the training data labeled as 1 is a characteristic sound, and the training data labeled as 0 is a non-characteristic sound; building a network model including a three-layer two-dimensional convolutional neural network and two layers of fully connected layers, wherein the last fully connected layer includes neurons using a sigmoid activation function; based on the training data and the network model, training to obtain a detection model, wherein the target loss function Loss is: Loss=-∑targets*log(predict) Targets represents the true value, which can be 0 or 1; predict represents the predicted value.
9. The device according to claim 6, characterized in that It also includes a pre-processing module, which is used to perform emphasis processing on the sound to be detected; and perform windowing processing on the emphasized sound to be detected through a Hamming window.
10. The device according to claim 7, characterized in that The size of the sliding window is 0.3s-0.7s, and the step size of the sliding window is 70ms-85ms; and / or, the characteristic sound is a pig cough.
11. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Complex audio segmentation clustering method based on bottleneck feature
CN106952644A
Device for diagnosing sleep apnea syndrome based on sound of snoring
CN107095645A
Sexy-whoop audio identification method, apparatus, and device, and computer-readable medium
CN108172213A
