Chicken abnormal sound recognition method, system and device for large-scale farm and storage medium

By combining audio technology and deep learning, using three-channel Mel fusion features to identify abnormal sounds of chickens, it solves the problem of difficult to identify sick chickens in a large-scale breeding environment, and realizes automatic and accurate identification, improving breeding efficiency and animal welfare.

CN119673178APending Publication Date: 2025-03-21SOUTH CHINA AGRICULTURAL UNIVERSITY

Patent Information

Application Number
CN202411877007.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In a large-scale breeding environment, it is difficult to identify sick chickens in a timely and accurate manner, which leads to disease monitoring dependent on human work, time-consuming and labor-intensive, and affects breeding efficiency and animal welfare.

Method used

By combining audio technology and deep learning, three-channel Mel fusion features are obtained by combining Mel spectrograms, first-order differential Mel spectrograms and second-order differential Mel spectrograms, which are used to identify model training to achieve automatic and non-invasive chicken abnormal sound recognition.

Benefits of technology

It improves the accuracy and efficiency of abnormal sound recognition of chickens, reduces the cost and time of human work inspections, improves breeding efficiency and economic benefits, and reduces the stress response of chickens.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119673178A_ABST
    Figure CN119673178A_ABST
Patent Text Reader

Abstract

The invention discloses a chicken abnormal sound recognition method, system and device for a large-scale farm and a storage medium. The method comprises the following steps: acquiring sound data of a chicken as a first audio; taking the preprocessed first audio as a second audio; taking the second audio frequency after the secondary noise reduction as a third audio frequency; performing sound endpoint detection on the third audio, and taking an obtained effective sound fragment as a fourth audio; performing data enhancement on the fourth audio, and taking the fourth audio after data enhancement as a fifth audio; converting the audio clip of the fifth audio into a Mel spectrogram, extracting a corresponding first-order difference Mel spectrogram and a corresponding second-order difference Mel spectrogram based on the Mel spectrogram, and performing feature fusion to obtain corresponding three-channel Mel fusion features; and inputting the Mel fusion feature into a model for identification to obtain an event category result corresponding to the audio. According to the invention, abnormal chicken sounds in the chicken farm can be accurately identified, and the breeding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent livestock and poultry breeding, and specifically relates to a method, system, equipment and storage medium for identifying abnormal sounds of chickens in large-scale breeding farms. Background Art

[0002] With the continuous development of my country's animal husbandry, poultry farming, as a basic industry of my country's animal husbandry, has gradually moved towards large-scale and intensive breeding, and the same is true for chickens, as the most representative type of poultry; however, the large-scale and intensive breeding of chickens will inevitably increase the risk of chickens being infected with various infectious diseases. If not discovered in time, it will eventually lead to a large number of chickens becoming sick or dying, which will bring huge losses to farmers. Therefore, how to identify sick chickens in a timely and accurate manner in a large-scale breeding environment 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] In the prior art, disease monitoring of broiler chickens during broiler farming is still basically a manual operation. The staff regularly inspects the chickens in the farm based on their own experience, and judges their health status by observing the chickens' activity patterns or food intake. Manual inspections are not only time-consuming and labor-intensive, but also easily cause excessive stress reactions in the chickens, affecting farming efficiency. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method for identifying abnormal sounds of chickens in large-scale farms. The method accurately identifies the abnormal calls of chickens in chicken farms through the effective combination of audio technology and deep learning, thereby realizing automatic and non-invasive recognition of abnormal calls of chickens in large-scale farms, reducing the manpower and economic costs of manual inspections, and improving the breeding efficiency of chickens.

[0005] At the same time, the second object of the present invention is to provide a chicken abnormal sound recognition system for large-scale breeding farms.

[0006] Meanwhile, a third object of the present invention is to provide a computer device.

[0007] Meanwhile, a fourth object of the present invention is to provide a storage medium.

[0008] The purpose of the present invention is achieved through the following technical solutions:

[0009] A method for identifying abnormal sounds of chickens in large-scale breeding farms comprises the following steps:

[0010] S1. Acquire the sound data of chickens in a farm as the first audio;

[0011] S2, preprocessing the first audio, and using the preprocessed first audio as the second audio; the second audio is composed of a plurality of audio clips of equal length;

[0012] S3, using a digital filter to perform preliminary noise reduction on the second audio, and then using spectral subtraction to perform secondary noise reduction on the second audio after the preliminary noise reduction, and using the second audio after the secondary noise reduction as the third audio;

