中国猪业 ›› 2024, Vol. 19 ›› Issue (1): 73-83.doi: 10.16174/j.issn.1673-4645.2024.01.011

• 数智化设备工艺 • 上一篇    下一篇

基于YOLOv5模型的仔猪社交识别方法研究

冯兴尧,王海峰,朱君,孙想,邱阳,李斌   

  • 出版日期:2024-03-04 发布日期:2024-03-04

  • Online:2024-03-04 Published:2024-03-04

摘要: 精准识别仔猪间社交关系对了解仔猪内部社交和预警异常仔猪具有重要意义。针对传统方法在仔猪社交识别时存在的人工依赖多、劳动强度大、观测效率低等问题,本研究借助机器视觉与深度学习技术,提出了一种基于改进的YOLOv5模型的仔猪社交识别研究方法。该研究以9头30~35日龄群养的长白二元杂交仔猪为研究对象,从顶部视角连续采集视频数据,经图像截取与数据增强共获得13 389张图像作为数据集。首先,选取Faster R-CNN、SSD、YOLOv4和YOLOv5这4种典型目标检测算法对数据集进行训练,通过对比分析,确定用于仔猪个体身份识别最优模型;然后依据K-means聚类算法确定仔猪社交中心,通过计算仔猪与社交中心的欧氏距离量化仔猪社交值,利用位置信息构建仔猪社交网络,绘制仔猪运动轨迹,获得社交正常与社交异常仔猪的识别阈值;最后,利用该闼值对仔猪进行分类,识别社交异常仔猪个体并实现预警。经测试,改进的YOLOv5对群养仔猪个体身份识别的平均精度均值达99.29%,模型大小为13.71 MB,满足仔猪身份识别需求,与YOLOv5、YOLOV4、SSD和Faster R-CNN模型相比,改进的YOLOv5平均精度均值分别提高了0.26、1.97、12.74和4.31个百分点。通过统计仔猪社交值均值变化情况,发现正常与异常仔猪社交值均值差异明显,正常仔猪社交值均值范围[0.259~0.351],异常仔猪社交值均值范围[0.402~0.441]。试验确定0.4为最佳社交判别阈值。该研究可为仔猪社交行为智能识别与异常早期预警提供方法参考。

关键词: 仔猪, Y0L0v5, K-means, 社交, 深度学习

