Autoencoder-based anomaly detection for surface defect inspection

https://doi.org/10.1016/j.aei.2021.101272Get rights and content

Abstract

In this paper, the unsupervised autoencoder learning for automated defect detection in manufacturing is evaluated, where only the defect-free samples are required for the model training. The loss function of a Convolutional Autoencoder (CAE) model only aims at minimizing the reconstruction errors, and makes the representative features widely spread. The proposed CAE in this study incorporates a regularization that improves the feature distribution of defect-free samples within a tight range. It makes the representative feature vectors of all training samples as close as possible to the mean feature vector so that a defect sample in the evaluation stage can generate a distinct distance from the trained center of defect-free samples. The proposed CAE model with regularizations has been tested on a variety of material surfaces, including textural and patterned surfaces in images. The experimental results reveal that the proposed CAE with regularizations significantly outperforms the conventional CAE for defect detection applications in the industry.

Introduction

Machine vision is an effective non-contact technology for automated defect inspection in the manufacturing process. Most of the traditional machine vision techniques are based on texture analysis. A set of discriminative features are extracted from the spatial or the spectral domain of the test image. A high-level multiple dimensional classifier such as Support Vector Machine (SVM) or Random Forest is then applied to identify defect samples. The success of the classification highly relies on the human experts to extract and select representative features based on the local gray-level (or color) and structure variations of a defect in the test image.

In the manufacturing environment, it is quite easy to collect normal samples as many as required. However, it is difficult to collect a sufficient number of defective samples in a short period of time to train robust classification models for defect detection. The machine vision methods currently available need handcrafted features based on the characteristics of individual defect types of a specific product, where the defect samples may not be sufficient for the analysis.

In this paper, the deep learning technique is explored to tackle the defect detection task without defect samples for the training. The proposed method is image-wise defect detection, i.e. it classifies a test image as defective or defect-free. It is not used for pixel-wise defect segmentation. The unsupervised convolutional autoencoder (CAE) is applied to extract the representative features that can well describe the distribution from a set of normal samples. The loss function of the conventional CAE measures only the reconstruction errors. It could make the extracted feature values widely spread in the high-dimensional variable space. When the trained CAE is used for anomaly detection, the encoded features of a defect sample image may thus fall within the range of the normal samples’ variable space. It could make the extracted features indistinguishable between normality and abnormality. A regularization penalty is thus included in the original CAE loss function to limit the spread of the learned feature values for normal training samples. It is expected that the distances of feature vectors between the normal samples are close to each other and the unseen defect samples yield sufficiently large distances from the normal samples. The proposed CAE-based model, denoted by λ-CAE, is tested on various material surfaces for defect detection, including textural surfaces and patterned surfaces. The proposed method is also compared to autoencoder-variant models based on encoded features and image reconstruction error.

This paper is organized as follows. Section 2 reviews the related work on defect detection with traditional machine vision and deep learning techniques. Anomaly detection with autoencoders for various applications is also discussed. Section 3 presents the original CAE and the regularized λ-CAE models for defect detection. Section 4 discusses the experimental results on various material surfaces. The paper is concluded in Section 5.

Section snippets

Related work

Traditional machine vision methods rely on the extraction of handcrafted features or the design of discrimination measures to identify defects in a test image. Texture analysis techniques [1] in image processing have been popularly used for defect detection in various material surfaces. Local texture features or descriptors are extracted from the spatial or the spectral domain [2] of a test image. Discriminant classifiers are then applied to identify defects. The statistical features or texture

CAE model

The autoencoder model used in this study is based on Convolutional Autoencoder (CAE) for practical implementation in manufacturing. The autoencoder architecture for unsupervised learning is composed of two parts, encoder and decoder. The encoder takes the raw image as the input, and the abstract representation from the encoder is then the input to the decoder. The encoder involves a series of convolutional layers and downsampling to compress the original data in a high-dimensional space into an

Experimental results

In this section, the performance of the CAE models with and without regularization is evaluated for defect detection in various material surfaces. The proposed models and methods are implemented with Tensorflow and Keras. They are executed on a PC equipped with Intel i7-7700 3.40 GHz CPU and one NVIDIA GTX 1080 Ti GPU. The CAE architecture used for feature extraction has been shown in Fig. 1. The detailed setting of each layer in the CAE models is presented in Table 1.

The Adam optimizer with a

Conclusions

The CAE has been a very popular unsupervised model to extract features for anomaly detection. However, the extracted features from the traditional CAE could be widely spread and degrade the performance for unsupervised defect detection. The main contribution of the paper is the two new regularization penalties that can effectively confine the spread of the extracted features in a very limited space from a set of defect-free samples. The first regularization is very effective and easy to train

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

References (42)

  • M.S. Sadooghi et al.

    Improving one class support vector machine novelty detection using nonlinear features

    Pattern Recogn.

    (2018)
  • J. Wang et al.

    Deep learning for smart manufacturing: methods and applications

    J. Manuf. Syst.

    (2018)
  • D. Weimer et al.

    Design of deep convolutional neural network architectures for automated feature extraction in industrial inspection

    CIRP Ann. – Manuf. Technol.

    (2016)
  • W. Dai et al.

    Soldering defect detection in automatic optical inspection

    Adv. Eng. Inf.

    (2020)
  • Y. Wang et al.

    A smart surface inspection system using faster R-CNN in cloud-edge computing environment

    Adv. Eng. Inf.

    (2020)
  • J.K. Chow et al.

    Anomaly detection of defects on concrete structures with the convolutional autoencoder

    Adv. Eng. Inf.

    (2020)
  • T. Schlegl et al.

    f-AnoGAN: fast unsupervised anomaly detection with generative adversarial networks

    Med. Image Anal.

    (2019)
  • X. Xie

    A review of recent advances in surface defect detection using texture analysis techniques

    Electron. Lett. Comput. Vision Image Anal.

    (2008)
  • S.A.H. Ravanidi et al.

    The influence of gray-level co-occurrence matrix variables on the textural features of wrinkled fabric surfaces

    J. Text. Inst.

    (2011)
  • G.-H. Hu et al.

    Unsupervised defect detection in textiles based on Fourier analysis and wavelet shrinkage

    Appl. Opt.

    (2015)
  • A.S. Malek et al.

    Optimization of automated online fabric inspection by fast Fourier transform (FFT) and cross-correlation

    Text. Res. J.

    (2013)
  • Cited by (63)

    • An automated defect detection method for optimizing industrial quality inspection

      2024, Engineering Applications of Artificial Intelligence
    View all citing articles on Scopus
    View full text