Model Training
Instructions For Use
The purpose of model training is to perform neural network model training using generated training data. The entire training procedure obtains a better network model through multiple iterations (epochs). Simultaneously, hyperparameter tuning (such as learning rate, batch size, etc.) can improve the efficiency and accuracy of model training to obtain a usable neural network model.
Additionally, a small number of sample data can be used to fine-tune a pretrained model, making the model better adapt to specific application scenarios while reducing training time.
Parameter Description
- Training Data Path: Select the folder of the generated training data.
- Training Model Purpose: Automatically matched after selecting the training data path.
- Model Algorithm: Select an appropriate model algorithm based on the model purpose. The most recommended algorithm is automatically selected, and users can choose according to their needs. If this parameter defaults to "Custom," it indicates the resources_ml resource package was not successfully configured. When loading a pretrained model, the model algorithm will be automatically matched based on the pretrained model.
- Training Config File: Select the algorithm configuration file (*.sdt) required for training. This file records some hyperparameters used in the training procedure, such as backbone network structure and backbone network weights. When the model algorithm parameter selects a specific network structure, this parameter automatically selects the training config file from the default path (resources_ml/trainer_config); when the model algorithm parameter selects "Custom," a training config file from a custom path can be chosen.
- Training Times: The number of times (Epochs) all training data participates in model training. As training times increase, model fitting improves but may lead to overfitting.Running time is proportional to training times. The default value is 10, and users can adjust as needed.
- Batch Size: The number of images processed in a single step during one training iteration. A set of training data composed of multiple images is called a Batch, and the number of images contained in each Batch is called the Batch Size. Appropriately increasing the batch size can improve training efficiency and model accuracy, but it is limited by the memory of the inference device (GPU for training) or system memory (CPU for training). The default value is 1, and users need to select based on their configuration.
- Learning Rate: Indicates the update magnitude of model parameters (Learning Rate), which can be set based on needs and experience. If it is difficult to determine a suitable learning rate, this parameter can be left blank. The product has a built-in base learning rate and base batch size; it will use a linearly scaled learning rate based on the batch size set by the user.
- Training Log Path: The user-defined storage path for training logs. Multiple folders will be generated under this path. An empty folder must be selected.
- Load Pretrained Model: If this option is checked, you need to select the model file (.sdm) of the pretrained model and choose a fine-tuning method. The tool will perform transfer learning based on the pretrained model. When the model algorithm is SegFormer or Mask2Former, the fine-tuning methods available are full finetuning and LoRA fine tuning. Other model algorithms only support full finetuning. LoRA fine tuning is suitable for efficient transfer training of large-parameter models, reducing resource consumption for transfer learning of such models.
Note:- If the pretrained model is a Mask2Former binary classification or land cover classification model, the classification system of the training data (including the number of classes and class order) can be different from that of the pretrained model. It supports transferring from a land cover classification model to a binary classification model. However, the training data dimensions, number of image bands, and band order must be consistent with the pretrained model.
- If the pretrained model is other than Mask2Former, the training data dimensions, classification system, number of image bands, band order, and training model purpose must be consistent with the pretrained model.
- Processor Type: Data can be processed using the computer's Central Processing Unit (CPU) or Graphics Processing Unit (GPU). GPUs have faster computation speeds.
- GPU ID: Specify the GPU ID for data processing. Default is 0. If "Processor Type" is set to CPU, this value is fixed at -1. If using a GPU, you need to query the GPU ID via the "nvidia-smi" command in the system command line. The GPU ID should be based on the query results. If there are multiple GPUs, you can specify the GPU identifier(s) to be used for data processing. To use multiple GPUs, separate the IDs with English commas ",", e.g., "0,2,3", indicating the use of GPUs with IDs 0, 2, and 3.
- Model Storage Path: Specify the path to save the model.
- Model Name: Specify the model name.
Related Topics