[1] 张建龙, 庄晏榕, 周康, 等. 基于机器视觉的育肥猪分群系统设计与试验[J]. 农业工程学报, 2020, 36(17):174-181. Zhang JL, Zhuang YR, Zhou K, et al. Design of automatic group sorting system for fattening pigs based on machine vision [J]. Transactions of the Chinese Society of Agricultural Engineering, 2020, 36(17):174-181. [2] Li YZ, Zhang HF, Lee J, et al. Understanding Tail-Biting in pigs through social network analysis [J]. Animals an Open Access Journal from Mdpi, 2018, 8(1):13. [3] Diane W, Nicole K, Eckhard S, et al. Characterisation of sows' postures and posture changes with regard to crushing piglets [J]. Applied Animal Behaviour Science, 2009, 119 (1-2):49-55. [4] Alonso-Spilsbury M, Ramirez-Necoechea R, Gonzlez-Lozano M, et al. Piglet survival in early lactation: a review[J]. Journal of Animal and Veterinary Advances, 2007, 6(1):76-86. [5] Skok J, Skorjanc D. Group suckling cohesion as aprelude to the formation of teat order in piglets[J]. Applied Animal Behaviour Science, 2014(154):15-21. [6] 张相鑫, Birgitte Ask. 通过育种改良猪的社交行为[J]. 国外畜牧学(猪与禽), 2021, 41(5):4-6. Zhang XX, Birgitte Ask. Breeding for improved social behaviour[J]. Animal Science Abroad(Pigs and Poultry), 2021, 41(5):4-6. [7] 张振玲, 石丰运, Salazar LC, 等. “仔猪早期社会化”——规模猪场提高仔猪社交技能的策略[J]. 猪业科学, 2020, 37(3):27-31. Zhang ZL, Shi FY, Salazar LC, et al. "Early socialization of piglets"——a strategy for large-scale pig farms to improve piglets' social skills[J]. Swine Industry Science, 2020, 37(3):27-31. [8] Kauppinen T, Vesala KM, Valros A. Farmer attitude toward improvement of animal welfare is correlated with piglet production parameters[J]. Livestock Science, 2012, 143(2-3):142-150. [9] Vigors B, Wemelsfelder F, Lawrence A B. What symbolises a "good farmer" when it comes to farm animal welfare[J]. Journal of Rural Studies, 2023(98):159-170. [10] Kathrin B, Scheffler K, Irena C, et al. Network characteristics and development of social structure of agonistic behaviour in pigs across three repeated rehousing and mixing events [J]. Applied Animal Behaviour Science, 2015(168):24-30. [11] 孙钰, 周焱, 袁明帅, 等. 基于深度学习的森林虫害无人机实时监测方法[J]. 农业工程学报, 2018, 34(21):74-81. Sun Y, Zhou Y, Yuan MS, et al. UAV real-time monitoring for forest pestbased on deep learning [J]. Transactions of the Chinese Society of Agricultural Engineering, 2018, 34(21):74-81. [12] Krizhevsky A, Sutskever I, Hinton G. ImageNet classification with deep convolutional neural networks [J]. Advances in Neural Information Processing Systems, 2012, 25(2):1097-1105. [13] Ren S, He K, Girshick R, et al. Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis & Machine Intelligence, 2017, 39(6):1137-1149. [14] Zeiler MD, Fergus R. Visualizing and understanding convolutional networks[C]// In: ECCV 2014, 2014. [15] Zhang Z, Fidler S, Urtasun R. Instance-level segmentation for autonomous driving with deep densely connected MRFs[J]. Computer Science, 2015. doi: 10.1007/978-3-319-46466-4_19. [16] Shao HM, Pu JY, Mu J. Pig-posture recognition based on computer vision: dataset and exploration[J]. Animals, 2021, 11(5):1295. [17] Zheng C, Zhu XM, Yang XF, et al. Automatic recognition of lactating sow postures from depth images by deep learning detector[J]. Computers and Electronics in Agriculture, 2018(147):51-63. [18] Shao B, Xin H. A real-time computer vision assessment and control of thermal comfort for group-housed pigs[J]. Computers and Electronics in Agriculture, 2008, 62(1):15-21. [19] Nasirahmadi A, Sturm B, Olsson AC, et al. Automatic scoring of lateral and sternal lying posture in grouped pigs using image processing and support vector machine [J].Computers and Electronics in Agriculture, 2019(156):475-481. [20] Xu J, Zhou S, Xia F, et al. Research on the lying pattern of grouped pigs using unsupervised clustering and deep learning[J]. Livestock Science, 2022(260):260. [21] Shin Y, Balasingham I. Comparison of hand-craft feature based SVM and CNN based deep learning framework for automatic polyp classification [J]. Conference of the IEEE Engineering in Medicine and Biology Society, 2017:3277-3280. [22] Wang Z, Bovik AC, Sheikh HR, et al. Image quality assessment: from error visibility to structural similarity [J]. IEEE Transactions on Image Processing, 2004, 13(4):600-612. [23] Wang CY, Bochkovskiy A, Liao HYM. YOLOv7:Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C]// In: arXiv.arXiv, 2022. [24] Durve M, Orsini S, Tiribocchi A, et al. Benchmarking YOLOv5 and YOLOv7 models with DeepSORT for droplet tracking applications[J]. The Europen Physical Journal E-Soft Matter, 2023. doi: 10.48550/arXiv.2301.08189. [25] Abdulnassar AA, Nair Latha R. Performance analysis of K-means with modified initial centroid selection algorithms and developed K-means9+ model [J]. Measurement: Sensors, 2023(25):100666. [26] Veit C, Foister S, Valros A, et al. The use of social network analysis to describe the effect of immune activation on group dynamics in pigs[J]. Animal, 2021, 15(9):100332. [27] Redmon J, Divvala S, Girshick R, et al. You only look once: unified, real-time object detection [C]// In: Computer Vision & Pattern Recognition.IEEE, 2016. [28] Wahjuni S, Wulandari, Nurarifah H. Faster RCNN based leaf segmentation using stereo images[J]. Journal of Agriculture and Food Research, 2023(11):100514. [29] Liu W, Anguelov D, Erhan D, et al. SSD: single shot multibox detector[C]// In: European conference on computer vision. Springer, Cham, 2016:21-37. [30] Bochkovskiy A, Wang CY, Liao HYM. YOLOv4: optimal speed and accuracy of object detection[J]. ArXiv. 2020. doi: 10.48550/arXiv.2004.10934. [31] 李晶, 顾宪红. 猪的异常行为与其福利水平[J]. 中国畜牧兽医, 2008, 35(7):141-145. Li J, Gu XH. The observation of abnormal behavior for assessing the animal welfare in pigs[J]. China Animal Husbandry & Veterinary Medicine, 2008, 35(7):141-145.
[1] 李雨菁,郝瑞荣. 葡萄籽原花青素对不同生长阶段猪生长性能的影响[J]. 中国猪业, 2024, 19(1): 19-24.
[2] 赵勤辉,许婷婷,刘家,汤海鸥. 复合营养性膏剂对新生仔猪生长性能的影响[J]. 中国猪业, 2024, 19(1): 25-31.
[3] 尹令,罗泗港,吴珍芳,蔡更元,沈卓婷,李钦萍,周润林. 基于点代理增强和逐层上采样的猪体点云补全方法[J]. 中国猪业, 2024, 19(1): 84-89.
[4] 殷林. 复合益生菌对仔猪生长性能的影响[J]. 中国猪业, 2023, 18(6): 50-52.
[5] 宋凤香,吕延飞,宋开山,刘洋,张敏,肖建森. 一种包衣丁酸钠的制备及对断奶仔猪生产性能的影响[J]. 中国猪业, 2023, 18(6): 53-56.
[6] 张俊艳. γ-氨基丁酸对断奶仔猪机体抗氧化功能的影响[J]. 中国猪业, 2023, 18(6): 60-62.
[7] 陈坚修, 冼理权. 发酵豆粕对仔猪生长性能的影响[J]. 中国猪业, 2023, 18(6): 67-69.
[8] 高艳霞. 苍术提取物对仔猪生长性能的影响[J]. 中国猪业, 2023, 18(6): 70-72.
[9] 王晓艳. 仔猪源链球菌分离鉴定与耐药性试验[J]. 中国猪业, 2023, 18(6): 138-141.
[10] 陈新湖. 仔猪副猪嗜血杆菌的分离鉴定及耐药性检测[J]. 中国猪业, 2023, 18(6): 142-145.
[11] 宋鑫伟. 不同添加量的复合有机酸对仔猪养分表观消化率的影响[J]. 中国猪业, 2023, 18(5): 52-54.
[12] 杜海涛. 不同缬氨酸添加量对哺乳母猪生产性能的影响[J]. 中国猪业, 2023, 18(5): 59-62,66.
[13] 林峰. 复合酸化剂对断奶仔猪抗氧化能力的影响[J]. 中国猪业, 2023, 18(5): 63-66.
[14] 王永生. 丝兰提取物对仔猪养分表观消化率的影响[J]. 中国猪业, 2023, 18(5): 67-69.
[15] 郑智伟,曹立明,郭伟,闫之春. 给低初生重仔猪补饲代乳品对其断奶重的影响[J]. 中国猪业, 2023, 18(4): 61-65.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!