摘要
Recognition and tracking of basic cow behaviors in natural environments are critical technologies for cows' health monitoring in smart farming. This study proposes an efficient cow behavior recognition and tracking method (PrunedYOLO-Tracker) to address the main problem of the lack of a real-time and identity-linked approach for analyzing and monitoring cow behaviors. Firstly, the channel pruning algorithm is employed to compress the size and parameters of the base model, YOLO v5l. Secondly, a multi-object tracking (MOT) method, Cascaded-Buffered IoU (C-BIoU), which expands the detection and trajectory matching space by increasing the buffer zone, is proposed to combine the behavior information from detection with the trajectory information from tracking, achieving multi-cows' behavior recognition and tracking. Through experimental verification, the pruned model maintains high detection accuracy while reducing the model size, floating-point operations (FLOPs) and parameters by 73.5%, 76.7% and 74.0%, respectively. Compared to the original model, the pruned model only experiences a slight decrease of 0.2% in F1 score, while achieving a 0.3% increase in mean Average Precision (mAP). In terms of cow tracking performance, when compared to six other multi-object tracking algorithms including DeepSort, DeepMot, OC-Sort, BotSort, StrongSort, and ByteTrack, the proposed method demonstrates the highest High Order Tracking Accuracy (HOTA), Multi-Object Tracking Precision (MOTP) and Identification F1 (IDF1) scores, reaching 72.4%, 86.1% and 80.3%, respectively. The results obtained from testing in multiple cow activity environments demonstrate that the proposed method exhibits excellent performance in behavior recognition and tracking, as well as high-speed processing capabilities, with an average video processing speed of 81 frames per second (FPS). This method possesses the ability to reliably monitor and manage cow behavior in real-time, providing technical support for promptly anomalies detection and cow health status monitoring for dairy farming managers.