[0013] S4, performing sound endpoint detection on the third audio based on a short-time energy threshold, a short-time zero-crossing rate threshold and a duration of the sound, selecting valid sound segments from the third audio, and using all the obtained valid sound segments as the fourth audio; the valid sound is the call of a chicken;

[0014] S5. Processing the fourth audio by using a data zero padding method, performing data enhancement on the processed fourth audio, and using the data enhanced fourth audio as the fifth audio;

[0015] S6, converting the audio segment of the fifth audio into a Mel spectrogram, and extracting a corresponding first-order difference Mel spectrogram and a second-order difference Mel spectrogram based on the Mel spectrogram; then performing feature fusion on the Mel spectrogram, the first-order difference Mel spectrogram, and the second-order difference Mel spectrogram to obtain a three-channel Mel fusion feature corresponding to the audio segment in the fifth audio;

[0016] S7. Input the three-channel Mel fusion features into the chicken abnormal sound recognition model for recognition, and obtain the event category result corresponding to the audio.

[0017] Preferably, the specific steps of step S2 are as follows:

[0018] S21, firstly, resampling, bit depth adjustment and channel number adjustment processing are performed on the first audio in sequence, so as to adjust the sampling frequency, bit depth and channel number of the first audio to preset parameters, and obtain the first audio after format adjustment;

[0019] S22, performing a DC component elimination and amplitude normalization process on the adjusted first audio to remove background noise in the audio and normalize the assignment interval in the audio, to obtain a preliminarily processed first audio;

[0020] S23, processing the preliminarily processed first audio by means of framing, windowing, and pre-emphasis to obtain a pre-processed first audio, and using the pre-processed first audio as the second audio; the specific process is as follows:

[0021] First, the preliminarily processed first audio is divided into frames to obtain audio segments of equal length, and then a window function is applied to each audio segment to reduce spectrum leakage; the window function is specifically expressed as follows:

[0022] The window function adopts a periodic Hamming window, the window length is 1024 sampling points, the frame shift is 128 sampling points, and the formula of the window function is as follows:

[0023]

[0024] Among them, ω(n) is the window function, L is the window length, and n is the sampling point.

[0025] Then, pre-emphasis processing is performed on each audio segment after the windowing processing, so that the high-frequency part in each audio segment is strengthened, and finally all the obtained audio segments are used as the pre-processed first audio, and the pre-processed first audio is used as the second audio.

[0026] Preferably, the digital filter in step S3 is a 5th-order high-pass filter, and the 5th-order high-pass filter is represented as follows:

[0027]

[0028] Where: y[n] is the output signal of the filter; x[n] is the input signal of the filter; a k and b k is the coefficient of the filter; N is the feedback coefficient of the output signal; M is the feedforward coefficient of the input signal.

[0029] Preferably, the specific process of step S6 is as follows:

[0030] S61, performing Fourier transform on each frame in the audio segment of the fifth audio to obtain frequency spectrum information of each frame of the audio segment;

[0031] S62, setting a group of Mel filters according to the Mel scale, and using the Mel filters to process the spectrum information of each frame of the audio clip to obtain a Mel spectrum;

[0032] S63, taking the logarithm of the Mel spectrum corresponding to each frame of the audio clip and combining them to compress the dynamic range to obtain a Mel spectrogram;

[0033] S64, extracting a corresponding first-order difference Mel spectrogram and a second-order difference Mel spectrogram based on the Mel spectrogram;

[0034] S65, performing feature fusion on the mel spectrogram, the first-order difference mel spectrogram, and the second-order difference mel spectrogram to obtain a three-channel mel fusion feature.

[0035] Preferably, the conversion formula of the Mel frequency in step S62 is as follows:

[0036]

[0037] Where f is the actual frequency in Hz, F mel It is the perceived frequency in Mel.

[0038] Preferably, the three-channel Mel fusion feature in step S65 is specifically expressed as follows:

[0039]

[0040] Where f is the number of Mel filters, t is the time frame, c = 1 corresponds to the Mel spectrogram S(f, t), c = 2 corresponds to the first-order difference ΔS(f, t) of the Mel spectrogram, and c = 3 corresponds to the second-order difference ΔΔS(f, t) of the Mel spectrogram.

[0041] Preferably, the specific content of data enhancement of the processed fourth audio in step S5 includes adding noise of different decibels to the audio, changing the audio playback speed, changing the audio pitch, and changing the audio playback speed and pitch at the same time.

[0042] Preferably, the abnormal sound recognition model for chickens is trained using the EfficientNetV2 convolutional neural network.

[0043] A chicken abnormal sound recognition system for large-scale breeding farms, used for the chicken abnormal sound recognition method for large-scale breeding farms, the system comprising:

[0044] A first audio acquisition module is used to acquire sound data of chickens in a breeding farm, and use the sound data of the chickens in the breeding farm as the first audio;

[0045] A preprocessing module, used for preprocessing the first audio and using the preprocessed first audio as the second audio;

[0046] A noise reduction module, configured to perform preliminary noise reduction on the second audio by using a digital filter, and then perform secondary noise reduction on the second audio after the preliminary noise reduction by using a spectral subtraction method, and use the second audio after the secondary noise reduction as the third audio;

[0047] an endpoint detection module, configured to perform sound endpoint detection on the third audio by using a short-time energy threshold, a short-time zero-crossing rate threshold, and a duration of the sound, select valid sound segments from the third audio, and use all the obtained valid sound segments as the fourth audio;

[0048] A data zero-padding module, used for processing the fourth audio by adopting a data zero-padding method;

[0049] A data enhancement module, used for performing data enhancement on the fourth audio after the data is padded with zeros, and using the fourth audio after the data enhancement as the fifth audio;

[0050] A feature extraction module, configured to convert the audio segment of the fifth audio into a Mel spectrogram, and extract a corresponding first-order difference Mel spectrogram and a second-order difference Mel spectrogram based on the Mel spectrogram; and then perform feature fusion on the Mel spectrogram, the first-order difference Mel spectrogram and the second-order difference Mel spectrogram to obtain a three-channel Mel fusion feature corresponding to the audio segment in the fifth audio;

[0051] A model building module is used to build an initial chicken abnormal sound recognition model, and use a training set generated by historical three-channel Mel fusion features for training to obtain a chicken abnormal sound recognition model;

[0052] A classification and recognition module, used to use the abnormal chicken sound recognition model to recognize the sound to be tested and obtain a corresponding classification and recognition result;

[0053] The visualization module is used to store and display the classification and recognition results locally, and upload the classification and recognition results to the cloud database for storage and display in the cloud database.

[0054] A computer device comprises a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the abnormal sound recognition method of chickens used in large-scale breeding farms is implemented.

[0055] A storage medium stores a program, and when the program is executed by a processor, the abnormal sound recognition method of chickens used in large-scale breeding farms is implemented.

[0056] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0057] (1) The abnormal sound recognition method for chickens in large-scale breeding farms of the present invention adopts a three-channel Mel fusion feature obtained by fusing a Mel spectrogram, a first-order difference Mel spectrogram and a second-order difference Mel spectrogram as an audio feature and applies it to recognition model training. The three-channel Mel fusion feature can simultaneously retain static and dynamic features, has better robustness to environmental noise and signal changes, can more comprehensively and accurately characterize audio features, and improve the classification speed and accuracy of the recognition model, so that farmers can better monitor the health status of chickens, and can promptly discover and deal with health problems of chickens when they have them, thereby improving breeding efficiency and economic benefits.

[0058] (2) The abnormal sound recognition method for chickens in large-scale breeding farms of the present invention performs sound endpoint detection on the acquired audio through a short-time energy threshold, a short-time zero-crossing rate threshold and the duration of the sound, thereby increasing the subsequent feature extraction speed, reducing the recognition events of abnormal chicken sounds, and improving work efficiency.

[0059] (3) The abnormal sound recognition system for chickens in large-scale breeding farms of the present invention can accurately identify the abnormal calls of chickens in the chicken farm through the effective integration of various modules, thereby realizing automatic and non-invasive recognition of abnormal calls of chickens in large-scale breeding farms, reducing the manpower and economic costs of manual inspections, and reducing the probability of emergency reactions of chickens, thereby improving the breeding efficiency, economic benefits and animal welfare of chickens. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 A schematic diagram of a flow chart of a method for identifying abnormal sounds of chickens in large-scale breeding farms provided in Example 1 of the present invention;

[0061] Figure 2 A schematic diagram of the structure of an abnormal sound recognition system for chickens in large-scale breeding farms provided by Embodiment 2 of the present invention;

[0062] Figure 3 A schematic diagram of the structure of a computer device provided in Example 3 of the present invention.

