Surface Defect Detection with Computer Vision Image Annotation

May 8, 2023

Manufacturing industries need to ensure that the quality of their products is high. As a result, they need to detect defects quickly and accurately. Therefore, quality control (QC) is essential for many production processes.

In the past, humans completed QC. But it's time-consuming and demanding on workers' expertise and skills. A solution to this problem is computer vision image annotation. It can be much more efficient at detecting defects than humans and more consistently.

Detection of surface defects is an essential process in the manufacturing industry. It helps companies ensure that products are defect-free and ready for delivery. The surface of many parts is prone to defects that can lead to poor performance and wasted material.

When it comes to metal surfaces, the quality control process can be pretty complex. This article explores how computer vision (CV) techniques detect these defects on surfaces.

schedule a call

Using computer vision to detect surface flaws

Computer vision systems can detect surface defects that are not visible to the human eye. For example, some can identify surface roughness and porosity. Surface defects are often more difficult to spot than internal flaws. They can cause severe problems if they go undetected.

Imperfections can be present on various surfaces and at depths (e.g., subconical). Furthermore, defects are not always visible outside. Some may only be detectable using special equipment. To detect defects in a material, you'll have to teach a machine how to identify them. Or need technologies like optical coherence tomography (OCT).

Image processing techniques can detect the location of certain surface flaws in parts. These techniques also determine the type and severity of defects. Examples include laser triangulation scanners (LTSs) or structured light projectors (SLPs)

How to train computer vision systems

Computer vision image annotation is a powerful tool for quality control. It can detect product defects and label images like "scratch" or "no scratch." One common way to use computer vision is for quality control for manufacturing.

Robots take these photos with cameras that travel around the factory floor. They scan products along their path and take pictures every few centimeters. These images then feed into a computer program. It analyzes them pixel-by-pixel to look for scratches, cracks, or other surface flaws.

Training a model to detect defects requires a large number of data samples. The more diverse the data is, the better your model will be. Your neural network can achieve high accuracy if you have enough examples (defect and non-defect).

You can label data manually or automatically depending on the type of defect we want to detect. Automated labeling makes a much faster and cheaper approach possible. Still, it will not provide high accuracy. Manual labeling has higher accuracy but requires much time and human expertise.

Maximizing data accuracy

As with any machine learning algorithm, the accuracy depends on your training datasets. To build a great classifier, you must have hundreds or thousands of samples in each category. The more data you can gather and label, your model will be better-trained.

This raises another problem. If your model isn't very accurate at first, there won't be enough labeled examples to train it. And if it doesn't get any better over time, then it won't be able to make accurate predictions on new data points.

Image annotation
Image annotation | Keymakr

Identifying specific defect types

The first step is identifying the specific defect types you're trying to detect. For example, if you're dealing with paint defects in a vehicle. Next, create data training sets with images of those defects. Then, your machine-learning algorithm can learn how to identify them.

A good data set consists of an image containing defects and another image that is free of defects. The software needs to recognize the difference between these images. It needs to be able to distinguish between the two types of images.

Use high-quality data sets representative of all possible defects that may occur. Then, if you have enough data about each type of defect, you can use computer vision algorithms to find them.

Optimizing data sets

The optimal input for computer vision contains images of various scratches and dings. This way, computer vision image annotation can detect and classify types of defects. Optimize the data sets by using the following:

  • high-resolution camera
  • high-quality lens
  • optimal lighting conditions
  • large enough sample size

You may also consider using many photos from different angles and distances. This data will give your algorithm more to work with when determining if there is a defect.

For example, you might use edge detection to look for sharp changes in color or luminance. After that, you could apply texture analysis to look for high-contrast areas. Finally, you could use edge detection to find edges that don't match the surroundings.

Image processing and classification

One way to classify images is a neural network, a type of artificial intelligence. This method uses an algorithm that can learn from data. Then, it makes predictions based on patterns it has seen before.

Then, you would feed these photos into a convolutional neural network (CNN) algorithm. You can train it for this purpose. The CNN will scan each photo and compare it to other images. And then, it can learn what makes up a scratch-free plate versus one with scratches. Once it knows this information, it can predict whether an image contains a defect. This type of algorithm uses "unsupervised learning."

Keymakr Demo


Surface defect detection has many applications in manufacturing and robotics. For example, you can use it to inspect the surface quality of manufactured products. Or detect defects in assembly line parts.

Computer vision image annotation uses algorithms to analyze images. It finds patterns that show defects or other issues with the product. You can train these algorithms to look for specific flaws and imperfections.

Keymakr's image annotation makes it easy for anyone to detect surface defects using computer vision. You can annotate your images or let our professional in-house annotation team handle them.

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.