Pig continuous cough sound recognition method in complex environment

By employing multi-endpoint detection and classifier fusion technology, the problem of recognizing continuous coughing sounds in pigs under complex environments was solved, achieving accurate recognition of single coughs and continuous coughs, and improving recognition accuracy.

CN117219088BActive Publication Date: 2026-05-19NORTHEAST AGRICULTURAL UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHEAST AGRICULTURAL UNIVERSITY
Filing Date
2023-09-20
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively identify continuous coughing sounds in pigs under complex conditions, and their accuracy is insufficient, lacking the ability to recognize consecutive coughs.

Method used

A multi-endpoint detection method was used to process continuous sounds in the pigsty. By setting a dynamic threshold and a multi-endpoint detection model, and combining acoustic and depth features, a classifier fusion optimization technique was used to identify individual sound segments and determine whether they were coughs or not. The interval between adjacent coughs was calculated to determine whether the coughs were continuous.

Benefits of technology

It has achieved effective recognition of continuous coughing sounds in pigs under complex environments, improved recognition accuracy, and can accurately distinguish between single coughs and continuous coughs, thus having higher practical engineering application value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117219088B_ABST
    Figure CN117219088B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of speech signal processing, in particular to a live pig continuous cough sound recognition method in a complex environment, comprising: collecting continuous sound in a pig house, constructing a corpus based on the continuous sound; performing multiple endpoint detection on the corpus to obtain a single sound segment and the start time and end time of the single sound segment; performing classification recognition on the single sound segment to determine whether the single sound segment is a cough, and if it is a cough, calculating the time interval between adjacent coughs based on the start time and end time of the single sound segment, and determining whether it is continuous cough according to the time interval. The present application can realize the recognition of continuous cough and improve the recognition accuracy of live pig cough sound in a complex environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of speech signal processing technology, and in particular to a method for recognizing continuous coughing sounds of pigs in complex environments. Background Technology

[0002] Respiratory diseases in pigs are one of the main reasons restricting the development of the pig farming industry. Recent studies have shown that monitoring the sound of pig coughs is an effective means of early warning of respiratory diseases, and the monitoring of single and continuous coughs is of great significance for disease early warning and diagnosis. Existing research mainly focuses on isolated word recognition methods, including feature selection, feature fusion, classifier optimization, and classifier fusion, to improve classification performance. However, these methods cannot detect coughs within continuous sounds, and existing research lacks the ability to identify continuous coughs. Furthermore, existing research has given insufficient consideration to the complexity of actual pigsty environments.

[0003] Patent application CN202211128776.2 discloses a method for recognizing pig cough sounds based on improved DS evidence theory and multi-classifier fusion. The method includes: collecting sound fragments from pigs in a pigsty to obtain a corpus; obtaining a training set and a test set based on the corpus, and extracting multiple acoustic features from the training and test sets; inputting the multiple acoustic features from the training set into several base classifiers, and outputting several base classifier performance evaluation indicators; selecting base classifiers based on the base classifier performance evaluation indicators to obtain a preferred base classifier; training the preferred base classifier using the training set to complete the target training model; inputting the test set into the target training model, and fusing the output results of the preferred base classifier using improved DS evidence theory to complete the recognition of pig cough sounds. This invention only recognizes single cough sounds and lacks the ability to recognize consecutive coughs.

[0004] Patent application CN202210938605.X discloses a method for recognizing pig cough sounds based on classifier fusion, comprising: collecting sound fragments of pigs in pigsties to obtain a corpus; labeling the corpus to obtain cough sound fragments and non-cough sound fragments; dividing the cough sound fragments and non-cough sound fragments into a training set and a test set according to a certain ratio, and extracting acoustic features and image features of the sound signals in the training set; constructing a support vector machine training model, inputting the acoustic features and image features into the support vector machine training model for model training, and obtaining a target training model; inputting the data from the test set into the target training model for classification, obtaining the classification result, and completing the recognition of pig cough sounds. This invention recognizes single cough sounds but lacks recognition of consecutive coughs, and also lacks optimization and selection of the base classifier.

