# Train Blue Locate for Identifying Features

You train the to identify trained features in images.

## Prerequisites

- You have created or imported a workspace into VisionPro Deep Learning application.

- You have collected images and loaded them into the application.

## Procedure

1. Add a Blue Locate tool.

2. Define ROI The Region of Interest (ROI) defines the area of operation for the tool. The ROI preserves the positions, angles, stretch and skew of the original image. (Region of Interest) to construct Views. If necessary, adjust the ROI of the tool.

3. Configure Features parameters and Sampling parameters before labeling Labeling is the process of annotating an image with "ground truth". Depending on the tool that you are using, labeling can take different forms. You label an image set for two reasons: to provide the information needed to train the tool and to allow you to measure and validate the performance of the trained tool against the ground truth..

   1. In the bottom-left corner of the display, there is a circle graphic that graphically illustrates the size of the Feature Size parameter setting.

   2. This circle graphic can be moved into the ROI and placed over the largest feature A feature is a visually distinguishable area in an image. Features typically represent something of interest for the application (a defect, an object, a particular component of an object).. Then, using the drag handle, you can adjust the Feature Size so that it approximately covers the feature.

4. Within the ROI, while hovering over the image, the mouse-cursor will have a cross-hairs icon which is used to place the feature label of the Blue tool. Click on a feature to label it.

5. The feature label will have a default character of 0. Enter in a meaningful character (A-Z, 0-9, up to 140 characters) to identify the feature. For identical features, you can use the same identifier.

   If there is more than one feature that you want to find in the image, identify and label each feature.

6. Go through each image in your image database and identify and label each instance of the feature(s).

   Tip: To ensure the best results, be careful and thorough in this process, ensuring that you identify and label every instance of the feature. When labeling your features, ensure that you are very accurate and precise with each feature that you label. You are establishing the ground truth Ground truth refers to the actual nature of the problem that is the target of a machine learning model, reflected by the relevant data sets associated with the use case in question. Supervised machine learning models are trained on labeled data that are considered for the model to identify patterns that predict those labels on new data. for the tool, and the tool's accuracy is a direct reflection of how accurately you label the features. See Creating Labels for the details of labeling.
7. Split the entire images into the 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. images and the test images. Utilize image sets to properly divide them into the training and test group. Add images to the training set.
   1. Select the images in the View Browser, and on the right-click pop-up menu click Add views to training set. To select multiple images in the View Browser, use the Shift + Left Mouse Button.
   2. 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.
8. Prior to training, you need to set parameters in Tool Parameters. You can configure Training, Sampling, Features (if necessary), and Perturbation parameters or just use the default values of these. See and 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 features that you are interested in identifying. So, if the Feature Size parameter setting is clearly going off from the size of features in your application, there is a chance the tool will not identify the features 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.
9. Once you have added desired images to the training set, press the Brain icon to train the tool.
   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.
   Tip: In addition to the following tips, consider using the bootstrap method of labeling your images. "Bootstrap" labeling refers to the process of beginning your labeling process by just labeling a small sample size of your images, then training the tool, and reviewing the results by accepting views with correct markings to convert them into labels, and removing incorrect markings and replacing them with correct labels. You can speed up this process further by dividing images into multiple views and only labeling a single view A view of an image is a region of pixels in an image. Tool processing is limited to the pixels within the view. You can manually specify a view, or you can use the results of an upstream tool to generate a view.. In addition, you can also temporarily reduce the Epoch Count parameter (one of the ), which will make the training time shorter.

10. After training, review the results. Open Database Overview panel and review the Confusion Matrix and Precision, Recall, F-Score for each feature and each model A specific spatial arrangement of a set of features (Blue Locate and Blue Read tools only.) During a post-processing step, the Blue Locate and Blue Read tools can fit all of the features detected in an image to the models defined for the tool. The overall pose and identity of the model is then returned. to understand the results.

11. 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.
    1. If the tool has correctly marked the features, right-click the image and select Accept View.

    2. If the tool has incorrectly marked the features, failed to identify a present feature, or placed a mismatch label to a feature, do the following:

       1. Right-click the image and select Accept View.
       2. Right-click the image again and select Clear Markings and Labels.
       3. Manually re-label the features in the image.
12. If you encountered the scenario in (10-a), you are ready to use the tool. If you encountered the scenario in (10-b), you will need to retrain the tool.