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

Smart Agriculture ›› 2024, Vol. 6 ›› Issue (4): 91-102.doi: 10.12133/j.smartag.SA202312027

• 专题--智慧畜牧技术创新与可持续发展 • 上一篇    下一篇

基于改进YOLOv8n-pose和三维点云分析的蒙古马体尺自动测量方法

李明煌1,2, 苏力德1,2, 张永1,2(), 宗哲英1,2, 张顺3   

  1. 1. 内蒙古农业大学 机电工程学院,内蒙古 呼和浩特 010018,中国
    2. 牧草饲料生产全程智能化装备内蒙古自治区工程研究中心,内蒙古 呼和浩特 010018,中国
    3. 内蒙古自治区巴彦淖尔市现代农牧事业发展中心,内蒙古 巴彦淖尔 015001,中国
  • 收稿日期:2023-12-28 出版日期:2024-07-30
  • 基金项目:
    国家自然科学基金(32360856); 内蒙古自治区自然科学基金(2022QN03019); 内蒙古自治区高等学校创新团队(NMGIR T2312); 内蒙古农业大学高层次人才引进科研启动项目(NDYB2020-21)
  • 作者简介:
    李明煌,研究方向为机电控制系统及智能技术。E-mail:
  • 通信作者:
    张 永,博士,教授,研究方向为数字化装备及自动控制技术。E-mail:

Automatic Measurement of Mongolian Horse Body Based on Improved YOLOv8n-pose and 3D Point Cloud Analysis

LI Minghuang1,2, SU Lide1,2, ZHANG Yong1,2(), ZONG Zheying1,2, ZHANG Shun3   

  1. 1. College of Mechanical and Electronic Engineering, Inner Mongolia Agriculture University, Hohhot 010018, China
    2. Inner Mongolia Engineering Research Center of Intelligent Equipment for the Entire Process of Forage and Feed Production, Hohhot 010018, China
    3. Bayannur Modern Agriculture and Animal Husbandry Development Center of Inner Mongolia, Bayannur 010051, China
  • Received:2023-12-28 Online:2024-07-30
  • Foundation items:National Natural Science Foundation of China(32360856); Inner Mongolia Autonomous Region Natural Science Foundation(2022QN03019); Science and Technology Innovation Project of Higher Education Team in Inner Mongolia Autonomous Region(NMGIR T2312); Research Initiation Program for the Introduction of High-level Talents in Inner Mongolia Agricultural University(NDYB2020-21)
  • About author:
    LI Minghuang, E-mail:
  • Corresponding author:
    ZHANG Yong, E-mail:

摘要:

[目的/意义] 准确高效地获取马匹体尺信息是马产业现代化进程中的关键环节。传统的人工测量方法耗时长、工作量大,且会对马匹造成一定应激反应。因此,实现准确且高效的体尺参数自动测量对于制定蒙古马早期育种计划至关重要。 [方法] 选择Azure Kinect深度相机获取蒙古马双侧RGB-D数据,以YOLOv8n-pose为基础,通过在C2f模块中引入可变形卷积(Deformable Convolution v2, DCNv2),同时添加洗牌注意力机制(Shuffle Attention, SA)模块和优化损失函数(SCYLLA-IoU Loss, SIoU)的方法,利用余弦退火法动态调整学习率,提出一种名为DSS-YOLO(DCNv2-SA-SIoU-YOLO)的模型用于蒙古马体尺关键点的检测。其次,将RGB图中的二维关键点坐标与深度图中对应深度值相结合,得到关键点三维坐标,并实现蒙古马点云信息的转换。利用直通滤波、随机抽样一致性(Random Sample Consensus, RANSAC)、统计离群值滤波、主成分分析法(Principal Component Analysis, PCA)完成点云处理与分析。最终根据关键点坐标自动计算体高、体斜长、臀高、胸围和臀围5项体尺参数。 [结果和讨论] DSS-YOLO的平均关键点检测精度为92.5%;dDSS为7.2个像素;参数量和运算量分别仅为3.48 M和9.1 G。体尺参数自动测量结果与人工测量值相比,各项体尺参数的整体平均绝对误差为3.77 cm;平均相对误差为2.29%。 [结论] 研究结果可为蒙古马运动性能相关遗传参数的确定提供技术支撑。