[0063] Figure 4 A schematic diagram of the structure of a storage medium provided in Example 4 of the present invention. DETAILED DESCRIPTION

[0064] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0065] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, 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 embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. 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.

[0066] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods.

[0067] Example 1

[0068] A method for identifying abnormal sounds of chickens in large-scale breeding farms, the method comprising the following steps:

[0069] S1. Acquire the sound data of chickens in a farm as the first audio;

[0070] Specifically, in this embodiment, a microphone is used to collect audio of chickens in a farm. The audio is recorded in a timed manner from 20:00 to 5:00 the next day. During this period, a segment of audio is saved every minute and uploaded to a computer and a cloud database.

[0071] S2, preprocessing the first audio, and using the preprocessed first audio as the second audio; the second audio is composed of a plurality of audio clips of equal length;

[0072] Specifically, the specific steps of step S2 are as follows:

[0073] S21, firstly, resampling, bit depth adjustment and channel number adjustment processing are performed on the first audio in sequence, so as to adjust the sampling frequency, bit depth and channel number of the first audio to preset parameters, and obtain the first audio after format adjustment;

[0074] Since the first audio is usually collected by different devices, it is necessary to process the format of the collected first audio. In this embodiment, the preset parameters are a sampling frequency of 48kHz, a bit depth of 16bit, a format of wav, and a channel of mono.

[0075] S22, performing a DC component elimination and amplitude normalization process on the adjusted first audio to remove background noise in the audio and normalize the assignment interval in the audio, to obtain a preliminarily processed first audio;

[0076] Specifically, the DC component elimination process of the adjusted first audio is expressed as follows:

[0077]

[0078] Where n is the sampling point, y(n) is the audio signal, and y(k) is the kth sampling point of the audio signal.

[0079] S23, processing the preliminarily processed first audio by means of framing, windowing, and pre-emphasis to obtain a pre-processed first audio, and using the pre-processed first audio as the second audio; the specific process is as follows:

[0080] First, the preliminarily processed first audio is divided into frames to obtain audio segments of equal length, and then a window function is applied to each audio segment to reduce spectrum leakage; the window function is specifically expressed as follows:

[0081] The window function adopts a periodic Hamming window, the window length is 1024 sampling points, the frame shift is 128 sampling points, and the formula of the window function is as follows:

[0082]

[0083] Among them, ω(n) is the window function, L is the window length, and n is the sampling point.

[0084] Then, pre-emphasis processing is performed on each audio segment after the windowing processing, so that the high-frequency part in each audio segment is strengthened, and finally all the obtained audio segments are used as the pre-processed first audio, and the pre-processed first audio is used as the second audio.

[0085] Specifically, the formula for pre-emphasis processing on the audio clip is expressed as follows:

[0086] y(n)=x(n)-αx(n-1)

[0087] Wherein, n is the sampling point, α is a constant, which is 0.97, x(n) is the audio signal, and y(n) is the signal output after pre-emphasis of x(n).

[0088] S3, using a digital filter to perform preliminary noise reduction on the second audio, and then using spectral subtraction to perform secondary noise reduction on the second audio after the preliminary noise reduction, and using the second audio after the secondary noise reduction as the third audio;

[0089] Specifically, the digital filter in step S3 is a 5th-order high-pass filter, and the 5th-order high-pass filter is represented as follows:

[0090]

[0091] Where: y[n] is the output signal of the filter; x[n] is the input signal of the filter; a k and b k is the coefficient of the filter; N is the feedback coefficient of the output signal; M is the feedforward coefficient of the input signal.

[0092] S4, performing sound endpoint detection on the third audio based on the short-time energy threshold, the short-time zero-crossing rate threshold and the duration of the sound, selecting valid sound segments in the third audio, and using all the obtained valid sound segments as the fourth audio; the valid sound is the call of a chicken; the specific process is as follows:

[0093] A valid sound clip refers to a sound event in which the short-time energy of the audio clip in the third audio is between a low energy threshold and a high energy threshold, the short-time zero-crossing rate of the audio clip is between a low zero-crossing rate threshold and a high zero-crossing rate threshold, and the sound duration is between a low duration threshold and a high duration threshold.

[0094] Therefore, firstly, the short-time energy values ​​of all the audio segments of the third audio are calculated, and then the obtained short-time energy values ​​are compared with the preset short-time energy low threshold and short-time energy high threshold. When the short-time energy of the audio segment is between the energy low threshold and the energy high threshold,

