Next Article in Journal
Dietary Defective Jujube as a Corn Substitute: Impacts on Growth Performance, Meat Traits, and Alternaria Toxin Exposure in Lambs
Previous Article in Journal
Testicular Gap (CX43) and Tight Junction (OCLN, CLDN3, 5 and 11) Components in the Dog Are Affected by GnRH-Mediated Downregulation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Article

Lightweight Fine-Tuning for Pig Cough Detection

1
Department of Agricultural Structure and Bioenvironmental Engineering, College of Water Resources and Civil Engineering, China Agricultural University, Beijing 100083, China
2
Beijing Engineering Research Center of Precision Measurement Technology and Instruments, Beijing University of Technology, Beijing 100124, China
3
Key Laboratory of Agricultural Engineering in Structure and Environment, Ministry of Agriculture and Rural Affairs, Beijing 100083, China
4
Beijing Engineering Research Center for Animal Health Environment, Beijing 100083, China
*
Author to whom correspondence should be addressed.
Animals 2026, 16(2), 253; https://doi.org/10.3390/ani16020253
Submission received: 1 December 2025 / Revised: 28 December 2025 / Accepted: 9 January 2026 / Published: 14 January 2026
(This article belongs to the Section Pigs)

Simple Summary

Respiratory diseases in pigs not only threaten animal health but also raise significant welfare concerns in modern farming. Early detection of symptoms such as coughing is essential for timely health management and improving animal welfare. This study tackles the challenge of automatically recognizing pig coughs under small-sample conditions. We propose a transfer learning-based fine-tuning approach using the PANNs-CNN14-TFDS network, which preserves pre-trained acoustic knowledge by freezing the backbone and only lightly tuning the fully connected layers. Experiments confirm that our model achieves high accuracy and strong generalization even with limited data. The approach provides a practical and efficient tool for real-time monitoring and early warning of respiratory diseases, thereby supporting both health management and welfare-oriented pig production.

Abstract

Respiratory diseases pose a significant threat to intensive pig farming, and cough recognition serves as a key indicator for early intervention. However, its practical application is constrained by the scarcity of labeled samples and the complex acoustic conditions of farm environments. To address these challenges, this study proposes a lightweight pig cough recognition method based on a pre-trained model. By freezing the backbone of a pre-trained audio neural network and fine-tuning only the classifier, our approach achieves effective knowledge transfer and domain adaptation with very limited data. We further enhance the model’s ability to capture temporal–spectral features of coughs through a time–frequency dual-stream module. On a dataset consisting of 107 cough events and 590 environmental noise clips, the proposed method achieved an accuracy of 94.59% and an F1-score of 92.86%, significantly outperforming several traditional machine learning and deep learning baseline models. Ablation studies validated the effectiveness of each component, with the model attaining a mean accuracy of 96.99% in cross-validation and demonstrating good calibration. The results indicate that our framework can achieve high-accuracy and well-generalized pig cough recognition under small-sample conditions. The main contribution of this work lies in proposing a lightweight fine-tuning paradigm for small-sample audio recognition in agricultural settings, offering a reliable technical solution for early warning of respiratory diseases on farms. It also highlights the potential of transfer learning in resource-limited scenarios.
Keywords: pig cough recognition; PANNs-CNN14; TFDS; transfer learning; early warning model pig cough recognition; PANNs-CNN14; TFDS; transfer learning; early warning model

Share and Cite

MDPI and ACS Style

Zhang, X.; Li, B.; Xue, X. Lightweight Fine-Tuning for Pig Cough Detection. Animals 2026, 16, 253. https://doi.org/10.3390/ani16020253

AMA Style

Zhang X, Li B, Xue X. Lightweight Fine-Tuning for Pig Cough Detection. Animals. 2026; 16(2):253. https://doi.org/10.3390/ani16020253

Chicago/Turabian Style

Zhang, Xu, Baoming Li, and Xiaoliu Xue. 2026. "Lightweight Fine-Tuning for Pig Cough Detection" Animals 16, no. 2: 253. https://doi.org/10.3390/ani16020253

APA Style

Zhang, X., Li, B., & Xue, X. (2026). Lightweight Fine-Tuning for Pig Cough Detection. Animals, 16(2), 253. https://doi.org/10.3390/ani16020253

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.
Back to TopTop