PatchCore-based Anomaly Detection using Major Object Segmentation

Gyu-Il Kim, Kyungyong Chung


Cameras utilized for product defect detection in the production line of the manufacturing process create noise due to environmental changes such as camera angle and direction of light. This causes a lack of manufacturing process data and reduces the efficiency of anomaly detection. Therefore, it is necessary to produce a method that detects defects occurring in the production line and guarantees product quality and safety using anomaly detection technology combined with artificial intelligence. Therefore, this thesis proposes PatchCore-based anomaly detection using major object segmentation. The proposed method pre-processes product packaging data by using Green Channel thresholding, Major Connected Component Selection, Extracting Outer Contour, and FloodFill with Centroid. As for the pre-processed data main objects are masked, and the image data is segmented. Through PatchCore model, normality and anomaly detection results are binarily classified. In the performance evaluation, the accuracy is compared between the pre-existing anomaly detection method and the proposed method through the pre-/post-preprocessing data, and high performance is proven. The conventional method showed an accuracy of 0.7684, while our approach achieved an accuracy of 0.9784. Additionally, among the CNN models, VGG19 demonstrated an accuracy of 0.5833, and EfficientNet80 showed an accuracy of 0.7, both of which were lower than our method's accuracy. Therefore, even a small data set shows strong performance through the proposed method. The proposed method is expected to be utilized as an effective defect detection model in diverse fields.


Anomaly detection; deep learning; machine learning; artificial intelligence; image segmentation

Full Text:



K. Morimoto, A. Ardelean, M. Wu, A. C. Ulku, I. M. Antolovic, C. Bruschini and E. Charbon, "Megapixel time-gated SPAD image sensor for 2D and 3D imaging applications," Opt. Lett., vol. 7, no. 4, pp. 346-354, 2020.

Z. Ren, F. Fang, N. Yan, and Y. Wu, "State of the art in defect detection based on machine vision," IJPEM., vol. 9, no. 2, pp. 661-691, 2022.

P. Boniol, M. Linardi, F. Roncallo, and T. Palpans, "Automated anomaly detection in large sequences," in Proc. - Int. Conf. Data Eng., TX, USA, 2020, pp. 1834-1837.

A. Abid, M. T. Khan, and J. Iqbal, "A review on fault detection and diagnosis techniques: basics and beyond," Artif. Intell. Rev., vol. 54, pp. 3639-3664, 2021.

Y. Chen, Y. Ding, F. Zhao, E. Zhang, Z. Wu, and L. Shao, "Surface defect detection methods for industrial products: A review," Appl. Sci., vol. 11, no. 16, pp. 7657, 2021.

V. Chandola, A. Banerjee, and V. Kumar, "Anomaly detection: A survey," ACM Comput. Surv., vol. 41, no. 3, pp. 1-58, 2009.

W. Yan and L. Yu, “On accurate and reliable anomaly detection for gas turbine combustors: A deep learning approach,†in Proc. Annu. Conf. Prognostics Health Manage. Soc., vol. 6, 2015. [Online]. Available: node/1652.

Z. Li, J. Li, Y. Wang, and K. Wang, "A deep learning approach for anomaly detection based on SAE and LSTM in mechanical equipment," Int. J. Adv. Manuf. Technol., vol. 103, pp. 499-510, 2019.

J. K. Chow, Z. Su, J. Wu, P. S. Tan, X. Mao, and Y. H. Wang, "Anomaly detection of defects on concrete structures with the convolutional autoencoder," Adv. Eng. Inform., vol. 45, pp. 101105, 2020.

B. U. Jeon, and K. Chung, "CutPaste-Based Anomaly Detection Model using Multi Scale Feature Extraction in Time Series Streaming Data," KSII Trans. Internet Inf. Syst., vol. 16, no. 8, 2022.

J. Seo, J. Park, J. Yoo, and H. Park, "Anomaly Detection System in Mechanical Facility Equipment: Using Long Short-Term Memory Variational Autoencoder", J Korean Soc Qual Manag, vol. 49, no. 4, pp. 581-594, 2021.

P. Bergmann, M. Fauser, D. Sattlegger, and C. Steger, "MVTec AD--A comprehensive real-world dataset for unsupervised anomaly detection," Proc. IEEE Comput. Soc. Conf. Comput. Vis. Pattern Recognit., pp. 9592-9600, 2019.

