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

Smart Agriculture

• •    

基于改进YOLOv11的轻量化肉牛面部识别方法

韩宇1,2, 齐康康1, 郑纪业1,2(), 李金瑷1,2, 姜富贵3, 张相伦3, 游伟3, 张霞2   

  1. 1. 山东省农业科学院农业信息与经济研究所,山东 济南 250100,中国
    2. 聊城大学 物理科学与信息工程学院,山东 聊城 252000,中国
    3. 山东省农业科学院畜牧兽医研究所,山东 济南 250100,中国
  • 收稿日期:2025-02-12 出版日期:2025-05-22
  • 基金项目:
    国家重点研发计划项目(2024YFD1300600); 山东省重点研发计划项目(2022TZXD0013); 泰山产业领军人才工程专项经费; 烟台市科技计划项目(2023ZDCX024)
  • 作者简介:

    韩 宇,硕士研究生,研究方向为深度学习农业应用。E-mail:

  • 通信作者:
    郑纪业,博士,副研究员,研究方向智慧农业。E-mail:

A Lightweight Cattle Facial Recognition Method Based on Improved YOLOv11

HAN Yu1,2, QI Kangkang1, ZHENG Jiye1,2(), LI Jinai1,2, JIANG Fugui3, ZHANG Xianglun3, YOU Wei3, ZHANG Xia2   

  1. 1. Institute of Agricultural Information and Economics, Shandong Academy of Agricultural Sciences, Ji'nan 250100, Shandong, China
    2. School of Physics Science and Information Engineering, Liaocheng University, Liaocheng 252000, Shandong, China
    3. Institute of Animal Science and Veterinary Medicine, Shandong Academy of Agricultural Sciences, Ji'nan 250100, China
  • Received:2025-02-12 Online:2025-05-22
  • Foundation items:National Key R&D Program of China(2024YFD1300600); Key R&D Program of Shandong Province, China(2022TZXD0013); Taishan Industry Leading Talents Program of Shandong Province; Science and Technology Plan Project of Yantai City(2023ZDCX024)
  • About author:

    HAN Yu, E-mail:

  • Corresponding author:
    ZHENG Jiye, E-mail:

摘要:

[目的/意义] 牛只个体的精准识别是现代化畜牧业发展的关键需求,也是推进肉牛精细化管理与高效生产的基础。基于面部特征的精准识别技术对推动畜牧业智能化发展具有重要研究价值和应用前景。针对牛脸识别准确性与效率提升需求,本研究提出一种基于改进YOLOv11的轻量级牛脸识别模型YOLO-PCW。 [方法] 将部分卷积(PConv)设计融合C3K2,借助PConv对特征图的独特卷积特性,在保障识别精度稳定的同时大幅削减模型计算量,以适配实际快速处理场景,此外,引入CBAM注意力机制,引导模型聚焦牛脸关键部位如牛眼、口鼻等,精准捕捉细微特征,显著提升检测精度。采用WIoU损失函数取代CIoU,重新优化目标框定位误差衡量模式,合理分配不同类型误差权重,进一步精细模型训练过程,使牛脸检测框更为精准。 [结果和讨论] 经实验验证,YOLO-PCW模型的准确率P达到了96.4%,召回率R达到96.7%,平均精度均值达到98.7%,其参数量、计算量分别为2.3 M、5.6 GFLOPs。与YOLOv11相比,YOLO-PCW不仅在准确率、召回率、平均精度分别提升了3.6、5、4.4个百分点,同时还将浮点计算量和参数量大小分别降低至原模型的88.9%和88.5%。消融实验表明,CBAM模块使精确率从92.8%提升至95.2%,WIoU优化目标定位精度,精确率提升至93.8%,PConv模块将计算量从6.3 GFLOPs降至5.5 GFLOPs,大幅减少了模型的计算量。多组件协同配合,为牛脸识别模型性能的提升提供了有力支持。将改进后的YOLO-PCW与Faster-RCNN、SSD、YOLOv5、YOLOv7-tiny、YOLOv8算法在相同的条件下进行比对,YOLO -PCW模型优势最为突出,能够兼顾识别精度与运算效率,实现计算资源的高效利用。 [结论] 提出的YOLO-PCW模型不仅提升了检测精度,还降低了模型的部署难度,可在实际生产环境中精准实现牛脸识别,为动物福利养殖、牧场智能化管理等多种场景提供一种可行的个体精准识别方案。

