Dataset format: Audio classification
Dataset format
The data for an audio classification experiment needs to be in a zip file (1) containing a CSV file (2) and an audio folder (3).
folder_name.zip (1)
│ └───csv_name.csv (2)
│ │
│ └───audio_folder_name (3)
│ └───name_of_audio.audio_extension
│ └───name_of_audio.audio_extension
│ └───name_of_audio.audio_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 follow the same format as a train CSV file, but does not require a label column(s)
- The available dataset connectors require the data for an audio 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 audio column containing the names of the audios for the experiment, where each audio has an audio extension specifiedNote
- Audios can contain a mix of supported audio extensions. To learn about supported audio extensions, see Supported audio extensions for audio processing.
- The names of the audio files do not specify the data directory (location of the audio 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 multi-class labels (one-hot encoded) or multiple multi-class/multi-label labels. For multi-class and binary classification, a single label column is sufficientNote
- H2O Hydrogen Torch can solve both multi-class and multi-label classification problems. The classes are mutually exclusive in multi-class problems, 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 indexesNote
The fold column can include integers (0, 1, 2, … , N-1 values or 1, 2, 3… , N values) or categorical values.
- An audio column containing the names of the audios for the experiment, where each audio has an audio extension specified
- An audio folder that contains all the audio files specified in the audio column above; H2O Hydrogen Torch uses the audios in this folder to run the audio classification experiment. Note
All audio file names need to specify an audio extension. Audios can contain a mix of supported audio extensions. To learn about supported audio extensions, see Supported audio extensions for audio processing.
Example
The esc10_audio_classification.zip
file is a preprocessed dataset in H2O Hydrogen Torch and was formatted to solve a multiclass audio classification problem. The structure of the zip file is:
esc10_audio_classification.zip
│ └───esc10_meta.csv
│ │
│ └───audio_esc10
│ └───2-37806-B-40.wav
│ └───5-200339-A-1.wav
│ └───1-172649-D-40.wav
│ ...
The first three rows of the CSV file are:
filename | fold | label |
---|---|---|
1-100032-A-0.wav | 0 | dog |
1-110389-A-0.wav | 0 | dog |
1-116765-A-41.wav | 0 | chainsaw |
- In this example, the data directory in the filename column is not specified. That being the case, it needs to be specified when uploading the dataset, and the audio_files folder needs to be selected 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