Objective To achieve real-time monitoring of cattle activity status in precision breeding, help farmers promptly identify cattle abnormal behaviors, and provide support for cattle feed allocation, disease monitoring, and breeding management.
Method This study modified the YOLO v10 model into LDCM-YOLO v10n, and based on this, conducted detection on cattle species and behaviors. The specific improvements were as follows: First, the C2f-LSKA structure was adopted in the Backbone of YOLO v10 to enhance the feature extraction capability of the model. Second, the DySample upsampling operator was introduced to effectively capture subtle changes in images and dense semantic information, avoiding the problems of image blurring and limited receptive field in traditional upsampling methods. Meanwhile, the PSA of YOLO v10 was replaced with the CloFormer attention mechanism to better distinguish cattle features from background noise and accurately identify small targets. In addition, the multi-scale dilated attention mechanism (MSDA) was added to enhance the aggregated semantic information at various scales within the receptive field and effectively reduce the redundancy of the self-attention mechanism. Finally, the Inner-IoU loss function was used to address the issue that the ordinary IoU loss function could not flexibly adjust loss calculation according to the target scale.
Result On the cattle behavior dataset, the mAP@0.50 of the LDCM-YOLO v10n model increased by 15.4, 10.7, 12.0, 8.4, 7.9 and 5.1 percentage points compared with YOLO v3, YOLO v5, YOLO v6, YOLO v8n, YOLO v9 and YOLO v10n model, respectively. Meanwhile, on the cattle species dataset, the mAP@0.50 of the LDCM-YOLO v10n model increased by 32.4, 11.9, 10.4, 9.5, 9.0 and 6.4 percentage points compared with the aforementioned models, respectively.
Conclusion The LDCM-YOLO v10n model demonstrates excellent performance in cattle behavior and species detection, providing a strong technical support for precision breeding.