关键词: 深度学习, YOLOv11, 肉牛个体识别, 牛脸识别

Abstract:

[Objective] Beef cattle breeding stands as a pivotal element in contemporary animal husbandry, with precise individual identification serving as the cornerstone for the advancement of automated technologies, including intelligent weight measurement, body condition scoring, body conformation assessment, and behavior monitoring. However, the actual breeding environment is fraught with challenges such as soiled conditions, intricate backgrounds, and the constant movement of animals, which contribute to the high variability of cattle face data features. Additionally, the effects of inconsistent lighting and diverse shooting angles can lead to blurred key features, increasing the risk of misjudgment during the detection process. In light of these challenges, an improved model named YOLO-PCW, built upon the YOLOv11 algorithm, was introduced to enhance the detection performance while preserving a lightweight structure to address the complexities of precise cattle face recognition in challenging breeding environments. [Methods] The research leveraged the cow fusion dataset (CFD), a comprehensive collection of real-world cattle face images captured under variable lighting conditions, from multiple angles, and against complex backgrounds, for the purpose of model training and validation. Concurrently, a custom cow monitor dataset (CMD) was created from video footage obtained through the Zhaoyuan Qingyangbao Breeding Farm's monitoring system, providing a robust basis for evaluating the model's generalization capabilities. The YOLOv11 architecture served as the foundational framework for implementing the following performance improvements. The partial convolution (PConv) was seamlessly integrated into the C3K2 module within the YOLOv11 head network. Utilizing the sparse convolutional properties of PConv on the feature maps, the convolutional structure was meticulously optimized, reduceing computational redundancy and memory access while preserving the model's accuracy—rendering it highly suitbale for real-time applications. Additionally, the convolutional block attention module (CBAM) was incorporated to enhance feature map processing through adaptive channel-wise and spatial attentions. This refinement enabled precise extraction of target regions by mitigating background interference, allowing the model to focus on critical anatomical features such as the eyes, mouth, and nose. Furthermore, the weighted intersection over union (WIoU) loss function was adopted to replace the CIoU, optimizing the weighted strategy for bounding box regression errors. This innovation reduced the adverse effects of large or outlier gradients in extreme samples, enabling the model to prioritize average-quality samples for refinement. The resulting improvment in key region localization accuracy bolstered the model's generalization capability and overall performance, establishing a state-of-the-art cattle face recognition framework. [Results and Discussion] The YOLO-PCW model achieved a remarkable accuracy rate (P) of 96.4%, a recall rate (R) of 96.7%, and a mean average precision (mAP) of 98.7%. With a parameter count of 2.3 M and a computational load of 5.6 GFLOPs, the YOLO-PCW not only improved accuracy, recall, and mean average precision by 3.6, 5, and 4.4 percentage point respectively, but also achieved a significant reduction in floating-point computational load and parameter size, down to 88.9% and 88.5% of the original model, respectively. Ablation studies revealed that the CBAM module enhanced precision from 92.8% to 95.2%. The WIoU loss function optimized target positioning accuracy, achieving a precision of 93.8%. The PConv module contributed to a substantial reduction in computational load from 6.3 GFLOPs to 5.5 GFLOPs, thereby significantly lightening the model's computational burden. The synergistic collaboration of these multiple components provided robust support for enhancing the performance of the cattle face recognition model. Comparative experiments demonstrated that the YOLO-PCW model, when benchmarked against algorithms such as Faster-RCNN, SSD, YOLOv5, YOLOv7-tiny, and YOLOv8 under identical conditions, exhibited the most outstanding performance, effectively balancing recognition accuracy with computational efficiency and achieving optimal utilization of computational resources. [Conclusions] The improved YOLO-PCW model, with its lightweight architecture and optimized attention mechanism, could successfully improve detection accuracy while simplify deployment. It is capable of delivering precise cattle face recognition in real-world breeding environments, offering an efficient and practical solution for individual identification in applications such as animal welfare breeding, intelligent ranch management, smart ranch construction, and animal health monitoring.

Key words: deep learning, YOLOv11, cattle individual identification, cattle facial recognition

中图分类号: