Abstract:The daily behaviors of sheep, such as standing, walking, eating, drinking and sitting, are closely related to their health. Efficient and accurate recognition of sheep behaviors is crucial for disease and health detection. To address the current problem of the limited behavior of sheep caused by contact devices such as sensors and lower accuracy caused by diverse behaviors, complex scenarios, and occlusions in group farming, the method for sheep behavior recognition based on improved YOLO v8s was proposed. Firstly, the SPPCSPC was introduced to improve the feature extraction ability and the detection accuracy of the model. Secondly, the P2 detection was used to enhance ability of the model to identify and locate the small targets. Finally, multi-scale lightweight modules PConv and EMSConv were introduced and the number of parameters and calculation of the model were reduced and the lightweight was realized while ensuring the recognition of effects. The results showed that the average accuracy of the model proposed for standing, walking, eating, drinking, and sitting was 84.62%, 92.58%, 87.54%, 98.13% and 87.18%, respectively. And the overall average accuracy was 90.01%. Compared with Faster R-CNN, YOLO v5s, YOLO v7, and YOLO v8s model, the average accuracy was 12.03 percentage points, 3.95 percentage points, 1.46 percentage points, and 2.19 percentage points higher, respectively. The results can provide technical support for sheep health management and disease warning.