Computer Science ›› 2025, Vol. 52 ›› Issue (1): 210-220.doi: 10.11896/jsjkx.240100202

• Computer Graphics & Multimedia • Previous Articles     Next Articles

Contrastive Representation Learning for Industrial Defect Detection

LUO Hangyu, WANG Xiaoping, MEI Meng, ZHAO Wenhao, LIU Sichun   

  1. School of Electronics and Information Engineering,Tongji University,Shanghai 200092,China
  • Received:2024-01-29 Revised:2024-06-25 Online:2025-01-15 Published:2025-01-09
  • About author:LUO Hangyu,born in 2000,postgra-duate.His main research interests include computer vision and industrial defect detection.
    WANG Xiaoping,born in 1965,Ph.D,professor.His main research interests include AI algorithms,deep learning and computer vision.
  • Supported by:
    National Key Research and Development Program of China(2022YFB4300504-4).

Abstract: Defect detection in large-scale manufacturing aims to find defective components,such as damaged,misaligned components,and components with printing errors.Due to unknown defect types and shortage of defect samples,industrial defect detection 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 extracted pre-trained features and the target data.Using this feature directly will lead to poor detection performance.Therefore,ConPatch,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 similarity,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 hypersphere 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.

Key words: Industrial product defect detection, Contrastive representation learning, Similarity measure, Memory bank, Hype-rsphere

CLC Number: 

  • TP391
