Solve Difficult Problems¶
The following means help improve the speed of training and deployment and the accuracy of the models.
Data Augmentation¶
The data set for training the model needs to contain as much as possible all situations that may actually occur.
If the site does not have the corresponding data-collecting conditions, you can adjust the Data Enhancement parameters to prepare data that can not be collected, thus enriching the training data set.
Data Augmentation Parameters¶
Attention
Please ensure that the added data reflects the actual on-site situations. For example, if there are no rotations on the site, then there is no need to adjust the parameter “Rotation”. Otherwise, the model’s performance may be affected.
Brightness
It refers to how much light is present in the image. When the on-site lighting changes greatly, by adjusting the brightness range, you can augment the data to have larger variations in brightness.
Contrast
Contradiction in luminance or color. When the objects are not obviously distinct from the background, you can adjust the contrast to make the object features more obvious.
Translation
Add the specified horizontal and vertical offsets to all pixel coordinates of the image. When the positions of on-site objects (such as bins, pallets, etc.) move in a large range, by adjusting the translation range, you can augment the data in terms of object positions in images.
Rotation
Rotate an image by a certain angle around a certain point to form a new image. In general, keeping the default parameters can meet the requirements. When the object orientations vary greatly, by adjusting the rotation range, you can augment the image data to have larger variations in object orientations.
Scale
Shrink or enlarge an image by a certain scale. When object distances from the camera vary greatly, by adjusting the scale range parameter, you can augment the data to have larger variations in object proportions in the images.
Flip horizontally
Flips the image 180° left to right. If the objects to be recognized have left-right symmetry, you can turn on Flip horizontally.
Flip vertically
Flips the image 180° upside down. If the objects to be recognized have vertical symmetry, you can turn on Flip vertically.
Dilation
Enlarge the regions of defects selected in an image by a certain scale. Only supported in the Defect Segmentation module. For most scenarios, you do not need to check this option.
If the regions of defects are too small, you can check this option to avoid affecting training when the defect regions are too small after image scaling.
Improve Model Training Speed and Accuracy¶
The default parameter settings can meet the requirements of most scenarios. If you need to improve the model training speed or model accuracy, you can adjust the training parameters and retrain the model.
Training Parameters¶
Input image size
The pixel-wise height and width of the image input to the neural network for training.
It is recommended to use the default setting, but if the objects or defect regions in the images are small, you need to increase the input image size.
The larger the image size, the higher the model accuracy, but the lower the training speed.
Batch size
The number of samples selected for each time of neural network training. It is recommended to use the default settings; if you need to increase the training speed, you can appropriately increase the batch size. If the batch size is set too large, memory usage will increase.
Model type
Defect Segmentation
Normal: Generally, it is recommended to use Normal mode.
Enhanced: You can choose the Enhanced mode when the model effect is not as expected or the accuracy requirement is high. This mode will decrease the training speed.
Instance Segmentation
Normal (better with GPU deployment): Select this option when the model is deployed on a GPU device.
Lite (better with CPU deployment): Select this option when the model is deployed on a CPU device.
Eval. interval
The number of epochs for each evaluation interval during model training. It is recommended to use the default setting.
Increasing the Eval. interval can increase the training speed.
The larger the parameter, the faster the training; the smaller the parameter, the slower the training, but a smaller value helps select the optimal model.
Epochs
The total number of epochs of model training. It is recommended to use the default setting.
If the features of objects to be recognized are complex, it is necessary to increase the number of training epochs appropriately to improve the model performance, but increasing the number of epochs will lead to longer training time.
Attention
It is not true that the bigger the number of epochs, the better. When the total number of epochs is set to be large, the model will continue to be trained after the accuracy stabilizes, which will result in a longer training time and the risk of overfitting.
Learning rate
The learning rate sets the step length for each iteration of optimization during neural network training.
It is recommended to use the default setting,
When the loss curve shows a slow convergence, you can appropriately increase the learning rate; if the accuracy fluctuates greatly, you can appropriately decrease the learning rate.
GPU ID
Graphics card information of the model deployment device.
Model simplification
This option is used to simplify the neural network structure. It is not checked by default. When the training data set is relatively simple, checking the option can improve the training and inference speeds.
Model Finetuning¶
Self Finetuning: Train based on the optimal model trained last time, which helps reduce the training time.
Super Model Finetuning: Perform fine-tuning based on the existing Super Model. You need to select the existing Super Model and add images on which the model has poor performance for training, thus saving the training time.
A Super Model example: the Super Model for boxes. Click here to download.
Improve Model Inference Speed and Accuracy¶
The default parameter settings can meet the requirements of most scenarios. If you need to improve the inference speed or accuracy, you can adjust the parameters under deployment settings.
Deployment Settings¶
Batch size
The number of samples taken at one time for model inference. It is recommended to use the default setting.
For the Defect Segmentation module, if the image size is too large and the defect regions are small, appropriately increasing the batch size can speed up the inference, but will lead to higher memory usage.
Float precision
FP32 : High model accuracy, low inference speed.
FP32 : Low model accuracy, high inference speed.
Image preprocessing device
GPU : For pre-processing image data before using the model for inference. Generally, it is recommended to select GPU.
CPU : If the images are large and image preprocessing should be fast, you can select CPU.
Model type to export
dlkmo: The model optimization takes about 5 minutes. This model type is for the situation where the GPU graphics card models are different for model training and model deployment.
dlkmt: No optimization is required for this type. This model type is for the situation where the GPU graphics card models are the same for model training and model deployment.
GPU ID
The graphics card information of the device deployed by the user. If the user’s device has multiple GPUs, the model deployment can be done on a specified GPU.