Data augmentation
One approach to increasing the accuracy in a model regardless of the amount of data you have is to create artificial examples based on existing data. This is called data augmentation. Data augmentation can also be used at test time to improve prediction accuracy.
Using data augmentation to increase the training data
We are going to apply data augmentation to the MNIST
dataset that we used in previous chapters. The code for this section is inChapter6/explore.Rmd
if you want to follow along. In Chapter 5, Image Classification Using Convolutional Neural Networks, we plotted some examples from the MNIST data, so we won't repeat the code again. It is included in the code file, and you can also refer back to the image in Chapter 5, Image Classification Using Convolutional Neural Networks:
Figure 6.3:Â The first 9 images in the MNIST dataset
We described data augmentation as creating new data from an existing dataset. This means creating a new instance that is sufficiently different...