Sick cattle monitoring system and method based on voiceprint data

Through the disease cattle monitoring system based on voiceprint data, automated and contactless disease cattle screening is achieved using LSTM and other technologies, which solves the problems of misdiagnosis, high misdiagnosis rate, poor real-time performance and infection risk in traditional methods, and improves the accuracy and efficiency of diagnosis.

CN119626230APending Publication Date: 2025-03-14SICHUAN ACAD OF GRASSLAND SCI
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411795624.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In the cattle breeding industry, traditional diagnosis of diseased cattle depends on the empirical judgment of ranch workers, and there are problems such as misdiagnosis, high misdiagnosis rate, poor real-time performance and increased infection risk.

Method used

A disease cattle monitoring system based on voiceprint data is adopted, which includes data acquisition, preprocessing, feature extraction and data classification models. It realizes automated, contactless disease cattle screening through technologies such as long-term memory neural network (LSTM) and full-connection layer.

Benefits of technology

Real-time, contactless screening of sick cattle is achieved, reducing the labor intensity of breeders and the risk of infection with the disease, and improving the accuracy and efficiency of diagnosis of sick cattle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119626230A_ABST
    Figure CN119626230A_ABST
Patent Text Reader

Abstract

The invention discloses a sick cattle monitoring system and method based on voiceprint data. The method comprises a data acquisition module; the audio data preprocessing module is used for receiving the cattle call audio data received by the data acquisition module and preprocessing the cattle call audio data; a feature extraction module which is connected with the audio data preprocessing module and is used for processing the audio data preprocessed by the audio data preprocessing module and carrying out feature extraction to obtain an improved cepstrum diagram of the cattle calling audio data; according to the data classification model, an LSTM, a full connection layer and a sigmoid activation function are adopted, and improved cepstrum diagrams of sound audio data of sick cattle and non-sick cattle are used as positive sample data and negative sample data for training; and the early warning module is used for suppressing misinformation of the classification model and judging whether diseased cattle exist in the cattle calling audio data or not. By means of the method, real-time and non-contact diseased cattle screening is achieved, and meanwhile the labor intensity of breeders and the risk of epidemic disease infection are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a sick cattle monitoring method, and in particular to a sick cattle monitoring system and method based on voiceprint data. Background Art

[0002] In order to prevent the outbreak and spread of cattle diseases, the prevention and control of animal diseases has always been based on the principle of prevention. Cattle farm workers need to closely monitor the vital signs of cattle and observe various symptoms of cattle to achieve the purpose of early detection, early isolation, early treatment, and reduced losses. Frequent and close contact will inevitably increase the workload of cattle farm workers and the risk of infection with zoonotic diseases.

[0003] At present, the screening of sick cattle is mainly based on the experience of ranch breeding staff. This method has the following disadvantages: (1) The diagnosis process of sick cattle is highly subjective and closely related to personal experience, resulting in a high rate of misdiagnosis and missed diagnosis of sick cattle; (2) The diagnosis process of sick cattle is not real-time. It is impossible for breeders to stay in the cowshed all the time to observe changes in the vital signs of cattle. Some cattle diseases spread very quickly, and failure to detect them in time may result in huge losses; (3) The screening and diagnosis of sick cattle requires breeders to have close contact with sick cattle, which increases the risk of breeders contracting zoonotic diseases.

[0004] In summary, there is an urgent need to introduce non-contact methods for screening and diagnosing sick cattle in the cattle farming industry.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The purpose of the present invention is to provide a sick cow monitoring system and method based on voiceprint data, which solves the problem that the traditional method uses empirical judgment to increase the risk of breeders contracting zoonotic diseases. After the method of the present invention, potential sick cows in the cowshed can be automatically screened out, realizing real-time, contactless screening of sick cows, while reducing the labor intensity of breeders and the risk of infection with epidemic diseases.

