Skip to content
Learning

Model types: Image classification

Image classification model

1.6. Image classification model

Image classification is a computer vision task that assigns a whole image to one of a fixed set of classes. However, the input differs from a conventional classification dataset. Specifically, each sample is a three-dimensional tensor of pixel values with the shape height × width × channels. As a result, the model learns each class’s visual features directly from the pixels. In Neural Designer, an image classification project combines an image data set with a convolutional neural network. Initially, you place the images in one folder per class. Then, the folder names become the class labels. The dataset must also contain at least two non-empty class folders.

Network architecture

The convolutional neural network then processes the images in four stages:
  • Image scaling: Initially, image min-max scaling normalizes the pixel values.
  • Feature extraction: After that, one or more 3 × 3 convolutional layers with ReLU activation learn local visual patterns. Also, a 2 × 2 max pooling layer follows each convolutional block.
  • Classification: Then, the network flattens the feature maps and feeds them to a dense ReLU layer.
  • Output: Finally, binary problems use a sigmoid output, while multiclass problems use softmax.

Training and evaluation

For training, cross-entropy is the appropriate loss function because the outputs are class probabilities. In general, adaptive moment estimation is the usual choice to train the network. When training ends, you can evaluate the model with a confusion matrix. You can also compute the binary or multiclass classification metrics.

Image classification applications

Overall, image classification has many uses in industry and research. For example, typical applications include handwritten character recognition, medical image classification, and visual quality inspection. In addition, the method supports remote-sensing image analysis and identifying species or diseases from photographs. In fact, one of the first successful convolutional networks read handwritten digits (LeCun et al., 1998).
Neural Designer Data set interface for an image classification model
The Dataset interface shows the image folder, the image size, and the number of classes. It also shows a sample image and the training, validation, and testing split.

All model types