EasySegment Unsupervised

EasySegment Unsupervised is the deep learning tool part of the EasySegment segmentation library of eVision. It detects and segments defects in images.

This tool trains in an unsupervised way. This means that it is trained only with good images. So it does not require any ground truth segmentation of the defects.

To create an EasySegment Unsupervised tool:

  • API: EUnsupervisedSegmenter .NET Python

  • To create an EasySegment Unsupervised project in Deep Learning Studio:

    1. Start Deep Learning Studio.

    2. Create a new project and select EasySegment Unsupervised in the New deep learning project dialog.

      ../../../_images/easysegment_1.webp

      Creating an EasySegment Unsupervised project.

Properties

../../../_images/easysegment_3.webp

Tool properties

The unsupervised segmenter tool has 6 parameters:

  1. The Good label is the name of the class that contains the good images.

    In the API: use SetGoodLabel .NET Python.

    In Deep Learning Studio, the Good label is a project property that you must select in the Dataset and annotations tab below the list of labels.

    Selecting the `Good label`
  2. The Capacity of the neural network (default: Normal) represents the quantity of information it is capable of learning. A larger capacity makes the tool slower.

    In the API:

  3. The Image type (default: Monochrome (1 channel)):

    In the API:

  4. The Sampling density (SetSamplingDensity .NET Python) is the parameter of the sliding window algorithm used to process whole images using patches of size (EUnsupervisedSegmenter::SetPatchSize .NET Python).

    • It indicates how much overlap there is between the image patches: 100 - (100 / SamplingDensity) (%)

    • In practice, the stride between 2 consecutive patches is: PatchSize / SampleDensity (pixels)

  5. The Patch size (SetPatchSize .NET Python) is the size of the patches processed by the neural network.

    • By default, the patch size is determined automatically from the images in the training dataset.

    • You can also select the resolution of the patch size from the drop down list.

      ../../../_images/easysegment_6.webp

      Patch sizes.

  6. Use the Scale (SetScale .NET Python) to automatically resize your images to a lower resolution and accelerate the processing.

    In Deep Learning Studio:

    • If the dataset contains images with different resolutions, the Input width and the Input height indicate the range of the resolutions with the given scale.

    • If all the images in the dataset have the same resolution, set either the Input width or the Input height to change the scale.

Training

To train your tool, see Training a Deep Learning Tool.

Validating the Results

There are 2 types of metric for the unsupervised segmentation tool:

  • Unsupervised metric only uses the results of the tool on good images. There is only one unsupervised metric: the error.

  • Supervised metrics require both good and defective images. The supervised metrics are the AUC (Area Under ROC Curve), the ROC curve, the accuracy, the good detection rate (also called the true negative rate), the defect detection rate (also called the true positive rate).

The unsupervised segmentation tool computes a classification score .NET Python for each image. The label of a result is obtained by thresholding this score with the segmenter classification threshold .NET Python. So, the supervised metrics also depends on the value of this classification threshold.

The ROC curve (Receiver Operating Characteristic) is the plot of the defect detection rate (the true positive rate) against the rate of good images classified as defective (also called the false positive rate). It is obtained by varying the classification threshold. The ROC curve shows the possible tradeoffs between the good detection rate and the defect detection rate.

The area under the ROC curve (AUC) is independent of the chosen classification threshold and represents the overall performance of the tool. Its value is between 0 (bad performance) and 1 (perfect performance).

Deep Learning Studio

  • In the Tools tab, the metrics Best validation error and Best validation AUC are computed during the training on the validation dataset without using data augmentation. The validation error, the training error and the validation AUC are plotted for each iteration.

    Training metrics.
  • In the Validation and results tab, various metrics, the confusion matrix, a cumulative score histogram, and the ROC curve are displayed. You can also change the classification threshold directly in this tab.

    • The cumulative score histogram shows the cumulative proportion of good (in green) and defective (in red) images with respect to the scores of the image.

    • You can change the classification threshold in 3 ways : direct input, dragging the threshold line in the score histogram and selecting a point on the ROC curve.

API

Applying the Tool to New Images

Deep Learning Studio

  • Add new images to the dataset and refresh the results.

    ../../../_images/easysegment_8.webp

    Refreshing or computing new results.

  • Open the Inference tests tab to apply the segmenter to new images and display detailed results for these images.

API