Defect Classification and Detection Using a Multitask Deep One-Class CNN

Research output: Contribution to journalArticlepeer-review


Defect classification and detection have been explored using convolutional neural networks (CNNs). Normally, a large set of training images containing defects and the associated annotation data are required by these approaches. However, such a large set of images is usually difficult to collect because defects are rare and annotation is time-consuming and expensive. To address these issues, we propose to use a multitask deep one-class CNN for defect classification. Compared with supervised classification methods, this CNN does not require abnormal images and annotated data for training. Specifically, we build a stacked encoder-decoder autoencoder for learning feature representation from normal images. The encoder is used as a feature extractor based on the hard sharing scheme of multitask learning. A one-class classification (OCC) objective learned as a hypersphere using minimum volume estimation is appended to it. Together the encoder and the OCC objective lead to a deep one-class classifier. To train both the autoencoder and one-class classifier end-to-end, a multitask loss function is built. Given an unknown sample, the distance between its feature representation and the center of the hypersphere is used as the anomaly score. Furthermore, defect detection is implemented using a moving-window scanning method on top of the deep one-class classifier. The proposed approach achieves better performance than its counterparts trained using a two-stage method. For defect detection, our approach achieves results almost as good as the supervised method even without using any annotated data. We attribute the promising results to the advantages of multitask learning. Note to Practitioners - Building and evaluating vision-based nondestructive testing (NDT) techniques require many examples of abnormal images, which may not be easy to acquire. This article describes a method that does not require abnormal images for training a convolutional neural network (CNN) in order to perform one-class defect classification (outlier detection). We also applied the method to defect detection with promising results. We include results of experiments demonstrating that better performance can be obtained using our method compared to a set of baselines. Although the proposed method does not use abnormal images for training, it still produces results that are almost as good as the supervised learning-based CNN approaches. This study provides a solution to the challenge encountered by the industrial inspection community when enough abnormal samples are hard to obtain.

Original languageEnglish
Pages (from-to)1719-1730
Number of pages12
JournalIEEE Transactions on Automation Science and Engineering
Issue number3
Early online date14 Sept 2021
Publication statusPublished - 1 Jul 2022


  • Autoencoder
  • defect classification
  • defect detection
  • industrial inspection
  • one-class classification (OCC)
  • one-class convolutional neural networks (CNNs)


Dive into the research topics of 'Defect Classification and Detection Using a Multitask Deep One-Class CNN'. Together they form a unique fingerprint.

Cite this