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
- Shuqin Tu (ORCID: https://orcid.org/0000-0001-5844-2360)
- Yang Hui (ORCID: https://orcid.org/0000-0002-8747-8060)
- Liang Mao (ORCID: https://orcid.org/0000-0003-1287-2191)
- Tao Cheng (ORCID: https://orcid.org/0000-0002-5503-9813)
- Fujie Sun
- Yuan Fang
- Haoxuan Ou
Institutions
- South China Agricultural University (CN)
- Hunan University (CN)
- Shenzhen Polytechnic University (CN)
- Jiangxi College of Applied Technology (CN)
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