欢迎您访问《智慧农业(中英文)》官方网站! English

Smart Agriculture

• •    

DC-YOLO:应对遮挡和光照变化的湖羊行为检测

李夏溪, 冀荣华, 常宏瑞(), 张所向   

  1. 中国农业大学信息与电气工程学院,北京 100083,中国
  • 收稿日期:2026-01-16 出版日期:2026-04-15
  • 通信作者:
    常宏瑞,博士研究生,研究方向为计算机视觉算法及其农业应用。E-mail:

DC-YOLO: A Behavior Detection Model for Hu Sheep Addressing Occlusion and Illumination Variations

LI Xiaxi, JI Ronghua, CHANG Hongrui(), ZHANG Suoxiang   

  1. College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China
  • Received:2026-01-16 Online:2026-04-15
  • Foundation items:国家重点研发计划(2022YFD1301104)
  • About author:

    李夏溪,硕士,研究方向为计算机视觉算法与应用。E-mail:

  • Corresponding author:
    CHANG Hongrui, E-mail:

摘要:

【目的/意义】 畜牧业中,动物行为是评估动物生理健康以及提供环境预警的重要指标。针对集约化养殖中行为检测面临的多目标严重遮挡、光照条件多变、类别分布不均等挑战,本研究旨在开发一种能够实现舍饲湖羊24小时日常行为自动监测的高效算法,以支撑羊群的精准化管理,提出DCAttention-YOLO(DC-YOLO)模型。 【方法】 针对多目标严重遮挡,引入自适应细节-上下文注意力(DCAttention,Adaptive Detail-Contextual Attention)机制构建DCAC3K2模块,并采用BS-NMS(Bounding Box Similarity Soft-NMS)防止错误去除遮挡目标的边界框。针对光照条件多变,预训练光照编码器并将其参数迁移至DC-YOLO。针对类别分布不均,设计综合分类质量焦点损失,对遮挡及少数类样本自适应增大损失权重。本研究数据集通过湖羊养殖场全天候监控采集,包含505张标注图像,涵盖饮水、采食、躺卧、舔舐和站立5种行为。 【结果和讨论】 DC-YOLO的重叠度阈值为 0.5 时的平均精度均值mAP@50达到91.4%,相比YOLOv12提高了7.8个百分点。此外,DC-YOLO的参数量为2.29 M,相较YOLOv12减少了8.74%。在CPU环境下,DC-YOLO的推理时间缩短至115.5 ms,帧率提升至8.50帧/s,分别提升了33.2%和48.9%。 【结论】 DC-YOLO在保持低参数量与高推理速度的同时,有效缓解了舍饲环境下多目标遮挡、光照条件多变及行为类别分布不均带来的检测难题,能够为集约化湖羊养殖的行为跟踪与分析提供有效的技术支撑。

关键词: 集约化养殖, 行为检测, 湖羊行为, 注意力机制, YOLO

Abstract:

[Objective] In the livestock industry, animal behavior serves as a critical indicator for evaluating physiological health and providing environmental early warning. To address the challenges of severe multi-object occlusion, complex illumination, and class imbalance in intensive farming, an efficient model is developed for the 24/7 automatic detection of daily behaviors in housed Hu sheep, thereby facilitating precision management. The DCAttention-YOLO (DC-YOLO) model is proposed. [Methods] For severe multi-object occlusion, an adaptive Detail-Contextual Attention (DCAttention) mechanism was introduced to construct the DCAC3K2 module, and Bounding box similarity soft-NMS(BS-NMS) was adopted to prevent incorrect removal of occluded bounding boxes. For complex illumination, a Light-Encoder was pre-trained on illumination conditions and its parameters were transferred to DC-YOLO. For class imbalance, a Comprehensive Classification-quality Focal Loss (CQFL) was designed to adaptively increase loss weights for occluded and minority-class samples. The dataset, collected through 24/7 surveillance at Hu sheep farms, comprised 505 annotated images depicting 5 daily behaviors: drinking, eating, lying, licking, and standing. [Results and Discussions] DC-YOLO achieved mAP@50 of 91.4%, improving by 7.8 percentage points over YOLOv12. Moreover, DC-YOLO had 2.29 M parameters, an 8.74% reduction compared to YOLOv12. On CPU, the inference time of DC-YOLO was reduced to 115.5 ms and the frame rate increases to 8.50 f/s, corresponding to improvements of 33.2% and 48.9%, respectively. [Conclusions] Experimental results demonstrate that DC-YOLO effectively mitigates detection challenges caused by severe occlusion, complex illumination, and class imbalance while maintaining high inference efficiency. Consequently, it provides effective technical support for tracking and analyzing behaviors in intensive Hu sheep farming.

Key words: Intensive livestock farming, Behavior detection, Hu sheep behavior, Attention Mechanism, YOLO

中图分类号: