The group-housed pigs attacking and daily behaviors detection and tracking based on improved YOLOv5s and DeepSORT

Automatic detection and tracking of pig behaviors through video surveillance remain challenges due to farm demanding conditions, e.g., illumination conditions and occlusion of one pig from another. The main goal of this study is to develop a deep learning method based on the improved YOLOv5s and DeepSORT to detect and track the behaviors of pigs, which has the advantages of stability and high accuracy. Firstly, YOLOv5s with the attention mechanism is used for pig detection and behavior recognition. To deal with the missed detection and false detection due to occlusion and overlapping between pigs and pigs, the improved YOLOv5s adopts the Shape-IoU to optimize the bounding box regression loss function, which improves the robustness of the model. Then, the improved DeepSORT model is proposed to track each pig behaviors including eat, stand, lie and attack four behavior types. Finally, we conduct a comparison test under different lighting and density conditions for pig detection and behavior tracking on special dataset. Experimental results show that the [email protected]% of improved YOLOv5s algorithm increases from 92.7% to 99.3%, which means 6.6% accuracy improvement compared with the YOLOv5s model. In terms of tracking, the values of MOTA and MOTP in all test videos are 94.5% and 94.9% respectively. These experiments demonstrate that the improved YOLOv5s and DeepSORT achieves high accuracy for both pig detection and behavior tracking. The proposed approach provides scalable technical support for contactless automatic pig monitoring.

Authors

Institutions

Publication Details

Journal
PLoS ONE
Published
2025-10-31
DOI
https://doi.org/10.1371/journal.pone.0334783
Citations
3
Primary Topic
Animal Behavior and Welfare Studies
Type
article
Field-Weighted Citation Impact
7.06
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

The group-housed pigs attacking and daily behaviors detection and tracking based on improved YOLOv5s and DeepSORT

Shuqin Tu, Yang Hui, Liang Mao, Tao Cheng et al.
3 citations
PLoS ONE
Animal Behavior and Welfare Studies
7.06
article

The group-housed pigs attacking and daily behaviors detection and tracking based on improved YOLOv5s and DeepSORT

Shuqin Tu, Yang Hui, Liang Mao, Tao Cheng, Fujie Sun, Yuan Fang, Haoxuan Ou
article en
3 citations

Abstract

Automatic detection and tracking of pig behaviors through video surveillance remain challenges due to farm demanding conditions, e.g., illumination conditions and occlusion of one pig from another. The main goal of this study is to develop a deep learning method based on the improved YOLOv5s and DeepSORT to detect and track the behaviors of pigs, which has the advantages of stability and high accuracy. Firstly, YOLOv5s with the attention mechanism is used for pig detection and behavior recognition. To deal with the missed detection and false detection due to occlusion and overlapping between pigs and pigs, the improved YOLOv5s adopts the Shape-IoU to optimize the bounding box regression loss function, which improves the robustness of the model. Then, the improved DeepSORT model is proposed to track each pig behaviors including eat, stand, lie and attack four behavior types. Finally, we conduct a comparison test under different lighting and density conditions for pig detection and behavior tracking on special dataset. Experimental results show that the [email protected]% of improved YOLOv5s algorithm increases from 92.7% to 99.3%, which means 6.6% accuracy improvement compared with the YOLOv5s model. In terms of tracking, the values of MOTA and MOTP in all test videos are 94.5% and 94.9% respectively. These experiments demonstrate that the improved YOLOv5s and DeepSORT achieves high accuracy for both pig detection and behavior tracking. The proposed approach provides scalable technical support for contactless automatic pig monitoring.

PLoS ONEVol. 20(10)
South China Agricultural University (CN), Hunan University (CN), Shenzhen Polytechnic University (CN), Jiangxi College of Applied Technology (CN)
Openalex Percentile: Top 3%
Animal Behavior and Welfare Studies
7.06
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.