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.