Pig Passage Counting Based on Improved YOLO and HMTC Strategy

Accurate pig counting during herd transfers is fundamental to effective livestock management in large-scale swine production, yet existing methods struggle with bidirectional passages, boundary oscillations, and occlusion in real corridor environments. This study proposes an integrated system combining an improved YOLO-based detection model with a Hysteresis-based Multi-frame Temporal Confirmation Counting Strategy (HMTC). The YOLO11s baseline was enhanced using lightweight RepViT blocks, dynamic upsampling (DySample), and shape-aware bounding box regression (Shape-IoU). The resulting model achieves a mAP50 of 0.982 with a compact architecture of 8.28M parameters, representing a 12.3% reduction relative to the baseline while improving detection accuracy. To address bidirectional counting challenges, the HMTC strategy utilizes hysteresis-based region classification, temporal confirmation, and trajectory verification to suppress boundary jitter and ensure directional correctness. Evaluated on nine videos from a single transfer corridor, the proposed system achieves an overall counting accuracy of 99.21% on this test set and runs in real time on an embedded edge device at over 30 FPS without loss of counting accuracy. Together, the improved detection model and HMTC counting strategy provide a cohesive approach to pig passage counting, validated here under a single transfer-corridor condition; these results offer a promising basis for automated animal inventory management, pending further validation across more diverse farm environments.

Authors

Institutions

Publication Details

Journal
Animals
Published
2026-06-24
DOI
https://doi.org/10.3390/ani16131951
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

Pig Passage Counting Based on Improved YOLO and HMTC Strategy

Guodong Cheng, H Steve Zhang, Saisai Wu, Yali Wang et al.
Animals
Animal Behavior and Welfare Studies
article

Pig Passage Counting Based on Improved YOLO and HMTC Strategy

Guodong Cheng, H Steve Zhang, Saisai Wu, Yali Wang, Shuqing Han, Lu Yang, Xin Chai
article en

Abstract

Accurate pig counting during herd transfers is fundamental to effective livestock management in large-scale swine production, yet existing methods struggle with bidirectional passages, boundary oscillations, and occlusion in real corridor environments. This study proposes an integrated system combining an improved YOLO-based detection model with a Hysteresis-based Multi-frame Temporal Confirmation Counting Strategy (HMTC). The YOLO11s baseline was enhanced using lightweight RepViT blocks, dynamic upsampling (DySample), and shape-aware bounding box regression (Shape-IoU). The resulting model achieves a mAP50 of 0.982 with a compact architecture of 8.28M parameters, representing a 12.3% reduction relative to the baseline while improving detection accuracy. To address bidirectional counting challenges, the HMTC strategy utilizes hysteresis-based region classification, temporal confirmation, and trajectory verification to suppress boundary jitter and ensure directional correctness. Evaluated on nine videos from a single transfer corridor, the proposed system achieves an overall counting accuracy of 99.21% on this test set and runs in real time on an embedded edge device at over 30 FPS without loss of counting accuracy. Together, the improved detection model and HMTC counting strategy provide a cohesive approach to pig passage counting, validated here under a single transfer-corridor condition; these results offer a promising basis for automated animal inventory management, pending further validation across more diverse farm environments.

AnimalsVol. 16(13)
Agricultural Information Institute (CN), Guangxi Academy of Agricultural Science (CN), Chinese Academy of Agricultural Sciences (CN), Ministry of Agriculture and Rural Affairs (CN)
Chinese Academy of Agricultural Sciences, Agricultural Science and Technology Innovation Program
Zero hunger
Openalex Percentile: Top 6%
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.