Using a Deep Learning Classifier

After the detection of spots, you can submit them to a custom deep learning classifier.

You must train this classifier specifically for the inspection task (inspection of battery foil or fabric will have different classifiers). The purpose of this process is to get a class that represents / qualifies the object, for example:
To confirm or discard the detection.
To evaluate the severity of the defect.
To classify objects based on their aspect.

1. In the class ESpotDetector, use the method DLClassifierPath to configure a deep learning classifier.
All further detected spots are passed to this classifier.
The resulting label and probability are stored in the class ESpot (as DLLabel and DLProbability).

In EasySpotDetector, the typical workflow with a deep learning classifier is:

a. Gather samples of detected objects in a deep learning project.
b. Open the deep Learning project in Deep Learning Studio to annotate the samples and train a new classifier.
c. Use the trained classifier at production time in EasySpotDetector.

2. After calling the method Detect, use the method AddDetectedSpotsToDLProject to fill a EDeepLearningProject with the newly detected spots:
The image used by Detect is copied to the subdirectory Images and linked in the project.

- Automatic image names are generated unless you set the parameter imageName.
- All images must have a different name.

All the detected spots are added to the project as ROIs of the image, with a label depending on the spot type (particle or scratch).
Use the optional parameter roiExtension to increase the ROI size by a pixel amount. It could help the deep learning inference to have a 'context' around the ROI.
Use the optional parameter noDefectSamples to set the number of extra ROIs added to the project and representing areas without defect. The label of these areas is given by the parameter noDefectLabel.
3. After adding enough spots to the deep learning project (depending on the context, between 20 and 200 samples per class are recommended), you can open the project with Deep Learning Studio.
2 To annotate and train a deep learning classifier, see:
Deep Learning Tools - Inspecting Images with Deep Learning > Purpose and Workflow.
4. At production time, set the trained classifier tool with the method SetDLClassifierPath.