Surface Detection

Surface Detection can be trained to detect a specific surface or known surface defects, it is suitable especially for detecting scratches, cracks, and defects on a highly variable background.

This module serves to detect a specific surface and it can also classify the types of surface, which are to be detected, into different classes like the Classifier.

ย 

Training Overview

ย 

Annotations

Surfaces can be marked in two ways - by brush painting in the image or by making polygons, those ways can also be combined. Each surface class has one color assigned. For quick color switching, you can press a numeric key indicating the number of the class that is given in square brackets.

Brush painting

Basic painting into the image by a brush of selected size. To change the brush size or switch between paint- and erase- mode, you can either use the sliders at the top, or you can use shortcuts, which can be found in the Help section under the โ€˜?โ€™ symbol.

Polygons

When you choose the polygon mode, you left-click into the image to define vertices of the polygon, which are being connected with a line in the order you put them in. You can move existing vertices by clicking and dragging them, or use double-click to delete them. When you're satisfied with the shape, use right-click which joins the last vertex with the first one and fills the polygon with chosen color. Polygons work in the erase-mode as well.

Include

It is used to include the selected image for training, however, the picture does not fall into one of the classes which were created, neither has any annotation, itโ€™s a defect-free image.

It can be used when a defect-free/OK image has some noise or itโ€™s slightly scratched for instance, in other words, can be used to fine tune the project for higher accuracy.

Ignore

Surfaces marked with โ€˜Ignoreโ€™ class are excluded from the training. Whereas, parts of the image which are left unannotated, are part of the training, but are considered an โ€˜OKโ€™ class, which is not displayed when detected. Type 3 surface detector doesn't use Ignore class.

Settings

Types of Surface Detection

Three types of surface detector are available, each based on a different kind of neural network.

ย 

Type 1 โ€“ Fast:

  • Detects a wide range of defects, however can suffer from a higher amount of false positives (good parts evaluated as bad by the software).

  • Training time is reduced, with bigger & less options of view-finder sizes.

  • This type does not require large datasets, however, performance on highly variable patterns may be suitable for the Precise option.

ย 

Type 2 โ€“ Experimental:

  • This type may work well for smaller defects, however, it usually requires a lot more training data and it is our Experimental type, meaning that may not perform well in some applications.

  • Training time is usually longer.

  • Smaller & more precise view-finder sizes.

ย 

Type 3 โ€“ Precise:

  • This type works well with smaller defects such as scratches and others, however, it usually requires more training data to perform well.

  • Training time is usually longer.

  • View-finder size not available & ignore function not included.

ย 

View-finder

Size of the view-finder determines how much the inspection will be focused. The size is selected depending on how detailed inspection model is desired. If you choose a size which is too small, you lose the knowledge of the surroundings and therefore can miss some defects; on the other hand, if chosen size is too large, details can be overlooked.

Just as when a human eye focuses on detecting errors. Some errors are seen from a larger distance, and others can only be seen through a magnifying glass.

Along with the size, the recognition speed also varies. There is no general rule on how to set the right size, you need to try out a number of sizes and learn how to estimate the best size at the first try. The size of the defects you are searching for might be of help.

Surface detector of Type 1 usually works better using bigger size of view-finder than what would work with Type 2. The Type 3 surface detector doesn't use this parameter.

Detection

The detection result is a set of heatmaps (one for each class). When validating, heatmaps are plotted in the image for better illustration. In the heatmaps, the searched-for areas surrounded by rectangles are added to the context to โ€˜detectedRectanglesโ€™. Each rectangle has a class assigned, depending on which heatmap it was found in.

ย 

Evaluation

We can set the rules for all classes or individually. There are three options for the evaluation rules:

Count - number of defects (rectangles)

Edge length - length of the edge of individual rectangle

Area - sum of pixels (of given class if itโ€™s selected) in the whole heatmap