Abstract:With the rapid development of modern pig breeding industry, the demand for precise recognition of pig behaviors is increasing. Aiming to address the issues of diversity of pig behaviors, similarity of features, mutual occlusion and stacking, a pig behavior recognition method based on the improved YOLO v8 model was proposed. Firstly, the ConvNeXt V2 was introduced as the backbone feature extraction network to enhance the ability to extract semantic information of the detection target. Secondly, the bi-directional feature pyramid network (BiFPN) was added to the feature fusion network to enhance the feature fusion ability of the model. Thirdly, combined with the CARAFE up-sampling operator, the feature extraction ability of the model in the process of behavior recognition was further improved. Finally, the WIoUv3 was used as the loss function to optimize the detection accuracy of the model. The experimental results showed that the precision rate, recall rate, mean average precision and F1 value of the improved model reached 89.6% , 88.0% , 91.9% and 88.8% , respectively. Compared with TOOD, YOLO v7 and YOLO v8 models, the mean average precision was increased by 10.9, 6.3 and 3.7 percentage points, respectively, which significantly improved the accuracy of pig behavior recognition. The ablation experiments showed that all the improvements improved the recognition performance of the model, and the ConvNeXt V2 backbone feature extraction network had the most obvious improvement effect on the model. In summary, the CBCW-YOLO v8 model demonstrated excellent overall performance in pig behavior recognition tasks and provided powerful technical support for pig health management and disease early warning.