[0005] Furthermore, existing methods for recognizing pig cough sounds, such as patent applications CN202210004800.5, CN202210004775.0, and CN201811402994.4, all identify individual cough sounds, lacking the ability to recognize consecutive coughs. They also fail to adequately consider the complex conditions of pigpens, leading to decreased recognition accuracy in such environments. Therefore, there is an urgent need for a method for recognizing continuous cough sounds in pigs under complex conditions. Summary of the Invention

[0006] The purpose of this invention is to address the aforementioned technical problems by providing a method for recognizing continuous coughing sounds in pigs under complex environments, thereby achieving the recognition of continuous coughing and improving the recognition accuracy of pig coughing sounds in complex environments.

[0007] To achieve the above objectives, the present invention provides the following solution:

[0008] A method for recognizing continuous coughing sounds in pigs under complex environments includes:

[0009] Collect continuous sounds inside the pigsty and construct a corpus based on the continuous sounds;

[0010] Multiple endpoint detection is performed on the corpus to obtain individual sound segments and the start and end times of the individual sound segments;

[0011] The individual sound segments are classified and identified to determine whether the individual sound segment is a cough. If it is a cough, the time interval between adjacent coughs is calculated based on the start and end times of the individual sound segment, and the cough is determined to be continuous based on the time interval.

[0012] Furthermore, before performing multi-endpoint detection on the corpus, the method further includes a step of processing the corpus, which includes:

[0013] The corpus is labeled, then divided into a training set and a test set. The continuous sounds in the training set and the test set are pre-emphasized, filtered, framed and windowed, and the short-time energy of each frame of the continuous sounds is calculated.

[0014] Furthermore, performing multiple endpoint detection on the corpus to obtain individual sound segments and their start and end times includes:

[0015] The training set and test set are input into a preset multi-endpoint detection model to obtain individual sound segments and their start and end times from the training and test sets. The multi-endpoint detection model is constructed based on a dual-threshold energy-based endpoint detection method, with dynamic thresholds defined as follows:

[0016]

[0017]

[0018] In the formula, For a relatively large threshold, For a smaller threshold, For the preceding continuous sound N Energy of frame noise segments a and b The threshold parameter is obtained by linearly searching the training set into the multi-endpoint detection model to find the minimum value of the objective function. The objective function is:

[0019]

[0020] In the formula, and The cough frame false negative rate and cough frame false positive rate are respectively defined as:

[0021]

[0022]

[0023] In the formula, This indicates the total number of frames in the audio segment. Indicates the number of missing frames. Indicates the number of mis-frames;

[0024] The working process of the multi-endpoint detection model includes:

[0025] The maximum duration of the preset single sound segment is set. T seconds, maximum number of detections M ;

[0026] Set the first threshold parameter a 1 and b 1. Perform the first endpoint detection and obtain the first endpoint detection result;

[0027] Determine whether there is a duration greater than 1 in the first endpoint detection result. T If a single sound segment of a second does not exist, the detection ends; if it does exist, the objective function of the first endpoint detection is calculated, and a second threshold parameter is set. a 2 and b 2, for the duration greater than T A second endpoint detection is performed on a single sound segment lasting more than one second. The second endpoint detection result is obtained, and it is determined whether there is a second endpoint detection result containing a duration greater than [missing information]. TIf a single sound segment lasting more than one second does not exist, the detection ends. If it does exist, the objective function of the second endpoint detection is calculated, and it is determined whether the objective function of the second endpoint detection is not lower than the objective function of the first endpoint detection. If it is not lower, the detection ends; if it is lower, the next endpoint detection is performed, and this process is iterated until no endpoint detection result with a duration greater than one second exists. T A single sound segment lasting one second, or the objective function of endpoint detection is not lower than the objective function of the previous endpoint detection, or the maximum number of detections is reached. M The test is now complete.

