首页|基于改进Yolov5模型的纱筒余纱量检测方法

基于改进Yolov5模型的纱筒余纱量检测方法

扫码查看
为实现针织圆纬机纱架上纱筒余纱量的实时检测,提出一种深度学习与传统图像处理相结合的检测方法.通过优化Yolov5 的主干网络并加入Shuffle-Attention注意力机制,利用改进后模型在图像中检测并框出纱筒位置;然后利用透视变换、均值偏移、canny轮廓检测、闭操作等处理获取纱筒内外圆轮廓,设计基于梯度下降的圆拟合算法,拟合纱筒内外圆的轮廓,得到纱筒的内外圆半径;最后结合小孔成像的原理完成纱筒余纱量的测量.结果表明:改进后的Yolov5 模型在纱筒检测精度上达到 99.5%,检测速度可达 20 帧/s,同时模型参数减少至3.255×106可检测的最小纱筒余纱量为 3 mm,当纱筒余纱量小于 3mm后,将其视为空筒,进行延时更换.本文算法拟合圆所花费时间是传统霍夫圆检测算法的 1/4 左右,因此可满足针织车间的实际应用需求.
Detection method for residual yarn quantity based on improved Yolov5 model
Objective In the automatic production line of circular weft machines in knitting workshops,the identification of the residual yarn quantity of the spindle was the prerequisite and key to realizing the automatic loading and unloading of the spindle.The detection result of spindle residual amount was easily affected by many factors,such as background spindle,spindle type,yarn crease structure and so on.In order to ensure the accuracy and real-time performance of the information of spindle residual yarn quantity of yarn frame,a machine vision-based online detection technology of spindle residual yarn quantity was studied.Method The improved Yolov5 model was adopted to detect the residual yarn quantity in a spindle,and the intercepted end picture of the spindle is extracted through perspective transformation,pixel average,contour detection and other operations to extract the inner and outer circle contours of the spindle.The circle fitting algorithm based on gradient descent designed in this paper was then adopted to fit the inner and outer circles of the spindle and obtain the inner and outer circle radii of the spindle.Finally,the principle of small-hole imaging was adopted to convert the pixel difference of the spindle into the actual residual yarn quantity.Results In terms of model recognition,performance comparison of the three models showed that the model accuracy could be improved by 0.24%simply by improving the Yolov5 backbone network,and the accuracy could be further enhanced by 0.27%by incorporating the Shuffle-Attention mechanism.As for residual yarn quantity detection,detecting the residual yarn quantity demonstrated that the detection error of this algorithm was less than 3 mm,outperforming the Hough circle algorithm.With regards to the dataset,in order to cater to the practical production needs of factories,this paper created a dataset comprising spindles from the actual production process of factories.Conclusion A method combining the improved Yolov5 with conventional image processing was proposed for sindle residual yarn quantity detection in the automated production line of circular weft machines.First,the spindle image was segmented using the enhanced Yolov5 model.Then,the segmented spindles image was processed by perspective transformation and end-face pixel averaging to effectively extract the inner and outer circular contours of the spindle.The circle fitting algorithm designed in this paper was utilized to fit the inner and outer circles of the spindle to complete the calculation of the residual yarn quantity the spindle.The improved YOLOv5 residual yarn quantity detection algorithm for spindle utilized an enhanced network structure and dataset.Therefore,it could be effectively applied to the on-line detection of residual yarn quantity in the spindle.It provided ideas for future applications in embedded devices.

improved Yolov5 modelperspective transformationmean shiftgradient descent methodspindle residual yarn quantitycircular lenitting machine

史伟民、李洲、陆伟健、屠佳佳、徐寅哲

展开 >

浙江理工大学 浙江省现代纺织装备技术重点实验室,浙江 杭州 310018

浙江机电职业技术学院 自动化学院,浙江 杭州 310053

改进Yolov5模型 透视变换 均值偏移 梯度下降法 纱筒余纱量 针织圆纬机

国家重点研发计划资助项目

2017YFB1304000

2024

纺织学报
中国纺织工程学会

纺织学报

CSTPCD北大核心
影响因子:0.699
ISSN:0253-9721
年,卷(期):2024.45(7)