| Assuring the quality of printed products has always been an important part during production.How to achieve timely detection of defects in printed products is a key concern for many companies and academics,and the integrity of printed products is a key factor in ensuring the smooth running of the entire production line in the print shop.However,due to vibration of mechanical parts,air particles and other factors,scratch defects can appear on the surface of printed products,which can have a negative impact on subsequent production.The current scratch detection method for printed products is mostly manual,which has problems such as high cost,low efficiency and subjectivity.Therefore,in this thesis,based on deep learning,an industrial camera is used to collect the scratch defect image data of printed products,pre-process the images,and then build an improved Faster-RCNN model,and the specific research contents are as follows:(1)Acquisition and pre-processing of scratch detection data of printed products.421 scratch defect images were collected using an industrial camera on the production floor of a flexible packaging printing company.The image data was formatted and manually annotated based on the characteristics and format requirements of the deep learning trained dataset.The scratch defect detection dataset was produced,and the data was expanded by combining data enhancement methods such as panning,rotation,mirroring,binarisation and greyscaling,median filtering and Canny operator,and finally the sample dataset was expanded to 13,893.(2)An improved Faster-RCNN scratch detection model for printed products was constructed,which is a combination of Fast-RCNN model and RPN network,and the use of RPN network instead of selective search improves the efficiency of generating candidate regions.For the characteristics that scratches in printed products are mostly small targets,this thesis makes the following improvements to the Faster-RCNN model:the traditional VGG16 is replaced by the Resnet50 network,which solves the problems of gradient dispersion and accuracy reduction caused by the deepening of the number of network layers;as the RPN network maps the pixel points contained in the feature map to the original map to generate anchor frames,the anchor frames in the original FasterThe anchor frame in the original Faster-RCNN model is obtained based on the public dataset,which is not consistent with the defective features of the printed product scratch,so the k-means++ clustering algorithm is used to regenerate the anchor frame suitable for the scratch features of the printed product to improve the detection accuracy;in addition,the Mish activation function is introduced instead of the ReLU function,which is smoother and has a slight negative gradient compared to the ReLU function.This results in a better gradient flow,which performs better in terms of accuracy and stability.(3)In order to verify the effectiveness of the improved model for the detection of scratch defects in printed products,experimental validation was conducted.Firstly,a deep learning model training environment was built,with average accuracy and loss function as evaluation metrics;the model was trained using transfer learning techniques,and the parameters obtained from the original model trained on the public dataset were applied to the improved Faster-RCNN model.The model is then continuously trained iteratively using the processed dataset.Finally,the completed improved Faster-RCNN model is compared with YOLOv4,the original Faster-RCNN.The improved Faster-RCNN model obtained detection results that met the requirements,and its average accuracy was better than that of the YOLOv4 model and the original Faster-RCNN model,and the loss of the improved Faster-RCNN model was substantially reduced compared with that of the YOLOv4 model and the original Faster-RCNN model. |