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.