[0095] Specifically, the calculation formula of the short-time energy is as follows:

[0096]

[0097] Among them, L is the window length, n is the sampling point, fn is the number of frames, y i (n) is the audio signal of the i-th frame, and E(i) is the short-time energy of the audio signal of the i-th frame.

[0098] The calculation formula of the short-time zero-crossing rate is as follows:

[0099]

[0100] Among them, L is the window length, n is the sampling point, fn is the number of frames, y i (n) is the audio signal of the i-th frame, Z(i) is the short-time zero-crossing rate of the audio signal of the i-th frame, and sgn[·] is the sign function.

[0101] S5. Processing the fourth audio by using a data zero padding method, performing data enhancement on the processed fourth audio, and using the data enhanced fourth audio as the fifth audio;

[0102] Specifically, the data zero-padding method is used to make the duration of the audio segments in the fourth audio consistent, and the data zero-padding method includes left zero-padding, right zero-padding and center zero-padding;

[0103] Specifically, the specific content of data enhancement of the processed fourth audio in step S5 includes adding noise of different decibels to the audio, changing the audio playback speed, changing the audio pitch, and changing the audio playback speed and pitch at the same time. This setting is to enhance the diversity of the data.

[0104] S6, converting the audio segment of the fifth audio into a Mel spectrogram, and extracting a corresponding first-order difference Mel spectrogram and a second-order difference Mel spectrogram based on the Mel spectrogram; then performing feature fusion on the Mel spectrogram, the first-order difference Mel spectrogram, and the second-order difference Mel spectrogram to obtain a three-channel Mel fusion feature corresponding to the audio segment in the fifth audio;

[0105] The specific process of step S6 is as follows:

[0106] S61. Perform Fourier transform on each frame in the audio segment of the fifth audio to obtain frequency spectrum information of each frame of the audio segment. Specifically, the Fourier transform on each frame in the audio segment of the fifth audio is expressed as follows:

[0107]

[0108] Among them, x(n) is the audio signal sequence, ω(n) is the window function, when n takes different values, ω(nm) slides to different positions along the time axis, X n (e jω ) is the Fourier transform result of the audio signal sequence.

[0109] S62, setting a group of Mel filters according to the Mel scale, and using the Mel filters to process the spectrum information of each frame of the audio clip to obtain a Mel spectrum;

[0110] Specifically, the conversion formula of the Mel frequency in step S62 is as follows:

[0111]

[0112] Where f is the actual frequency in Hz, F mel It is the perceived frequency in Mel.

[0113] S63, taking the logarithm of the Mel spectrum corresponding to each frame of the audio clip and combining them to compress the dynamic range to obtain a Mel spectrogram;

[0114] S64, extracting a corresponding first-order difference Mel spectrogram and a second-order difference Mel spectrogram based on the Mel spectrogram;

[0115] S65, the Mel spectrogram, the first-order difference Mel spectrogram and the second-order difference Mel spectrogram are subjected to feature fusion to obtain a three-channel Mel fusion feature. The specific process is as follows:

[0116] The mel spectrogram, the first-order difference mel spectrogram and the second-order difference mel spectrogram are stacked vertically along the depth direction, so as to fuse and obtain a three-channel mel fusion feature;

[0117] The specific representation of the three-channel Mel fusion feature is as follows:

[0118]

[0119] Where f is the number of Mel filters, t is the time frame, c = 1 corresponds to the Mel spectrogram S(f, t), c = 2 corresponds to the first-order difference ΔS(f, t) of the Mel spectrogram, and c = 3 corresponds to the second-order difference ΔΔS(f, t) of the Mel spectrogram.

[0120] The three-channel Mel fusion feature can capture the time-frequency characteristics of the audio signal more comprehensively by combining the Mel spectrogram and its first-order and second-order differences. Compared with a single Mel spectrogram, the differential feature provides richer dynamic information, helps capture short-term changes and complex patterns, and improves the model's perception of audio classification tasks. In addition, the use of three-channel Mel fusion features can reduce the errors and fluctuations caused by a single feature, so that the abnormal sound recognition model of chickens can still maintain a high stability in complex environments, thereby improving the model's noise resistance and robustness.

[0121] S7. Input the three-channel Mel fusion features into the chicken abnormal sound recognition model for recognition, and obtain the event category result corresponding to the audio.

