Journal of Henan Agricultural Sciences ›› 2026, Vol. 55 ›› Issue (2): 144-155.DOI: 10.15933/j.cnki.1004-3268.2026.02.016

• Agricultural Information and Engineering and Agricultural Product Processing • Previous Articles     Next Articles

A Pig Cough Sound Recognition Method Based on CNN‑BiLSTM

FU Xiaopeng1,2,ZHOU Xin2,WANG Xingbo2,XU Xing2,WU Yue2,XIE Ronghui3,SHAN Ying4,YE Chunlin1,ZHOU Weidong2   

  1. (1.School of Biological & Chemical Engineering,Zhejiang University of Science and Technology,Hangzhou 310023,China;2.Institute of Animal Husbandry and Veterinary,Zhejiang Academy of Agricultural Sciences,Hangzhou 310021,China;3.Zhejiang Center of Animal Disease Control and Prevention,Hangzhou 311119,China;4.College of Animal Sciences,Zhejiang University,Hangzhou 310058,China)
  • Received:2025-10-09 Accepted:2025-11-28 Published:2026-02-15 Online:2026-03-10

基于CNN-BiLSTM的猪咳嗽声识别方法

付小朋1,2,周昕2,王星博2,徐杏2,吴越2,谢荣辉3,单颖4,叶春林1,周卫东2   

  1. (1.浙江科技大学 生物与化学工程学院,浙江 杭州 310023;2.浙江省农业科学院 畜牧兽医研究所,浙江 杭州 310021;3.浙江省动物疫病预防控制中心,浙江 杭州 311119;4.浙江大学 动物科学学院,浙江 杭州 310058)
  • 通讯作者: 叶春林,教授,博士,主要从事肿瘤的靶向治疗研究。E-mail:chlye2005@126.com 周卫东,研究员,博士,主要从事动物营养与饲料研究。E-mail:zhouwd@zaas.ac.cn
  • 作者简介:付小朋,在读硕士研究生,研究方向:畜牧农机装备。E-mail:2171794909@qq.com
  • 基金资助:
    浙江省重点研发计划项目(2021C02050);浙江省农机研发制造推广一体化项目(10401110124KH5601G)

Abstract: Respiratory diseases are one of the common and frequently‑occurring diseases in large‑scale pig farms.Timely and accurate detection of typical clinical symptoms of coughing in pigs is crucial for early warning and prevention. This study taked the sounds of coughing,squealing,and snoring of mid‑pregnancy sows as the research object and proposed a pig cough sound recognition model based on the fusion of convolutional neural network and bidirectional long short‑term memory network(CNN‑BiLSTM).The pig sounds data was preprocessed through methods such as fourth‑order Butterworth band‑pass filtering for noise reduction,first‑order high‑pass filtering for pre‑emphasis,and short‑time energy endpoint detection.The Mel frequency cepstral coefficients(MFCC)feature parameters of the preprocessed sound data were extracted using methods such as framing,windowing,and fast Fourier transform,and the model recognition performance was evaluated.The results showed that the fourth‑order Butterworth band‑pass filter for noise reduction could significantly reduce the background noise of pig coughing,squealing,and snoring sounds,without distorting the waveform and retaining the main energy of the pig sound signal.The first‑order high‑pass filter for pre‑emphasis could significantly enhance the energy in the high‑frequency region,weaken the energy in the low‑frequency region,and narrow the frequency range. Endpoint detection could quickly mark the effective speech segments of the pig sounds and reduce the interference of irrelevant information to the recognition model.The MFCC feature parameters extracted from the preprocessed sound data could well reflect the acoustic characteristics of the pig sounds,and the MFCC coefficients could be used as feature inputs for model recognition.The established deep neural network model of CNN‑BiLSTM fusion had good convergence.The confusion matrix showed that the correct recognition rates of pig coughing,squealing,and snoring sounds were 83.67%,85.19%,and 81.58% respectively,and it had good generalization ability.The five‑fold cross‑validation showed that the average accuracy rate was 84.03%(82.79%—85.31%).The accuracy rate of the CNN‑BiLSTM model on the test set was 83.93%,which was superior to the Transformer,CNN,LSTM,and BiLSTM models.Therefore,the CNN‑BiLSTM model proposed in this study has good performance in recognizing pig coughing sounds and can provide a new method for the early detection of respiratory diseases in pigs.

Key words: Pig cough sounds, CNN?BiLSTM detection model, Characteristic parameters, Confusion matrix, Five?fold cross?validation

摘要: 呼吸道疾病是规模猪场常见高发疫病之一,及时准确发现猪呼吸道疾病典型临床症状如咳嗽声对于实现早期预警、预防至关重要。以怀孕中期母猪咳嗽、尖叫、打呼噜声音为研究对象,提出了基于卷积神经网络和双向长短期记忆网络(CNN-BiLSTM)融合的猪咳嗽声识别模型,通过四阶巴特沃斯带通滤波器降噪、一阶高通滤波器预加重、短时能量端点检测等方法预处理猪声数据,采用分帧、加窗、快速傅里叶变换等方法提取预处理后声音数据的梅尔频率倒谱系数(MFCC)特征参数,并对模型识别性能进行评价。结果表明,采用四阶巴特沃斯带通滤波器降噪处理可明显降低猪咳嗽声、尖叫声和打呼噜声的背景噪音,且波形无失真,猪声信号的主要能量保留完整;一阶高通滤波器预加重可明显增强高频区域能量,减弱低频区域能量,缩小区域范围;端点检测可快速标出猪声的有效语音段,减少无关信息对识别模型的干扰;通过提取预处理声音数据的MFCC特征参数可较好地反映猪声的声学特性,将MFCC系数作为特征输入用于模型的识别。融合卷积神经网络与双向长短期记忆网络的深度神经网络(CNN-BiLSTM)模型具有良好的收敛性,混淆矩阵显示,猪咳嗽声、尖叫声和打呼噜声正确识别率分别为83.67%、85.19%和81.58%,说明模型具有良好的泛化能力;五折交叉验证显示,平均准确率为84.03%(82.79%~85.31%);CNN-BiLSTM模型在测试集上的准确率为83.93%,优于Transformer、CNN、LSTM和BiLSTM模型。由此,所提出的CNN-BiLSTM模型在识别猪咳嗽声上具有良好的性能,能够为猪只呼吸道疾病早期检测提供新的方法。

关键词: 猪咳嗽声, CNN-BiLSTM识别模型, 特征参数, 混淆矩阵, 五折交叉验证

CLC Number: