This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Open AccessArticle
Machine Learning-Based Detection of Pig Coughs and Their Association with Respiratory Diseases in Fattening Pigs
by
Panuwat Yamsakul
Panuwat Yamsakul 1,*,
Terdsak Yano
Terdsak Yano 1
,
Kiettipoch Junchum
Kiettipoch Junchum 1,
Wichittra Anukool
Wichittra Anukool 2 and
Nattinee Kittiwan
Nattinee Kittiwan 2
1
School of Veterinary Medicine, Faculty of Veterinary Medicine, Chiang Mai University, Chiang Mai 50100, Thailand
2
Veterinary Development and Research Center (Upper Northern Region), Department of Livestock Development, Lampang 52190, Thailand
*
Author to whom correspondence should be addressed.
Submission received: 22 June 2025
/
Revised: 8 August 2025
/
Accepted: 21 August 2025
/
Published: 26 August 2025
Simple Summary
Respiratory problems in pigs are one of the important issues in pig farming, as they can affect both animal health and the overall productivity of the farm. Coughing is one of the noticeable symptoms and can be either productive or non-productive, but in practice, distinguishing between the two types can be difficult and often depends on the person’s experience. In this study, we aimed to use machine learning to help classify pig coughs and also find out if certain types of cough are linked with specific respiratory diseases. We recorded pig cough sounds and used a machine learning model to analyze them. We also compared its performance with the judgement of farmers and a pig specialist. The result showed that machine learning could classify coughs more accurately than people in most cases. Interestingly, we found that non-productive coughs are strongly related to one specific type of bacterial infection. This suggests that machine learning might be helpful as a tool for early detection of pig diseases in the future. We believe that this approach has potential to support swine health monitoring and improve disease management on pig farms.
Abstract
Respiratory infections are a major concern in pig farming as they negatively impact animal health and productivity. Coughing is a key symptom of respiratory disease and can be classified as productive or non-productive, but human assessment often leads to inconsistencies. This study aimed to use a machine learning model to classify pig coughs and investigate their association with respiratory infections. Cough sounds from 49 fattening pigs were recorded and analyzed using a Python-based machine learning system. The model’s accuracy in detecting coughs was 0.72, compared to 0.69 for farmers. For classification of non-productive coughs, the machine learning results showed strong agreement with infection status by Mycoplasma hyopneumoniae, with a Spearman’s correlation of 0.80 and a Cohen’s Kappa of 0.79. However, the association with Porcine Circovirus type 2 was weak, with correlation and Kappa values of 0.05 and 0.037, respectively. These findings indicate that machine learning can classify pig coughs more accurately than human evaluators and that non-productive coughs are strongly linked to Mycoplasma infection but not to PCV2. This suggests the potential use of machine learning for more reliable disease monitoring and early detection in swine production.
Share and Cite
MDPI and ACS Style
Yamsakul, P.; Yano, T.; Junchum, K.; Anukool, W.; Kittiwan, N.
Machine Learning-Based Detection of Pig Coughs and Their Association with Respiratory Diseases in Fattening Pigs. Vet. Sci. 2025, 12, 818.
https://doi.org/10.3390/vetsci12090818
AMA Style
Yamsakul P, Yano T, Junchum K, Anukool W, Kittiwan N.
Machine Learning-Based Detection of Pig Coughs and Their Association with Respiratory Diseases in Fattening Pigs. Veterinary Sciences. 2025; 12(9):818.
https://doi.org/10.3390/vetsci12090818
Chicago/Turabian Style
Yamsakul, Panuwat, Terdsak Yano, Kiettipoch Junchum, Wichittra Anukool, and Nattinee Kittiwan.
2025. "Machine Learning-Based Detection of Pig Coughs and Their Association with Respiratory Diseases in Fattening Pigs" Veterinary Sciences 12, no. 9: 818.
https://doi.org/10.3390/vetsci12090818
APA Style
Yamsakul, P., Yano, T., Junchum, K., Anukool, W., & Kittiwan, N.
(2025). Machine Learning-Based Detection of Pig Coughs and Their Association with Respiratory Diseases in Fattening Pigs. Veterinary Sciences, 12(9), 818.
https://doi.org/10.3390/vetsci12090818
Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details
here.
Article Metrics
Article metric data becomes available approximately 24 hours after publication online.