Improved YOLOv5 for piglet detection in group housing: a lightweight and accurate approach

China's pig industry, rooted in the world's largest pork-producing and consuming nation, has evolved into an indispensable cornerstone of the country's agricultural and economic development. In the intensive farming mode, the pig industry urgently needs to ensure the health of pigs with precise monitoring technology. Especially in high-density collective breeding environments where individual pigs obstruct each other and the lighting conditions inside the pens are complex and varied, traditional detection methods often fail to meet practical demands due to insufficient recognition accuracy. Therefore, this study proposes an improved lightweight detection model YOLOv5-Ghost-Triplet. This model replaces the standard convolutional layer with a lightweight GhostNet structure, generating redundant feature maps using inexpensive linear transformations. The network's parameters are reduced by 29.3%, from 7.02 million to 4.96 million, while computational complexity decreases by 32.1%, with GFLOPs optimized from 15.9 to 10.8. These enhancements greatly improve edge device deployment. Although there is only a slight difference of 1.2-2.1 percentage points between the detection accuracy (96.4%) and recall rate (94.1%) compared to the benchmark model, the fusion of Triplet Attention mechanism enhances cross dimensional feature interaction by synchronously capturing global dependencies in the channel, height, and width dimensions, effectively alleviating the problem of feature confusion caused by overlapping occlusion and uneven lighting of pigs, thus achieving a 95.1% F1 comprehensive score in dense pig herd scenes. This lightweight design provides a promising solution for intelligent livestock management.

Authors

Institutions

Publication Details

Published
2025-07-16
DOI
https://doi.org/10.1117/12.3070653
Primary Topic
Animal Behavior and Welfare Studies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Improved YOLOv5 for piglet detection in group housing: a lightweight and accurate approach

Xin Yang, Sam Yang, J. Li, Lin-Zhi Chen et al.
Animal Behavior and Welfare Studies
article

Improved YOLOv5 for piglet detection in group housing: a lightweight and accurate approach

Xin Yang, Sam Yang, J. Li, Lin-Zhi Chen, Yi-min Lin, Chongzhao Han
article en

Abstract

China's pig industry, rooted in the world's largest pork-producing and consuming nation, has evolved into an indispensable cornerstone of the country's agricultural and economic development. In the intensive farming mode, the pig industry urgently needs to ensure the health of pigs with precise monitoring technology. Especially in high-density collective breeding environments where individual pigs obstruct each other and the lighting conditions inside the pens are complex and varied, traditional detection methods often fail to meet practical demands due to insufficient recognition accuracy. Therefore, this study proposes an improved lightweight detection model YOLOv5-Ghost-Triplet. This model replaces the standard convolutional layer with a lightweight GhostNet structure, generating redundant feature maps using inexpensive linear transformations. The network's parameters are reduced by 29.3%, from 7.02 million to 4.96 million, while computational complexity decreases by 32.1%, with GFLOPs optimized from 15.9 to 10.8. These enhancements greatly improve edge device deployment. Although there is only a slight difference of 1.2-2.1 percentage points between the detection accuracy (96.4%) and recall rate (94.1%) compared to the benchmark model, the fusion of Triplet Attention mechanism enhances cross dimensional feature interaction by synchronously capturing global dependencies in the channel, height, and width dimensions, effectively alleviating the problem of feature confusion caused by overlapping occlusion and uneven lighting of pigs, thus achieving a 95.1% F1 comprehensive score in dense pig herd scenes. This lightweight design provides a promising solution for intelligent livestock management.

Zhuhai Institute of Advanced Technology (CN)
Sustainable cities and communities
Openalex Percentile: Top 81%
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.