A Multi-Object Tracking Method for Pigs Based on Oriented Bounding Box Detection
Xuhui Ye, Lilu Huang, Yuyan Li, Zhong Li, Yan ChenTo address background redundancy in detection boxes and identity switches caused by variable body orientations, mutual occlusion, and high appearance similarity among group-housed pigs, a multi-object tracking method based on oriented bounding box detection was proposed to improve the accuracy of pig detection and trajectory association in farming environments. First, YOLO11m-OBB was adopted as the baseline detector. Its original backbone was replaced with EfficientViT-M0, and a dual-teacher knowledge distillation framework based on the DINOv3 vision foundation model was constructed, resulting in a lightweight pig detection model named PIG-YOLO. Second, an AdaptiveSORT tracking algorithm was developed within the tracking-by-detection framework. Camera motion compensation, adaptive state prediction, and multi-scale feature extraction modules were incorporated into the multi-object tracking process, together with a three-stage association strategy and a dedicated track management mechanism. Finally, detection, tracking, and cross-dataset generalization experiments were conducted using both public and self-collected pig video datasets. PIG-YOLO achieved a precision of 94.7%, a recall of 88.3%, an mAP50 of 93.1%, and an mAP50–95 of 85.6%, representing improvements of 3.7, 9.9, 8.0, and 8.9 percentage points over the baseline model, respectively. Meanwhile, the number of parameters, floating-point operations, and model size were reduced by 37.7%, 51.5%, and 36.2%, respectively. On the public test dataset, the combination of PIG-YOLO and AdaptiveSORT achieved HOTA, MOTA, and IDF1 scores of 96.32%, 98.82%, and 99.41%, respectively. On the private dataset, the corresponding scores were 94.98%, 97.31%, and 98.86%. In the cross-dataset generalization experiment, the proposed method achieved HOTA, MOTA, and IDF1 scores of 71.231%, 76.043%, and 83.008%, respectively, outperforming the other comparative tracking algorithms in overall performance. The proposed method reduces the computational complexity of the detection model while improving the accuracy of pig detection and the stability of trajectory association. It therefore provides technical support for pig behavior analysis and intelligent monitoring in large-scale pig farms.