[0028] Furthermore, classifying and identifying the individual sound segments includes:

[0029] The acoustic and depth features of individual sound segments in the training and test sets are extracted. The acoustic and depth features of individual sound segments in the test set are input into a preset classification model to obtain the cough recognition result of individual sound segments in the test set. The classification model is obtained by training a classifier by inputting the acoustic and depth features of individual sound segments in the training set.

[0030] Furthermore, the acoustic features include Mel frequency cepstral coefficients and power spectral density, and the deep features are features extracted from image features through a convolutional neural network. The image features include spectrograms, Mel spectrograms, constant Q-transform graphs, and Mel frequency cepstral coefficient matrix graphs.

[0031] Furthermore, training the classifier by inputting the acoustic and depth features of individual sound segments from the training set includes:

[0032] The acoustic and depth features of a single sound segment in the training set are input into a classifier to obtain several base classifiers;

[0033] Calculate the fusion evaluation index among the base classifiers, and optimize and screen the base classifiers based on the fusion evaluation index to obtain the preferred base classifiers;

[0034] The preferred base classifiers are fused together, and the preferred base classifiers are trained using the training set to obtain the classification model.

[0035] Furthermore, the method for calculating the fusion evaluation index among the base classifiers is as follows:

[0036]

[0037] In the formula, For the first i The base classifier and the first j Evaluation metrics for the fusion of base classifiers and The first i The and the first j The overall recognition accuracy of each base classifier For the first i The base classifier and the first j Q-statistic between base classifiers β The normalization factor is... ,in, OA max and OA min These represent the maximum and minimum overall recognition accuracy among all base classifiers, respectively. Q_statistics max and Q_ statistics min These are the maximum and minimum values ​​of the Q statistic, respectively.

[0038] Furthermore, the method for calculating the overall recognition accuracy is as follows:

[0039]

[0040] In the formula, To improve overall recognition accuracy, TP The number of coughs that are correctly identified as coughs. TN The table shows the number of non-coughing individuals that were correctly identified as non-coughing. FN The number of coughs that were incorrectly identified as non-coughs. FP The number of non-coughs that were incorrectly identified as coughs;

[0041] The method for calculating the Q statistic is as follows:

[0042]

[0043] In the formula, For the first i The base classifier and the first j Q-statistics among base classifiers.

[0044] Furthermore, optimizing and screening the base classifiers based on the fusion evaluation index to obtain preferred base classifiers includes:

[0045] The base classifiers are ranked based on the overall recognition accuracy. A preliminary screening of the base classifiers is then performed based on the ranking results and the Q statistic to obtain the base classifiers. C 1, C 2,…, Cn ;

[0046] Base classifier CStarting from 1, a second base classifier is selected based on the fusion evaluation index, and the remaining base classifiers are calculated to the base classifier. C The average value of the fusion evaluation index of the first and second base classifiers is used to select the third base classifier. This process is repeated until the nth base classifier is selected, and the combination of the first base classifiers is obtained.

[0047] Using base classifiers respectively C 2, C 3…, Cn Starting from the above, repeat the above operation to obtain all base classifier combinations, and filter the base classifier combinations based on classification accuracy to obtain the preferred base classifier.

[0048] Furthermore, determining whether a cough is continuous based on the time interval includes:

[0049] Based on the start and end times of individual sound segments identified as coughs in the test set, the time interval between adjacent individual sound segments identified as coughs is calculated. If the time interval is less than... t seconds, and the time interval is less than t The number of consecutive single sound segments per second is not less than s If there are 1, then the continuous single sound segment is determined to be a continuous cough; otherwise, it is determined to be a single cough.

[0050] The beneficial effects of this invention are as follows:

