Semi-Supervised Audio Transformers for Non-Invasive Welfare Monitoring in Pig Farming: A BEATs-Based Approach
This study presents a non-invasive acoustic monitoring framework for commercial pig fattening barns. It works in two steps: Model I separates pig (Sus scrofa) vocalizations from barn noise, and Model II classifies the retained calls as alarming or not alarming. Both models adapt the BEATs audio transformer to one-second clips in two phases. In Phase 1 , only a classifier head is trained on labeled data while the encoder stays frozen. In Phase 2 , the whole network is fine-tuned, and confident, class-balanced pseudo-labels from unlabeled recordings are added to the labeled data. In five-fold cross-validation, Phase 2 raised accuracy from 93.0% to 96.5% for pig detection and from 88.0% to 94.9% for alarming calls. On a held-out test set, the models reached 95.7% and 94.5%, outperforming MFCC-based classifiers and a fine-tuned HuBERT model. On recording months not seen during training, accuracy fell to about 85% (Model I) and 87% (Model II), and models trained on only one data source (farm or public) did not transfer to the other. An ablation attributed most of the Phase 2 gain to fine-tuning the encoder rather than to the pseudo-labels. In a retrospective assessment of 15 automatically flagged events, two veterinarians confirmed 60.0% and 73.3% as alarming, respectively. Agreement between the veterinarians was 81.8% on the 11 events assessed by both, with a Cohen’s kappa of 0.42. The framework is therefore proposed as an offline-validated, clip-level decision-support tool that directs expert attention to flagged periods, not as a real-time alerting system.
Authors
- Simon Herter (ORCID: https://orcid.org/0009-0009-8270-3861)
- Sarah C. L. Fischer (ORCID: https://orcid.org/0000-0003-1569-276X)
- Valentina Restrepo
Institutions
- Fraunhofer Institute for Nondestructive Testing (DE)
- Saarland University (DE)
Publication Details
- Journal
- Smart Agricultural Technology
- Published
- 2026-11-01
- DOI
- https://doi.org/10.1016/j.atech.2026.102694
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00