[0122] In this embodiment, the abnormal sound recognition model for chickens adopts the EfficientNetV2 convolutional neural network. This setting is because although the EfficientNetV2 convolutional neural network uses multiple feature channels, its training efficiency can still maintain a high level. Its efficient network architecture can reduce the amount of calculation while maintaining a high accuracy rate. Compared with the use of more complex traditional convolutional neural networks or other redundant feature combination methods, the training process of the EfficientNetV2 convolutional neural network can not only ensure model performance, but also effectively reduce computing costs and improve training speed.

[0123] The training process of the chicken abnormal sound recognition model is as follows:

[0124] Before model training, a sound data set of chickens in a historical farm is obtained, and the corresponding three-channel Mel fusion feature set is obtained by using the method of steps S1-S6, and then a training set and a test set are divided in the three-channel Mel fusion feature set, and the test set is used to train the EfficientNetV2 convolutional neural network model; during model training, a loss function and an optimizer are used to optimize parameters, and when the accuracy or loss change of the verification set does not change significantly for several consecutive rounds, the training is stopped and the EfficientNetV2 convolutional neural network model at this time is saved as the optimal model, and this model is used as the abnormal sound recognition model for chickens.

[0125] The working process of the abnormal sound recognition model for chickens is as follows:

[0126] After the three-channel Mel fusion features are input into the abnormal sound recognition model for chickens, the initial convolution layer in the model first extracts low-level spatial features from the three-channel Mel fusion features to form a smaller feature map, and then multiple MBConv modules (based on depthwise separable convolution) in the model extract high-level time-frequency features in the smaller feature map layer by layer, and improve the representation capability through expansion and point-by-point convolution. The multiple MBConv modules all use residual connections to enhance gradient propagation. Finally, the model uses global pooling to compress the feature map into a one-dimensional vector of a fixed length, and then outputs the probability distribution of the category through the fully connected layer and the Softmax layer, thereby obtaining the event category result corresponding to the audio.

[0127] Example 2

[0128] like Figure 2 As shown, this embodiment provides a chicken abnormal sound recognition system for large-scale breeding farms, which is used to implement the chicken abnormal sound recognition method for large-scale breeding farms as described in Example 1. The system includes:

[0129] A first audio acquisition module is used to acquire sound data of chickens in a breeding farm, and use the sound data of the chickens in the breeding farm as the first audio;

[0130] A preprocessing module, used for preprocessing the first audio and using the preprocessed first audio as the second audio;

[0131] A noise reduction module, configured to perform preliminary noise reduction on the second audio by using a digital filter, and then perform secondary noise reduction on the second audio after the preliminary noise reduction by using a spectral subtraction method, and use the second audio after the secondary noise reduction as the third audio;

[0132] an endpoint detection module, configured to perform sound endpoint detection on the third audio by using a short-time energy threshold, a short-time zero-crossing rate threshold, and a duration of the sound, select valid sound segments from the third audio, and use all the obtained valid sound segments as the fourth audio;

[0133] A data zero-padding module, used for processing the fourth audio by adopting a data zero-padding method;

[0134] A data enhancement module, used for performing data enhancement on the fourth audio after the data is padded with zeros, and using the fourth audio after the data enhancement as the fifth audio;

[0135] A feature extraction module, configured to convert the audio segment of the fifth audio into a Mel spectrogram, and extract a corresponding first-order difference Mel spectrogram and a second-order difference Mel spectrogram based on the Mel spectrogram; and then perform feature fusion on the Mel spectrogram, the first-order difference Mel spectrogram and the second-order difference Mel spectrogram to obtain a three-channel Mel fusion feature corresponding to the audio segment in the fifth audio;

[0136] A model building module is used to build an initial chicken abnormal sound recognition model, and use a training set generated by historical three-channel Mel fusion features for training to obtain a chicken abnormal sound recognition model;

[0137] A classification and recognition module, used to use the abnormal chicken sound recognition model to recognize the sound to be tested and obtain a corresponding classification and recognition result;

[0138] The visualization module is used to store and display the classification and recognition results locally, and upload the classification and recognition results to the cloud database for storage and display in the cloud database.

[0139] Example 3

[0140] like Figure 3 As shown, this embodiment provides a computer device, which includes a processor 102, a memory, an input device 103, a display device 104 and a network interface 105 connected through a system bus 101. Among them, the processor 102 is used to provide computing and control capabilities, and the memory includes a non-volatile storage medium 106 and an internal memory 107. The non-volatile storage medium 106 stores an operating system, a computer program and a database. The internal memory 107 provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium 106. When the computer program is executed by the processor 102, the abnormal sound recognition method for chickens in large-scale breeding farms described in Example 1 is implemented.

