Ye Wang, Xin-Ning Wang, Hong-Rui Guo, Zhi-Xin Gu
Dairy cow body condition score (BCS) is a practical, semi-quantitative indicator of body energy reserves and changes in energy balance. To improve five-class BCS detection under complex imaging conditions, this study developed UGT-YOLO by integrating a UniRepLKNet Block, a Gather-and-Distribute feature-fusion mechanism, and a Task-Aligned Dynamic Detection Head into YOLOv11n. The model was evaluated using a single publicly available dataset containing five adjacent BCS classes: 3.25, 3.50, 3.75, 4.00, and 4.25. Following redundancy removal and image-quality screening, 7015 original images were retained. Dataset partitioning was completed before data augmentation. The original images were divided at the source-video-sequence level into training, validation, and test subsets containing 5612, 702, and 701 images, respectively. Available cow identifiers were additionally used to keep images of the same identified animal within a single subset. Data augmentation was applied exclusively to the training subset, increasing the training set to 9639 images and producing a final experimental dataset of 11,042 images. UGT-YOLO achieved a precision of 84.3%, a recall of 81.1%, an mAP@0.5 of 88.5%, and an mAP@0.5:0.95 of 66.8%. Compared with YOLOv11n, these values increased by 4.8, 0.9, 2.8, and 4.5 percentage points, respectively. The parameter count increased from 2.6 to 6.5 million, and computational cost increased from 6.4 to 19.2 GFLOPs. Under an input resolution of 640 × 640 pixels, a batch size of 1, and FP32 inference on an NVIDIA GeForce RTX 3090, UGT-YOLO achieved a throughput of 68 frames s-1. These results demonstrate an accuracy-complexity trade-off within the evaluated public dataset and restricted BCS range. Independent cow-level, cross-farm, full-range BCS, multi-scorer, and edge-device validation remains necessary.