# Red Analyze High Detail Parameters

The parameters adjust how the neural network model is trained, and also how the tool processes statistical results. You can open and close the parameters side pane by selecting the tool and then clicking the % icon. You can access additional parameters that provide advanced features by selecting Expert Mode in the Help menu.

## Architecture, Mode, and Network Model Parameters

Parameter | Expert Mode | Description
Architecture | No | Specifies the type of neural network model. For more information, see Tool Architectures.
Mode | No | Specifies the tool mode, Basic or Adaptation. Select Basic to train a new tool or Adaptation to adapt an already trained tool with new images from your production line. For more information, see Adaptation Mode.
Network Model | No | Specifies the size of the neural network model, which affects the time required for training and processing. You can choose from the following options: Small: Select this option to make the processing time faster but it might decrease performance. Normal: Select this option for general projects. Large: Select this option when you have more complex images.

## Training Parameters

The Training tool parameters control the training process.

Note: If you change the training parameters of an already trained tool, you must retrain the tool.

Parameter | Expert Mode | Description
Maximum Epochs | Yes | Specifies the maximum number of epochs used for training. Training stops automatically if the training reaches convergence before reaching the Maximum Epochs value. If the training does not reach convergence before reaching the Maximum Epochs value, you decide whether to continue or stop the training.
Patience Epochs | Yes | Affects the time that the system waits before it can stop the training early. During training, the system checks if the model has reached optimal performance, and if so, the system can finish the training early. The value range is 0–100. A higher value corresponds to longer training time.
Patch Size | No | Specifies the size of the square that divides each view into several chunks. The system executes the training and the processing of each view based on each chunk. Select a smaller Patch Size for catching small subtle blobs, and a larger Patch Size for large obvious blobs to reach convergence in training faster.
Training Set | No | Specifies the training data set used to create a neural network model. The system only extracts the features of the images that are included in the training set. Click Edit to open a dialog where you can specify the sample sets and the percentage of the labeled images used as training samples. The system selects the training images randomly each time you start training.
Validation Set Ratio | No | Specifies the ratio of the views used in the validation set. The system randomly selects the validation set from the training set when you start the training. The value range is 1%–50%. If you increase the Validation Set Ratio while keeping the size of the training set, the amount of data used for training decreases. This means that a high Validation Set Ratio can negatively affect the performance when using a small training set. On the other hand, if the Validation Set Ratio is too low, it will not be helpful for selecting a good model for an unseen data set.

## Perturbation Parameters

With the Perturbation parameters, you can allow the tools to generate images that simulate the variations expected during runtime.

Read more...

For example, if your part rotates by +/-45 degrees, you can set the Rotation parameter, and the software rotates the images during training by that amount. However, image perturbation is not a substitute for collecting and training actual images. The image perturbations can only approximate the variations of real parts or scenes.

Note: For the best results, Cognex recommends using actual sample images of the part variations. When a part spins, there might be different shadows, which are not captured by the tool when the rotation is based on artificially spinning the image.

The Perturbation parameters are common across all of the tools, and you can use these parameters in combination. This way, you can generate more complex images by using the parameters separately, as well as in conjunction.

Note: All training image samples can be applied to perturbation. Every train image has 50% chance to be augmented to every checked options independently. By the law of large numbers, all perturbation options can be applied equally and trained by increasing the number of epochs.

Parameter | Expert Mode | Description
Horizontal Flip | No | Performs flipping in horizontal direction. Useful in cases where the location and the angles of the object are not strictly fixed.
Vertical Flip | No | Performs flipping in vertical direction. Useful in cases where the location and the angles of the object are not strictly fixed.
Rotation 90° | No | Performs 90° rotation in clockwise direction. If you check Horizontal Flip, Vertical Flip, and Rotation 90°, performs 0°, 90°, 180°, and 270° rotations probabilistically.
Rotation | No | Performs rotation between 0° to 45°. If you check Rotation 90°, Rotation, Horizontal Flip, and Vertical Flip, performs random rotation between 0° to 360°.
Zoom-In | No | Randomly zooms in from the center. The maximum zooming is 5/6 of the original size. The random variable follows uniform distribution. Useful when the defect to be detected has an irregular size.
Colorwise | No | Adjusts color by multiplying and/or adding different random values per channels. Use this parameter together with the Contrast and/or the Luminance parameter. The Colorwise parameter changes the way the Contrast and Luminance parameters are applied from applying the same value for all channels to different random values for each channel. Useful when the images have inconsistent color tone because of the irregular lighting environment.
Gradation | No | Randomly adjusts the gradation. Useful when the images have inconsistent gradation because of the irregular lighting environment.
Distortion | No | Applies a distortion by picking the points in the views and moving them. The number of points is the same or less than six. Useful when the images are distorted due to the deterioration of the optical equipment.
Contrast | No | Adjusts contrast by multiplying a random value for all channels. The random value follows uniform distribution within a range of 0 to 2. Useful when the images have inconsistent contrast because of the irregular lighting environment
Luminance | No | Adjusts luminance by adding a random value for all channels. The random value follows uniform distribution within a range of - 255 to 255. Useful when the images have inconsistent luminance because of the irregular lighting environment.
Sharpen | No | Randomly sharpens the views by image filtering within a range of 0 to 2. Useful when the image are too blurry.
Blur | No | Randomly applies Gaussian Blur to the views. The random variable follows to the Gaussian Sigma Distribution within a range of 0 to 2. Useful when the images are too sharp.
Noise | No | Applies noise by multiplying a random value per pixel for all channels. The random value follows uniform distribution within a range of 0 to 2. Useful when the images are distorted or contaminated by dust due to the deterioration of the optical equipment.

## Resizing Parameters

The Resizing parameters are for resizing views. Resizing is applied to all views while they are trained and processed, but the images are preserved in their original size in the View Browser and Image Display Area. For more information, see Resizing Views.

Parameter | Expert Mode | Description
Resize Mode | Yes | Specifies the mode for resizing views. Select Auto to allow the system to automatically resize views or select Manual to specify the views for resizing yourself.
Resize to | Yes | Specifies the resize factor as a percentage. The maximum value is 100%. Only available if you select the Manual Resize Mode.

## Processing Parameters

The Processing parameters control the way the tool processes images. Processing (in another word, inferencing) with the same models always gives the same results. You do not need to retrain the tool after changing the Processing parameters. You can see the effect after reprocessing the database.

Parameter | Expert Mode | Description
Threshold | No | Specifies the thresholds that determine whether the tool detects and marks regions as good or bad. The Threshold parameter has two settings, T1 and T2 (expressed as [T1,T2]. The tool classifies values below T1 as good, and values above T2 as bad. You can also set the T1 and T2 values using the Scores graphic in the Database Overview.
Region Filter | No | Specifies a filter for the tool to be used as criteria for found regions. By specifying a filter, regions that do not match the filter are removed from the results. If you leave the parameter empty, the tool returns all regions. Note: The syntax for filters is the same as the syntax used for Display Filters. For more information about constructing the syntax for a filter, see Custom Display Filters. The following region properties are available: score area perimeter compactness x y