# 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 Focused 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
--- | --- | --- | ---
Architecture | The processing time of High Detail modes is usually longer than that of Focused 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 determines the number of samples required for a given image size. The larger the feature 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 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 Focused Unsupervised Expert Mode) | Increasing the iteration value increases processing time linearly. | N/A
Low Precision (Focused mode) | 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 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 Focused 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), 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.