Image Classification and Recognition

In the previous chapters, we looked at the process of developing deep neural network models for classification and regression problems. In both cases, we were dealing with structured data and the models were of the supervised learning type, where target variables were available. Images or pictures belong to the unstructured category of data. In this chapter, we will illustrate the use of deep learning neural networks for image classification and recognition using the Keras package with the help of an easy-to-follow example. We will get started with a small sample size to illustrate the steps involved in developing an image-classification model. We will apply this model to a supervised learning situation involving the labeling of images or pictures. 

Keras contains several built-in datasets for image classification, such as CIFAR10, CIFAR100, MNIST, and fashion-MNIST. CIFAR10 contains 50,000 32 x 32 color training images and 10,000 testing images with 10 label categories. CIFAR100, on the other hand, contains 50,000 32 x 32 color training images and 10,000 testing images with as many as 100 label categories. The MNIST dataset has 60,000 28 x 28 grayscale images for training and 10,000 images for testing with 10 different digits. The fashion-MNIST dataset has 60,000 28 x 28 grayscale images for training and 10,000 images for testing with 10 fashion categories. These datasets are already in a format that can be used straightaway to develop deep neural network models with a minimal need for data-preparation-related steps. However, to get a better handle on dealing with image data, we will start by reading raw images from our computer into RStudio and go over all the steps needed to make image data ready for building a classification model.

The steps involved include exploring image data, resizing and reshaping images, one-hot encoding, developing a sequential model, compiling the model, fitting the model, evaluating the model, making predictions, and model-performance assessment using a confusion matrix.

More specifically, in this chapter, we will cover the following topics:

  • Handling image data
  • Data preparation
  • Creating and fitting the model
  • Model evaluation and prediction
  • Performance optimization tips and best practices
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset