A Compact Convolutional Neural Network for Surface Defect Inspection

Yibin Huang, Congying Qiu, Xiaonan Wang, Shijun Wang, Kui YuanSensors 2020 · DOI

TL;DR

This paper introduces a novel, compact Convolutional Neural Network (CNN) designed for surface defect inspection that achieves high accuracy while being computationally efficient enough to run on low-power CPUs. This breakthrough makes advanced AI-powered quality control more accessible for manufacturing environments that cannot afford expensive GPU hardware.

What Problem Does This Paper Address?

Automated Surface Inspection (ASI) is crucial for manufacturing quality control, aiming to reduce labor costs and improve efficiency. While Convolutional Neural Networks (CNNs) have revolutionized computer vision, their significant computational demands (requiring powerful GPUs) have limited their widespread adoption in ASI, especially in cost-sensitive manufacturing settings that often rely on low-power CPUs or FPGAs. Furthermore, surface defect datasets are often imbalanced, with far fewer defect samples than normal ones, and tiny defects can be easily overlooked, leading to low accuracy. This paper tackles the challenge of developing a CNN that is both highly accurate for defect detection (even tiny ones) and computationally lightweight enough for deployment on resource-constrained hardware.

Methods

The core of this work is a novel "LightWeight" (LW) CNN architecture. It features:

  • LW Bottleneck: This module replaces standard convolutional layers with a pyramid of lightweight kernels (including 1x1, kx1, 1xk, and 3x3) that capture features at different receptive fields. This design significantly reduces weights and computation while maintaining rich feature extraction.
  • Lightweight Decoder: For segmentation tasks, the decoder incorporates an Atrous Spatial Pyramid Pooling (ASPP) module and depthwise separable convolutions.
  • Depthwise Separable Convolutions: This technique, a cornerstone of efficient CNNs like MobileNets, is used throughout the architecture. It decomposes standard convolutions into a depthwise convolution (per channel) and a pointwise convolution (1x1), drastically reducing parameters and FLOPs.
  • Gradual Training Strategy: To combat data imbalance and the difficulty of detecting tiny defects, the authors propose a strategy that initially focuses training on defect regions, progressively zooming out, and later incorporating normal product images. This helps prevent overfitting to the background and improves the detection of small defects.

Datasets

The authors evaluated their model on several datasets:

  • Textures Dataset: A custom dataset compiled from three public sources (KTH, Kyberge, UIUC) containing 8674 images across 64 texture classes. This was used for pretraining and evaluating classification performance.
  • NEU Surface Defect Dataset: A dataset of hot-rolled steel strip surface defects, featuring 6 classes of defects and 1800 images. Used for classification.
  • DAGM Dataset: A dataset of textured surfaces with 6 classes of defects, characterized by coarse elliptical masks. Used for segmentation.
  • Wood Defect Dataset: A dataset of dried lumber boards with 18 types of defects, notable for its severe data imbalance and challenging bounding box annotations. Used for segmentation.

Key Insights and Ideas

  • Compactness is Key for Real-World ASI: The paper strongly advocates that for practical ASI, computational efficiency (low FLOPs, few weights) is as important as accuracy, especially for deployment on low-cost hardware.
  • Multiscale Kernels in Bottlenecks: Using a pyramid of kernels with varying receptive fields within the bottleneck is an effective way to capture diverse features without a significant computational penalty.
  • Gradual Training for Tiny Defects: The proposed gradual training strategy is crucial for handling the inherent data imbalance and the challenge of detecting very small defects, which are often missed by standard training.
  • Transfer Learning is Powerful: Fine-tuning models pretrained on large datasets like ImageNet significantly boosts performance and accelerates convergence, even for specialized tasks like surface defect inspection.

Key Results

  • CPU Performance: The compact CNN can successfully classify/segment surface defects on an Intel i3-4010U CPU within 30 ms.
  • Efficiency Gains: Compared to MobileNetV2, the proposed model achieves similar accuracy with less than 1/3 of the FLOPs and 1/8 of the weights.
  • Accuracy: The model achieves competitive accuracy across various datasets, including 100% test accuracy on the NEU dataset with a specific configuration.
  • Segmentation Performance: On the DAGM dataset, the model achieved a high mAcc of 99.43% with significantly lower computational cost than other advanced methods.
  • Wood Defect Segmentation: The model demonstrated higher accuracy and lower error escape rates compared to a previous state-of-the-art method on the Wood Defect dataset, with significantly faster inference times.

Limitations and Future Work

  • Data Imbalance Handling: While the gradual training strategy shows promise, the paper acknowledges the ongoing challenge of severe data imbalance, especially with tiny defects. Further research into more robust data augmentation and training techniques could be beneficial.
  • Generalization: The paper explores the model's applicability across different surfaces, but further validation on a wider variety of industrial materials and defect types would strengthen its claim of being a "generic solution."
  • Hardware-Specific Optimization: While the model is designed for low-power CPUs, further optimization for specific embedded hardware platforms (like FPGAs) could unlock even greater efficiency.
  • Real-time Applications: The authors suggest the model is promising for low-power, real-time systems and smartphone apps, indicating future work could focus on integrating it into such applications.

Summary updated

Abstract

The advent of convolutional neural networks (CNNs) has accelerated the progress of computer vision from many aspects. However, the majority of the existing CNNs heavily rely on expensive GPUs (graphics processing units). to support large computations. Therefore, CNNs have not been widely used to inspect surface defects in the manufacturing field yet. In this paper, we develop a compact CNN-based model that not only achieves high performance on tiny defect inspection but can be run on low-frequency CPUs (central processing units). Our model consists of a light-weight (LW) bottleneck and a decoder. By a pyramid of lightweight kernels, the LW bottleneck provides rich features with less computational cost. The decoder is also built in a lightweight way, which consists of an atrous spatial pyramid pooling (ASPP) and depthwise separable convolution layers. These lightweight designs reduce the redundant weights and computation greatly. We train our models on groups of surface datasets. The model can successfully classify/segment surface defects with an Intel i3-4010U CPU within 30 ms. Our model obtains similar accuracy with MobileNetV2 while only has less than its 1/3 FLOPs (floating-point operations per second) and 1/8 weights. Our experiments indicate CNNs can be compact and hardware-friendly for future applications in the automated surface inspection (ASI).
BibTeX
@inproceedings{huang2020compact,
  author = {Yibin Huang and Congying Qiu and Xiaonan Wang and Shijun Wang and Kui Yuan},
  title = {{A Compact Convolutional Neural Network for Surface Defect Inspection}},
  booktitle = {Sensors},
  year = {2020},
  doi = {10.3390/s20071974},
}
Figure