chapter six

6 Teaching machines to see: image classification with CNNs

 

This chapter covers,

  • Performing exploratory data analysis on image datasets in Python
  • Implement an image pipelines in TensorFlow that preprocesses and feeds image data to the model
  • Implementing a complex CNN that has parallel layers and other intricacies using Keras Functional API
  • Train a CNN model using a validation set for performance monitoring as well as a test set to measure final accuracy

We already have done a fair bit of work on convolutional neural networks. Convolutional neural networks are a type of networks that can operate on 2-dimensional data like images. Convolutional neural networks use the convolution operation to create feature maps of images (i.e. a grid of pixels) by moving a kernel (i.e. a smaller grid of values) over the image to produce new values. The convolutional neural network has several of these layers that generate more and more high-level feature maps as the get deeper. You can also use max or average pooling layers between convolutional layers to reduce the dimensionality of the feature maps. The pooling layers also move a kernel over feature maps to create the smaller representation of the input. The final feature maps are connected to a series fully connected layer, where the final layer produces the prediction (e.g. probabilities of an image belonging to a certain category).

6.1 Putting the data under the microscope: Exploratory data analysis

6.1.1 The folder / file structure

6.1.2 Understanding the classes in the dataset

6.1.3 Computing simple statistics on the dataset

6.2 Creating data pipelines using Keras ImageDataGenerator

6.3 Inception Net: Implementing a state-of-the-art image classifier

6.3.1 Recap on convolutional neural networks

6.3.2 Inception net v1

Going deeper into the Inception block

Connection between Inception block and sparsity

1x1 convolutions as a dimensionality reduction method

Auxiliary output layers

6.3.3 Putting everything together

6.3.4 Other Inception models

Inception v1

Inception v2

Inception v3

Inception v4

Inception Resnet v1 and Inception Resnet v2

6.4 Training the model and evaluating the performance

6.5 Summary

6.6 Answers