# Lightweight Fine-Tuning for Pig Cough Detection

**Authors:** Xu Zhang, Baoming Li, Xiaoliu Xue

PMC · DOI: 10.3390/ani16020253 · Animals : an Open Access Journal from MDPI · 2026-01-14

## TL;DR

This paper introduces a lightweight method for detecting pig coughs using pre-trained models, enabling accurate disease monitoring with limited data in farming environments.

## Contribution

The novel contribution is a lightweight fine-tuning approach for small-sample audio recognition in agriculture, leveraging transfer learning.

## Key findings

- The proposed model achieved 94.59% accuracy and 92.86% F1-score on a small dataset of pig coughs and noise.
- Ablation studies confirmed the effectiveness of the time–frequency dual-stream module and cross-validation accuracy of 96.99%.

## Abstract

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.

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.

## Full-text entities

- **Diseases:** Respiratory diseases (MESH:D012140), Cough (MESH:D003371)
- **Species:** Sus scrofa (pig, species) [taxon 9823]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12837947/full.md

## Figures

15 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12837947/full.md

## References

28 references — full list in the complete paper: https://tomesphere.com/paper/PMC12837947/full.md

---
Source: https://tomesphere.com/paper/PMC12837947