What is image classification?
Image classification is the computer vision task of assigning an image one or more labels from a predefined set of classes; the model names the objects present without localising them.
Unlike object detection, which finds the type and position of each object, classification makes one decision for the whole image. Image segmentation takes labelling down to pixel level.
- Topic
- Machine learning, models and training
- Also known as
- Image recognition
- Origin
- ImageNet challenge run annually since 2010; deep convolutional networks marked a turning point in 2012
How image classification works
- Each training image is labelled with a class.
- A convolutional neural network or a Vision Transformer extracts features; the final layer outputs a probability for each class.
- A model pre-trained on a large dataset can be fine-tuned on an organisation's smaller dataset.
- Performance is measured on a held-out test set with accuracy or top-5 error.
In more detail
From convolutional networks to vision transformers
A deep convolutional network published in 2012, with 60 million parameters, was trained to classify the 1.3 million high-resolution images of the ImageNet training set into 1000 classes. Residual learning, proposed in 2015, eased the training of networks far deeper than before. In 2020 a pure transformer that processes an image as a sequence of small patches was shown to perform very well on image classification too.
Commonly confused terms
| Term | How it differs |
|---|---|
| Image captioning | Image classification gives an image labels from predefined classes. Image captioning describes the content of an image in a natural language sentence; its output is not limited to a fixed list of labels. |
Why image classification matters for on-premises AI
The ImageNet Large Scale Visual Recognition Challenge, with 1000 object classes and about 1.2 million training images, became the field's shared benchmark. It saw a turning point in 2012 with large convolutional neural networks; in 2015 an ensemble of residual networks up to 152 layers deep won the classification task with 3.57% error on the ImageNet test set. In organisations, classification speeds up repetitive visual decisions such as quality control and sorting document types.
An e-commerce company sorts sellers' product photos into categories such as clothing, shoes and accessories with a pre-trained network fine-tuned on its own labelled images; low-confidence predictions go to the catalogue team for approval.
Common questions
What is the difference between image classification and object detection?
Classification gives the whole image one or more labels. Object detection finds the type and location of each object in the image separately.
What does top-5 error mean?
In the ImageNet challenge a model may return five labels for an image; the prediction counts as correct if the true label is among them. The error rate is the share of images whose true label falls outside the five.
Can an image get more than one label?
Yes. In multi-label classification the model computes a separate probability for each class and returns every label above a threshold; a photo can be labelled both vehicle and road.
Related terms
Sources
- ImageNet Large Scale Visual Recognition Challenge, arXiv, 2014
- ImageNet Classification with Deep Convolutional Neural Networks, NIPS 2012
- Deep Residual Learning for Image Recognition, arXiv, 2015
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale, arXiv, 2020
In the glossary: Glossary, E to L