Before we start building our CNN, let's take a look at image augmentation, which is an important technique in image classification projects. Image augmentation is the creation of additional training data by making minor alterations to images in certain ways in order to create new images. For example, we can do the following:
- Image rotation
- Image translation
- Horizontal flip
- Zooming into the image
The motivation for image augmentation is that CNNs require a huge amount of training data before they can generalize well. However, it is often difficult to collect data, more so for images. With image augmentation, we can artificially create new training data based on the existing images.
As always, Keras provides a handy ImageDataGenerator class to help us easily perform image augmentation. Let's create a new instance of the class:
from keras.preprocessing...