YOLOv5-VF-W3: A novel cattle body detection approach for precision livestock farming
-
Graphical Abstract
-
Abstract
Accurate cattle body detection can significantly enhance the efficiency and quality of animal husbandry production. Traditional manual observation approaches are not only inefficient but also lack objectivity, while computer vision-based methods demand prolonged training periods and present challenges in implementation. To address these issues, this paper develops a novel precise cattle body detection solution, namely YOLOv5-VF-W3. By introducing the Varifocal loss, the YOLOv5-VF-W3 model can handle imbalanced samples and focus more attention on difficult-to-recognize instances. Additionally, the introduction of the WIoUv3 loss function provides the model with a wise gradient gain allocation strategy. This strategy reduces the competitiveness of high-quality anchor boxes while mitigating harmful gradients produced by low-quality anchor boxes, thereby emphasizing anchor boxes of ordinary quality. Through these enhancements, the YOLOv5-VF-W3 model can accurately detect cattle bodies, improving the efficiency and quality of animal husbandry production. Numerous experimental results have demonstrated that the proposed YOLOv5-VF-W3 model achieves superior cattle body detection results in both quantitative and qualitative evaluation criteria. Specifically, the YOLOv5-VF-W3 model achieves an mAP of 95.2% in cattle body detection, with individual cattle detection, leg detection, and head detection reaching 95.3%, 94.8%, and 95.4%, respectively. Furthermore, in complex scenarios, especially when dealing with small targets and occlusions, the model can accurately and efficiently detect individual cattle and key body parts. This brings new opportunities for the development of precision livestock farming.
-
-