Cross-Breed Few-Shot Learning for Pig Detection via Improved YOLOv7 and CycleGAN-Based Sample Generation
Complex farming environments, breed variation, and the high cost of manual annotation remain major obstacles to robust pig detection, while cross-breed detection under few-shot conditions has been insufficiently explored in previous studies. To address this gap, we propose a few-shot pig detection framework that combines an improved YOLOv7 detector with CycleGAN-based pseudo-sample generation. The detector was enhanced through anchor optimization, Efficient Channel Attention (ECA), and Log-Sum-Exp (LSE) pooling to improve localization and feature discrimination in dense pigsty scenes. In addition, an optimized CycleGAN with perceptual loss was used to generate synthetic Duroc-like pig images to enrich the limited target-domain training set. The framework was evaluated using a two-dataset design: a White Pig Base Dataset was used to establish the source-domain detector and validate the architectural improvements, whereas a Duroc Pig Few-Shot Dataset was used to assess cross-breed adaptation under a 10-shot setting. The experimental results show that the proposed method achieved 98.16% mAP on the White pig dataset and 85.52% mAP on the Duroc Few-Shot Dataset. On the Duroc Few-Shot Dataset, the final framework outperformed Faster R-CNN, CenterNet, and YOLOv8, and also surpassed DCGAN- and SRGAN-based augmentation strategies. These results indicate that the proposed method provides an effective and practical solution for cross-breed few-shot pig detection, with potential value for intelligent livestock monitoring under annotation-limited conditions.
Authors
- Jianlan Wang (ORCID: https://orcid.org/0000-0002-9895-5221)
- Yan Fu (ORCID: https://orcid.org/0000-0002-4942-159X)
- Xiaoliang Hou
- Q Y Wang
- Zhen Wang (ORCID: https://orcid.org/0000-0002-1896-3716)
- Z Zhang (ORCID: https://orcid.org/0000-0003-2346-6228)
- Yuchun Pan (ORCID: https://orcid.org/0000-0002-1163-5963)
- Haoqi Xu
- Lingyao Xu
- Yiting Wang (ORCID: https://orcid.org/0000-0003-3224-239X)
- Wei Zhao (ORCID: https://orcid.org/0000-0002-7130-7670)
- Yongqi He (ORCID: https://orcid.org/0009-0008-3782-1407)
- Yihan Fu
- Yizheng Zhuang
- Jinyun Jiang (ORCID: https://orcid.org/0009-0004-6806-6249)
- Pengfei Yu
Institutions
- Beike Biotechnology (China) (CN)
- Zhejiang University (CN)
Publication Details
- Journal
- Biology
- Published
- 2026-04-16
- DOI
- https://doi.org/10.3390/biology15080623
- Primary Topic
- Animal Behavior and Welfare Studies
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China