Industrial Surface-Defect Detection

Automated surface-anomaly detection using machine learning has become an interesting and promising area of research, with a very high and direct impact on the application domain of visual inspection. Deep-learning methods have become the most suitable approaches for this task. They allow the inspection system to learn to detect the surface anomaly by simply showing it a number of exemplar images.

Our research explores a segmentation-based deep-learning architectures that are designed for the detection and segmentation of surface anomalies and is applied to a specific domain of surface-crack detection. We developed a novel two-stage network architecture. The first stage implements a segmentation network that performs a pixel-wise localization of the surface defect, while the second stage, where binary-image classification is performed, includes an additional network that is built on top of the segmentation network and uses both the segmentation output as well as features of the segmentation net.


We explored three different implementations of the proposed architecture:

  • one with our custom made segmentation network
  • one with U-Net for segmentation
  • one with DeepLab v3+ for segmentation

Additionally, we compared those models against a state-of-the-art commercial product. Experiments have been performed on a newly created dataset based on a real-world quality control case, which demonstrate that the proposed approach is able to learn on a small number of defected surfaces, using only approximately 25-30 defective training samples, instead of hundreds or thousands, which is usually the case in deep-learning applications. This makes the deep-learning method practical for use in industry where the number of available defective samples is limited.

This research is done in collaboration with our industry partner Kolektor Group d.o.o..


TensorFlow implementation of the developed network architecture is available in Github repository.

The Kolektor Surface-Defect Dataset

The dataset is constructed from images of defected electrical commutators that were provided and annotated by Kolektor Group d.o.o.. A microscopic fractions or cracks were observed on the surface of the plastic embedding in electrical commutators. The surface area of each commutator was captured in eight non-overlapping images. The images were captured in a controlled environment.

The dataset consists of:

  • 50 physical items (defected electrical commutators)
  • 8 surfaces per item
  • Altogether 399 images:
    • 52 images of visible defect
    • 347 images without any defect
  • Original images of sizes:
    • width: 500 px
    • height: from 1240 to 1270 px
  • For training and evaluation images should be resized to 512 x 1408 px

For more details about the dataset see KolektorSDD dataset.



The experiments on KolektorSDD demonstrated that our developed model achieves significantly better results than related methods with only one miss-classification, while the related methods achieve five or more miss-classifications.


Sensitivity to the number of training samples

We also evaluated the effect of smaller training sample size.The number of positive training samples was reduced to effectively obtain the training size of 25, 20, 15, 10 and 5 samples for each fold, while the test set for each fold remained unchanged.


Some examples of detections with our developed architecture are shown below:



Publications for the topic of traffic-sign detection