Concept

Directory Structure for Image Classification Datasets

A standard convention for organizing image classification datasets is to separate images into distinct training and testing directories, with each containing subfolders named after their respective class labels (e.g., hotdog and not-hotdog). Deep learning frameworks provide dedicated utilities—such as torchvision.datasets.ImageFolder in PyTorch and gluon.data.vision.ImageFolderDataset in MXNet—that exploit this hierarchical layout to automatically infer the correct class label for every image based on the name of its parent subfolder, thereby eliminating the need for a separate annotation file.

0

1

Updated 2026-05-24

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L