Since surface defects of printed matter will greatly reduce the quality of printed matter and manual detection of defects is very time-consuming,the efficient and automatic detection of surface defects of printed matter is of high value to the printing industry.Defect detection algorithms based on deep learning have been greatly developed in recent years,and their performance far exceeds that of traditional algorithms.However,the depth-based detection method requires a large amount of manually labeled data for model training.But,in the actual production process,the defective rate of products is very low,which makes it difficult for us to collect a sufficient number of positive samples of defects for model training and the process of labeling defect positive samples consumes a lot of manpower and time,and the economic cost is unacceptable.Therefore,the goal of this paper is to use only defect-free high-resolution images to complete the surface defect detection of printed matter,which can save the cost of collecting and labeling positive samples of defects,so that the algorithm can be quickly deployed in actual production.The main work is as follows:First of all,aiming at the problem that the traditional cropping method will cause the pattern of different sizes in the high-resolution image to be cropped out of the uneven number of slices,an end-to-end cropping method for high-resolution images(image level)is designed.Secondly,since the defects on the surface of the printed matter are often very small,the number of defective pixels is very different from the number of background pixels.For this reason,this paper designs a simple and effective loss function(TSO)to solve such quantity imbalance(pixel level).Aiming at the problem of missing real defect samples,this paper designs an algorithm for online real-time generation of defects.The algorithm directly generates defects on cropped defect-free images,and outputs pseudo-defect samples and defect masks for model training.In order to improve the segmentation effect of the model,this paper also designs a novel and effective semantic segmentation head(GST)based on the self-attention mechanism,which can use the global information to patch the defect detection results to obtain better detection results.However,due to the large occupation of GPU Memery(GM)in the training process of the GST segmentation head,and its poor performance in the overkilling rate.This paper designs a lightweight anchor-free object detection algorithm(LAFD)to uniformly crop the feature map of the backbone network and solves the problem of excessive memory usage of GPU and poor performance in overkilling rate.In the experimental part,in order to better evaluate the effect of the algorithm,this paper annotates a ZCC dataset of surface defects of printed matter,and uses the DAGM 2007 public dataset for evaluation.Experiments show that the series of algorithms proposed in this paper are effective,the feature-clipped GST achieves better performance in overkilling rate and escaping rate on our annotated dataset.Especially on the DAGM 2007 public dataset,GST without feature clipping achieves the best performance. |