Research on cow behavior recognition algorithm based on YOLO-SW and temporal features
The postural behavior of cows is closely related to their health status,and for the problems of inefficiency and high leakage rate of traditional manual monitoring methods,this paper proposes a cow posture estimation model YOLO-SW(YOLOv8-Swin Transformer WIoU)with improved YOLOv8 and combines it with time-series statistical methods to realize the automatic identification of cow behavior.First,the YOLO-SW model incorporates the Swin Transformer module in the Backbone backbone network part to extract features,and utilizes its downsampling hierarchical design of the shift window mechanism to gradually increase the sensory field,which significantly improves the model's ability of extracting the global feature information of the cows;second,in response to the problem of the model's original loss function having a low convergence rate,the bounding box regression loss function WIoU to replace CIoU,and use outlier to replace IoU to assess the quality of the anchor frame,which provides a suitable gradient gain allocation strategy and effectively improves the model's convergence speed and recognition performance.The experimental results show that the mAP50 index of the YOLO-SW model reaches 97.7%,and the mAP50:90 index reaches 83.8%.In video behavior recognition,the video frames of cow behavior were input into the model in chronological order,and the mean filtering statistical algorithm was used,which showed that the average accuracy value of YOLOv8 was 86.84%,and the average accuracy of YOLO-SW reached 90.74%.This study shows that the model has advantages in the accuracy of dairy cow behavior recognition analysis,provides technical support for disease prevention and health monitoring of dairy cows,and has a wide range of application prospects in the field of behavior recognition.