# Red Analyze Tool

| The Red Analyze tool is used to perform two types of defect detection; anomaly/defect detection (Focused - Unsupervised) and segmentation (Focused - Supervised, High Detail, High Detail Quick). These two different modes of operation stands for the differences that can exist between the two types of defect detection. There are 3 types of architecture used for Red Analyze; High Detail modes, High Detail Quick mode, and Focused mode. High Detail mode and Focused mode use different architecture from each other, so there are differences in tool parameter options. And because of the different architecture, the results and time spent for training/processing are different. High Detail Quick mode basically shares a similar architecture with High Detail mode but it doesn't have the validation step in training phase and produces results much more quickly than High Detail mode. Please see the sections below for more information.

#### Focused - Unsupervised

With Red Analyze 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 Red Analyze 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 Red Analyze 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 Classify High Detail. 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 | Accurate | More Accurate

### High Detail - Quick (Supervised)

Red Analyze High Detail Quick is the speed-optimized version of Red Analyze High Detail, sacrificing a little detection accuracy for greater speed. To extract the most speed available, it skips calculating the validation loss and picks the best neural network model without the validation set in training phase. Instead of using the validation set and the validation loss, it uses a state-of-the-art learning algorithm to guarantee robust results. Therefore, Red Analyze High Detail Quick can considerably boost up training speed while maintaining the deviation of detection accuracy within a subduable range.

Adding to the use of validation set and the speed-accuracy tradeoff, the training of Red Analyze High Detail Quick became almost effortless as it does not require a lot of parameters for acquiring decent performance due to its advanced architectural backbone.

Away from these features, the training, processing, and interpretation of the results of Red Analyze High Detail Quick are similar to those of Red Analyze High Detail. For other details of Red Analyze High Detail Quick usage, see Red Analyze Tool – High Detail Quick.

| High Detail (Supervised) | High Detail Quick (Supervised)
--- | --- | ---
Training Time | Long | Very Short
Results | More Accurate | Accurate

Note: As Red Analyze High Detail Quick becomes out of the "training with validation" scheme, it does not offer validation loss and does not support Loss Inspector.

#### 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 (Red Analyze Focused Unsupervised) tool could be used to first filter the visual anomalies, and one or more subsequent Supervised tools (Red Analyze Focused Supervised, Red Analyze High Detail, Red Analyze High Detail Quick) 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.