[0051] This invention provides a method for recognizing continuous coughing sounds in pigs under complex environments. First, a corpus of continuous sounds collected from within a pigsty is analyzed using a multi-endpoint detection method, addressing the low probability of detecting active speech in complex pigsty environments. Second, individual sound segments obtained from multi-endpoint detection are classified and identified as coughing sound segments. Finally, the time interval between adjacent coughs is calculated based on the start and end times of the identified coughing sound segments, and the degree of continuity of coughing is determined according to this time interval. Compared with existing methods, this invention can recognize continuous coughing and significantly improves the recognition accuracy of pig coughing sounds in complex environments, thus possessing higher practical engineering application value. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1This is a flowchart of a method for recognizing continuous coughing sounds of pigs in a complex environment, according to an embodiment of the present invention.

[0054] Figure 2 This is a flowchart of the multi-endpoint detection algorithm according to an embodiment of the present invention;

[0055] Figure 3 This is a flowchart illustrating the cough sound recognition process according to an embodiment of the present invention.

[0056] Figure 4 This is a flowchart of the classifier selection algorithm according to an embodiment of the present invention;

[0057] Figure 5 This is a flowchart of the continuous cough determination method according to an embodiment of the present invention. Detailed Implementation

[0058] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0059] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0060] This embodiment provides a method for recognizing continuous coughing sounds in pigs under complex environments, such as... Figure 1 As shown, it includes:

[0061] S1. Collect continuous sounds from actual pigsties to build a corpus.

[0062] The corpus can reflect the complexity of actual pigsties. It consists of two parts. The first part is a series of cough segments, each lasting 7-40 seconds, totaling 316 segments, containing a large number of cough sounds and a small number of non-cough sounds. The second part is a series of continuous sound segments randomly selected from the morning, afternoon, evening, and night, each lasting 10 minutes, totaling 25 segments, containing a large number of non-cough sounds and a small number of cough sounds.

[0063] S2. Processing the corpus

[0064] The corpus is labeled and then divided into training and testing sets. Continuous audio signals in both sets are preprocessed, first by pre-emphasis and filtering (pre-emphasis coefficient 0.9375, bandpass filter frequency 100Hz~16kHz), then framed with a frame length of 20ms and an overlap length of 10ms. The short-time energy of each frame of the continuous audio signal is calculated.

[0065] S3. Perform multi-endpoint detection based on the processed corpus.

[0066] The multi-endpoint detection algorithm process is as follows: Figure 2 As shown, the idea of ​​the multi-endpoint detection algorithm is to analyze the background noise and complex situation of the actual pig house based on the traditional energy-based dual-threshold endpoint detection method, set multiple dynamic thresholds to adapt to the complex environment, and determine whether further detection is needed based on the duration of the sound segment.

[0067] The energy-based dual-threshold method requires setting two thresholds: a larger threshold and a smaller threshold. and smaller threshold Suppose the preceding continuous sound N The energy of the frame noise segment is Then we have:

[0068]

[0069]

[0070] In the formula, a and b The threshold parameter is obtained by training the endpoint detection model on the training set using a linear search method. The threshold parameter is the value that minimizes the objective function during the linear search. The objective function is:

[0071]

[0072] In the formula , and These represent the cough frame false negative rate and the cough frame false positive rate, respectively, and are defined as follows:

[0073]

[0074]

[0075] In the formula, This indicates the total number of frames in the audio segment. Indicates the number of missing frames. Indicates the number of misframes.

[0076] In this embodiment, the energy value of the first 50 noisy frames is calculated. Set a lower threshold parameter a 1 and b 1. Perform the first endpoint detection. The threshold parameter should ensure that more than 98% of the audio segments can be successfully detected. Then, determine whether there is an audio segment longer than 0.9 seconds. If not, the endpoint detection process is complete; otherwise, continue to set a higher threshold parameter. a 2 andb 2. For sound segments with a duration greater than 0.9 seconds, a second endpoint detection is performed, and it is determined whether the objective function of the second endpoint detection is not greater than the result of the first endpoint detection. If so, and there are sound segments with a duration greater than 0.9 seconds, the endpoint detection process is continued with higher threshold parameters until there are no sound segments longer than 0.9 seconds, or the objective function is not lower than the previous objective function, or the maximum number of detections is exceeded. In this embodiment, the optimal threshold parameters obtained by the linear search method are (2, 2.4), (5, 5.5), and (15, 16), respectively.

