# Train Blue Read

When a tool is in Blue Read mode, the training workflow of the tool is:

1. Launch VisionPro Deep Learning.
2. Create a new workspace or import an existing one into VisionPro Deep Learning.
3. Collect images that contain characters and load them into VisionPro Deep Learning.

4. Add a Blue Read tool.

5. Configure the ROI and Feature Size

   1. Within the Read tool, set the ROI and Feature Size.

      Note: For more information on setting the Feature Size, see the .
   2. In the Image Display window, click the first image.
   3. The rectangular ROI will encompass the entire image.
   4. Re-size the ROI so that it encloses the characters. There are two handles on the ROI, in the upper-left and lower-right corners, that you can use to drag and re-size the ROI so that it covers the characters and their possible locations within all of the images.
   5. Once the ROI is set, press the Apply button.
   6. This will then apply the ROI setting to all of the images.
   7. After the ROI has been applied, click the first image again.

   8. In the bottom left corner of the display will be an interactive Feature Size box, which indicates the default character size. You can grab it and drag it up to a character and re-size it so that it fits a character.

      Tip: Try to keep from making it so big that it encloses parts of another character. After setting it on one character, you can then move it around to the other characters to ensure it's sized correctly.

   9. Once the character size is set, press the Book icon to process all of the images based on the new character size. This will apply the new character size to all of the images.

      Note: If the character size is changed in one image, the change will automatically be applied to all of the other images. However, if the Scaled parameter option is active, the features will only adapt their aspect-ratio to meet the character of the nominal feature-size and clamp the features to within the interval [1/4, 4] of the nominal feature size. That will require pressing the Book icon to reprocess the images and see the result of the Feature Size change on the rest of the images in the training set.

6. Label the Characters

   The next major step is the labeling of the characters. At least one instance of each character must be labeled. The process of Labeling provides a useful mechanism to determine if the tool is interpreting the characters correctly, prior to training.

   1. Expand the Database Overview window. The table lists all of the characters found by the tool.
      1. Go through the table, character by character, and select an instance of each found character:
      2. In the table, select a character, then double-click it, which will change the Display window to display only the instances of that character.
      3. From the displayed characters, select a good instance of the character.
   2. The main display will switch to that image. Right-click the image and select Accept View.
   3. That will create a Label of that instance of the character.
   4. Also delete any instances where the tool incorrectly labeled a character, by selecting the character, right-clicking and selecting Delete Feature.
   Note: By labeling and accepting more than one instance of a character, the tool will have more trained results when the tool is trained. See for the details of labeling.

7. Train the Tool

   When using the Blue Read to identify characters, follow these steps:

   1. Once a labeled instance of each character has been completed, it's time to train the tool. To train the tool, first add the desired images to the training set.

   2. Select the images in the View Browser, and on the right-click pop-up menu click Add views to training set.

      1. To select multiple images in the View Browser, use the Shift + Left Mouse Button. Or, use to show the desired images for the training only and add them to the training set by clicking Actions for ... views → Add views to training set.

   3. Prior to training, you need to set parameters in Tool Parameters. You can configure Training, Sampling, and Perturbation parameters or just use the default values of these. See for the details of the supported parameters.

      1. Ensure that the Feature Size parameter in Sampling parameters has been set. The Feature Size parameter gives the network a clue to the size of the characters that you are interested in identifying. So, if the Feature Size parameter setting is clearly going off from the size of characters in your application, there is a chance the tool will not identify the characters in your image.

      2. If you want more granular control over training or processing, turn on Expert Mode on Help menu to initialize additional parameters in Tool Parameters.

   4. Once the training set is filled with the right images, press the Brain icon, and the software will begin its computation for the training.

      1. If you stop training in the middle of it by pressing the Stop icon, you can stop training but you will lose the current tool so far trained.

   5. After training, review the results. Open Database Overview panel and review the Confusion Matrix and Precision, Recall, F-Score for each character and each model to understand the results. See for the details of interpreting results.

   6. After reviewing the results, go through all of the images and see how the tool correctly or incorrectly marked the features and models for each image.

8. Review Character Model

   After training has been completed, you can generate a character model, based on the number of expected characters, their spacing and placement, and their fielding.

9. Review the Training

   After training has been completed, you'll want to go back over your images and ensure that the tool correctly identified the characters in the images. Again, you can use the Database Overview window to review the table of characters, and review the results. Each character the tool found should be the expected character; for example, for the #2, all of the instances in the Display window should be of the #2. If there are instances where there is a "5" or an "S", for instance, you will need to click on that image and re-label those instances with the correct label.

   If the tool found all of the instances correctly, the tool is ready for runtime deployment. However, if you had to re-label some of the instances, you will need to retrain the tool, and then repeat the review process.