Systems Science & Control Engineering (Dec 2024)

YOLOv5-MHSA-DS: an efficient pig detection and counting method

  • Wangli Hao,
  • Li Zhang,
  • Shu-ai Xu,
  • Meng Han,
  • Fuzhong Li,
  • Hua Yang

DOI
https://doi.org/10.1080/21642583.2024.2394428
Journal volume & issue
Vol. 12, no. 1

Abstract

Read online

Accurate and efficient livestock detection and counting are crucial for agricultural intelligence. To address the obstacles created by traditional manual methods and limitations of current vision technology, we introduce YOLOv5-MHSA-DS, a novel model that integrates YOLOv5 framework with Multi-Head Self-Attention and DySample modules. Multi-Head Self-Attention excels at capturing diverse features, enhancing pig detection and counting accuracy. On the other hand, DySample dynamically adjusts sampling strategies based on input data, allowing it to focus on the most critical parts of the image and thereby significantly improving pig detection and counting performance. To validate the generalization and robustness of our proposed model, we conducted ablation experiments. The results demonstrate that YOLOv5-MHSA-DS achieves an impressive mAP of 93.8% and counting accuracy of 95.0%, surpassing other models by significant margins of 12.2% and 19.0%, respectively.

Keywords