关键词: 蒙古马, 体尺测量, 卷积神经网络, 注意力机制, 三维点云处理, YOLOv8n-pose

Abstract:

[Objective] There exist a high genetic correlation among various morphological characteristics of Mongolian horses. Utilizing advanced technology to obtain body structure parameters related to athletic performance could provide data support for breeding institutions to develop scientific breeding plans and establish the groundwork for further improvement of Mongolian horse breeds. However, traditional manual measurement methods are time-consuming, labor-intensive, and may cause certain stress responses in horses. Therefore, ensuring precise and effective measurement of Mongolian horse body dimensions is crucial for formulating early breeding plans. [Method] Video images of 50 adult Mongolian horses in the suitable breeding stage at the Inner Mongolia Agricultural University Horse Breeding Technical Center was first collected. Fifty images per horse were captured to construct the training and validation sets, resulting in a total of 2 500 high-definition RGB images of Mongolian horses, with an equal ratio of images depicting horses in motion and at rest. To ensure the model's robustness and considering issues such as angles, lighting, and image blurring during actual image capture, a series of enhancement algorithms were applied to the original dataset, expanding the Mongolian horse image dataset to 4 000 images. The YOLOv8n-pose was employed as the foundational keypoint detection model. Through the design of the C2f_DCN module, deformable convolution (DCNV2) was integrated into the C2f module of the Backbone network to enhance the model's adaptability to different horse poses in real-world scenes. Besides, an SA attention module was added to the Neck network to improve the model's focus on critical features. The original loss function was replaced with SCYLLA-IoU (SIoU) to prioritize major image regions, and a cosine annealing method was employed to dynamically adjust the learning rate during model training. The improved model was named DSS-YOLO (DCNv2-SA-SIoU-YOLO) network model. Additionally, a test set comprising 30 RGB-D images of mature Mongolian horses was selected for constructing body dimension measurement tasks. DSS-YOLO was used for keypoint detection of body dimensions. The 2D keypoint coordinates from RGB images were fused with corresponding depth values from depth images to obtain 3D keypoint coordinates, and Mongolian horse's point cloud information was transformed. Point cloud processing and analysis were performed using pass-through filtering, random sample consensus (RANSAC) shape fitting, statistical outlier filtering, and principal component analysis (PCA) coordinate system correction. Finally, body height, body oblique length, croup height, chest circumference, and croup circumference were automatically computed based on keypoint spatial coordinates. [Results and Discussion] The proposed DSS-YOLO model exhibited parameter and computational costs of 3.48 M and 9.1 G, respectively, with an average accuracy mAP0.5:0.95 reaching 92.5%, and a dDSS of 7.2 pixels. Compared to Hourglass, HRNet, and SimCC, mAP0.5:0.95 increased by 3.6%, 2.8%, and 1.6%, respectively. By relying on keypoint coordinates for automatic calculation of body dimensions and suggesting the use of a mobile least squares curve fitting method to complete the horse's hip point cloud, experiments involving 30 Mongolian horses showed a mean average error (MAE) of 3.77 cm and mean relative error (MRE) of 2.29% in automatic measurements. [Conclusions] The results of this study showed that DSS-YOLO model combined with three-dimensional point cloud processing methods can achieve automatic measurement of Mongolian horse body dimensions with high accuracy. The proposed measurement method can also be extended to different breeds of horses, providing technical support for horse breeding plans and possessing practical application value.

Key words: Mongolian horse, body measurements, convolutional neural network, attention mechanism, 3D point cloud processing, YOLOv8n-pose