[0007] In order to achieve the above-mentioned purpose, the present invention provides a sick cattle monitoring system based on voiceprint data, which system comprises: a data acquisition module, which is used to obtain the audio data of cattle calls; an audio data preprocessing module, which is connected to the data acquisition module, and is used to receive and preprocess the audio data of cattle calls received by the data acquisition module, and comprises: a pre-emphasis processing submodule and an audio framing processing submodule; the pre-emphasis processing submodule is used to smooth the peak signal in the audio data through a filter to remove noise; the audio framing processing submodule is used to frame the audio signal in the pre-emphasized audio data, and perform windowing processing on the audio signal; a feature extraction module, which is connected to the audio data preprocessing module, and is used to receive the audio data preprocessed by the audio data preprocessing module, convert the signal from the time domain to the frequency domain through the fast Fourier transform, and perform the Mel transform to obtain Mel spectrum, converting the frequency domain signal back to the time domain by inverse Fourier transform through discrete cosine transform, and obtaining the improved inverse spectrum of the cattle audio data based on the Gaussian weighted feature combination method; the data classification model, which adopts the long short-term memory neural network LSTM+fully connected layer+sigmoid activation function, is connected to the feature extraction module, and is used to receive the improved inverse spectrum output by the feature extraction module, and uses the improved inverse spectrum as the input of the long short-term memory neural network LSTM; wherein, the audio data of sick cows and non-sick cows manually screened out are used as samples, the improved inverse spectrum of the sick cow call audio data is used as positive sample data, and the improved inverse spectrum of the non-sick cow call audio data is used as negative sample data for training; the early warning module is used to suppress the output false alarm of the data classification model, and judge whether there is a sick cow in the cattle call audio data.

[0008] Among them, in the feature extraction module, the feature combination model based on Gaussian weighting is:

[0009]

[0010] In formula (4), M is the signal dimension obtained by discrete cosine transform, F is the dimension of the feature vector of the target output, h is the index of the feature vector dimension, f(h) represents the h-th dimension of the original feature vector, y(h) represents the h-th dimension of the output feature vector, and j represents the index of the feature vector when the index is greater than F.

[0011] Preferably, the early warning module is provided with an alarm trigger variable s(t). When s(t) is greater than a threshold value T, an alarm is triggered, otherwise it is considered that there is no alarm at present; the update expression of the alarm trigger variable is:

[0012]

[0013] In formula (5), s(t) is the alarm trigger variable; a is the attenuation rate, where 0 < a < 1; p(t) is the score indicating whether the audio data at time t by the data classification model is from a diseased cow, where 0 ≤ p ≤ 1.

[0014] Preferably, in the pre-emphasis processing sub-module, the expression of the filter is shown in formula (1):

[0015] y(t) = x(t) - 0.97 * x(t - 1) (1)

[0016] In formula (1), x(t) is the sampling signal at time t, x(t - 1) is the sampling signal at time t - 1, and y(t) is the filtered audio signal.

[0017] Or / and, in the audio frame processing sub-module, for the audio signal x[n] with a length of N obtained after frame processing, where 0 ≤ n ≤ N - 1, the Hanning window is selected as the window function of the signal, and the corresponding weight w[n] of the window function is expressed as shown in formula (2):

[0018]

[0019] In formula (2), N is the number of sampling points of the audio signal, which is the same as the length of the audio signal; n represents the current signal point count; w[n] represents the weight of the nth signal point.

[0020] Or / and, in the feature extraction module, for the audio signal x[n] with a length of N that has undergone the above audio data preprocessing, where 0 ≤ n ≤ N - 1, the mathematical expression of the discrete Fourier transform of the one-dimensional signal used is shown in formula (3):

[0021]

[0022] In formula (3), represents the value of the kth frequency of the audio signal in the frequency domain; N represents the length of the audio signal; ∑ represents the summation symbol; n represents the nth sampling point of the time-domain signal, which is the same as the current signal point count in formula (2); exp represents the exponential function with base e; i represents the imaginary unit; π represents the pi; x[n] represents the nth sampling point of the audio signal in the time domain.

[0023] Preferably, the cow call audio data is the audio data collected at a frequency of 16000 Hz; or / and, for the frame processing, the length of the audio frame is set to 25 milliseconds, and the sampling interval is 10 milliseconds. The collection frequency of the cow call audio data can be determined through comprehensive evaluation based on the actual cow shed environment, the breed of cows, and the performance of the audio collection and processing equipment. The set 16000 Hz in the present invention is the result obtained based on specific observation data, but is not limited thereto.

[0024] Another object of the present invention is to provide a method for monitoring sick cattle based on voiceprint data, the method comprising the following steps:

[0025] (S100) Acquiring audio data of cattle calls;

[0026] (S200) pre-processing the audio data of cattle calls: smoothing the peak signal in the audio data by using a filter to remove noise; performing frame processing on the audio signal in the audio data after pre-emphasis processing, and performing window processing on the audio signal;

[0027] (S300) extracting features from the audio data of cattle calls: converting the preprocessed audio data from the time domain to the frequency domain by fast Fourier transform, performing Mel transform to obtain Mel spectrum, performing inverse Fourier transform by discrete cosine transform to convert the frequency domain signal back to the time domain, and obtaining an improved inverse frequency spectrum of the audio data of cattle calls based on a Gaussian weighted feature combination model;

[0028] (S400) Data classification model construction and classification: A data classification model is constructed by using a long short-term memory neural network LSTM + fully connected layer + sigmoid activation function; the audio data of sick cows and non-sick cows screened out manually are used as samples, the improved inverse spectrum of the audio data of sick cow calls is used as positive sample data, and the improved inverse spectrum of the audio data of non-sick cow calls is used as negative sample data to construct a data set for training;

[0029] (S500) Suppressing the false alarms of the output of the data classification model, and determining whether there are sick cows in the audio data of cow calls.

[0030] Wherein, in step (S300), the feature combination model based on Gaussian weighting is:

[0031]

[0032] In formula (4), M is the signal dimension obtained by discrete cosine transform, F is the dimension of the feature vector of the target output, h is the index of the feature vector dimension, f(h) represents the h-th dimension of the original feature vector, y(h) represents the h-th dimension of the output feature vector, and j represents the index of the feature vector when the index is greater than F.

[0033] Preferably, in step (S100), the cattle call audio data is audio data collected at a frequency of 16000 Hz; or / and, in step (S200), in the process of framing the audio signal, the length of the audio frame is set to 25 milliseconds, with a sampling interval of 10 milliseconds.

[0034] Preferably, in step (S200), a first-order filter is selected to process the original cattle-calling audio data; the mathematical expression of the first-order filter is:

[0035] y(t) = x(t) - 0.97 * x(t - 1) (1)

[0036] In Equation (1), x(t) is the sampled signal at time t, x(t - 1) is the sampled signal at time t - 1, and y(t) is the filtered audio signal.

[0037] Preferably, in step (S200), a Hanning window is selected as the window function of the signal. For an audio signal x[n] of length N, 0 ≤ n ≤ N - 1, the weight w[n] corresponding to the window function is expressed as:

[0038]

[0039] In Equation (2), N is the number of sampling points of the audio signal, which is the same as the length of the audio signal; n represents the current signal point count; w[n] represents the weight of the nth signal point.

[0040] Preferably, in step (S200), the pre - processed audio data is transformed from the time domain to the frequency domain through a fast Fourier transform. The mathematical expression of the discrete Fourier transform used is:

[0041]

[0042] In Equation (3), represents the value of the kth frequency of the audio signal in the frequency domain; N represents the length of the audio signal; ∑ represents the summation symbol; n represents the nth sampling point of the time - domain signal, which is the same as the current signal point count in Equation (2); exp represents the exponential function with base e; i represents the imaginary unit; π represents pi; x[n] represents the nth sampling point of the audio signal in the time domain.

[0043] Preferably, in step (S500), an alarm trigger variable s(t) is set. When s(t) is greater than the threshold T, an alarm is triggered; otherwise, it is considered that there is no alarm at present. The update expression of the alarm trigger variable is:

[0044]

[0045] In Equation (5), s(t) is the alarm trigger variable; a is the attenuation rate, 0 < a < 1; p(t) is the score of whether the audio data at time t by the data classification model is a diseased cow, 0 ≤ p ≤ 1.

[0046] The diseased cow monitoring system and method based on voiceprint data of the present invention have the following advantages:

[0047] (1) The sick cow screening and diagnosis method based on cattle sound wave data proposed in the present invention can automatically screen out potential sick cows in the cowshed by installing an audio sensor in the cowshed to obtain the voiceprint data of the cow. This realizes real-time, contactless screening of sick cows, while reducing the labor intensity of breeders and the risk of infection with epidemic diseases.

[0048] (2) The method of the present invention uses a cosine function weighted method to simplify the standard cepstral coefficient counting process, reducing the complexity of the feature extraction algorithm. At the same time, the improved MFCC feature is used as the input of the LSTM network to omit the feature embedding process, effectively improving the computational efficiency of the classification algorithm;

[0049] (3) The method of the present invention minimizes the loss of the original signal and retains the original information during the signal processing process; a large number of multiplication and division operations will be introduced in the process of calculating the first-order and second-order gradients, which increases the time complexity of the algorithm;

[0050] (4) The method of the present invention introduces alarm variables and updates the alarm variables through the values ​​output by the model, which effectively suppresses the false alarm rate of the single model output. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 The figure is a flow chart of the sick cattle monitoring method based on voiceprint data of the present invention.

[0052] Figure 2 The waveform diagram of the audio data of the cow's call of the present invention; (a) original signal; (b) filtered signal.

[0053] Figure 3 The audio signal preprocessing effect diagram of the present invention; (a) Hanning window curve; (b) audio signal after windowing.

[0054] Figure 4 This is the discrete Fourier transform effect of the audio frame of the present invention; (a) audio frame waveform in the time domain; (b) audio frame waveform in the frequency domain.

[0055] Figure 5 The Mel filter bank and filtering effect diagram of the present invention; (a) Mel filter bank; (b) frequencies contained in the audio frame.

[0056] Figure 6 This is a pseudo-color image of the improved cepstral coefficients of the cow call soundprint of the present invention.

[0057] Figure 7 Examples of the improved MFCC characteristic curves of the present invention; (a) for the 100th frame; (b) for the 200th frame; (c) for the 300th frame; (d) for the 400th frame.

[0058] Figure 8This is a flow chart of the end-to-end cow voiceprint recognition based on LSTM network of the present invention.

[0059] Fig. 9 This is the loss change curve of the sick cattle audio data training process of the present invention; the horizontal axis is the number of training rounds, and the vertical axis is the recognition accuracy.

[0060] Fig.10 This is a practical application effect diagram of the sick cattle monitoring system based on voiceprint data of the present invention. DETAILED DESCRIPTION

[0061] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] The present invention provides a method for monitoring sick cattle based on voiceprint data, see Figure 1 , the method comprises:

[0063] (S100) Obtaining audio data from the cattle shed

[0064] Through the observation of a large amount of cattle audio data, it is found that the energy of cattle audio is mainly concentrated in the medium and low frequency bands. Therefore, the acquisition frequency of the cattle shed audio sensor is set to 16000Hz, which can more completely cover the frequency range of cattle soundprints. The cattle audio data is 1D serialized data, and its waveform is as follows: Figure 2 As shown, the figure shows the audio data of a cow's call with a duration of 4.3651 seconds.

[0065] (S200) Audio Data Preprocessing

[0066] Audio data preprocessing includes: pre-emphasis processing and audio frame processing, as follows:

[0067] (S210) Pre-emphasis Processing

[0068] exist Figure 2 It can be found from the ripple curve of the original data of the cow-calling audio that there are many spike peaks in the cow-calling audio signal (that is, high-frequency components or high-frequency signals, referring to single-point or isolated spike signal parts). It can be considered that the peak part of the audio signal contains more information. Therefore, the original audio signal needs to be pre-emphasized, that is, filtered, to emphasize the input original audio signal and remove the peak part of the audio signal.

[0069] A first-order filter is selected to process the original audio data of the cow's call. The mathematical expression of the first-order filter is shown in formula (1). The function of filtering is to compensate and increase the peak signal. In the audio signal, the high-frequency component has a large amount of information, while the low-frequency component has a small amount of information. The high-frequency component of the signal is often caused by noise or random disturbance. The signal emphasis operation here is to smooth the signal and remove the interference noise. The low-frequency component is often the more stable part of the signal and represents the basic characteristics of the signal.

[0070] y(t)=x(t)-0.97*x(t-1) (1)

[0071] In formula (1), x(t) is the sampled signal at time t, x(t-1) is the sampled signal at time t-1, and y(t) is the filtered audio signal.

[0072] like Figure 2 As shown in b, it is the effect of the first-order filtering of the cattle calling audio signal by the present invention.

[0073] (S220) Audio Frame Processing

[0074] from Figure 2 From the ripple curve of the audio data of cow calls, we can find that the signal data is a non-stationary signal, so it is necessary to extract features from the local area, because in each local short time, the audio signal can be approximately considered as a stationary signal.

[0075] The pre-emphasized audio signal is divided into very short segments on the time axis. Unlike the image frames in the video, the framing of the voice signal has little to do with human hearing. When playing audio, the human ear still hears densely sampled signals, not sparse audio frames. In the process of audio signal processing, the audio signal is artificially framed to facilitate subsequent signal analysis and processing.

[0076] There are two important parameters in the audio framing process, namely the length of the frame itself (i.e., the frame length described below) and the length of the interval between frames. If the interval between frames is equal to the frame length, there is no overlap between frames; if the interval between frames is less than the frame length, there will be a certain overlap between frames; if the interval between frames is greater than the frame length, there will be gaps between frames, and the original signal cannot be completely covered, resulting in missing information after framing. It is generally assumed that the audio signal is relatively stable within the range of 10 to 30 milliseconds, so the frame length can be set within this range. In the present invention, during the framing process of the audio signal, the length of the audio frame is set to 25 milliseconds, with a sampling interval of 10 milliseconds. If the sampling frequency of the cattle call audio is 16000Hz, 101 audio frames can be obtained for audio data of 1 second in length.

[0077] After the pre-emphasized audio signal is framed, features can be extracted for each frame, but this feature extraction process is a feature extraction operation for the entire signal. In the framing process, it is equivalent to retaining only the part of the signal covered by the current frame, and setting the signal before the frame start point and the signal after the frame end point to 0, resulting in a high degree of discontinuity in the position of the frame start point and the frame end point of the frame after framing. If the feature extraction operation is performed directly on the signal, high-frequency components will be generated at the discontinuous points of the signal. In addition, since the periodic signal is truncated during the framing process, the signal spectrum will cause tailing in the entire frequency band.

[0078] In order to avoid the above situation affecting the audio analysis process, the signal needs to be windowed after framing. Windowing is to weight a frame of signal with a window function. The design focus of the window function is to give a larger weight to the signal near the center of the window and a weight close to 0 to the signal near the edge of the window to reduce the signal discontinuity caused by framing.

[0079] For an audio signal x[n] of length N obtained after frame processing, 0≤n≤N-1 (discrete signal), the present invention selects a Hanning window as the window function of the signal, and the weight w[n] corresponding to the window function is expressed as shown in formula (2).

[0080]

[0081] In formula (2), N is the number of sampling points of the audio signal (the same as the length of the audio signal); n represents the current signal point count; and w[n] represents the weight of the nth signal point.

[0082] like Figure 3 FIG. 2 b shows the effect of the audio signal preprocessing of the present invention.

[0083] (S300) Feature Extraction

[0084] Since the audio signal preprocessing process is carried out in the time domain, and various transformations in the time domain are difficult to feedback the essential features contained in the audio signal for subsequent classification and recognition. Therefore, after preprocessing the audio signal, the signal is converted from the time domain to the frequency domain through fast Fourier transform, and the essential features represented by different speech signals are observed from the dimension of signal energy distribution.

[0085] Mel-frequency cepstral coefficient (MFCC) is the most commonly used feature in speech recognition. It is widely used in both voiceprint recognition and speech recognition. Since the cepstral step in the MFCC feature extraction process is computationally intensive and loses a large amount of original information, an improved MFCC feature extraction method is proposed in the present invention, that is, an improved cepstral coefficient feature map is obtained by a feature combination method based on Gaussian weighting.

[0086] (S310) Discrete Fourier Transform

[0087] For the audio signal x[n] with a length of N after the above audio data preprocessing, 0≤n≤N-1, in order to extract the description that can characterize the essence of the sound object from the audio signal, the discrete time domain signal is converted into a discrete frequency domain signal using discrete Fourier transform. The mathematical expression of the discrete Fourier transform of the one-dimensional signal is shown in formula (3).

[0088]

[0089] In formula (3), represents the value of the kth frequency of the audio signal in the frequency domain; N represents the length of the audio signal; ∑ represents the summation symbol; n represents the nth sampling point of the time domain signal (the same as the current signal point count in formula (2)); exp represents an exponential function with e as the base; i represents an imaginary unit; π represents pi; x[n] represents the nth sampling point of the audio signal in the time domain.

[0090] like Figure 4 As shown, the discrete Fourier transform effect of the audio frame of the present invention, wherein a is the audio frame, and b is the discrete Fourier transform result, indicating the distribution range of the frequency contained in the signal.

[0091] (S320) Mel filter

[0092] In most cases, the high-frequency signals contained in the audio signal are noise, which interferes with the subsequent audio classification and recognition operations. Therefore, it is necessary to filter the high-frequency information in the audio signal. Mel transform is a nonlinear mathematical transformation of frequency perception. It conforms to the standard acoustic model of human hearing characteristics. By weighted summing the Mel filter weight value with the original signal, the high-frequency part of the spectrum signal obtained by Fourier transform can be filtered and the information can be compressed. The graph of the Mel filter bank is shown in Figure 5 As shown in a, Figure 5 b is the effect of the discrete Fourier transform of an audio frame after the Mel transform, which is obtained by Figure 4 The audio frame frequency graph in b is Figure 5 The 64-dimensional audio frame Mel feature curve is obtained after filtering by the Mel filter bank in a.

[0093] (S330) Cepstral coefficient calculation

[0094] The Mel spectrum needs to be inversely transformed to convert the frequency domain signal back to the time domain signal. In order to simplify the calculation, the discrete cosine transform is used instead of the inverse Fourier transform, so that the 64-dimensional Mel feature can be transformed into a 64-dimensional feature vector. The existing standard speech cepstral coefficient (MFCC) calculation steps require the first-order and second-order gradient boosting of the discrete cosine transform result to obtain a 39-dimensional feature vector. From the perspective of information theory, no mathematical technique can make up for the lack of information. Therefore, in the process of signal processing, the loss of the original signal should be minimized to retain the original information; the existing method will introduce a large number of multiplication and division operations in the process of first-order and second-order gradient calculation, which increases the complexity of the algorithm.

