AutoTrain documentation

Image Classification

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.6.10).
Model Database's logo
Join the Model Database community

and get access to the augmented documentation experience

to get started

Image Classification

Image classification is a supervised learning problem: define a set of target classes (objects to identify in images), and train a model to recognize them using labeled example photos. Using AutoTrain, its super-easy to train a state-of-the-art image classification model. Just upload a set of images, and AutoTrain will automatically train a model to classify them.

Data Preparation

The data for image classification must be in zip format, with each class in a separate subfolder. For example, if you want to classify cats and dogs, your zip file should look like this:

cats_and_dogs.zip
β”œβ”€β”€ cats
β”‚   β”œβ”€β”€ cat.1.jpg
β”‚   β”œβ”€β”€ cat.2.jpg
β”‚   β”œβ”€β”€ cat.3.jpg
β”‚   └── ...
└── dogs
    β”œβ”€β”€ dog.1.jpg
    β”œβ”€β”€ dog.2.jpg
    β”œβ”€β”€ dog.3.jpg
    └── ...

Some points to keep in mind:

  • The zip file should contain multiple folders (the classes), each folder should contain images of a single class.
  • The name of the folder should be the name of the class.
  • The images must be jpeg, jpg or png.
  • There should be at least 5 images per class.
  • There should not be any other files in the zip file.
  • There should not be any other folders inside the zip folder.

When train.zip is decompressed, it creates two folders: cats and dogs. these are the two categories for classification. The images for both categories are in their respective folders. You can have as many categories as you want.

Training

Once you have your data ready and jobs added, you can start training your model by clicking the β€œStart Training” button.

Image Classification