Dataset format: 3D Image classification
Dataset format
The data for a 3D image classification experiment needs a zip file (1) containing a CSV file (2) and an image folder (3).
folder_name.zip (1)
│ └───csv_name.csv (2)
│ │
│ └───image_folder_name (3)
│ └───name_of_image.image_extension
│ └───name_of_image.image_extension
│ └───name_of_image.image_extension
│ ...
You can have multiple CSV files in the zip file that you can use as train, validation, and test dataframes:
- A train CSV file needs to follow the format described above
- A validation CSV file needs to follow the same format as a train CSV file
- A test CSV file needs to the same format as a train CSV file, but does not require a label column(s)
- The available dataset connectors require the data for a 3D image classification experiment to be in a zip file. Note
To learn how to upload your zip file as your dataset in H2O Hydrogen Torch, see Dataset connectors.
- A CSV file containing the following columns:
- An image column containing the names of the images for the experiment, where each image has an image extension specified Note
- Images can contain a mix of supported image extensions. To learn about supported image extensions, see Supported 3D image extensions for 3D image processing.
- The names of the image files do not specify the data directory (location of the images in the zip file). You can specify the data directory (data folder) when uploading the dataset or before the dataset is used for an experiment. For more information, see Import dataset settings.
- One or more label columns containing either one-hot encoded multi-class labels or multiple multi-class/multi-label labels. For multi-class and binary classification, a single label column is sufficient Note
- H2O Hydrogen Torch can solve both multi-class and multi-label classification problems. In multi-class problems, the classes are mutually exclusive, while the classes represent unique labels for multi-label problems. For N label class columns, in multi-class problems, only a single column could be set to 1, while in multi-label problems, all or none could be set to 1.
- For binary classification experiments utilizing precison, recall, F1, F05, or F2 as a metric, the label column needs to contain 0/1 values. If the column contains string values, the column is transformed into multiple columns using a one-hot encoder method resulting in the experiment being treated as a multi-class classification experiment while leading to an incorrect calculation of the precision, recall, F1, F05, or F2 metric.
- An optional fold column containing cross-validation fold indexes Note
The fold column can include integers (0, 1, 2, … , N-1 values or 1, 2, 3… , N values) or categorical values.
- An image column containing the names of the images for the experiment, where each image has an image extension specified
- An image folder that contains all the images specified in the image column; H2O Hydrogen Torch uses the images in this folder to run the 3D image classification experiment. Note
All images need to specified an image extension. To learn about supported 3D image extensions, see Supported 3D image extensions for 3D image processing.
Example
The mnist_3d_image_classification_3d.zip
file is a preprocessed dataset in H2O Hydrogen Torch and was formatted to solve a multi-class 3D image classification problem. The structure of the zip file is as follows:
mnist_3d_image_classification_3d.zip
│ └───train.csv
│ │
│ └───images
│ └───39385.npy
│ └───28837.npy
│ └───35708.npy
│ ...
The first three rows of the train.csv
file are as follows:
image | label |
---|---|
39385.npy | 1 |
28837.npy | 0 |
35708.npy | 2 |
- In this example, the data directory in the image column is not specified. Therefore, it needs to be specified when uploading the dataset, and the images folder needs to be specfied as the value for the Data folder setting. For more information, see Import dataset settings.
- To learn how to access one of the preprocessed datasets in H2O Hydrogen Torch, see Demo (preprocessed) datasets.
- Submit and view feedback for this page
- Send feedback about H2O Hydrogen Torch to cloud-feedback@h2o.ai