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

Smart Agriculture

• •    

融合SimAM与四尺度检测的YOLOv11荷斯坦奶牛姿态估计

刘思伊1, 李振波1,2()   

  1. 1. 中国农业大学信息与电气工程学院,北京 100083,中国
    2. 农业农村部信息化标准化重点实验室,北京 100083,中国
  • 收稿日期:2026-04-28 出版日期:2026-07-17
  • 基金项目:
    国家重点研发计划课题(2024YFD2000304); 现代农业产业技术体系北京市智慧农业创新团队岗位专家项目(BAIC10-2026-E14)
  • 作者简介:

    刘思伊,本科,研究方向为计算机视觉。E-mail:

  • 通信作者:
    李振波,博士,教授,研究方向为计算机视觉。E-mail:

Holstein Cattle Pose Estimation via YOLOv11 with Integrated SimAM and Four-Scale Detection

LIU Siyi1, LI Zhenbo1,2()   

  1. 1. College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China
    2. Key Laboratory of Standardization of Agricultural Informatization, Beijing 100083, China
  • Received:2026-04-28 Online:2026-07-17
  • Foundation items:National Key Research and Development Program of China(2024YFD2000304); Post Expert Project of the Beijing Smart Agriculture Innovation Team, Modern Agriculture Industry Technology System(BAIC10-2026-E14)
  • About author:

    LIU Siyi, E-mail:

  • Corresponding author:
    LI Zhenbo, E-mail:

摘要:

【目的】 荷斯坦奶牛养殖环境存在光照复杂、遮挡多等干扰因素,且现有AI模型对奶牛蹄部、耳尖等末端关键点表征不足,导致姿态估计精度不高。为提高复杂牛舍场景下奶牛姿态估计的精度与鲁棒性,以YOLOv11n-Pose为基础模型,提出一种融合自适应注意力与多尺度感知的轻量化奶牛姿态估计算法YOLOv11n-AS4D。 【方法】 针对蹄部、耳尖等末端关键点因多级下采样导致的空间信息衰减,设计基于P2高分辨率特征的非对称四尺度检测头,通过渐进式通道配置与单向特征流提升细粒度空间表征能力;针对遮挡与背景纹理相似条件下特征判别不稳定问题,提出Adaptive SimAM模块,通过自适应正则化、多尺度能量建模与层级差异化部署增强关键点特征的判别稳定性。 【结果】 改进模型在自建与CMBN数据集上的精确率为97.6%和98.0%,召回率为97.6%和98.7%,mAP@0.5:0.95为84.6%和83.8%,较YOLOv11n-Pose的mAP@0.5:0.95分别提升1.2和1.4个百分点,精确率分别提升0.4和0.3个百分点,召回率分别提升0.4和0.5个百分点;参数量由2.90/2.91 M降至2.27/2.28 M;计算量由7.3/7.2增至9.8 GFLOPs,端到端推理速度为83.1帧/s,表明模型以一定计算开销换取更高定位精度,并保持实时推理能力。 【结论】 该模型以适度增加计算量为代价,降低了参数量并提升了姿态估计精度,有效缓解了末端关键点空间信息衰减与复杂遮挡下的特征判别不稳定,可为奶牛行为识别与养殖管理提供骨架感知支撑。

关键词: 奶牛姿态估计, 多尺度检测, 自适应注意力, 关键点检测, YOLOv11

Abstract:

