Contrastive Representation Learning for Industrial Defect Detection
Defect detection in large-scale manufacturing aims to find defective components,such as damaged,misaligned compo-nents,and components with printing errors.Due to unknown defect types and shortage of defect samples,industrial defect detec-tion faces great challenges.To overcome the above difficulties,some methods utilize common visual representations from natural image datasets to extract generalized features for defect detection.However,there are distribution differences between the extrac-ted pre-trained features and the target data.Using this feature directly will lead to poor detection performance.Therefore,Con-Patch,a method based on contrastive representation learning is proposed.This method employs contrastive representation lear-ning to collect similar features or separate dissimilar features,resulting in goal-oriented representations of features.In order to solve the problem of lack of defect annotation,two similarity measures in data representations,pairwise similarity and global simi-larity,are used as pseudo labels.In addition,the method uses a lightweight memory bank and only stores the feature centers of all normal sample which are all defect-free sample in the memory bank,reducing the space complexity and the size of the memory bank.Finally,the normal features are brought closer to a hypersphere and the defect features are distributed outside the hyper-sphere to gather the normal features.Experimental results show that the I-AUROC and P-AUROC of the ConPatch model based on Wide-ResNet50 reaches 99.35%and 98.26%respectively in the industrial defect detection dataset MVTec AD.In the VisA dataset,I-AUROC and P-AUROC reaches 95.50%and 98.21%,respectively.The above results verify the effectiveness of the proposed model.