[0077] Since the noise environment in actual pig farms is highly variable, this embodiment focuses on... Perform real-time updates. Let the energy of the current noisy frame be... E Then the current frame Updated to:

[0078]

[0079] In the formula, This represents the update rate, typically set to [0.9, 0.98]. A smaller value indicates a faster update rate. In this embodiment... The value is 0.95. Endpoint detection obtains a single sound segment, as well as the start and end times of each sound segment.

[0080] S4. Classify individual sound segments, identifying the result as either coughing sounds or non-coughing sounds.

[0081] The cough sound recognition algorithm process is as follows: Figure 3As shown, the audio segments after endpoint detection are first preprocessed, including pre-emphasis, filtering, framing, and windowing. Then, acoustic features and depth features are extracted. Acoustic features include Mel-frequency cepstral coefficients (MFCCs) and power spectral density (PSD). Depth features are extracted from image features using a fine-tuned convolutional neural network, SqueezeNet. These image features include spectrograms, Mel-frequency spectrograms, constant Q-transform (CQT) graphs, and MFCC matrix graphs. The fine-tuned SqueezeNet uses transfer learning to fix the parameters of the convolutional layers, modifies the number of output classifications to 2, and trainable layers are trained using data from the training set. The trained SqueezeNet is then used as a depth feature extractor to extract depth features. Different features were input into SVM, Adaboost, and BiLSTM classifiers respectively, resulting in 18 base classifiers. All base classifiers were ranked from highest to lowest based on overall recognition accuracy. Based on the ranking results and feature-based diversity, the top eight base classifiers were selected for further optimization and selection: MFCC-SVM, PSD-Adaboost, MFCC-LSTM, PSD-LSTM, Spectrograph-SVM, Mel Spectrograph-SVM, CQT Graph-SVM, and MFCC Matrix Graph-SVM. These eight classifiers were named... C 1, C 2,…, C 8. For these eight base classifiers, a fusion evaluation metric is used to further optimize and select the base classifiers.

[0082] This embodiment uses the overall recognition accuracy. OA The Q statistic is used to evaluate the accuracy of the base classifier. Q_ statistics To evaluate the diversity among base classifiers. Overall recognition accuracy. OA Defined as:

[0083]

[0084] In the formula, TP This indicates the number of coughs that were correctly identified as coughs. TN This indicates the number of non-coughing items that were correctly identified as non-coughing. FN This indicates the number of coughs that were incorrectly identified as non-coughs. FP This indicates the number of non-coughs that were incorrectly identified as coughs;

[0085] No. i A base classifier and the j A base classifier The Q statistic Q_statistic between them is defined as:

[0086]

[0087] No. i A base classifier and the j A base classifier Integration evaluation indicators AD Defined as:

[0088]

[0089] In the formula, and Indicates the first i The and the first j The accuracy of each base classifier β The normalization factor is... β Its function is to give accuracy and diversity equal weight in decision-making. β The definition is as follows:

[0090]

[0091] In the formula, and For all base classifiers OA The maximum and minimum values, and They are respectively The maximum and minimum values.

[0092] AD The metric integrates the accuracy and differences of two base classifiers, providing a good evaluation of the base classifier fusion effect and thus enabling the selection of a base classifier fusion scheme. For eight base classifiers... C 1, C 2,…, C 8. The classifier selection algorithm process used in this embodiment is as follows: Figure 4 As shown, firstly C Starting from 1, according to AD The second base classifier is selected, and then the remaining base classifiers are calculated to be derived from these two base classifiers. AD Calculate the average value and select a third base classifier, repeating this process until eight base classifiers are selected. Then, calculate the average value separately. C 2, C 3,…, Cn Starting from this point, repeat the above operations to obtain all possible combinations of base classifiers. Then, select the classifier combination with the highest classification accuracy, which is the preferred base classifier. In this embodiment, the preferred base classifier is ( C 1, C 4, C 5, C 6, C 8), its classifier accuracy is 94.24%.

