Experiment settings: Image classification
The settings for an image classification experiment are listed and described below.
General settings
Dataset
This setting defines the dataset for the experiment.
Problem category
This setting defines a particular general problem type category, for example, image.
- The selected problem category (for example, image) determines the options in the Problem type setting.
- The From experiment option enables you to utilize the settings of an experiment (another experiment).
- The From experiment option is unavailable when you select AutoDL as the experience level.
Experiment
This setting defines the experiment H2O Hydrogen Torch references to initialize the experiment settings. H2O Hydrogen Torch initializes the experiment settings with the values from the selected (built) experiment.
This setting is available only if From experiment is selected in the Problem category setting.
Problem type
This setting defines the problem type of the experiment, which also defines the settings H2O Hydrogen Torch displays for the experiment.
- The selected problem category (in the Problem category setting) determines the available problem types.
- The selected problem type and experience level determine the settings H2O Hydrogen Torch displays for the experiment.
Import config from YAML
This setting defines the YML file that defines the experiment settings.
- H2O Hydrogen Torch supports a YML file import and export functionality. You can download the config settings of finished experiments, make changes, and re-upload them when starting a new experiment in any instance of H2O Hydrogen Torch.
- To learn how to download the YML file (configuration file) of a completed experiment, see Download an experiment's logs/config file.
Experiment name
This setting defines the name of the experiment.
Use previous experiment weights
This setting determines whether to initialize the model weights with the weights from the experiment specified in the Experiment setting.
A model's weights are available for an experiment (model) of the same problem type and backbone.
This setting might be useful in case you want to continue training from a built experiment.
The Use previous experiment weights setting is available only if From experiment is selected in the Problem category setting.
Dataset settings
Train dataframe
This setting specifies the path to a file that contains a dataframe comprising training records utilized by H2O Hydrogen Torch for model training within the experiment. Here, the term 'file' denotes a specific file adhering to a dataset format tailored for the problem type addressed in the experiment. To learn more, see Dataset formats.
- The records are combined into mini-batches when training the model.
- If a validation dataframe is provided, a fold column is not needed in the train dataframe.
- To import datasets for inference only, when defining the settings for an experiment, set the Train dataframe setting to None while setting the Test dataframe setting to the relevant dataframe (as a result, H2O Hydrogen Torch utilizes the relevant dataset for predictions and not for training).
Data folder
Defines the location of the folder containing assets (for example, images or audio clips) the model utilizes for training. H2O Hydrogen Torch loads assets from this folder during training.
Validation strategy
This setting specifies the validation strategy H2O Hydrogen Torch uses for the experiment.
To properly assess the performance of your trained models, it is common practice to evaluate it on separate holdout data that the model has not seen during training.
Details
Options
- K-fold cross validation
- This option splits the data using the provided optional fold column in the train data or performs an automatic 5-fold cross-validation in the absence of a fold column.
- Grouped k-fold cross-validation
- This option allows you to specify a group column based on which the data is split into folds.
- Custom holdout validation
- This option specifies a separate holdout dataframe.
- Automatic holdout validation
- This option allows you to specify a holdout validation sample size that is automatically generated.
Validation dataframe
This setting defines a file containing a dataframe with validation records that H2O Hydrogen Torch uses to evaluate the model during training.
- To set a Validation dataframe requires the Validation strategy to be set to Custom holdout validation. In the case of providing a validation dataframe, H2O Hydrogen Torch fully respects the choice of a separate validation dataframe and does not perform any internal cross-validation. In other words, the model is trained on the full provided train dataframe, and model performance is evaluated on the provided validation dataframe.
- The validation dataframe should have the same format as the train dataframe but does not require a fold column.
The Validation dataframe settings is only available when you select Validation strategy in the Custom holdout validation setting.
Selected folds
This setting defines the selected validation fold(s) in case of cross-validation; a separate model is trained for each value selected. Each model utilizes the corresponding part of the data as a holdout sample to assess performance while the model is fitted to the rest of the records from the training dataframe. As a result, folds estimate how the model performs in general when used to make predictions on data not used during model training.
H2O Hydrogen Torch allows running experiments on a single selected fold for faster experimenting and multiple selected folds to gain more trust in the model's generalization and performance capabilities.
This setting is available only when the Validation strategy setting is not set to Custom holdout validation or Automatic holdout validation.
Test dataframe
This setting defines a file containing a dataframe with test records that H2O Hydrogen Torch uses to test the model.
- The test dataframe should have the same format as the train dataframe but does not require a label column.
- To import datasets for inference only, when defining the setting for an experiment, set the Train dataframe setting to None while setting the Test dataframe setting to the relevant dataframe (as a result, H2O Hydrogen Torch utilizes the relevant dataset for predictions and not for training).
Data folder test
Defines the location of the folder containing assets (for example, images, texts, or audio clips) H2O Hydrogen Torch utilizes to test the model. H2O Hydrogen Torch loads the assets from this folder when testing the model. This setting is only available if a test dataframe is selected.
- This setting is only available if a test dataframe is selected.
- The Data folder test setting appears when you specify a test dataframe in the Test dataframe setting.
Unlabeled dataframe
Defines a separate CSV or Parquet file (depending on the problem type) containing a dataframe with unlabeled records that H2O Hydrogen Torch utilizes to generate pseudo labels. H2O Hydrogen Torch first trains the model with the provided labeled data (Train dataframe). Right after, the model predicts pseudo labels for the provided unlabeled dataframe before doing another training run that combines the original labels and pseudo labels.
- Image regression | Image classification | Image object detection
- The unlabeled dataframe just needs to contain a single image column
- Text regression | Text classification
- The unlabeled dataframe just needs to contain a single text column
- Audio regression | Audio classification | Speech recognition
- The unlabeled dataframe just needs to contain a single audio column
- Image regression | Image classification | Image object detection | Audio regression | Audio classification | Speech recognition
- Assets (images or audios) need to be located in the Data folder (setting)
- All supported problem types
- The training time can significantly increase depending on the size of the unlabeled data
As labeling can be expensive, having additional unlabeled data is quite common. Providing this unlabeled data in H2O Hydrogen Torch trains the model semi-supervised, potentially improving the model quality in contrast to only training on labeled data.
Label columns
This setting defines the name(s) of the dataframe column(s) that refer to the target value(s) an H2O Hydrogen Torch experiment can aim to predict.
Image column
Defines the dataframe column storing the names of images that H2O Hydrogen Torch loads from the Data folder and Data folder test when training and testing the model.
Data sample
This setting defines the percentage of the data to use for the experiment. The default percentage is 100%.
Changing the default value can significantly increase the training speed. Still, it might lead to a substantially poor accuracy value. Using 100% of the data for final models is highly recommended.
Data sample choice
This setting specifies the data H2O Hydrogen Torch samples according to the percentage set in the Data sample setting. H2O Hydrogen Torch does not sample the unselected data.
The Data sample choice setting is only available if the value in the Data sample setting is less than 1.0.
Image settings
Image width
Defines the width H2O Hydrogen Torch uses to rescale the images for training and predictions.
Depending on the original image size, a bigger width can generate a higher accuracy value.
Image height
Defines the width H2O Hydrogen Torch uses to rescale the images for training and predictions.
Depending on the original image size, a bigger width can generate a higher accuracy value.
Image channels
Defines the number of channels the train images contain.
- Typically images have three input channels (red, green, and blue (RGB)), but grayscale images have only 1. When you provide image data in a NumPy data format, any number of channels is allowed. For this reason, data scientists can specify the number of channels
- The defined number of channels also refers to the provided validation and test datasets
Image normalization
Grid search hyperparameter
Defines the transformer to normalize the image data before training the model.
Usually, state-of-the-art image models normalize the training images by scaling values of each of the input channels to predefined means and standard deviations.
Details
Options
Details
Image regression | Image classification | Image object detection | Image semantic segmentation | Image instance segmentation | Image metric learning
- Channel
- Calculates mean and standard deviation per channel in all the images in the batch and then applies per channel normalization: subtracts mean and divides by standard deviation.
- Image
- Calculates mean and standard deviation per image and then applies normalization.
- ImageNet
- Divides input images by 255 and normalizes with mean and standard deviation equal to (0.485, 0.456, 0.406) and (0.229, 0.224, 0.225) per channel, respectively.
- Inception
- Divides input images by 255 and normalizes with mean and standard deviation equal to 0.5.
- Min_Max
- Calculates minimum and maximum values in all the images in the batch and then applies min-max normalization: subtracts min and divides by the max and min difference.
- No
- No normalization is applied to the input images.
- Simple
- Divides input images by 255.
Details
3D image classification | 3D image regression | 3D image semantic segmentation
- No
- No normalization is applied to the input images.
- Simple
- Divides input images by 255.
- Min_Max
- Calculates minimum and maximum values in all the images in the batch and then applies min-max normalization: subtracts min and divides by the max and min difference.
Usually, state-of-the-art image models normalize the training images by scaling values of each of the input channels to predefined means and standard deviations.
Augmentation settings
Augmentations strategy
Grid search hyperparameter
Defines the augmentation strategy to apply to the input images. Soft, Medium, and Hard values correspond to the strength of the augmentations to apply.
Details
Options
Details
Image regression | Image classification | Image object detection | Image semantic segmentation | Image instance segmentation | Image metric learning | Image and text classification
- Soft
- The Soft strategy applies image Resize and random HorizontalFlip during model training while applying image Resize during model inference.
- Medium
- The Medium strategy adds ShiftScaleRotate and CoarseDropout to the list of the train augmentations.
- Hard
- The Hard strategy applies RandomResizedCrop (instead of Resize) during model training while adding RandomBrightnessContrast to the list of train augmentations.
- Custom
- The Custom strategy allows users to use their own augmentations that can be defined in the following two settings:
- Custom train augmentations
- Custom inference augmentations
- The Custom strategy allows users to use their own augmentations that can be defined in the following two settings:
Details
3D image classification | 3D image regression | 3D image semantic segmentation
- Soft
- The Soft strategy applies image Resize and random HorizontalFlip during model training while applying image Resize during model inference.
- Medium
- The Medium strategy adds ShiftScaleRotate and CoarseDropout to the list of the train augmentations.
- Hard
- The Hard strategy applies RandomResizedCrop (instead of Resize) during model training while adding RandomBrightnessContrast to the list of train augmentations.
Augmentations are ways to modify train images while keeping the target values valid, such as flipping the image or adding noise. Distorting training images do not influence the expected prediction of the model but enrich the training data. Augmentations help generalize the model better and improve its accuracy.
Custom train augmentations
This setting specifies a list of custom augmentations to be applied to the training data. The augmentations are defined in a JSON file generated by calling the albumentations.save()
function from the Albumentations library. You can use the placeholders IMAGE_HEIGHT
and IMAGE_WIDTH
to dynamically incorporate the image dimensions from the experiment configuration.
Augmentations are ways to modify train images while keeping the target values valid, such as flipping the image or adding noise. Distorting training images do not influence the expected prediction of the model but enrich the training data. Augmentations help generalize the model better and improve its accuracy. Augmentations are applied to every image at each epoch with the provided probability.
The Custom train augmentations setting is only available when you select Custom in the Augmentations strategy setting.
Custom inference augmentations
This setting allows you to define a list of custom inference augmentations that are applied to the test and validation data.
The augmentations are specified in a JSON format, which is generated by calling the albumentations.save()
function from the Albumentations library.
To make it easier to adapt the augmentations to different image dimensions, you can use the IMAGE_HEIGHT
and IMAGE_WIDTH
placeholders, which are replaced with the actual image dimensions from the experiment configuration.
Inference augmentations serve the same purpose as training augmentations, but the difference is that inference augmentations are applied to validation and test data. Typically, inference augmentations only contain resizing or very simple augmentations.
The Custom inference augmentations setting is only available when you select Custom in the Augmentations strategy setting.
Mix image
Grid search hyperparameter
Defines the image mix augmentation to use during model training.
Details
Options
Details
Image regression | Image classification | Image object detection | Image semantic segmentation | Image instance segmentation
- Mixup
- Mixup overlays (mixes) two images one on another based on a random ratio. To learn more about this mix augmentation approach, refer to the following article: mixup: BEYOND EMPIRICAL RISK MINIMIZATION.
noteFor an image object detection experiment using Mixup, H2O Hydrogen Torch uses the union of all the target boxes in mixed images.
- Cutmix
- Cutmix replaces an image region with a patch from another image; the region size is based on a random ratio. To learn more about this mix augmentation approach, refer to the following article: SOLVING LINEAR SYSTEMS OVER TROPICAL SEMIRINGS THROUGH NORMALIZATION METHOD AND ITS APPLICATIONS.
noteFor an image object detection experiment using Cutmix, H2O Hydrogen Torch uses the target boxes from the corresponding region from each image. Also, with Cutmix selected, H2O Hydrogen Torch cuts out and replaces only the corners of the images with a patch from another image.
- Disabled
- No augmentation is applied.
Details
3D image classification | 3D image regression | 3D image semantic segmentation
- Mixup
- Mixup overlays (mixes) two images one on another based on a random ratio. To learn more about this mix augmentation approach, refer to the following article: mixup: BEYOND EMPIRICAL RISK MINIMIZATION.
noteFor an image object detection experiment using Mixup, H2O Hydrogen Torch uses the union of all the target boxes in mixed images.
- Disabled
- No augmentation is applied.
Mix target
Grid search hyperparameter
This setting defines the target (label) mix augmentation to apply during model training.
Details
Options
Details
Image regression | 3D image regression | Image classification | 3D image classification | Image object detection | Image semantic segmentation | 3D image semantic segmentation | Image instance segmentation | Audio regression | Audio classification
- Ratio: Two classification targets are averaged based on the sample ratio during model training.
- Min: The minimum of both targets is taken while ignoring the ratio during model training.
- Max: The maximum of both targets is taken while ignoring the ratio during model training.
Cutmix corner
Grid search hyperparameter
When turned On, cutmix augmentation is applied where only the corners of an image are replaced with a patch from another image.
The Cutmix corner setting is only available when the Cutmix option is selected in the Mix image setting.
Mix concentration
Grid search hyperparameter
This setting defines the concentration parameter value of the Beta probability distribution to generate mix ratios. A larger value leads to more equal ratios (50% - 50%) for mixing.
- Image problem types: The Mix concentration setting is only available when the Mixup option is selected in the Mix image setting.
- Audio problem types: The Mix concentration setting is only available when the Mixup option is selected in the Mix audio setting.
Mix probability
Grid search hyperparameter
This setting defines the probability value to apply mix augmentation. The mix probability value is used for each batch or mix iteration.
If the mixing probability is specified as 0.3, mix augmentation is applied to each batch (or mix iteration) with a probability of 0.3.
- Image problem types: The Mix probability setting is only available when the Mixup option is selected in the Mix image setting.
- Audio problem types: The Mix probability setting is only available when the Mixup option is selected in the Mix audio setting.
Mix iterations
Grid search hyperparameter
- Image problem types: This setting defines the number of times to apply mix augmentation on each batch. The larger the value, the more images are mixed into a single train sample.
- Audio problem types: This setting defines the number of times to apply mix augmentation on each batch. The larger the value, the more audios are mixed into a single train sample.
- Image problem types: The Mix iterations setting is only available when the Mixup option is selected in the Mix image setting.
- Audio problem types: The Mix iterations setting is only available when the Mixup option is selected in the Mix audio setting.