Abstract:The behavior of beef cattle in the process of activity is the comprehensive embodiment of the health status of beef cattle. The rapid and accurate recognition of beef cattle behavior plays an important role in the prevention and control of beef cattle diseases, their own development assessment and estrus monitoring. Behavior recognition technology based on machine vision has been applied to behavior recognition of livestock and poultry breeding because of its lossless and fast characteristics. However, the existing behavior recognition methods of beef cattle based on machine vision were usually studied for a single cow or a single behavior, and there were problems such as large amount of calculation. In view of the above problems, a method based on Slim-Neck & Separated and enhancement attention module & Simplified spatial pyramid pooling-fast-YOLO v7 (SNSS-YOLO v7) was proposed. Firstly, seven common behavior images of beef cattle, such as mounting, lying, searching, standing, walking, licking and fighting, were collected in the complex environment to construct a beef cattle behavior dataset. Secondly, the Slim-Neck structure was used in the neck of YOLO v7 to reduce the amount of calculation and parameters of the model. Then, separated and enhancement attention module (SEAM) was introduced into the head to enhance the detection effect after the output of the Neck layer. Finally, the simplified spatial pyramid pooling-fast (SimSPPF) module was used to replace the spatial pyramid pooling cross stage partial conv (SPPCSPC) module of the original YOLO v7, which further reduced the number of parameters while increased the receptive field. Tested on the selfbuilt dataset, the mean average precision ([email protected]) of the beef cattle behavior recognition method proposed was 95.2%, the model size was 39MB, and the number of parameters was 1.926×107. Compared with YOLO v7, YOLO v6m, YOLO v5m, YOLOX-S, TPH-YOLO v5 and Faster R-CNN, the model size was reduced by 47.9%, 45.4%, 7.6%, 43.1%, 57.8% and 92.5%, respectively. The mean average precision ([email protected]) was improved by 1.4 percentage points, 2.2 percentage points, 3.1 percentage points, 13.7 percentage points, 1.9 percentage points, and 4.5 percentage points, respectively. The experimental results showed that the proposed method can achieve accurate recognition of beef cattle behavior, and can be deployed on devices with limited computing resources to provide support for intelligent livestock breeding.