A. B. Nassif, M. A. Talib, Q. Nasir, and F. M. Dakalbab, "Machine learning for anomaly detection: A systematic review," IEEE Access., vol. 9, pp. 78658-78700, 2021.

W. Ullah, A. Ullah, I. U. Haq, K. Muhammad, M. Sajjad, and S. W. Baik, "CNN features with bi-directional LSTM for real-time anomaly detection in surveillance networks," Multimed. Tools Appl., vol. 80, pp. 16979-16995, 2021.

J. Dib, K. Sirlantzis, and G. Howells, "A Review on Negative Road Anomaly Detection Methods," IEEE Access., vol. 8, pp. 57298-57316, 2020.

V. Thamilarasi, R. Roselin, "Automatic Thresholding for Segmentation in Chest X-Ray Images Based on Green Channel Using Mean and Standard Deviation," Int. j. eng. innov. technol., vol. 8, no. 8, pp. 695-699, 2019.

Y. Weng, C. Xia, "A new deep learning-based handwritten character recognition system on mobile computing devices," Mob. Netw. Appl, vol. 25, pp. 402-411, 2020.

T. Goel, K. C. Tripathi, and M. L. Sharma, "Single Line License Plate Detection Using OPENCV and tesseract," Int Res J Eng Technol, vol. 7, no. 5, pp. 5884-5887, 2020.

A. Roychoudhury, M. Missura, and M. Bennewitz, "Plane segmentation in organized point clouds using flood fill," Proc. - IEEE Int. Conf. Robot. Autom., pp. 13532-13538, May. 2021.

M. Chen, T. Artieres, and L. Denoyer, "Unsupervised object segmentation by redrawing", NeurIPS., vol. 32, 2019.

C. Chen, S. Yi, J. Mao, F. Wang, B. Zhang, and F. Du, "A Novel Segmentation Recognition Algorithm of Agaricus bisporus Based on Morphology and Iterative Marker-Controlled Watershed Transform," Agronomy, vol. 13, no. 2, pp. 347, 2023.

N. Cohen, Y. Hoshen, "Sub-image anomaly detection with deep pyramid correspondences," arXiv preprint arXiv:2005.02357, 2020.

T. Defard, A. Setkov, A. Loesch, and R. Audigier, "Padim: a patch distribution modeling framework for anomaly detection and localization," in 1st International Workshop on Industrial Machine Learning, 2021, pp. 475-489.

K. Roth, L. Pemula, J. Zepeda, B. Schölkopf, T. Brox, and P. Gehler, "Towards total recall in industrial anomaly detection," Proc. IEEE Comput. Soc. Conf. Comput. Vis. Pattern Recognit., pp. 14318-14328, 2022.

A. Satria, O. S. Sitompul, and H. Mawengkang, "5-Fold Cross Validation on Supporting K-Nearest Neighbour Accuration of Making Consimilar Symptoms Disease Classification," in Conf. Computer Science and Engineering 2021, vol. 1, pp. 1-5.

H. Yoo, R. C. Park, and K. Chung, "IoT-based health big-data process technologies: a survey," KSII Trans. Internet Inf. Syst., vol. 15, no. 3, pp. 974-992, 2021.

G. Kou, P. Yang, Y. Peng, F. Xiao, Y. Chen, and F. E. Alsaadi, "Evaluation of feature selection methods for text classification with small datasets using multiple criteria decision-making methods," Appl. Soft Comput., vol. 86, pp. 105836, 2020.

H. Yoo, K. Chung, "Classification of Multi-Frame Human Motion Using CNN-based Skeleton Extraction," Intell. Autom. Soft Comput., vol. 34, no. 1, 2022.

N. T. Mohammad, S. A. Ismail, M. N. kama, O. M. Yusop, and A. Azmi, "Customer churn prediction in telecommunication industry using machine learning classifiers," in Proc. 3rd Int. Conf. Vis., Image Signal Process., Aug. 2019, pp. 1–7.

S. Imambi, K. B. Prakash, and G. R. Kanagachidambaresan, "PyTorch," in Programming with TensorFlow: Solution for Edge Computing Applications, Cham, Switzerland: Springer, 2021, pp. 87-104.



  • There are currently no refbacks.

Published by INSIGHT - Indonesian Society for Knowledge and Human Development