In modern animal husbandry, intelligent digital farming has become the key to improve production efficiency. This paper introduces a model based on improved YOLOv8, Cattle Behavior Recognition-YOLO (CBR-YOLO), which aims to accurately identify the behavior of cattle. We not only generate a variety of weather conditions, but also introduce multi-target detection technology to achieve comprehensive monitoring of cattle and their status. We introduce Inner-MPDIoU Loss and we have innovatively designed the Multi-Convolutional Focused Pyramid module to explore and learn in depth the detailed features of cattle in different states. Meanwhile, the Lightweight Multi-Scale Feature Fusion Detection Head module is proposed to take advantage of deep convolution, achieving a lightweight network architecture and effectively reducing redundant information. Experimental results prove that our method achieves an average accuracy of 90.2% with a reduction of 3.9 G floating-point numbers, an increase of 7.4%, significantly better than 12 kinds of SOTA object detection models. By deploying our approach on monitoring computers on farms, we expect to advance the development of automated cattle monitoring systems to improve animal welfare and farm management.
This study addresses the practical demand for facial recognition of pigs in the food safety and insurance industries, tackling the challenge of low recognition accuracy caused by complex farming environments, occlusions, and similar textures. To this end, we propose an enhanced model, DGS-YOLO, based on YOLOv11n, designed to achieve precise facial recognition of group-raised young pigs. The core improvements of the model include the following: (1) replacing standard convolutions with dynamic convolutions (DMConv) to enhance the network’s adaptive extraction capability for critical detail features; (2) designing a C3k2_GBC module with a bottleneck structure to replace the C3k2 neck, enabling more efficient capture of multi-scale contextual information; (3) introducing the SimAM parameter-free attention mechanism to optimize feature focusing; (4) employing the Shape-IoU loss function to mitigate the impact of bounding box geometry on regression accuracy. Experiments on self-built datasets demonstrate that DGS-YOLO achieves 4%, 2.1%, and 2.3% improvements in accuracy, recall, and mAP50, respectively, compared to the baseline model YOLOv11n. Furthermore, its overall performance surpasses that of Faster R-CNN and SSD in comprehensive evaluation metrics. Especially in limited sample scenarios, the model demonstrates strong generalization ability, with accuracy and mAP50 further increased by 20.1% and 10.3%. This study provides a highly accurate and robust solution for animal facial recognition in complex scenarios.