Abstract:It is of vital significance to detect pig’s eating and drinking behavior by using intelligent method, and analyze the law of eating and drinking water, which plays an important role in early warning of pig disease and maintaining pig welfare. Pig diet behavior detection model based on YOLOv4 was proposed. Aiming at the pig diet image with multi time period, multi view angle and different degrees of occlusion, the database of pig eating behavior image was established. The in-depth feature extraction and high-precision detection classification characteristics of YOLOv4 deep learning network were used to accurately detect pig eating behavior. The results from the whole experiments showed that the model based on YOLOv4 can accurately predict the diet behavior of pigs in different angles of view, different degrees of occlusion and different illuminations. The average detection accuracy (mAP) was 95.5%, which was 2.8 percentage points and 3.6 percentage points higher than that of the same series of YOLOv3 and Tiny-YOLOv4 models, 1.5 percentage points higher than that of Faster R-CNN model, 5.9 percentage points higher than that of RetinaNet model and 5 percentage points higher than that of SSD model. This method can accurately predict the occurrence of pig eating behavior and provide targeted and adaptive technical support for pig intelligent breeding and management.