[1]LUO D L,CAI Y X,YANG Z H,et al.A review of deep lear-ning methods for industrial defect detection [J].Chinese Science:Information Science,2022,52(6):1002-1039.
[2]DAVLETSHINA D,MELNYCHUK V,TRAN V,et al.Unsupervised anomaly detection for X-ray images[J].arXiv:2001.10883,2019.
[3]NGUYEN D T,LOU Z,KLAR M,et al.Anomaly detectionwith multiple-hypotheses predictions[C]//International Confe-rence on Machine Learning.2019:4800-4809.
[4]SAKURADA M,YAIRI T.Anomaly detection using autoenco-ders with nonlinear dimensionality reduction[C]//Proceedings of the MLSDA 2014 2nd Workshop on Machine Learning for Sensory Data Analysis.2014:4-11.
[5]PIDHORSKYI S,ALMOHSEN R,DORETTO G.Generativeprobabilistic novelty detection with adversarial autoencoders[C]//Advances in Neural Information Processing Systems.2018:6822-6833.
[6]SABOKROU M,KHALOOEI M,FATHY M,et al.Adversa-rially learned one-class classifier for novelty detection[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition.2018:3379-3388.
[7]ZHANG Y,CHEN X W,CHEN M D,et al.Unsupervised industrial surface anomaly detection using contrastive learning generative adversarial networks[J].Journal of Electronic Mea-surement and Instrumentation,2023,37(10):193-201.
[8]RUFF L,VANDERMEULEN R,GOERNITZ N,et al.Deepone-class classification[C]//Proceedings of the International Conference on Machine Learning.2018:4393-4402.
[9]PERERA P,PATEL V M.Learning deep features for one-class classification[J].IEEE Transactions on Image Processing,2019,28(11):5450-5463.
[10]YI J,YOON S.Patch svdd:Patch-level svdd for anomaly detection and segmentation[C]//Proceedings of the Asian Conference on Computer Vision.2020:375-390.
[11]ROTH K,PEMULA L,ZEPEDA J,et al.Towards total recall in industrial anomaly detection[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2022:14318-14328.
[12]COHEN N,HOSHEN Y.Sub-image anomaly detection withdeep pyramid correspondences[J].arXiv:2005.02357,2020.
[13]DEFARD T,SETKOV A,LOESCH A,et al.Padim:a patch distribution modeling framework for anomaly detection and localization[C]//Proceedings of the International Conference on Pattern Recognition.2020:475-489.
[14]HE S R,ZHANG S J,WANG Y X.Industrial Defect Detection Model Integrating Multi-scale Features[J].Journal of Chinese Computer Systems,2023,44(5):1029-1034.
[15]HUANG P Q Z,DUAN X J,HUANG W W,et al.Asymmetric defect detection method of small sample image based on meta learning[J].Journal of Jilin University(Engineering and Technology Edition),2023,53(1):234-240.
[16]LEE S,LEE S,SONG B C.Cfa:Coupled-hypersphere-based feature adaptation for target-oriented anomaly localization[J].IEEE Access,2022,10:78446-78454.
[17]WU Z,XIONG Y,YU S X,et al.Unsupervised feature learning via non-parametric instance discrimination[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition.2018:3733-3742.
[18]CHEN T,KORNBLITH S,NOROUZI M,et al.A simpleframework for contrastive learning of visual representations[C]//International Conference on Machine Learning.2020:597-1607.
[19]CHEN X,HE K.Exploring simple siamese representation lear-ning[C]//Proceedings of the IEEE/CVF Conference on Compu-ter Vision and Pattern Recognition.2021:15750-15758.
[20]YE M,ZHANG X,YUEN P C,et al.Unsupervised embedding learning via invariant and spreading instance feature[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2019:6210-6219.
[21]HE K,FAN H,WU Y,et al.Momentum contrast for unsupervised visual representation learning[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2020:9729-9738.
[22]CHEN T,KORNBLITH S,NOROUZI M,et al.A simpleframework for contrastive learning of visual representations[C]//Proceedings of the International Conference on Machine Learning.2020:1597-1601.
[23]KIM S,KIM D,CHO M,et al.Embedding transfer with label relaxation for improved metric learning[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2021:3967-3976.
[24]GUO J,LU S,JIA L,et al.ReContrast:Domain-specific anomaly detection via contrastive reconstruction [J].arXiv.2306.02602,2023.
[25]HYUN J,KIM S,JEON G,et al.Reconpatch:Contrastive patch representation learning for industrial anomaly detection[C]//Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision.2024:2052-2061.
[26]ZHANG Z Q,ZHANG H,WU T Y,et al.Continuous dense normalized flow model for industrial image anomaly detection[J].Computer Science,2023,50(12):212-220.
[27]BERGMANN P,FAUSER M,SATTLEGGER D,et al.MVTec AD-A comprehensive real-world dataset for unsupervised ano-maly detection[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2019:9592-9600.
[28]ZOU Y,JEONG J,PEMULA L,et al.Spot-the-difference self-supervised pre-training for anomaly detection and segmentation[C]//Proceedings of the European Conference on Computer Vision.2022:392-408.
[29]GUDOVSKIY D,ISHIZAKA S,KOZUKA K.Cflow-ad:Real-time unsupervised anomaly detection with localization via conditional normalizing flows[C]//Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision.2022:98-107.
[30]LIU T,LI B,DU X,et al.FAIR:Frequency-aware image restoration for industrial visual anomaly detection[J].arXiv:2309.07068,2023.
[31]GUO H W,REN L P,FU J J,et al.Template-guided hierarchical feature restoration for anomaly detection[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision.2023:6447-6458.
[32]BAE J,LEE J H,KIM S.PNI:Industrial anomaly detectionusing position and neighborhood information[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision.2023:6373-6383.
[1] SUN Haowen, DING Jiaman, LI Bowen, JIA Lianyin. Clustering Algorithm Based on Attribute Similarity and Distributed Structure Connectivity [J]. Computer Science, 2024, 51(7): 124-132.
[2] GAO Jianlei, LUO Minxia. Similarity Measure Between Picture Fuzzy Sets and Its Application in Pattern Recognition [J]. Computer Science, 2024, 51(6A): 230500153-5.
[3] HUANG Ming, SUN Lin-fu, REN Chun-hua , WU Qi-shi. Improved KNN Time Series Analysis Method [J]. Computer Science, 2021, 48(6): 71-78.
[4] ZHANG Yan-jin, BAI Liang. Fast Symbolic Data Clustering Algorithm Based on Symbolic Relation Graph [J]. Computer Science, 2021, 48(4): 111-116.
[5] WANG Xing , KANG Zhao. Smooth Representation-based Semi-supervised Classification [J]. Computer Science, 2021, 48(3): 124-129.
[6] HU Ping, QIN Ke-yun. Similarity Construction Method for Pythagorean Fuzzy Set Based on Fuzzy Equivalence [J]. Computer Science, 2021, 48(1): 152-156.
[7] SHAO Yang-xue, MENG Wei, KONG Deng-zhen, HAN Lin-xuan, LIU Yang. Cross-modal Retrieval Method for Special Vehicles Based on Deep Learning [J]. Computer Science, 2020, 47(12): 205-209.
[8] DING Wu, MA Yuan, DU Shi-lei, LI Hai-chen, DING Gong-bo, WANG Chao. Mining Trend Similarity of Multivariate Hydrological Time Series Based on XGBoost Algorithm [J]. Computer Science, 2020, 47(11A): 459-463.
[9] WANG Yong, WANG Yong-dong, DENG Jiang-zhou, ZHANG Pu. Recommendation Algorithm Based on Jensen-Shannon Divergence [J]. Computer Science, 2019, 46(2): 210-214.
[10] WEI Hui-juan, DAI Mu-hong. Collaboration Filtering Recommendation Algorithm Based on Ratings Difference
and Interest Similarity
[J]. Computer Science, 2018, 45(6A): 398-401.
[11] LIU Yi-zhi, CHENG Ru-feng and LIANG Yong-quan. Clustering Algorithm Based on Shared Nearest Neighbors and Density Peaks [J]. Computer Science, 2018, 45(2): 125-129.
[12] JI Jin-chao, ZHAO Xiao-wei, HE Fei, HU Ying-hui, BAI Tian and LI Zai-rong. Fuzzy Weighted Clustering Algorithm with Fuzzy Centroid for Mixed Data [J]. Computer Science, 2018, 45(2): 109-113.
[13] LIU Shuang, BAI Liang, YU Tian-yuan and JIA Yu-hua. Cross-media Semantic Similarity Measurement Using Bi-directional Learning Ranking [J]. Computer Science, 2017, 44(Z6): 84-87.
[14] CHI Yun-xian, ZHAO Shu-liang, LUO Yan, ZHAO Jun-peng, GAO Lin and LI Chao. Similarity Measure for Text Classification Based on Feature Subjection Degree [J]. Computer Science, 2017, 44(11): 289-296.
[15] LI Yi-kun, HU Yu-xi and YANG Ping. Frequency Domain Information Based Water Body Image Retrieval in High Resolution Satellite Image Databases [J]. Computer Science, 2016, 43(Z6): 118-121.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!