[0095] Therefore, the present invention proposes a feature combination method based on Gaussian weighting, which can retain all the information of discrete cosine transform in the output signal, ensuring that no information is lost during the signal processing and transformation process. The mathematical expression of the feature combination method based on Gaussian weighting is shown in formula (4).

[0096]

[0097] In formula (4), M is the signal dimension obtained by discrete cosine transform, F is the dimension of the feature vector of the target output, h is the index of the feature vector dimension, f(h) represents the h-th dimension of the original feature vector, y(h) represents the h-th dimension of the output feature vector, and j represents the index of the feature vector when the index is greater than F.

[0098] If the value of F is set to 32, a pseudo-color image of the improved cepstral coefficients of the audio data of the cow call can be obtained as follows: Figure 6 As shown in the figure, this is the effect after feature pseudo color processing (the feature value here has only one value and cannot be expressed as a color. The single value mapping method can be used to generate a color effect, but because it is not a real color, it is called pseudo color) to more vividly demonstrate the processing of the algorithm, and finally obtain a 32*T two-dimensional feature map, where T is the number of frames contained in the audio file. Figure 7 The a is Figure 6 The characteristic curve corresponding to the 100th frame in Figure 7 The b is Figure 6 The characteristic curve corresponding to the 200th frame in Figure 7 The c is Figure 6 The characteristic curve corresponding to the 300th frame in Figure 7 The d is Figure 6 The characteristic curve corresponding to the 400th frame in .

[0099] (S400) Data classification model design and training