[0093] In this embodiment, the selected base classifier combination is enhanced with data sample perturbation. Multiple base classifiers are trained with different data, and then soft voting is performed to obtain the recognition result of cough sound.

[0094] S5. After obtaining the results of determining whether there is a cough or not, determine whether the cough is a single cough or a series of coughs.

[0095] The procedure for determining persistent cough is as follows: Figure 5 As shown, based on the start and end times of individual sound segments identified as coughs in the test set, the time interval between two adjacent coughs is calculated. If the time interval is less than... t Seconds, and the number of coughs is not less than s If there are 3 or more coughs, it is determined to be a continuous cough; otherwise, it is determined to be a single cough. In this embodiment, if the time interval between two adjacent coughs is less than 1.5 seconds and the number of coughs is not less than 3, then these coughs are determined to form a continuous cough; otherwise, they are determined to be a single cough.

[0096] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for recognizing continuous coughing sounds in pigs under complex environments, comprising: Collect continuous sounds inside the pigsty and construct a corpus based on the continuous sounds; The corpus is labeled, then the corpus is divided into a training set and a test set, and the continuous sounds in the training set and the test set are pre-emphasized, filtered, framed and windowed, and the short-time energy of each frame of the continuous sound is calculated. Multiple endpoint detection is performed on the corpus. The training set and test set are input into a preset multiple endpoint detection model to obtain a single sound segment and the start time and end time of the single sound segment in the training set and test set. The individual sound segments are classified and identified to determine whether they represent coughs. If a cough is identified, the time interval between adjacent coughs is calculated based on the start and end times of the individual sound segment. The time interval is then used to determine whether the coughs are continuous. The multi-endpoint detection model is constructed using a dual-threshold energy-based endpoint detection method with dynamic thresholds. These dynamic thresholds are as follows: In the formula, For a relatively large threshold, For a smaller threshold, For the preceding continuous sound N Energy of frame noise segments a and b The threshold parameter is obtained by linearly searching the training set into the multi-endpoint detection model to find the minimum value of the objective function. The objective function is: In the formula , and The cough frame false negative rate and cough frame false positive rate are respectively defined as: In the formula, This indicates the total number of frames in the audio segment. Indicates the number of missing frames. Indicates the number of mis-frames; The working process of the multi-endpoint detection model includes: The maximum duration of the preset single sound segment is set. T seconds, maximum number of detections M ; Set the first threshold parameter a 1 and b 1. Perform the first endpoint detection and obtain the first endpoint detection result; Determine whether there is a duration greater than 1 in the first endpoint detection result. T If a single sound segment of a second does not exist, the detection ends; if it does exist, the objective function of the first endpoint detection is calculated, and a second threshold parameter is set. a 2 and b 2, for the duration greater than T A second endpoint detection is performed on a single sound segment lasting more than one second. The second endpoint detection result is obtained, and it is determined whether there is a second endpoint detection result containing a duration greater than [missing information]. T If a single sound segment lasting more than one second does not exist, the detection ends. If it does exist, the objective function of the second endpoint detection is calculated, and it is determined whether the objective function of the second endpoint detection is not lower than the objective function of the first endpoint detection. If it is not lower, the detection ends; if it is lower, the next endpoint detection is performed, and this process is iterated until no endpoint detection result with a duration greater than one second exists. T A single sound segment lasting one second, or the objective function of endpoint detection is not lower than the objective function of the previous endpoint detection, or the maximum number of detections is reached. M The test is now complete.

