高级检索+

基于EDEL-YOLO模型的奶牛翘尾行为检测方法

Method for detecting tail-raising behavior in dairy cows using the EDEL-YOLO model

  • 摘要: 奶牛分娩时间的准确预测是围产期健康管理的重要环节,翘尾是反映奶牛临近分娩的重要行为表征之一。针对真实牛舍环境中奶牛尾部目标细长、易受遮挡及线性背景干扰而导致的漏检、误检和定位不准确等问题,该研究以YOLOv11n为基线,提出一种基于EDEL-YOLO模型的奶牛翘尾行为检测方法。首先设计边缘金字塔引导融合结构(edge pyramid guided fusion,EPGF),将多尺度边缘先验与语义特征融合,以强化奶牛尾部轮廓表达;其次,构建了动态统计频谱模块(C2-dynamic statistical spectral,C2-DSS),以提升高层语义表征与全局建模能力;再次,用CSP-EDLAN替换原C3k2模块,以提高特征聚合效率与梯度传递稳定性;最后,采用轻量共享细节增强卷积检测头(lightweight shared detail enhanced convolutional detection head,LSDECD)生成检测结果,以提升目标定位精度与分类稳定性。试验结果表明,EDEL-YOLO模型的精确率(P)为88.77%,召回率(R)为82.47%,mAP0.5与mAP0.5-0.95分别为86.32%和54.82%,与基线YOLOv11n相比,P、R、mAP0.5和mAP0.5-0.95分别提升3.45、3.73、2.40和2.81个百分点,并优于Faster R-CNN、Cascade R-CNN、YOLOv5n、YOLOv8n、YOLOv10n等主流模型。该方法可为奶牛围产期翘尾行为的自动监测以及后续产犊预警提供视觉决策依据。

     

    Abstract: In dairy-house videos, dairy cow tails are slender, frequently occluded, and easily confused with rails, shadows, and other linear background structures, leading to missed detections, false detections, and inaccurate localization. Such interference becomes more difficult to resolve when multiple cows overlap or when the visible tail shape changes with standing and lying postures. To address these problems, this study proposed an EDEL-YOLO model for automatic detection of tail-raising behavior, using YOLOv11n as the baseline. A dataset containing 2268 images and 3988 annotated tail instances was prepared from dairy-house surveillance videos. The dataset retained standing and lying postures as separate conditions, with raised and lowered tails annotated as four distinct states. Video frames were screened to reduce visually redundant samples while preserving diverse appearances and challenging backgrounds. Four modifications were incorporated: edge pyramid guided fusion (EPGF) combined multiscale edge priors with semantic features; a C2-dynamic statistical spectral (C2-DSS) module integrated token statistics self-attention, DynamicTanh, Mona, and spatial-frequency feature enhancement; CSP-EDLAN replaced C3k2 blocks in the backbone and neck to improve feature aggregation; and a lightweight shared detail-enhanced convolutional detection head (LSDECD) combined shared and differential convolutions for tail localization and classification. Together, these modifications were designed to combine low-level boundary cues, broader contextual information, and local detail enhancement within a unified detector. Ablation and model comparison experiments were conducted using consistent data partitions and evaluation metrics. On the test set, the EDEL-YOLO model achieved 88.77% precision, 82.47% recall, 86.32% mean average precision at an intersection-over-union (IoU) threshold of 0.50, and 54.82% mean average precision averaged over IoU thresholds from 0.50 to 0.95. Compared with YOLOv11n, these metrics increased by 3.45, 3.73, 2.40, and 2.81 percentage points, respectively. Introducing EPGF, C2-DSS, CSP-EDLAN, and LSDECD separately increased mean average precision at the 0.50 threshold from 83.92% to 85.04%, 85.23%, 85.33%, and 85.28%, respectively. At IoU thresholds from 0.50 to 0.95, the corresponding values were 53.86%, 53.92%, 54.19%, and 52.18%, compared with 52.01% for the baseline. Partial combinations showed different performance trade-offs. The complete model achieved the highest precision, recall, and both mean average precision measures among the evaluated ablation configurations. In comparisons with other detectors, its mean average precision across IoU thresholds from 0.50 to 0.95 exceeded Faster R-CNN and Cascade R-CNN by 9.70 and 5.17 percentage points, respectively, and YOLOv5n, YOLOv8n, YOLOv10n, and YOLOv12n by 2.90, 2.72, 2.75, and 2.93 percentage points, respectively. At an IoU threshold of 0.75, the average precision increased from 0.695 without LSDECD to 0.708 with LSDECD. The higher IoU threshold placed stricter demands on bounding-box alignment, allowing the contribution of the detection head to be examined beyond basic target identification. The proposed model required 10.1 billion floating-point operations and contained 3.14 million parameters, compared with 6.5 billion operations and 2.62 million parameters for YOLOv11n, indicating additional computational requirements. Gradient-weighted class activation mapping (Grad-CAM) visualizations of five representative scenes showed more concentrated feature responses around cow tails and fewer responses to background structures. Qualitative comparisons also showed improved detection in selected scenes involving multiple cows, partial occlusion, distant targets, railing interference, and nighttime glare. However, missed detections remained under motion blur, low illumination, and overlap between tails and railings. These results indicated that the EDEL-YOLO model improved tail-state detection under the evaluated dairy-house conditions, with higher precision, recall, and localization accuracy than the baseline. The proposed model provides a technical basis for automatic monitoring of peripartum tail-raising behavior. Future research will incorporate multiple camera views and temporal features, including tail-raising frequency and duration, to investigate their potential for automated calving warning.

     

/

返回文章
返回