[0141] Example 4

[0142] like Figure 4 As shown, this embodiment provides a storage medium storing a program, and when the program is executed by a processor, the method for identifying abnormal sounds of chickens in large-scale breeding farms described in Example 1 is implemented.

[0143] 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.

[0144] 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.

[0145] 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).

[0146] In summary, the present invention obtains a three-channel Mel fusion feature as an audio feature by fusing a Mel spectrogram, a first-order difference Mel spectrogram and a second-order difference Mel spectrogram and applies it to recognition model training. The three-channel Mel fusion feature can retain static and dynamic features at the same time, has better robustness to environmental noise and signal changes, can more comprehensively and accurately characterize audio features, and improve the classification speed and accuracy of the recognition model, so that farmers can better monitor the health status of chickens, and can promptly discover and deal with health problems in chickens, thereby improving breeding efficiency and economic benefits.

[0147] The above specific implementation modes are preferred embodiments of the present invention and cannot be used to limit the present invention. Any other changes or other equivalent replacement methods that do not deviate from the technical solution of the present invention are included in the protection scope of the present invention.

Claims

1. A method for identifying abnormal sounds of chickens in large-scale breeding farms, characterized in that: The following steps are involved: S1. Acquire the sound data of chickens in a farm as the first audio; S2, preprocessing the first audio, and using the preprocessed first audio as the second audio; The second audio is composed of a plurality of audio clips of equal duration; S3, performing preliminary noise reduction on the second audio by using a digital filter, and then performing secondary noise reduction on the second audio after the preliminary noise reduction by using a spectral subtraction method, and using the second audio after the secondary noise reduction as the third audio; S4, performing sound endpoint detection on the third audio based on a short-time energy threshold, a short-time zero-crossing rate threshold and a duration of the sound, selecting valid sound segments from the third audio, and using all the obtained valid sound segments as the fourth audio; the valid sound is the call of a chicken; S5. Processing the fourth audio by using a data zero padding method, performing data enhancement on the processed fourth audio, and using the data enhanced fourth audio as the fifth audio; S6, converting the audio segment of the fifth audio into a Mel spectrogram, and extracting a corresponding first-order difference Mel spectrogram and a second-order difference Mel spectrogram based on the Mel spectrogram; then performing feature fusion on the Mel spectrogram, the first-order difference Mel spectrogram, and the second-order difference Mel spectrogram to obtain a three-channel Mel fusion feature corresponding to the audio segment in the fifth audio; S7. Input the three-channel Mel fusion features into the chicken abnormal sound recognition model for recognition, and obtain the event category result corresponding to the audio.

2. The method for identifying abnormal sounds of chickens in large-scale breeding farms according to claim 1, characterized in that: The specific steps of step S2 are as follows: S21, firstly, resampling, bit depth adjustment and channel number adjustment processing are performed on the first audio in sequence, so as to adjust the sampling frequency, bit depth and channel number of the first audio to preset parameters, and obtain the first audio after format adjustment; S22, performing a DC component elimination and amplitude normalization process on the adjusted first audio to remove background noise in the audio and normalize the assignment interval in the audio, to obtain a preliminarily processed first audio; S23, processing the preliminarily processed first audio by means of framing, windowing, and pre-emphasis to obtain a pre-processed first audio, and using the pre-processed first audio as the second audio; the specific process is as follows: First, the preliminarily processed first audio is divided into frames to obtain audio segments of equal length, and then a window function is applied to each audio segment to reduce spectrum leakage; the window function is specifically expressed as follows: The window function adopts a periodic Hamming window, the window length is 1024 sampling points, the frame shift is 128 sampling points, and the formula of the window function is as follows: Among them, ω(n) is the window function, L is the window length, and n is the sampling point; Then, pre-emphasis processing is performed on each audio segment after the windowing processing, so that the high-frequency part in each audio segment is strengthened, and finally all the obtained audio segments are used as the pre-processed first audio, and the pre-processed first audio is used as the second audio.

3. The method for identifying abnormal sounds of chickens in large-scale breeding farms according to claim 1, characterized in that: The digital filter in step S3 is a 5th-order high-pass filter, and the 5th-order high-pass filter is represented as follows: Where: y[n] is the output signal of the filter; x[n] is the input signal of the filter; a k and b k is the coefficient of the filter; N is the feedback coefficient of the output signal; M is the feedforward coefficient of the input signal.

