Defect Detection of Spray Printed Variable Color 2D Code Based on ResNet34-TE
Addressing the defect characteristics of multicolor interference and the high complexity of spray-printed variable color 2D codes,along with the challenges of insufficient accuracy and low efficiency in current detection methods used by printing enterprises,this paper proposes a defect classification model by integrating ResNet34 and Transformer structure(ResNet34-TE).Initially,a color 2D code defect dataset is constructed,followed by the introduction of a contour shape detection method to identify the target region and mitigate background interference.ResNet34 serves as the backbone network for feature extraction.In a significant modification,the average pooling layer is omitted,and a Transformer encoder layer is employed to capture the global information of the extracted features,emphasizing the region of interest.Experimental results demonstrate that the accuracy of ResNet34-TE reaches 96.80%,with the average detection time for a single sheet reduced to 15.59 ms.This represents a 5.3 percentage points improvement in accuracy and a 5.8%enhancement in detection speed compared to the baseline model,outperforming classical models.Additionally,on the public defect detection dataset NEU-DET,the proposed model achieves an accuracy of 98.86%,surpassing mainstream defect classification algorithms.Consequently,the proposed model exhibits superior classification effectiveness in defect recognition.