# Red Analyze Tool

| The Red Analyze tool is used to perform two types of defect detection, anomaly detection or defect detection (Focused - Unsupervised) and segmentation (Focused - Supervised, High Detail mode). These two different modes of operation stands for the differences that can exist between the two types of defect detection. There are two types of architecture used for Red Analyze; High Detail mode and Focused mode. High Detail mode and Focused mode use different architecture from each other, so there are some differences in tool parameter options. And because of the different architecture, the results and time spent for training/processing are different. Please see sections below for more information.

#### Focused - Unsupervised

With Focused - Unsupervised, Red Analyze tool is taught the appearance of the good parts – and only the good parts (including any and all acceptable variations) – so that it finds anomalies from the learned, normal appearance. As such, the tool tries to find a compact description of the object to be inspected. The tool's ability to find anomalies, both in terms of selectivity and specificity, depends largely on the compactness of the model. If, for instance, the part comes in different types and different orientations, the compactness gets reduced, and ambiguities between part types and orientations may prevent the tool from finding certain anomalies.

#### Focused - Supervised

With Focused - Supervised, Red Analyze tool is taught the appearance of defects. As such it does not (at least explicitly) form a model of the inspected part and as a consequence is much less dependent on part configuration, type or the conditions during image acquisition. However, the Red Analyze tool in Focused - Supervised mode will need to form an explicit model of the different types of defects. Thus, it needs both good and bad samples to train. In particular, it requires a representative collection of the latter (which are often quite challenging to obtain).

Also, while in Focused - Supervised mode, a Red Analyze tool can be used to search for differences other than defects. The tool can be used to identify different regions in an image that are intended to be there. A Red Analyze tool in Focused - Supervised mode could be used to label the targeted regions on the training images in order to be able find and mark similar type of regions on untrained images after training.

#### High Detail (Supervised)

With High Detail , Red Analyze tool is also taught the appearance of defects but coming with a different architecture from Focused - Supervised mode. Similar to Green Classify High Detail mode, Red Analyze High Detail mode samples from the entire region of each view both in training and processing, which means that it does not use a feature sampler for training and processing.

This difference offers a trade-off between the performance or the speed of the training that is left for your choice, like Green HDM. Thus, if you need better, detailed results and if you can bear with a little slowdown in Training/Processing speed, Red Analyze High Detail - Supervised can be your option. It forms an explicit model of the different types of defects and thus it still needs both good and bad samples to train.

| Focused - Supervised | High Detail (Supervised)
--- | --- | ---
Training/Processing Time | Short | Long
Results | Focused but less detailed results | Detailed and more accurate results

#### Unsupervised Mode vs Supervised Mode

The two modes are complementary, in terms of their performance and requirements, and can be used in combination. For example, an Unsupervised tool could be used to first filter the visual anomalies, and one or more subsequent Supervised tools would be used to find specific and visually difficult to discern defects like scratches, low contrast stains or texture changes.

Challenge | Unsupervised Mode | Supervised Mode
--- | --- | ---
Finds unforeseen defects | Likely | Hardly
Requires defect samples | No | Yes
Sensitivity to part configurations and variations | Strong | Weak
Detects line-type defects like scratches, cracks or fissures | Difficult | Easy
Detects specific defect-types | No | Possible
Measurable defect parameters (next to position and intensity) | None | Size, shape

Note:

- For more information about configuring the Red Analyze tool, see the Using the Red Analyze Tool topic.

- Within the Red Analyze tool, the default region names are “deviation”, the name applied to Unsupervised mode regions, and “defect”, the name applied to Supervised mode regions. There is a potential to have a mix of region names in the tool.

  This can be encountered under the following conditions:

  1. Create a Red Analyze tool and leave it in its default Unsupervised mode and set the tool’s ROI.
  2. Open the Database Overview.
  3. Launch the Edit Regions functionality, draw some defects and apply the changes.
  4. With the Edit Regions editor still open, switch the tool from its default mode (Unsupervised) to Supervised.
  5. Select another view, draw some defects and apply the changes.
  6. Note that the thumbnails in the View list and in the Database Overview will be out of sync with the name in the Edit Regions editor.

  To resolve the naming discrepancies, close the Edit Region editor and toggle the mode, which will cause the tool to merge and then correctly rename the regions.