Related Experiment Video
Updated: Sep 13, 2025

Noninvasive, In-pen Approach Test for Laboratory-housed Pigs
Published on: June 5, 2019
Enhanced YOLOv8 for Robust Pig Detection and Counting in Complex Agricultural Environments
Jian Li1,2, Wenkai Ma3,4, Yanan Wei2
1School of Biology and Food Engineering, Fuyang Normal University, Fuyang 236037, China.
None:
Accurate pig counting is crucial for precision livestock farming, enabling optimized feeding management and health monitoring. Detection-based counting methods face significant challenges due to mutual occlusion, varying illumination conditions, diverse pen configurations, and substantial variations in pig densities. Previous approaches often struggle with complex agricultural environments where lighting conditions, pig postures, and crowding levels create challenging detection scenarios. To address these limitations, we propose EAPC-YOLO (enhanced adaptive pig counting YOLO), a robust architecture integrating density-aware processing with advanced detection optimizations. The method consists of (1) an enhanced YOLOv8 network incorporating multiple architectural improvements for better feature extraction and object localization. These improvements include DCNv4 deformable convolutions for irregular pig postures, BiFPN bidirectional feature fusion for multi-scale information integration, EfficientViT linear attention for computational efficiency, and PIoU v2 loss for improved overlap handling. (2) A density-aware post-processing module with intelligent NMS strategies that adapt to different crowding scenarios. Experimental results on a comprehensive dataset spanning diverse agricultural scenarios (nighttime, controlled indoor, and natural daylight environments with density variations from 4 to 30 pigs) demonstrate our method achieves 94.2% mAP@0.5 for detection performance and 96.8% counting accuracy, representing 12.3% and 15.7% improvements compared to the strongest baseline, YOLOv11n. This work enables robust, accurate pig counting across challenging agricultural environments, supporting precision livestock management.
Related Concept Videos
Imaging Biological Samples with Optical Microscopy
In optical microscopy, the specimen to be viewed is placed on a glass slide and clipped on the stage...
Cloning of Dolly the Sheep
Microorganisms in Agriculture and Food industry
Two-Dimensional Microscopy in Microbiology

