Abstract:Daily behavior is an important manifestation of the health status of livestock. In traditional behavior recognition methods, livestock usually need to be observed manually or rely on additional tools. In order to solve the above problems, an efficient sheep behavior recognition method was proposed based on the YOLO v5n model, which used the target recognition algorithm to recognize the feeding, lying and standing behaviors of domesticated sheep from the video sequence above the sheepflod. Firstly, the daily behavior images of sheep in the farm were collected by cameras, and the data set of sheep behavior was constructed. Secondly, SE attention mechanism was introduced into the Backbone feature extraction network of YOLO v5n to enhance the global information interaction and expression capability and improve the detection performance. The GIoU loss function was utilized to reduce the computational cost and improve the convergence speed of the model. Finally, GhostConv convolution was integrated into Backbone network, which effectively reduced the calculation and parameter number of the model. The experimental results showed that the parameter number of GS-YOLO v5n object detection method proposed was only 1.52×106, which was reduced by 15% compared with the original model YOLO v5n. The FLOPs was 3.3×109, which was 30% less than the original model. The average accuracy achieved 95.8%, which was 4.6 percentage points higher than that of the original model. Compared with the current mainstream YOLO series of object detection models, the improved model significantly reduced the computational and parameter complexity of the model, while also achieved higher detection accuracy. It was deployed on edge devices and met the standard of real-time detection. It can accurately and quickly locate and detect sheep, providing ideas and support for intelligent sheep breeding.