[0100] After obtaining the improved mfcc feature map of the cattle calling audio data (such as Figure 6 As shown in the figure, the convolutional neural network is selected as the feature extractor, and the high-dimensional feature map is reduced in dimension again. Finally, the fully connected neural network is used to classify the features to identify whether the current audio contains the sound of sick cows, so as to identify whether there are sick cows in the cowshed through audio data. However, according to the experimental results, the recognition model constructed by training the improved cepstral coefficient feature map with the convolutional neural network has poor generalization ability on real data. The reasons are as follows: (1) The cepstral coefficient feature map lacks obvious texture features, which is not conducive to the learning and generalization of the convolutional neural network structure; (2) The audio signal has obvious time series characteristics, and the recurrent neural network with time series modeling ability should be considered as a feature extraction tool.

[0101] After observing the improved inverse spectrum of a large number of cattle audio data, it was found that the audio frame features have obvious periodic characteristics. Therefore, a long short-term memory neural network (LSTM) plus a fully connected layer and a Sigmoid activation function were selected to model and classify the cattle audio data. The end-to-end recognition model design flow chart is shown below: Figure 8 As shown in the figure, the Sigmoid function is used as the activation function in the fully connected layer of the data classification model, so that the output value of the model is within the range of [0,1], indicating whether the real-time audio is a score of a sick cow.

[0102] In order to make the samples contain more effective features during the experiment, the sampling time of the audio was set to 4 seconds, the frame length was 25 milliseconds, the frame interval was set to 10 milliseconds, each sampled audio contained 401 frames, and each frame contained 400 sampling points. The audio data of sick cows and non-sick cows were manually screened out, and the improved inverse spectrum obtained by voiceprint feature extraction using steps (S200) and (S300) of the present invention was used as positive samples and negative samples. After using the improved inverse spectrum as the input of the LSTM model, the feature embedding step can be omitted because the feature dimension of the improved inverse spectrum coefficient output is fixed. Among them, a total of 162,000 positive sample data were produced from the audio data of sick cow calls, and 165,000 negative sample data (voiceprints of non-sick cows) were also produced at the same time to balance the positive and negative samples during the training process. The recognition rate of the model trained on the sick cow identification dataset reached 98.54% on the test data, and the loss curve of the training process is as follows Fig. 9 As shown in the figure (the horizontal axis is the number of training rounds, and the vertical axis is the recognition accuracy), the black dotted line represents the recognition accuracy change curve of the model on the verification data set during the training process, and the black solid line represents the model loss change curve during the training process.

[0103] (S500) Alarm Mechanism

[0104] Since the actual cow shed audio data collected is inevitably interfered by random noise, which causes the audio recognition model to produce false alarms, it is necessary to suppress the false alarms of the model. Observed over a period of time, the number of error judgments of the model is small compared to the number of correct judgments. According to this characteristic, an alarm trigger variable s(t) is designed. If s(t) is greater than a certain threshold T, the alarm is triggered; otherwise, it is considered that there is no alarm at present. The update expression of the alarm trigger variable is shown in formula (5).

[0105]

[0106] Among them, s(t) is the alarm trigger variable, a is the attenuation rate (0 < a < 1), and p(t) represents the score (0 ≤ p ≤ 1) of whether the audio data of the data classification model at time t is a diseased cow; when s(t) is greater than the threshold T, it means that there is a diseased cow in the audio data at time t and in a neighboring period of time, otherwise there is no diseased cow. Such processing can effectively suppress the false alarm rate of the model.

[0107] For the practical application of the diseased cow monitoring system based on voiceprint data of the present invention, refer to Fig.10 , and it can be seen that the system of the present invention can screen out diseased cows.

[0108] Although the content of the present invention has been introduced in detail through the above preferred embodiments, it should be recognized that the above description should not be considered as a limitation of the present invention. After those skilled in the art have read the above content, various modifications and substitutions of the present invention will be obvious. Therefore, the protection scope of the present invention should be defined by the appended claims.

Claims

1. A sick cattle monitoring system based on voiceprint data, characterized in that: The system includes: A data acquisition module, which is used to obtain bovine call audio data; An audio data preprocessing module, which is connected to the data acquisition module and is used to receive the bovine call audio data received by the data acquisition module and perform preprocessing. It includes: a pre-emphasis processing sub-module and an audio framing processing sub-module; the pre-emphasis processing sub-module is used to smooth the peak signals in the audio data through a filter to remove noise; the audio framing processing sub-module is used to frame the audio signals in the pre-emphasized audio data and perform windowing processing on the audio signals; A feature extraction module, which is connected to the audio data preprocessing module and is used to receive the audio data preprocessed by the audio data preprocessing module, convert the signal from the time domain to the frequency domain through fast Fourier transform, perform Mel transform to obtain Mel spectrum, perform inverse Fourier transform through discrete cosine transform to convert the frequency domain signal back to the time domain, and obtain an improved cepstrum diagram of the bovine call audio data based on the Gaussian weighted feature combination method; A data classification model, which uses a long short-term memory neural network LSTM + fully connected layer + sigmoid activation function. It is connected to the feature extraction module and is used to receive the improved cepstrum diagram output by the feature extraction module and use the improved cepstrum diagram as the input of the long short-term memory neural network LSTM; among them, the audio data of diseased cattle and non-diseased cattle are selected as samples manually, and the improved cepstrum diagram of the audio data of diseased cattle calls is used as positive sample data, and the improved cepstrum diagram of the audio data of non-diseased cattle calls is used as negative sample data to construct a dataset for training; An early warning module, which is used to suppress false alarms in the output of the data classification model and judge whether there are diseased cattle in the bovine call audio data; Among them, in the feature extraction module, the Gaussian weighted feature combination model is: In formula (4), M is the signal dimension obtained by discrete cosine transform, F is the dimension of the target output feature vector, h is the index of the feature vector dimension, f(h) represents the h-th dimension of the original feature vector, y(h) represents the h-th dimension of the output feature vector, and j represents the index of the feature vector when the index is greater than F.

2. The sick cattle monitoring system according to claim 1, characterized in that: The early warning module is provided with an alarm trigger variable s(t). When s(t) is greater than the threshold T, an alarm is triggered, otherwise it is considered that there is no alarm currently; The update expression of the alarm trigger variable is: In formula (5), s(t) is the alarm trigger variable; a is the attenuation rate, 0 < a < 1; p(t) is the score of whether the audio data at time t by the data classification model is a diseased cattle, 0 ≤ p ≤ 1.

3. The sick cattle monitoring system according to claim 1, characterized in that: In the pre-emphasis processing sub-module, the expression of the filter is shown in formula (1): y(t) = x(t) - 0.97 * x(t - 1) (1) In formula (1), x(t) is the sampling signal at time t, x(t - 1) is the sampling signal at time t - 1, and y(t) is the filtered audio signal; Or / and, in the audio framing processing submodule, for the audio signal x[n] of length N obtained after framing processing, 0≤n≤N-1, a Hanning window is selected as the window function of the signal, and the weight w[n] corresponding to the window function is expressed as shown in formula (2): In formula (2), N is the number of sampling points of the audio signal, which is the same as the length of the audio signal; n represents the current signal point count; w[n] represents the weight of the nth signal point; Or / and, in the feature extraction module, for the audio signal x[n] of length N after the above audio data preprocessing, 0≤n≤N-1, the mathematical expression of the discrete Fourier transform of the one-dimensional signal is shown in formula (3): In formula (3), represents the value of the kth frequency of the audio signal in the frequency domain; N represents the length of the audio signal; ∑ represents the summation symbol; n represents the nth sampling point of the time domain signal, which is the same as the current signal point count in equation (2); exp represents an exponential function with e as the base; i represents an imaginary unit; π represents pi; x[n] represents the nth sampling point of the audio signal in the time domain.

4. The sick cattle monitoring system according to any one of claims 1 to 3, characterized in that: The audio data of cattle calls is audio data collected at a frequency of 16000 Hz; Or / and, in the frame processing, the length of the audio frame is set to 25 milliseconds, with a sampling interval of 10 milliseconds.

5. A method for monitoring sick cattle based on voiceprint data, characterized in that: The method comprises the following steps: (S100) Acquiring audio data of cattle calls; (S200) pre-processing the audio data of cattle calls: smoothing the peak signal in the audio data by using a filter to remove noise; performing frame processing on the audio signal in the audio data after pre-emphasis processing, and performing window processing on the audio signal; (S300) extracting features from the audio data of cattle calls: converting the preprocessed audio data from the time domain to the frequency domain by fast Fourier transform, performing Mel transform to obtain Mel spectrum, performing inverse Fourier transform by discrete cosine transform to convert the frequency domain signal back to the time domain, and obtaining an improved inverse frequency spectrum of the audio data of cattle calls based on a Gaussian weighted feature combination model; (S400) Data classification model construction and classification: A data classification model is constructed by using a long short-term memory neural network LSTM + fully connected layer + sigmoid activation function; the audio data of sick cows and non-sick cows screened out manually are used as samples, the improved inverse spectrum of the audio data of sick cow calls is used as positive sample data, and the improved inverse spectrum of the audio data of non-sick cow calls is used as negative sample data to construct a data set for training; (S500) suppressing the output false alarm of the data classification model, and determining whether there is a sick cow in the audio data of the cow call; Wherein, in step (S300), the feature combination model based on Gaussian weighting is: In formula (4), M is the signal dimension obtained by discrete cosine transform, F is the dimension of the feature vector of the target output, h is the index of the feature vector dimension, f(h) represents the h-th dimension of the original feature vector, y(h) represents the h-th dimension of the output feature vector, and j represents the index of the feature vector when the index is greater than F.

6. The sick cattle monitoring method according to claim 5, characterized in that: In step (S100), the audio data of cattle calls is audio data collected at a frequency of 16000 Hz; Or / and, in step (S200), in the process of framing the audio signal, the length of the audio frame is set to 25 milliseconds, with 10 milliseconds as the sampling interval.

7. The sick cattle monitoring method according to claim 5, characterized in that: In step (S200), a first-order filter is selected to process the original audio data of the cattle call; The mathematical expression of the first-order filter is: y(t) = x(t) - 0.97 * x(t - 1) (1) In Equation (1), x(t) is the sampled signal at time t, x(t - 1) is the sampled signal at time t - 1, and y(t) is the filtered audio signal.

8. The sick cattle monitoring method according to claim 5, characterized in that: In step (S200), the Hanning window is selected as the window function of the signal. For the audio signal x[n] with length N, 0 ≤ n ≤ N - 1, the corresponding weight w[n] of the window function is expressed as: In Equation (2), N is the number of sampling points of the audio signal, which is the same as the length of the audio signal; n represents the current signal point count; w[n] represents the weight of the nth signal point.

9. The sick cattle monitoring method according to claim 5, characterized in that: In step (S200), the preprocessed audio data is transformed from the time domain to the frequency domain through the fast Fourier transform. The mathematical expression of the discrete Fourier transform adopted is: In formula (3), represents the value of the kth frequency of the audio signal in the frequency domain; N represents the length of the audio signal; ∑ represents the summation symbol; n represents the nth sampling point of the time domain signal, which is the same as the current signal point count in equation (2); exp represents an exponential function with e as the base; i represents an imaginary unit; π represents pi; x[n] represents the nth sampling point of the audio signal in the time domain.

10. The sick cattle monitoring method according to any one of claims 5 to 9, characterized in that: In step (S500), an alarm trigger variable s(t) is set. When s(t) is greater than the threshold T, the alarm is triggered; otherwise, it is considered that there is no alarm currently. The update expression of the alarm trigger variable is: In Equation (5), s(t) is the alarm trigger variable; a is the attenuation rate, 0 < a < 1; p(t) is the score of whether the audio data of the data classification model at time t is a diseased cow, 0 ≤ p ≤ 1.

Citation Information

Patent Citations

  • MFCC coefficient-based pig sound recognition system and method

    CN114203187A

  • Method and system for tracking cattle target by unmanned aerial vehicle in pasture based on Siamese network

    CN116452629A

  • Method and system for judging respiratory diseases according to poultry sounds

    CN118351888A

  • Lightweight LSTM (Long Short Term Memory) model construction method and system for multi-modal data processing

    CN118446247A