# Optimizing Parameters for Faster Processing

The header row of the following table lists the parameters that affect processing time. In the second row, you can see the tools where these parameters are available and guidelines for estimating the effect on processing time.

Parameters | Feature Size | Sampling Density | Color Channels | Precision | Iteration
--- | --- | --- | --- | --- | ---
Tools | Blue Locate Red Analyze Green Classify | Blue Locate Red Analyze Green Classify | Blue Locate Red Analyze Green Classify | Blue Locate | Red Analyze Unsupervised in Expert mode
Processing Time |  |  |  |  |

The parameter choices affect tool runtime speed but there is typically a trade-off between speed, and accuracy or robustness.

Parameters | Effect on Speed | Best Value Option | Comments
--- | --- | --- | ---
Type | The processing time of Standard modes is usually longer than that of Legacy modes (and SuaKIT Segmentation/Classification) because of the difference in both post- and pre-processing logic. | N/A | N/A
Feature Size | At runtime, the tools need to sample the entire input image. The feature size The subjective size of the image features that you feel are most important for analyzing image content. The feature size determines the size of the image region used for sampling. Only used with Blue Locate, Blue Read, and Legacy type tools. determines the number of samples required for a given image size. The larger the 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). size, the fewer the samples. | O(n2) increase in speed with larger feature size. | Larger feature sizes might cause the tool to miss features or defects. Use the Parameter Search parameter optimization utility to find an optimal feature size.
Sampling Density | Similarly to feature size, the sampling density The amount by which the sampling point is moved in the image between samples, expressed in terms of the feature size. If the feature size is 100 and the sampling density is 1, the sampling location is advanced by 100 pixels between samples. A sampling density of 4 advances the sampling location by 25 pixels between samples. determines the number of samples required for a given image size. | O(n2) increase in speed with lower sampling density. | Risk of missing features or defects.
Refinement parameters | The Blue Locate and Red Analyze tools include the following processing-time parameters that provide more accurate results at the cost of increasing execution time: Blue Locate tool: Precision Red Analyze tool: Iterations (Red Analyze Unsupervised Expert Mode) | Increasing the iteration value increases processing time linearly. | N/A
Low Precision (Legacy type tool) | If your system meets certain specific requirements (CUDA Compute Capability 6.1 or greater), you can enable the Low Precision processing mode for the Red Analyze and the Green Classify tools. Enabling Low Precision mode converts any existing trained tool to use a low-precision computation mode during processing, and it generates low-precision tools for all future 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. operations until it is disabled. Note: Once you convert a tool to use the Low Precision mode, you must retrain it to disable Low Precision mode. Low precision tools can execute from 25% to 50% faster than normal-precision tools. | Additional runtime speed improvements for low precision tools are seen on systems with Turing Tensor cores. | Changing a tool to use Low Precision mode might change the results the tool produces to a small degree. Generally high-level feature identification, defect classification, and general classification are unchanged, but specific feature and defect regions and scores might change slightly.

## Feature Size Optimization

Feature size strongly influences processing time (n2 ), and to a lesser extent, the time required to train a tool. A feature size of 100 is 100 times faster than a size of 10, while a feature size less than 15 usually does not yield good results. A larger feature size is much quicker to process, but larger feature sizes cannot "see" or "respond to" small features.

For both training and runtime, each tool collects image samples that completely cover the extent of the image.

During training, the tool samples the entire extent of the input image, and it oversamples regions that it determines contain more information.

## Sampling Density Optimization

The Sampling Density parameter determines how densely the image is sampled. The smaller the number, the fewer samples are taken of the image.

A Sampling Density setting of 0.5 is four times faster than a setting of 1 [0(n2)].

## Color Channels Optimization

If your application relies on color images, only use the minimal number of required color channels possible, and only send images that already have the correct number of channels to avoid conversion. This is because:

## Precision Optimization

The Blue Locate tool has the Precision parameter, which is used to indicate when the tool stops looking for features after it has reached the desired positional precision. This is set as a percentage of the feature size being searched for:

If Precision is equal to 400 % the tool stops at D0

200 %: D1

100 %: Matches with precision

Stop criteria:

## Iteration Optimization

The Red Analyze Unsupervised tool has the Iterations parameter in Expert Mode. This parameter specifies the number of additional iterations in interesting areas the tool performs to locally improve the results of the analysis.

## Region of Interest (ROI) Optimization

When configuring your Region of Interest (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.), try to create a ROI that is as small as possible.When using the Red Analyze tool, mask everything in the image that is not relevant to the application.