# Labeling in Red Analyze

For Standard and Legacy type tools, label the bad views by manually drawing over the regions that have defects. You can create multiple classes for different types of defects in the same 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.. For example, you can create a class for scratches and another for blobs. The labels for the different classes appear in different colors.

Besides 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. bad views, include some defect free, good images in the training image set A collection of images of your specific application. A training image set represents images of a specific part or process acquired in a consistent way using the lighting, optical, and mechanical characteristics of your runtime system. The training image set includes images that represent the range of image appearances that you expect to see in normal operation. and label them as good.

The accuracy of your labeling is crucial for the performance of the tool. Mislabeled views can negatively impact 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. by teaching the tool incorrectly.

The image shows two classes of labeled defects with different colors. On the top of the image, you can see the Edit Regions toolbar, which has the labeling tools you can use for drawing the labels.

Note: You can import labels as image files, JSON files, or files in VisionPro Deep Learning internal label format. See Label Import/Export Plug-in for more information.

## Labeling Procedure

To label views:

1. To label good views, select all of the good views in the view browser and either:
   1. Right-click and select the Label Views as Good option from the context menu.
   2. Click the Actions for N Views menu option and select the Label Views as Good option.

2. To label bad views, open the Edit Regions Toolbar with any of the following methods:

   - Select View > Edit Regions in the main menu bar.

   - Right-click in an image and select Edit Regions from the context menu.

   - Use the Ctrl+R keyboard shortcut.

   The toolbar appears at the top of the image view area.

3. Use the tools in the toolbar to draw over the regions that have defects.

   You can switch between the defect classes in the toolbar or by pressing the numerical key assigned to the class. For example, press 1 to switch to the first class, and press 2 to switch to the second.

   Note: If the labels seem to be incorrect or noisy over many views, you can examine the quality level of the label for each view and correct the wrong label. For more information, see Label Quality Check.
4. Once you have carefully and accurately drawn your defect region, click Apply or press Enter. You must do this on an image-by-image basis.
5. After drawing all the regions, click Close.

## Labeling Best Practices

- Use the AI Click Tool and the AI Box Tool to automatically draw regions by clicking on a region.

- Use the Bootstrap Labeling method to label fast.

- Draw the regions as precisely and consistently as possible.

  - Small amounts of the region outside of the defect is acceptable.

  - Avoid drawing larger areas. This can cause the tool consider the background a defect.

  - Avoid underfilling a defect.

  The graphics below show the best methods for drawing over a defect. The dark grey lines represent the defect, and the red is the region defining the defect.

  The ideal way to draw the region is to align it closely with the defect. | This method covers too much of the background and causes the tool to consider the background as a defect. | This method misses parts of the defect, and causes the tool to consider the parts not outlined in red as not being a defect.