# Use Image Sample Sets as Training and Testing Sets

Once image sample sets are configured, they can be used to both train and test Deep Learning tools, allowing you to validate the tools performance prior to deployment.

1. From your database of collected images, create a training Training is the process that your tool, which is a neural network, is learning about the features (pixels) based on the labels you made. For example, a tool will learn the defect/normal pixels in each image based on the defect/normal labels you drew. The goal of the tool Training is learning enough to give the correct inspection results of whether an unseen image is defective or not. The key to training is to ensure that you include all possible variations within your training set, and that your images are accurately labeled. Training times vary by the application, tool setup and the GPU in the PC being used to train the network. image sample set.
2. Create a separate set as a testing image sample set.
3. Label all of the images/views in the training and testing image sample sets.
4. In the Training Set dialog, select the training image sample set and train the tool.
5. In the Database Overview, double-click the testing image sample set to load it into the View Browser.
6. From the Actions for N Views menu, select Clear Markings.
7. Process the images.

8. The statistics for the testing image set will then be displayed in the Database Overview.

   Note: Alternatively, you can also use the Filter in the Database Overview to load and process image sample sets.

Tip:

The process of creating an image sample set for training and validation Validation refers to a process during the training of a tool that helps to evaluate performance. Validation is like a mock exam that the tool takes during the training phase, separate from the final test. For example, validation helps you to recognize overfitting and avoid wasting time when training a tool. If you recognize that the tool is overfitting, you can stop the training early. is best done iteratively. At the beginning of the application development process, you will probably want to select approximately half of the images in your image database for your training image sample set (in the Training Set dialog, the Count parameter will be set to 50%). As your database grows and increases in completeness, you will have more subsets of images (for example morning shift, afternoon shift, evening shift; line 1, line 2; plant 1, plant 2, etc.), and either additions to existing image sample sets, or additional image sample sets.

When you are ready to assess the generalization status of your tools, you can switch the Training Set Count parameter to 100% and train your desired training image sample set. Then you can run your testing sample image sets against the trained tools, to see how they perform against these other sets.