2. The method for recognizing continuous coughing sounds of pigs in complex environments according to claim 1, characterized in that, Classifying and identifying the individual sound segments includes: The acoustic and depth features of individual sound segments in the training and test sets are extracted. The acoustic and depth features of individual sound segments in the test set are input into a preset classification model to obtain the cough recognition result of individual sound segments in the test set. The classification model is obtained by training a classifier by inputting the acoustic and depth features of individual sound segments in the training set.

3. The method for recognizing continuous coughing sounds of pigs in complex environments according to claim 2, characterized in that, The acoustic features include Mel frequency cepstral coefficients and power spectral density, and the deep features are features extracted from image features through a convolutional neural network. The image features include spectrograms, Mel spectrograms, constant Q-transform graphs, and Mel frequency cepstral coefficient matrix graphs.

4. The method for recognizing continuous coughing sounds of pigs in complex environments according to claim 2, characterized in that, Training the classifier by inputting the acoustic and depth features of a single sound segment from the training set includes: The acoustic and depth features of a single sound segment in the training set are input into a classifier to obtain several base classifiers; Calculate the fusion evaluation index among the base classifiers, and optimize and screen the base classifiers based on the fusion evaluation index to obtain the preferred base classifiers; The preferred base classifiers are fused together, and the preferred base classifiers are trained using the training set to obtain the classification model.

5. The method for recognizing continuous coughing sounds of pigs in complex environments according to claim 4, characterized in that, The method for calculating the fusion evaluation index between the base classifiers is as follows: In the formula, For the first i The base classifier and the first j Evaluation metrics for the fusion of base classifiers and The first i The and the first j The overall recognition accuracy of the base classifiers For the first i The base classifier and the first j Q-statistic between base classifiers β The normalization factor is... ,in, OA max and OA min These represent the maximum and minimum overall recognition accuracy among all base classifiers, respectively. Q_statistics max and Q_ statistics min These are the maximum and minimum values ​​of the Q statistic, respectively.

6. The method for recognizing continuous coughing sounds of pigs in complex environments according to claim 5, characterized in that, The method for calculating the overall recognition accuracy is as follows: In the formula, For the overall recognition accuracy, TP For the number of coughs to be correctly identified as coughs, TN The number of non-coughs that were correctly identified as non-coughs. FN The number of coughs that were mistakenly identified as non-coughs. FP The number of non-coughs that were incorrectly identified as coughs; The method for calculating the Q statistic is as follows: In the formula, For the first i The base classifier and the first j Q-statistic among base classifiers.

7. The method for recognizing continuous coughing sounds of pigs in complex environments according to claim 6, characterized in that, Optimizing and selecting the base classifier based on the fusion evaluation index to obtain the preferred base classifier includes: The base classifiers are ranked based on the overall recognition accuracy. A preliminary screening of the base classifiers is then performed based on the ranking results and the Q statistic to obtain the base classifiers. C 1, C 2,…, Cn ; Base classifier C Starting from 1, a second base classifier is selected based on the fusion evaluation index, and the remaining base classifiers are calculated to the base classifier. C The average evaluation metric of the fusion of the first and second base classifiers is used to select the third base classifier, and this process is repeated until the first base classifier is selected. n I base classifiers, obtain the first base classifier combination; Using base classifiers respectively C 2, C 3…, Cn Starting from the above, repeat the above operation to obtain all base classifier combinations, and filter the base classifier combinations based on classification accuracy to obtain the preferred base classifier.

8. The method for recognizing continuous coughing sounds of pigs in complex environments according to claim 2, characterized in that, Determining whether a cough is continuous based on the time interval includes: Based on the start and end times of individual sound segments identified as coughs in the test set, the time interval between adjacent individual sound segments identified as coughs is calculated. If the time interval is less than... t seconds, and the time interval is less than t The number of consecutive single sound segments per second is not less than s If there are 1, then the continuous single sound segment is determined to be a continuous cough; otherwise, it is determined to be a single cough.