Chicken voice recognition method, system and equipment based on improved neural network model and medium
By improving the neural network model to preprocess and identify the sound data of chickens in the chicken cage, combined with the two-way long and short memory network-attention mechanism model, the problem of chicken pullorum diagnosis relying on image data in the existing technology has been solved, and a higher level has been achieved. The diagnostic accuracy and convenience are particularly advantageous in detecting early diseased chickens.
Patent Information
- Application Number
- CN202410760920.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-06
AI Technical Summary
The existing diagnostic methods for chicken pullorum based on neural network models mainly rely on image or video data of chickens, which are greatly affected by environmental factors, and the vocalization data are not effectively utilized, resulting in insufficient diagnostic accuracy and convenience.
Using an improved neural network model, by obtaining the sound data of chickens in the chicken cage, we perform spectral subtraction noise reduction, low-frequency noise filtering, dual-threshold endpoint detection and multiple feature extraction of the smoothing mechanism, combined with the bidirectional long and short memory network-attention mechanism model. Recognize and obtain the classification results of sounds.
It improves the accuracy and convenience of diagnosis of pullorum, can effectively detect early-stage chickens suffering from pullorum, and significantly improves the recognition rate and accuracy.
Smart Images

Figure CN118609549A
Abstract
Description
Technical Field
[0001] The invention relates to a chicken sound recognition method, system, equipment and medium based on an improved neural network model, and belongs to the technical field of computer-aided animal husbandry development. Background Art
[0002] As the poultry industry develops towards large-scale and intensive breeding, the breeding density continues to increase, and the problem of infectious diseases becomes increasingly serious, causing huge losses to farmers. Pullorum disease is a bacterial infectious disease caused by Salmonella pullorum. Chickens of different ages can be infected and fall ill, especially chicks, which can cause large-scale death of chicks. The disease also harms breeder chickens, causing egg production, egg fertilization rate and hatching rate to decrease. It also causes chicks to carry bacteria, thereby increasing the mortality rate and carrying rate of offspring. The sale of latent breeder chickens and infected eggs will also spread the epidemic and expand the scope of the epidemic. A survey found that the losses caused by pullorum disease in chicken farms are far higher than those caused by Newcastle disease and avian influenza. Whether sick chickens can be identified in a large-scale breeding environment in a timely and accurate manner is not only directly related to the economic benefits of the poultry industry, but also has important significance for the healthy and sustainable development of the industry.
[0003] With the development of computer technology, sound and video monitoring methods have been increasingly used in the study of animal behavior. However, the existing diagnosis methods for pullorum disease based on neural network models mainly rely on images or video data of chickens, which require a lot of annotation and training and are greatly affected by environmental factors. Vocalization is an important indicator for assessing poultry welfare and can reflect information such as poultry feeding, growth and health. Compared with other technologies, sound technology has the advantages of no contact, no stress, continuous acquisition, and no restrictions on sight and light. Therefore, how to use sound data for identification and thus diagnose pullorum disease has become an urgent problem to be solved. Summary of the invention
[0004] In view of this, the present invention provides a chicken sound recognition method, system, computer equipment and storage medium based on an improved neural network model, which can recognize the sounds of chickens in chicken cages and obtain sound classification results to improve the accuracy and convenience of pullorum disease diagnosis, and provide new ideas for subsequent research on chicken disease algorithm research and engineering applications.
[0005] The first object of the present invention is to provide a chicken sound recognition method based on an improved neural network model.
[0006] The second object of the present invention is to provide a chicken sound recognition system based on an improved neural network model.
[0007] A third object of the present invention is to provide a computer device.
[0008] A fourth object of the present invention is to provide a storage medium.
[0009] The first object of the present invention can be achieved by adopting the following technical solutions:
[0010] A chicken sound recognition method based on an improved neural network model, the method comprising:
[0011] Get the sound data of chickens in the chicken coop;
[0012] The input sound data is denoised using spectral subtraction with a smoothing mechanism;
[0013] Filtering low-frequency noise signals in the denoised sound data;
[0014] A dual-threshold endpoint detection algorithm is used to capture sound clips from the filtered data;
[0015] A plurality of feature extraction algorithms are used to extract the sound features in the sound clip, and the extracted multiple sound features are merged;
[0016] The combined sound features are input into the bidirectional long short-term memory network-attention mechanism model for recognition to obtain the sound classification result.
[0017] Furthermore, the spectral subtraction method using a smoothing mechanism to reduce noise of the input sound data specifically includes:
[0018] Calculate the energy spectrum of each leading non-speech frame, take the average value to obtain the average noise spectrum, and take the maximum value of the difference between the energy spectrum of the leading non-speech frame and the average noise spectrum as the maximum noise residual;
[0019] When the power spectrum of the clean speech signal is less than the maximum noise residual, the minimum value of the power spectrum of the clean speech signal in the adjacent frame is selected for replacement; when it is greater than or equal to the maximum noise residual, it remains unchanged.
[0020] Furthermore, filtering the low-frequency noise signal in the noise-reduced sound data specifically includes:
[0021] A high-pass filter is used to filter out low-frequency noise signals in the denoised sound data.
[0022] Furthermore, the method of using a dual-threshold endpoint detection algorithm to intercept sound clips from the filtered data specifically includes:
[0023] Establish the startup threshold of zero-crossing rate and the startup threshold of short-term energy;
[0024] When both the zero-crossing rate and the short-time energy exceed their respective starting thresholds, the corresponding point is identified as the beginning of the speech segment, marking the beginning of the speech; when the zero-crossing rate or the short-time energy is lower than their respective ending thresholds, the corresponding point is identified as the end of the speech segment, indicating a speech deviation.
[0025] Furthermore, the method of extracting the sound features in the sound clip using multiple feature extraction algorithms and merging the extracted multiple sound features specifically includes:
[0026] Extract the sound features in the sound clips using spectrogram, Fbank features and Mel-frequency cepstral coefficients;
[0027] Each extracted sound feature is normalized, and the three normalized sound features are merged.
[0028] Furthermore, the calculation process of the spectrogram is as follows: performing frame division and windowing processing on the audio signal; performing Fourier transform on the signal in each window to convert the time domain signal into a frequency domain signal; performing absolute value operation on the frequency domain signal to obtain the spectrogram;
[0029] The calculation process of the Fbank feature is as follows: performing frame division and windowing processing on the audio signal; performing Fourier transform on the signal in each window to convert the time domain signal into a frequency domain signal; further processing using a Mel filter to obtain the energy value of each filter;
[0030] The calculation process of the Mel-frequency cepstrum coefficient is as follows: framing and windowing the audio signal; performing Fourier transform on the signal in each window to convert the time domain signal into a frequency domain signal; further processing using a Mel filter to obtain the energy value of each filter; taking the logarithm of the energy value of each filter and performing discrete cosine transform.
[0031] Furthermore, the bidirectional long short-term memory network-attention mechanism model includes a convolutional neural network part, a bidirectional long short-term memory part and an attention mechanism part;
[0032] The convolutional neural network part has two convolutional layers and two maximum pooling layers, the first convolutional layer has 32 channels, the second convolutional layer has 32 channels, the first maximum pooling layer is located between the two convolutional layers, and the second maximum pooling layer expands the nodes to prepare for data input into the bidirectional long short-term memory part;
[0033] The BILSTM layer of the bidirectional long short-term memory part has 64 neurons, each neuron has 2 outputs, and a total of 128 outputs to capture the long-term and short-term context information of the sound signal. A Dropout layer is attached to the BILSTM layer;
[0034] The Attention layer of the attention mechanism part adopts 4 self-attention heads, and the input features will be divided into 4 different representation subspaces. Each head focuses on capturing different relationships and patterns in the input sequence. The embedding dimension is 128. At the end of the Attention layer, three fully connected layers with S-shaped activation functions are set, containing 128, 64, and 32 neurons respectively. The Softmax layer is used as the output of the bidirectional long short-term memory network-attention mechanism model.
[0035] The second object of the present invention can be achieved by adopting the following technical solutions:
[0036] A chicken sound recognition system based on an improved neural network model, the system comprising:
[0037] An acquisition module is used to obtain the sound data of chickens in the chicken coop;
[0038] A denoising module, used for denoising input sound data by using a spectral subtraction method with a smoothing mechanism;
[0039] A filtering module, used for filtering low-frequency noise signals in the noise-reduced sound data;
[0040] An interception module, for intercepting sound segments from the filtered data using a dual-threshold endpoint detection algorithm;
[0041] An extraction module, used to extract sound features from a sound clip using a variety of feature extraction algorithms, and merge the extracted multiple sound features;
[0042] The recognition module is used to input the combined sound features into the bidirectional long short-term memory network-attention mechanism model for recognition to obtain the sound classification result.
[0043] The third object of the present invention can be achieved by adopting the following technical solutions:
[0044] A computer device includes a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the above-mentioned method for measuring the economic potential of urban commercial back streets is implemented.
[0045] The fourth object of the present invention can be achieved by adopting the following technical solutions:
[0046] A storage medium stores a program, which, when executed by a processor, implements the above-mentioned method for measuring the economic potential of urban commercial back streets.
[0047] The present invention has the following beneficial effects compared with the prior art:
[0048] The present invention utilizes the advantages of convolutional neural networks and bidirectional long short-term memory neural networks to design an improved neural network model. By first performing a series of preprocessing on sound data, and then using the improved neural network model to recognize the preprocessed sound data, the sound classification result is obtained. Compared with the existing method, this method has a higher accuracy rate in identifying pullorum disease and can effectively discover problems of chickens suffering from pullorum disease in the early stage. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0050] Figure 1 This is a flow chart of the method for measuring the economic potential of urban commercial back streets in Example 1 of the present invention.
[0051] Figure 2 This is the original audio image of Example 1 of the present invention.
[0052] Figure 3 This is a spectral subtraction noise reduction diagram of Example 1 of the present invention.
[0053] Figure 4 This is a spectral subtraction denoising diagram with a smoothing mechanism introduced in Example 1 of the present invention.
[0054] Figure 5 This is a Gaussian filter diagram of Example 1 of the present invention.
[0055] Figure 6 This is an endpoint detection flow chart of Example 1 of the present invention.
[0056] Figure 7a to Figure 7b This is a feature merging diagram of Example 1 of the present invention.
[0057] Figure 8 This is a structural diagram of the bidirectional long short-term memory network-attention mechanism model of Example 1 of the present invention.
[0058] Fig. 9 Graph showing the recall rates at different periods after infection in Example 1 of the present invention.
[0059] Fig.10 This is a graph of F1 scores at different stages after infection in Example 1 of the present invention.
[0060] Fig.11 This is a structural block diagram of the urban commercial backstreet economic potential measurement system of Example 2 of the present invention.
[0061] Fig.12 This is a structural block diagram of a computer device according to Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0063] Embodiment 1:
[0064] like Figure 1 As shown, this embodiment provides a chicken sound recognition method based on an improved neural network model, the method comprising the following steps:
[0065] S101, obtaining sound data of chickens in a chicken cage.
[0066] In this embodiment, 25 one-day-old fast-growing Lingnan yellow-feathered broilers with uniform weight and health were selected. The experiment was carried out in the chicken house of Guangdong Academy of Agricultural Sciences. In order to ensure the normal activities of poultry during the experiment, 25 one-day-old fast-growing Lingnan yellow-feathered broilers were placed in the chicken cage 5 days in advance to adapt to the environment. On the 5th day of feeding, the fast-growing Lingnan yellow-feathered broilers in the experimental group were subjected to Salmonella gavage (10°CFU / chicken) and continued to be challenged on the 6th and 7th days. Each fast-growing Lingnan yellow-feathered broiler was marked to observe the clinical symptoms of each fast-growing Lingnan yellow-feathered broiler; the Logitech C1000e camera was connected to the computer to collect the sound data of the chickens in the chicken cage, and the sound data included sound and video. The 16-bit sampling frequency of the monophonic sound (single channel) recording was 44.1kHz, and the video data was mainly used to help identify the sound source and category.
[0067] S102: Use spectral subtraction with a smoothing mechanism to reduce noise on input sound data.
[0068] The recorded audio includes the sounds made by the chickens, but also other sounds (environmental noise), such as the sound of fans, the sound of poultry flapping wings, and the sound of chickens walking. In order to accurately detect and analyze the sounds of chickens, it is necessary to pre-process the sound data to reduce the impact of noise.
[0069] Spectral subtraction is a noise reduction algorithm for removing additive noise. Under the assumption that clean speech is uncorrelated with noise, the estimated noise is eliminated in the frequency domain to obtain clean speech. The spectral subtraction formula is as follows:
[0070]
[0071] Where ω represents the angular frequency energy, |Y(ω)| 2 represents the power spectrum of noisy speech signal, |S(ω)| 2 represents the power spectrum of the clean speech signal, |D(ω)| 2 It means estimating the noise power spectrum and obtaining the power spectrum of the clean speech signal. In reality, it cannot be negative. When a negative number is encountered, the power spectrum of the clean speech signal is set to 0.
[0072] The original audio of this embodiment is as follows Figure 2 As shown in the figure, after spectral subtraction, the noise is reduced as shown in the figure. Figure 3 shown.
[0073] In order to reduce the influence of noise, this embodiment uses a spectrum subtraction method with a smoothing mechanism. Compared with directly setting to zero, this method sets a lower limit of the spectrum value. After noise reduction using the spectrum subtraction method with a smoothing mechanism, Figure 4 shown.
[0074] The steps of spectral subtraction with smoothing mechanism are as follows:
[0075] It is usually considered that the first 30 frames of the speech signal are non-speech segments. This segment is not interfered by the crowing audio. The first 30 frames of the audio are taken as the leading non-speech frames. The energy spectrum of each leading non-speech frame is calculated and the average noise spectrum is obtained by taking the average value. The maximum noise residual is the maximum value of the difference between the energy spectrum of the leading non-speech frame and the average noise spectrum.
[0076] When the power spectrum of the clean speech signal is less than the maximum noise residual, the minimum value of the power spectrum of the clean speech signal in the adjacent frame is selected for replacement. When it is greater than or equal to the maximum noise residual, it remains unchanged, as shown in the following formula:
[0077]
[0078] Wherein, t represents the t-th frame speech signal, k represents the adjacent k-frame speech signal, and max(ω) represents the maximum noise residual.
[0079] S103: Filter the low-frequency noise signal in the noise-reduced sound data.
[0080] Although the spectral subtraction method with the smoothing mechanism can effectively remove regular noise, there are many types of noise in the experimental environment. There are some low-frequency signal noises, which will affect the results. Therefore, this embodiment uses a high-pass filtering method (high-pass filter) to filter out the low-frequency noise signals in the sound data after noise reduction in step 2. Figure 2 to Figure 4It can be seen that the noise reduction effect of the chicken call audio after the spectral subtraction with the smoothing mechanism is significantly better than the traditional spectral subtraction. After passing through the Gaussian filter, Figure 5 As shown, the noise reduction effect is more obvious.
[0081] S104: Using a dual-threshold endpoint detection algorithm to capture sound clips from the filtered data.
[0082] After the processing of steps S101 to S103 above, most of the noise in the original audio signal has been effectively reduced in this embodiment. In order to accurately analyze the chicken calls and reduce the amount of calculation, it is necessary to detect the sound endpoints of the audio. The dual threshold endpoint detection algorithm is an audio event endpoint detection method, which is widely used in speech processing and audio detection tasks.
[0083] In the dual-threshold endpoint detection algorithm, the zero-crossing rate and short-time energy are combined. Before starting endpoint detection, two thresholds are established - the starting threshold of the zero-crossing rate and the starting threshold of the short-time energy. These parameters are key parameters for accurately locating the beginning of speech; the algorithm iterates the signal and evaluates the relationship between the calculated zero-crossing rate, short-time energy and the threshold set at each point.
[0084] Short-term energy (STE) is one of the key features of time domain signals. It reflects the energy of sound signals in a short period of time. The short-term energy E of a frame of audio signal is n The calculation formula is as follows:
[0085]
[0086] Among them, x n (m) represents the nth frame of audio signal, and N represents the length of the signal of this frame.
[0087] Short-time zero-crossing rate is a feature in speech signal processing and audio analysis, which is used to describe the rate of change of the signal waveform. In digital signal processing, the zero-crossing rate refers to the number of times the signal crosses the zero level; for speech signals, the zero-crossing rate reflects the waveform change of the signal in the time domain. Specifically, when the waveform of the speech signal crosses the zero level in the time domain, the zero-crossing rate increases. The short-time zero-crossing rate divides the entire speech signal into small time windows and calculates the zero-crossing rate in each time window. The purpose of this is to more finely describe the change of the signal in time.
[0088] The short-term zero crossing rate (ZCR) is a feature in speech signal processing and audio analysis that describes the rate of change of the signal waveform:
[0089]
[0090] Where i represents the number of sampling points of the signal, sgn(x) represents the value ofn (m) is 1 when it is greater than 0, x n When (m) is equal to or less than 0, it is -1.
[0091] When both the zero-crossing rate and the short-time energy exceed their respective starting thresholds, the corresponding point is identified as the beginning of the speech segment, marking the beginning of the speech; when the zero-crossing rate or the short-time energy is lower than their respective ending thresholds, the corresponding point is identified as the end of the speech segment, indicating a speech deviation.
[0092] The dual-threshold endpoint detection algorithm of this embodiment combines the zero-crossing rate and short-time energy, becoming a powerful tool for speech endpoint detection. Its synergistic method improves the accuracy and robustness of endpoint recognition, making it valuable for various applications in speech signal processing; however, there are abnormal regular noises in the chicken house, such as those generated by the operation of fans, manure cleaning equipment, feeding equipment, egg collection equipment, etc., which can be effectively solved by improved spectral subtraction; in addition, there are also other occasional noises such as pecking and trampling of poultry, which can be effectively reduced after passing through a Gaussian filter.
[0093] In order to prevent transient noise from not being processed by noise reduction, this embodiment adds a restriction condition of audio time in the dual threshold endpoint detection. It is found from the audio processed by dual threshold endpoint detection that most of the residual transient noise time will not exceed 4 frames, and the rooster's call generally does not exceed 60 frames, so the sound clips of 4 to 60 frames are retained to create the rooster's call audio data set. The process is as follows: Figure 6 As shown, the average values of the short-time energy and short-time zero-crossing rate of the first 30 frames are calculated as the values of T1 and T2, and T3 and T4 are set to 4 frames and 60 frames respectively.
[0094] S105: extracting sound features from the sound clip using a variety of feature extraction algorithms, and merging the extracted multiple sound features.
[0095] Feature extraction is an important part of sound processing. When it comes to audio signal processing and audio feature extraction, spectrogram, Fbank features, and Mel-frequency cepstral coefficients (MFCC) are indispensable tools; these feature extraction algorithms play a key role in the field of audio analysis and recognition. Spectrogram is an image representation that shows the energy of audio signals in time and frequency. It divides the audio signal into small time windows and then obtains the spectrum of each window through Fourier transform. The intensity of the spectrogram represents the degree of occurrence of different frequency components at different times, so it can be used to analyze the periodic structure and frequency components in the audio signal; Fbank features are also a feature extraction method commonly used in audio signal processing. It is similar to Mel-frequency cepstral coefficients, but does not include logarithmic and discrete cosine transforms, so the calculation is simpler; Mel-frequency cepstral coefficients are a widely used feature extraction method in audio signal processing. It simulates the characteristics of the human auditory system and is often used for sound feature extraction.
[0096] The spectrogram is calculated as follows:
[0097] (1) Perform frame and window processing on the audio signal.
[0098] (2) Fast Fourier Transform (TFT): Perform Fourier transform on the signal in each window to convert the time domain signal into the frequency domain signal:
[0099] X(i,k)=FFT[x i (m)]
[0100] Among them, x represents the preprocessed sound signal, x i X(i,k) represents the value at the kth frequency and the i-th frame.
[0101] (3) Perform absolute value operation on the frequency domain signal to obtain the spectrogram:
[0102] |X(i,k)|
[0103] The calculation process of Fbank features is as follows:
[0104] After framing, windowing, and short-time Fourier transform, the Fbank feature is further processed using a Mel filter to obtain the energy value S of each filter. i [m]:
[0105]
[0106] Among them, E i [k] represents the energy of the spectral line, H m[k] represents the frequency response function of the Mel filter, and m represents the mth Mel filter.
[0107] Mel frequency cepstral coefficients are similar to Fbank. The previous steps are the same. After using the Mel filter bank to obtain the energy value, the logarithm is taken and the discrete cosine transform (DCT) is performed:
[0108]
[0109] Among them, i represents the mth frame of speech signal, n represents the spectrum line after discrete cosine transform, and M represents the number of Mel filters.
[0110] Three sound features are extracted through spectrogram, Fbank feature and Mel frequency cepstral coefficient. However, the evaluation criteria and range of features are different. Therefore, it is necessary to normalize each feature before analysis. All chicken calls on the same day are extracted and each feature of the sound is normalized, as shown in the equation:
[0111]
[0112] Among them, F K Indicates the sound characteristics, F K ' represents the normalized value.
[0113] The three normalized sound features are merged, and the feature axis consists of three features (spectrogram, Fbank feature and Mel frequency cepstral coefficient), and the shape of each feature is 40×20; Figure 7a to Figure 7b As shown, it is a visualization image of the feature merging graph, where Figure 7a is before normalization, Figure 7b After normalization, it can be seen that before normalization, the three features have different value ranges and distributions, there are value differences, and the correlation between the three is not strong; after normalization, the value range of the features is adjusted to between 0 and 1, the value difference in the image will be reduced, and the relationship between the features will be more balanced, which is conducive to the training and performance of the model. When the three features are extracted, the FFT window size is 512.
[0114] S106. Input the combined sound features into the bidirectional long short-term memory network-attention mechanism model for recognition to obtain the sound classification result.
[0115] Recurrent neural network (RNN) is a time series method for processing time-varying signals, but traditional RNN has the problem of insufficient capture of long-term dependency information. To solve this problem, the long short-term memory neural network (LSTM) introduces forget gates and memory gates to enhance the model's learning ability for time series data. However, LSTM only considers current and previous information in one direction, without historical information. To address this limitation, the bidirectional long short-term memory network (BILSTM) adds two LSTM layers, forward and reverse, to not only process current and previous information, but also consider historical information before and after the sound, thereby more comprehensively understanding the sequence context. This structural design of BILSTM is particularly suitable for processing short and regular signals such as chicken calls, because it can simultaneously capture the correlation before and after the sound.
[0116] The core idea of the attention mechanism is to automatically assign weights to different features based on the input features, so as to highlight important features and ignore unimportant features. The multi-head attention mechanism is an extension of the attention mechanism, which processes the input sequence in multiple representation subspaces simultaneously, and each subspace is called a "head". This mechanism can help the model focus on key information more effectively when processing complex data, and improve the performance and generalization ability of the model. Its calculation process is:
[0117]
[0118]
[0119] O=Concat(head1,...,head h )W O
[0120] Among them, Q, K, and V represent query, key, and value respectively. k represents the dimension of each head, h represents the number of heads, and W O The weight matrix representing the output transformation
[0121] Existing research usually uses bidirectional long short-term memory neural network (BILTM) for text understanding, while there are few studies on BILSTM for poultry sound recognition. However, BILTM can indeed improve the ability to understand contextual data such as sound. However, in tasks such as sound recognition, the classification effect of using only BILSTM is not good. Convolutional neural network (CNN) has good performance in classification and recognition. By extracting features through CNN and then putting the features into the BILSTM module, the module's ability to understand the features will be increased, thereby achieving better sound recognition and classification effects. Placing the attention mechanism module after the BILSTM module can weight different parts of the sequence after the bidirectional recurrent neural network learns the sequence features, so as to increase the model's attention to key features, thereby improving the performance of poultry speech recognition.
[0122] The network structure of the bidirectional long short-term memory network-attention mechanism model (FLOCKVIGIL-NET) is as follows Figure 8 As shown in the figure, its structure can be divided into three parts. The first part is the convolutional neural network (CNN) part, the second part is the bidirectional long short-term memory (BILSTM) part, and the third part is the attention mechanism (Attention) part.
[0123] The amount of feature data is small. In order to extract the most features and fewer parameters, there are two convolutional layers in the convolutional neural network part, with a kernel size of 3×3, and two maximum pooling layers with the same pool size and a stride size of 2×2. The kernel size is commonly used, which can ensure that enough data can be extracted from the short-term chicken calls. The first convolutional layer has 32 channels, and the second convolutional layer has 32 channels. The first maximum pooling layer is located between the two convolutional layers. The second maximum pooling layer expands the nodes and transforms the data into one-dimensional data to prepare for the data input into the bidirectional long short-term memory part.
[0124] The BILSTM layer of the bidirectional long short-term memory part has 64 neurons, each neuron has 2 outputs, and a total of 128 outputs to capture the long-term and short-term context information of the sound signal; this embodiment introduces the random deactivation (Dropout) technology to prevent overfitting, that is, a Dropout layer is added after the BILSTM layer, which can prevent overfitting while improving the generalization of the model and reducing the training time of the model.
[0125] The Attention layer of the attention mechanism uses 4 self-attention heads. The input features will be divided into 4 different representation subspaces. Each head focuses on capturing different relationships and patterns in the input sequence. The embedding dimension is 128. At the end of this layer, three fully connected layers with S-shaped activation functions are set, containing 128, 64, and 32 neurons respectively. Finally, the Softmax layer is used as the output of the model.
[0126] The day before the virus injection was marked as Day0, which was the health status of the flock. The 2nd, 4th, 6th, and 8th days after the flock was infected with pullorum were called Day1, Day2, Day3, and Day4, respectively. We compared the chicken calls on these dates with those on Day0. After Smooth-HF noise reduction algorithm, improved dual threshold endpoint detection based on time conditions, and feature extraction processing, we recorded the audio files and merged the data from Day0 to Day4 into a dataset, named DAY1, DAY2, DAY3, and DAY4, respectively. Day0 contained 20,647 data, Day1 had 22,204 data, Day2 had 21,850 data, Day3 had 21,703 data, and Day4 had 22,859 data.
[0127] In this experiment, Day0 is combined with Day1 to Day4 to create the data set DAY1 to DAY4, and the Day0 data is marked as 0, and the Day1 to Day4 data is marked as 1. In order to train and test the model, we divide it into 80% training set and 20% test set. The specific data volume is shown in Table 1.
[0128] Table 1 Data size of training set and test set
[0129]
[0130] The experiment uses four different methods shown in Table 2: CNN, LSTM, BILSTM and FLOCKVIGIL-NET. The learning rate used in the training of the four models is 0.0001, the batch size is 64, and all four methods go through 100 training cycles.
[0131] Table 2 Recognition rate of each model
[0132]
[0133] As shown in Table 2, from the results of different days, the recognition rate of the four models increases over time, indicating that the disease affects the chirping of poultry. In the four-day data set, the recognition accuracy of CNN reached more than 82%, proving the superior performance of CNN in sound classification and recognition. LSTM and BILSTM are designed to solve the long-term dependency problem of RNN (recurrent neural network), and the recognition accuracy in this data set also reached more than 83%, indicating that both have excellent discrimination ability for the chicken sound with sequence context information. The FLOCKVIGIL-NET model combines the advantages of the two models. After weighting the key features through the attention mechanism module, the recognition accuracy in the four-day data set is the best, which shows that adding the BILSTM layer and the attention mechanism layer to the CNN model can effectively increase the model's ability to extract the sound features of sick chickens. It is worth noting that within the first day, the sick chickens did not have obvious behavioral symptoms, but the recognition accuracy of FLOCKVIGIL-NET reached 86.53%, which shows that the model proposed in this embodiment can identify sick chickens by sound in the early stage of the disease.
[0134] Table 3 Accuracy of each model
[0135]
[0136] As shown in Table 3, the accuracy rate increases with the passage of time, which further verifies that the impact of pullorum disease on the calls of Lingnan yellow-feathered broiler chickens gradually increases with the passage of time. The higher the accuracy rate, the higher the prediction accuracy of identifying the calls of sick chickens as the calls of sick chickens. The FLOCKVIGIL-NET model has the highest accuracy rate, which is 86.51%, 87.86%, 89.50%, and 91.07% respectively.
[0137] like Fig. 9 As shown in the figure, the recall rates of all methods increased with the extension of time after infection, which once again proved that the virus affects the vocalization of poultry. Among all models, FLOCKVIGIL-NET still has the highest recall rate, indicating that more pathological vocalizations detected by this method are truly pathological vocalizations, and the detection results are more accurate.
[0138] like Fig.10 As shown in the figure, FLOCKVIGIL-NET also has the highest F1 score among all the methods. Combining the recognition rate, precision rate, recall rate and F1 score of each method, the FLOCKVIGIL-NET model used in this embodiment has the best performance in the detection of pullorum vocalization, with the recognition rate, precision rate, recall rate and F1 score being 86.81%, 87.73%, 88.67% and 90.29% respectively.
[0139] In order to verify that the recognition effect of feature merging is better than other feature extraction methods, the Day0 and Day4 datasets were subjected to feature extraction after Smooth-HF denoising algorithm and improved double threshold endpoint detection based on time conditions, and the spectrogram, Fbank feature, Mel frequency cepstral coefficient and feature merging were obtained. Figure 4 The data sets are divided into four groups, and the Day0 data is marked as 0, the Day4 data is marked as 1, and the shape of the four features is 120 × 20. The model is trained on these four feature map data sets, and the recognition rate is calculated. The results are shown in Table 4.
[0140] Table 4 Recognition rates of the four features in each model
[0141]
[0142] As shown in Table 4, the recognition rate of CNN for feature merging graphs reached 86.04%, which is better than spectrograms, Fbank features, and Mel frequency cepstral coefficients. In the LSTM and BILSTM models, the recognition rates of feature merging graphs reached 86.64% and 87.44%, respectively. The recognition rate of FLOCKVIGIL-NET for feature merging graphs reached 90.26%, and the other three models also reached more than 85%.
[0143] The four models have the best recognition effect on the feature combination graph, and the FLOCKVIGIL-NET model has the highest recognition rate for the feature combination graph. This shows that compared with other features, this feature graph can provide richer and more comprehensive information, which is conducive to improving the performance and generalization ability of the model.
[0144] It should be noted that although the method operations of the above embodiments are described in a specific order, this does not require or imply that these operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0145] Embodiment 2:
[0146] like Fig.11 As shown, this embodiment provides a chicken sound recognition system based on an improved neural network model, which includes an acquisition module 1101, a noise reduction module 1102, a filtering module 1103, an interception module 1104, an extraction module 1105 and a recognition module 1106. The specific functions of each module are as follows:
[0147] An acquisition module 1101 is used to acquire sound data of chickens in a chicken cage;
[0148] A noise reduction module 1102, configured to reduce noise of input sound data by using a spectral subtraction method with a smoothing mechanism;
[0149] The filtering module 1103 is used to filter the low-frequency noise signal in the noise-reduced sound data;
[0150] An interception module 1104 is used to intercept the sound clips in the filtered data using a dual threshold endpoint detection algorithm;
[0151] An extraction module 1105, for extracting sound features from the sound clip using a plurality of feature extraction algorithms, and merging the extracted multiple sound features;
[0152] The recognition module 1106 is used to input the combined sound features into the bidirectional long short-term memory network-attention mechanism model for recognition to obtain the sound classification result.
[0153] It should be noted that the system provided in this embodiment is only illustrated by the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.
[0154] Embodiment 3:
[0155] This embodiment provides a computer device, such as Fig.12 As shown, it includes a processor 1202, a memory, an input device 1203, a display device 1204 and a network interface 1205 connected through a system bus 1201. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium 1206 and an internal memory 1207. The non-volatile storage medium 1206 stores an operating system, a computer program and a database. The internal memory 1207 provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the processor 1202 executes the computer program stored in the memory, the chicken sound recognition method of the above-mentioned embodiment 1 is implemented as follows:
[0156] Acquire the sound data of chickens in the chicken coop; use the spectral subtraction method with the introduction of smoothing mechanism to reduce the noise of the input sound data; filter the low-frequency noise signal in the denoised sound data; use the double threshold endpoint detection algorithm to intercept the sound fragments in the filtered data; use multiple feature extraction algorithms to extract the sound features in the sound fragments, and merge the extracted multiple sound features; input the merged sound features into the bidirectional long short-term memory network-attention mechanism model for recognition, and obtain the sound classification result.
[0157] Embodiment 4:
[0158] This embodiment provides a storage medium, which is a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the chicken sound recognition method of the above embodiment 1 is implemented as follows:
[0159] Acquire the sound data of chickens in the chicken coop; use the spectral subtraction method with the introduction of smoothing mechanism to reduce the noise of the input sound data; filter the low-frequency noise signal in the denoised sound data; use the double threshold endpoint detection algorithm to intercept the sound fragments in the filtered data; use multiple feature extraction algorithms to extract the sound features in the sound fragments, and merge the extracted multiple sound features; input the merged sound features into the bidirectional long short-term memory network-attention mechanism model for recognition, and obtain the sound classification result.
[0160] It should be noted that the computer-readable storage medium of the present embodiment 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.
[0161] In this embodiment, the 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 this embodiment, the 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. 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. The computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program used by or in combination with an instruction execution system, device, or device. The computer program contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0162] The computer readable storage medium can be written in one or more programming languages or a combination thereof to execute the computer program of the present embodiment, and the programming language includes an object-oriented programming language, such as Java, Python, C++, and also includes a conventional procedural programming language, such as C language or a similar programming language. The program can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).
[0163] In summary, the present invention utilizes the advantages of convolutional neural networks and bidirectional long short-term memory neural networks to design an improved neural network model. By first performing a series of preprocessing on the sound data, and then using the improved neural network model to recognize the preprocessed sound data, the sound classification result is obtained. Compared with the existing methods, this method has a higher accuracy rate in identifying pullorum disease and can effectively detect problems of chickens suffering from pullorum disease in the early stage.
[0164] The above description is only a preferred embodiment of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention.
Claims
1. A chicken sound recognition method based on an improved neural network model, characterized in that: The method comprises: Get the sound data of chickens in the chicken coop; The input sound data is denoised using spectral subtraction with a smoothing mechanism; Filtering low-frequency noise signals in the denoised sound data; A dual-threshold endpoint detection algorithm is used to capture sound clips from the filtered data; A plurality of feature extraction algorithms are used to extract the sound features in the sound clip, and the extracted multiple sound features are merged; The combined sound features are input into the bidirectional long short-term memory network-attention mechanism model for recognition to obtain the sound classification result.
2. The chicken sound recognition method according to claim 1, characterized in that: The spectral subtraction method using a smoothing mechanism to reduce noise of the input sound data specifically includes: Calculate the energy spectrum of each leading non-speech frame, take the average value to obtain the average noise spectrum, and take the maximum value of the difference between the energy spectrum of the leading non-speech frame and the average noise spectrum as the maximum noise residual; When the power spectrum of the clean speech signal is less than the maximum noise residual, the minimum value of the power spectrum of the clean speech signal in the adjacent frame is selected for replacement; when it is greater than or equal to the maximum noise residual, it remains unchanged.
3. The chicken sound recognition method according to claim 1, characterized in that: The filtering of the low-frequency noise signal in the noise-reduced sound data specifically includes: A high-pass filter is used to filter out low-frequency noise signals in the denoised sound data.
4. The chicken sound recognition method according to claim 1, characterized in that: The method of using a dual-threshold endpoint detection algorithm to intercept sound clips in the filtered data specifically includes: Establish the startup threshold of zero-crossing rate and the startup threshold of short-term energy; When both the zero-crossing rate and the short-time energy exceed their respective starting thresholds, the corresponding point is identified as the beginning of the speech segment, marking the beginning of the speech; when the zero-crossing rate or the short-time energy is lower than their respective ending thresholds, the corresponding point is identified as the end of the speech segment, indicating a speech deviation.
5. The chicken sound recognition method according to claim 1, characterized in that: The method of extracting the sound features in the sound clip by using multiple feature extraction algorithms and merging the extracted multiple sound features specifically includes: Extract the sound features in the sound clips using spectrogram, Fbank features and Mel-frequency cepstral coefficients; Each extracted sound feature is normalized, and the three normalized sound features are merged.
6. The chicken sound recognition method according to claim 5, characterized in that: The calculation process of the spectrogram is as follows: performing frame division and windowing processing on the audio signal; performing Fourier transform on the signal in each window to convert the time domain signal into a frequency domain signal; performing absolute value operation on the frequency domain signal to obtain the spectrogram; The calculation process of the Fbank feature is as follows: performing frame division and windowing processing on the audio signal; performing Fourier transform on the signal in each window to convert the time domain signal into a frequency domain signal; further processing using a Mel filter to obtain the energy value of each filter; The calculation process of the Mel-frequency cepstrum coefficient is as follows: framing and windowing the audio signal; performing Fourier transform on the signal in each window to convert the time domain signal into a frequency domain signal; further processing using a Mel filter to obtain the energy value of each filter; taking the logarithm of the energy value of each filter and performing discrete cosine transform.
7. The chicken sound recognition method according to any one of claims 1 to 6, characterized in that: The bidirectional long short-term memory network-attention mechanism model includes a convolutional neural network part, a bidirectional long short-term memory part and an attention mechanism part; The convolutional neural network part has two convolutional layers and two maximum pooling layers, the first convolutional layer has 32 channels, the second convolutional layer has 32 channels, the first maximum pooling layer is located between the two convolutional layers, and the second maximum pooling layer expands the nodes to prepare for data input into the bidirectional long short-term memory part; The BILSTM layer of the bidirectional long short-term memory part has 64 neurons, each neuron has 2 outputs, and a total of 128 outputs to capture the long-term and short-term context information of the sound signal. A Dropout layer is attached to the BILSTM layer; The Attention layer of the attention mechanism part adopts 4 self-attention heads, and the input features will be divided into 4 different representation subspaces. Each head focuses on capturing different relationships and patterns in the input sequence. The embedding dimension is 128. At the end of the Attention layer, three fully connected layers with S-shaped activation functions are set, containing 128, 64, and 32 neurons respectively. The Softmax layer is used as the output of the bidirectional long short-term memory network-attention mechanism model.
8. A chicken sound recognition system based on an improved neural network model, characterized in that: The system comprises: An acquisition module is used to obtain the sound data of chickens in the chicken coop; A denoising module, used for denoising input sound data by using a spectral subtraction method with a smoothing mechanism; A filtering module, used for filtering low-frequency noise signals in the noise-reduced sound data; An interception module, for intercepting sound segments from the filtered data using a dual-threshold endpoint detection algorithm; An extraction module, used to extract sound features from a sound clip using a variety of feature extraction algorithms, and merge the extracted multiple sound features; The recognition module is used to input the combined sound features into the bidirectional long short-term memory network-attention mechanism model for recognition to obtain the sound classification result.
9. A computer device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, the chicken sound recognition method described in any one of claims 1 to 7 is implemented.
10. A storage medium storing a program, characterized in that: When the program is executed by a processor, the chicken sound recognition method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Method, device and system for starting based on wake-up word
CN119626217A
Chicken abnormal sound recognition method, system and device for large-scale farm and storage medium
CN119673178A