[Objective] In large-scale Holstein farms, accurate pose estimation remains difficult because images are affected by complex illumination, occlusions caused by facilities and neighboring individuals, and local similarity between black-and-white coat patterns and barn textures, which weaken feature discrimination and reduce keypoint localization reliability. Distal keypoints, especially hoof keypoints, are particularly affected. Existing lightweight models meet real-time requirements but have insufficient representational ability for these small distal keypoints under occlusion and background interference. To improve distal keypoint localization while keeping the model compact and real-time, a lightweight Holstein cattle pose estimation algorithm, YOLOv11n-AS4D, was proposed based on YOLOv11n-Pose by integrating adaptive attention with multi-scale perception. [Methods] Two complementary improvements were introduced. First, an asymmetric four-scale detection head based on P2 high-resolution features was constructed to compensate for the spatial information loss of small distal keypoints during repeated downsampling. Compared with conventional three-scale structures, the added P2 branch (stride 4) provides a higher-resolution feature layer that retains shallow spatial details for final keypoint prediction. To control the extra cost of this high-resolution branch, three coordinated strategies were adopted: a unidirectional feature flow, in which the P2 branch only received deep semantic features for prediction and was not propagated back into the bottom-up aggregation path, thereby suppressing shallow noise transmission; a progressive channel configuration, with 64, 128, 256, and 512 channels for P2 to P5, which kept the main convolutional cost of each scale at a comparable level; and depthwise separable convolution in the aggregation path to further reduce computation. Second, an Adaptive SimAM module was proposed to improve feature discrimination under occlusion and texture interference. Unlike the original SimAM with a fixed regularization coefficient and a single-scale response, it introduced three extensions: adaptive regularization, which generated a sample-level coefficient from a global feature descriptor to adjust the attention response to the current feature distribution; multi-scale energy modeling, which combined multi-receptive-field pooling with a Sobel-based edge prior to jointly capture local residual texture and larger-scale context; and hierarchical deployment, which inserted the module after the P2, P3, and P4 stages of the backbone and at the P3 scale of the neck according to their functional roles. The model was trained and evaluated separately on a self-constructed Holstein cattle pose dataset and the public CMBN dataset to examine scene adaptability and generalization. [Results and Discussions] On the self-constructed and CMBN datasets, YOLOv11n-AS4D achieved 97.6% and 98.0% precision, 97.6% and 98.7% recall, and 84.6% and 83.8% mAP@0.5:0.95, respectively. Compared with YOLOv11n-Pose, mAP@0.5:0.95 increased by 1.2 and 1.4 percentage points, precision increased by 0.4 and 0.3 percentage points, and recall increased by 0.4 and 0.5 percentage points, respectively,,indicating improved localization under stricter thresholds. The number of parameters decreased from 2.90/2.91 M to 2.27/2.28 M, while computational cost increased from about 7.3/7.2 GFLOPs to 9.8 GFLOPsand the end-to-end inference speed reached 83.1 f/s, showing that accuracy was improved at a moderate computational cost while real-time inference was maintained. Ablation experiments showed that the two modules were complementary rather than redundant. Their joint gains in mAP@0.5:0.95 were 1.2 and 1.4 percentage points on the self-constructed and CMBN datasets, respectively, exceeding the summed individual gains on the self-constructed dataset and remaining close to their sum on the CMBN dataset. This indicated that the four-scale detection head and Adaptive SimAM enhanced different aspects of feature representation: fine-scale spatial localization of distal keypoints and feature discrimination under occlusion, respectively. In occlusion robustness tests, , average precision (AP) under severe occlusion increased from 73.5% for YOLOv11n-Pose to 75.9% for YOLOv11n-AS4D, and on continuous video sequences, the keypoint missing rate decreased from 8.73% for the baseline to 1.94% for the proposed model. Per-keypoint analysis showed reduced hoof localization errors, confirming the benefit of high-resolution feature compensation for small distal keypoints. [Conclusions] The proposed YOLOv11n-AS4D improved Holstein cattle pose estimation accuracy under complex farming conditions while reducing the number of parameters, with only a moderate increase in computation. By combining an asymmetric four-scale detection head with Adaptive SimAM, it mitigated spatial information loss of distal keypoints and improved feature discrimination under occlusion, while maintaining real-time inference, thereby providing more reliable skeleton perception for downstream behavior recognition, lameness assessment, and intelligent herd management.

Key words: holstein cattle pose estimation, multi-scale detection, adaptive attention, keypoint detection, YOLOv11

中图分类号: