| During the production of cigarette products,various factors such as machine malfunctions and production conditions can lead to appearance quality issues such as wrinkling,twisting,deformation,punctures,stains,and more.Therefore,how to detect cigarette appearance defects quickly and accurately is of great significance to the guarantee of cigarette product quality.At present,the detection means of cigarette appearance defects mainly rely on traditional image processing and manual inspection.However,these methods have problems such as difficulty in identifying unknown defects,low detection efficiency and the detection results are easily affected by human factors.To address this problem,this thesis proposes a cigarette appearance quality detection method based on an improved YOLO deep learning model.The method not only can effectively improve the detection speed and accuracy,but also can obtain the detection ability of unknown defects through defect data training.The main work of this study includes the following three aspects:Construction of a dataset for cigarette appearance defects.Firstly,through data investigation and analysis of cigarette defect samples,combined with practical requirements,a total of 13 defect types related to cigarette appearance quality were defined,which is the defect type library covering the most cigarette appearance quality problem types among current relevant studies.Secondly,based on the defect type library,the cigarette appearance defect dataset in VOC format is constructed.At present,5150 defective pictures of a certain brand of cigarettes have been included,providing data support for the training of the deep learning model.Cigarette appearance defect detection based on YOLOv5.Based on the above defined dataset,the application of Faster R-CNN,SSD,YOLOv3,YOLOv5(n,s,m and l)and YOLOv7_tiny models in cigarette appearance defect detection was compared and analyzed.After model fine-tuning and parameter optimization,m AP_0.5 of YOLOv5 s reached 89.9%.Model optimization based on YOLOv5 s.In order to improve its application performance of YOLOv5 s and adapt to higher rate cigarette production in the future.The optimization is conducted from three aspects.Firstly,WIo U Loss is used to improve the loss function of the model.The experimental results show that the m AP_0.5 of the improved model is improved by 0.9%.Secondly,Coordinate Attention was introduced in YOLOv5 s to make the model pay more attention to the position information in cigarette appearance defects,and m AP_0.5 was increased by1.1%.Then,deformable convolutional networks integrated into the backbone network of YOLOv5 s to adapt the network to different scale defect types in cigarette defect types,and the improved model m AP_0.5 is enhanced by 1%.Finally,an optimal model combination WIo U+DCN was obtained through ablation experiment,and m AP_0.5 increased by 1.3%.Among the five types of defects whose detection accuracy is less than 90%,WIo U+CA is the combination with the largest improvement.The m AP_0.5 of these five types of defects is 85.9%,which is 2.7%higher than that of the original model.Among FZZ02 defects with the worst performance in the original model,the improved model has the most obvious improvement effect,with m AP_0.5 rose by 5.4%.In conclusion,this thesis focuses on practical application by utilizing a deep learning algorithm of computer vision to reduce the difficulty of appearance quality problem detection.The research is both advanced and highly applicable. |