中国农业大学学报2025,Vol.30Issue(5):179-189,11.DOI:10.11841/j.issn.1007-4333.2025.05.15
改进YOLOv5s后的轻量化猪只姿态识别方法
Lightweight pig posture recognition method after improving YOLOv5s
摘要
Abstract
To address the issues of low accuracy,high model complexity,and slow detection speed that existed in current pig posture recognition tasks,a lightweight pig pose recognition method is proposed in this study.This method applies the performance-aware global channel pruning algorithm to the YOLOv5s model,identifies and removes redundant or less contributions to performance in the original model,and performs parameter adjustment compensation optimization on the pruned model.The results indicate that:The YOLOv5s-prune model achieved an average precision value(mAP0.5)of 94.7%at an intersection over union(IoU)threshold of 0.5,and reached an average precision mean(mAP0 5-0 95)of 84.6%with multiple IoU thresholds set at intervals of 0.05 between[0.5,0.95],which were 0.8%and 0.4%higher compared to the original YOLOv5s model,respectively.Furthermore,the number of parameters and the number of floating-point operations per second(FLOPs)were 3.9×106 and 10.9×109,respectively,which were 3.1× 106 and 5.3×109 lower than those of the original YOLOv5s model;The model achieved an inference speed of 3.6 ms,representing an improvement of 1.1 ms over the original model.Compared to other object detection models including Faster R-CNN,CenterNet,YOLOv3-SPP,YOLOXs,YOLOv8s,YOLOv10s and YOLOv11s,the model constructed in this study reduced the parameter count by 132.8×106,28.2×106,100.8×106,5.0×106,7.2×106,4.2×106 and 5.5×106,decreased the FLOPs by 143.9×109,79.4×109,2 72.9×109,16.3×109,18×109,14.3×109 and 11.1×109,improved the detection time of each graph by 25.4,20.4,35.2,1.5,3.9,4.2 and 1.8 ms,respectively.The detection performance of the model was better than that of YOLOv5 s in the scenario of feeding 12,8 and 6 pigs in a single column.In summary,the proposed method not only reduces model parameters and computational complexity but also enhances detection speed and recognition accuracy.Therefore,the new method presented in this study effectively meets the requirements of pig posture recognition in practical pig farming scenarios.关键词
猪/姿态行为识别/深度学习/通道剪枝Key words
pig/posture behavior recognition/deep learning/channel pruning分类
农业科技引用本文复制引用
葛绍娟,冀横溢,詹宇,李修松,郑炜超,王涛..改进YOLOv5s后的轻量化猪只姿态识别方法[J].中国农业大学学报,2025,30(5):179-189,11.基金项目
2023青岛市科技惠民示范专项(23-2-8-xdny-3-nsh) (23-2-8-xdny-3-nsh)
山东省重点研发计划(2022S1203-00337) (2022S1203-00337)