Skip to main content
Version: Next

Dataset format: Image regression

Dataset format

The data for an image regression experiment needs to be in 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
│ ...
Note

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 follow the same format as a train CSV file, but does not require a label column(s)
  1. The available dataset connectors require the data for an image regression 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.

  2. 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 image extensions for 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 the numerical labels (targets)
      Note

      H2O Hydrogen Torch can train models that predict multiple labels simultaneously. You can provide multiple columns with multiple unique labels and choose which labels to predict when starting a new experiment.

    • 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.

  3. 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 image regression experiment.
    Note

    All image file names need to specify image extension. Images can contain a mix of supported image extensions. To learn about supported image extensions, see Supported image extensions for image processing.

Example

The coins_image_regression.zip file is a preprocessed dataset in H2O Hydrogen Torch and was formatted to solve an image regression problem. The zip file contains a CSV file and an image folder. The structure of the zip file is as follows:

coins_image_regression.zip
│ └───coins_image_regression.csv
│ │
│ └───images
│ └───95_1477858074.jpg
│ └───95_1477858068.jpg
│ └───95_1477858062.jpg
│ ...

The first three rows of the CSV file are as follows:

image_pathlabelfold
105_1479344562.jpg1051
105_1479344940.jpg1052
125_1479424716.jpg1251
Note
  • In this example, the data directory in the image column (image_path) is not specified. Therefore, it needs to be specified when uploading the dataset, and the images folder needs to be specified 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.

Feedback