The following example shows the verifying and refining process of the Anomaly Detector tool. In this specific example, the initial setup only used a few labeled views. Out of 80 images in the image database The set of images used to train and test your vision application.:

- A total of six views labeled as OK

- Four views assigned Train roles, two views assigned Test roles

## Viewing the Results

Following the completion of the Process step, you can filter the view panel by Result Class. In this case, filtering for NG displays all the views the tool predicted to have anomalies. Sort by ascending Score to see the lowest scored NG views the tool predicted first:

Use these views to verify how accurate the predictions of the Anomaly Detector tool are.

## Repeating Tool Setup

Go to the Label step and manually label views that are wrongly classified as OK. Label views that the tool correctly predicted as NG as NG to influence the anomaly score threshold and improve the performance of the tool. Experiment with how many views you need to label to get the desired results. In this example refinement process, five more views were labeled as OK and two as NG.

In the example, the tool predicted the following view to be NG with a high anomaly score, even though it is an OK image. Label the view as OK to further train the tool and help it learn what anomalies to look for. The Heat Map helps determine why the tool made the prediction and, in this case, it considered an area of the view where anomalies are not expected. To improve the performance of the tool further, go back to the ROI The Region of Interest (ROI) is the area of the image where the vision tool operates. step and narrow down the view by adjusting the Region of Interest The Region of Interest (ROI) is the area of the image where the vision tool operates..

Note: Once you apply a new ROI, the Process step is out of date and you can no longer see the predictions.

You can also assign Train roles to these newly labeled images to make sure the Anomaly Detector tool uses them for training.

To test the performance of the Anomaly Detector tool after the additional manual labeling Labeling is the process of marking features or defects in images, or categorizing the images into classes. Labeling is crucial for training Deep Learning Lite and Deep Learning Standard tools because the labels serve as training material to guide the tools how to function correctly. and ROI reset, train, and process views again and examine the results.

## Verifying the Results Again

The table shows new filtering after completing the steps again. Between the anomaly scores 62 and 72 the predicted views should actually be NG. This shows that the Anomaly Detector tool needs more refinement, and that the anomaly score threshold also needs adjusting.

Result Class: OK, sort by Score descending order | Result Class: NG, sort by Score ascending order
The selected views have wrong predictions. | The lowest scored views do have anomalies and all the NG predictions are correct.

Based on this information, you can set the anomaly score lower threshold limit to 60 in the Process step. Click Process All again and verify that the Anomaly Detector tool is now well-trained.

Result Class: OK, sort by Score descending order | Result Class: NG, sort by Score ascending order
The highest scored view is OK. | The lowest scored view is NG.

Sorting by score also helps spot any false positives or negatives remaining. Check for false positives and retrain as needed, as there might be views with anomalies scoring lower than the highest scoring OK view.