# Training Image Set

The ViDi tools are based on deep learning, which teaches a neural network by feeding the network data and having the machine deduce from the learned data what should be accomplished. So the data that is fed into the network is vitally important. Therefore, it is paramount to ask yourself, "What am I teaching the network?"

What you are teaching the network is based on your training image set. The training image set represents the data that you are feeding your network. For the ViDi tools, images constitute the backbone of the dataset that will be used to teach the tools. With deep learning, a large set of data is fed into the system, and the system will then deduce from the data what it is that we are trying to accomplish. So the data, in this context, images, is critically important.

Within the deep learning realm, the training image sets represent the data that will be passed into the network. When constructing your training image set, you will want to consider the following:

- Is my training image set representative of runtime images? This includes the following:

  - Lighting – If there will be lighting variations, then your Training Set should include the lighting variations you expect at runtime.
  - Color – Are parts going to change color during runtime? Then you should include all of the different color variations.
  - Rotation/Scale – When the part is presented to the camera, will it show up rotated or scaled? Then those variations should be included.
  - Part-to-part variation – If the parts being inspected may have subtle variations, then those variations should be included in your Training Set.
  - Background – In a lot of instances, images of your part may be captured on your desk. However, the parts will ultimately be running on a conveyor belt, which provides a much more interesting background for the ViDi tools. If that will be the case, you should get a Training Set of the part on the conveyor belt. And, if the background is not important to the inspection, you can mask it out. Masking out the background will generally improve the performance of the tool by not teaching the network about extraneous information.
- Is my training image set providing enough data? Many problems encountered while programming the ViDi tools can be solved by providing more images and data, and then retraining the tools.

Tip: If you annotate your images, i.e. provide descriptive information in the file names, such as "good", "bad", etc., you can help speed up the process of labeling your images.