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

Institutions

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

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Cross-Breed Few-Shot Learning for Pig Detection via Improved YOLOv7 and CycleGAN-Based Sample Generation

Jianlan Wang, Yan Fu, Xiaoliang Hou, Q Y Wang et al.
Biology
Animal Behavior and Welfare Studies
article

Cross-Breed Few-Shot Learning for Pig Detection via Improved YOLOv7 and CycleGAN-Based Sample Generation

Jianlan Wang, Yan Fu, Xiaoliang Hou, Q Y Wang, Zhen Wang, Z Zhang, Yuchun Pan, Haoqi Xu, Lingyao Xu, Yiting Wang, Wei Zhao, Yongqi He, Yihan Fu, Yizheng Zhuang, Jinyun Jiang, Pengfei Yu
article en

Abstract

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.

BiologyVol. 15(8)
Beike Biotechnology (China) (CN), Zhejiang University (CN)
National Natural Science Foundation of China
Peace, Justice and strong institutions
Openalex Percentile: Top 21%
Animal Behavior and Welfare Studies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.