4. The method for identifying abnormal sounds of chickens in large-scale breeding farms according to claim 1, characterized in that: The specific process of step S6 is as follows: S61, performing Fourier transform on each frame in the audio segment of the fifth audio to obtain frequency spectrum information of each frame of the audio segment; S62, setting a group of Mel filters according to the Mel scale, and using the Mel filters to process the spectrum information of each frame of the audio clip to obtain a Mel spectrum; S63, taking the logarithm of the Mel spectrum corresponding to each frame of the audio clip and combining them to compress the dynamic range to obtain a Mel spectrogram; S64, extracting a corresponding first-order difference Mel spectrogram and a second-order difference Mel spectrogram based on the Mel spectrogram; S65, performing feature fusion on the mel spectrogram, the first-order difference mel spectrogram, and the second-order difference mel spectrogram to obtain a three-channel mel fusion feature.

5. The method for identifying abnormal sounds of chickens in large-scale breeding farms according to claim 4, characterized in that: The conversion formula of the Mel frequency in step S62 is as follows: Where f is the actual frequency in Hz, F mel It is the perceived frequency in Mel.

6. The method for identifying abnormal sounds of chickens in large-scale breeding farms according to claim 4, characterized in that: The specific representation of the three-channel Mel fusion feature in step S65 is as follows: Where f is the number of Mel filters, t is the time frame, c = 1 corresponds to the Mel spectrogram S(f, t), c = 2 corresponds to the first-order difference ΔS(f, t) of the Mel spectrogram, and c = 3 corresponds to the second-order difference ΔΔS(f, t) of the Mel spectrogram.

7. The method for identifying abnormal sounds of chickens in large-scale breeding farms according to claim 1, characterized in that: The chicken abnormal sound recognition model is trained using the EfficientNetV2 convolutional neural network.

8. A chicken abnormal sound recognition system for large-scale breeding farms, used to implement the chicken abnormal sound recognition method for large-scale breeding farms as described in any one of claims 1 to 7, characterized in that: The system comprises: A first audio acquisition module is used to acquire sound data of chickens in a breeding farm, and use the sound data of the chickens in the breeding farm as the first audio; A preprocessing module, used for preprocessing the first audio and using the preprocessed first audio as the second audio; A noise reduction module, configured to perform preliminary noise reduction on the second audio by using a digital filter, and then perform secondary noise reduction on the second audio after the preliminary noise reduction by using a spectral subtraction method, and use the second audio after the secondary noise reduction as the third audio; an endpoint detection module, configured to perform sound endpoint detection on the third audio by using a short-time energy threshold, a short-time zero-crossing rate threshold, and a duration of the sound, select valid sound segments from the third audio, and use all the obtained valid sound segments as the fourth audio; A data zero-padding module, used for processing the fourth audio by adopting a data zero-padding method; A data enhancement module, used for performing data enhancement on the fourth audio after the data is padded with zeros, and using the fourth audio after the data enhancement as the fifth audio; A feature extraction module, configured to convert the audio segment of the fifth audio into a Mel spectrogram, and extract a corresponding first-order difference Mel spectrogram and a second-order difference Mel spectrogram based on the Mel spectrogram; and then perform feature fusion on the Mel spectrogram, the first-order difference Mel spectrogram and the second-order difference Mel spectrogram to obtain a three-channel Mel fusion feature corresponding to the audio segment in the fifth audio; A model building module is used to build an initial chicken abnormal sound recognition model, and use a training set generated by historical three-channel Mel fusion features for training to obtain a chicken abnormal sound recognition model; A classification and recognition module, used to use the abnormal chicken sound recognition model to recognize the sound to be tested and obtain a corresponding classification and recognition result; The visualization module is used to store and display the classification and recognition results locally, and upload the classification and recognition results to the cloud database for storage and display in the cloud database.

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 abnormal sound recognition method for chickens in large-scale breeding farms 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 abnormal sound recognition method for chickens in large-scale breeding farms described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Sound classification method and system based on channel attention and multi-scale Mel spectrogram

    CN117854546A

  • Chicken voice recognition method, system and equipment based on improved neural network model and medium

    CN118609549A

Cited By

  • Anti-interference sound analysis system and method for pig farm

    CN121438844A

  • An anti-interference sound analysis system and method for pig farms

    CN121438844B