Our plot still follows an approximately normal distribution, but it’s not a perfect distribution as on the left.Ī model trained on this modified, augmented data is more likely to generalize to example data points not included in the training set. Instead, to increase the generalizability of our classifier, we may first randomly jitter points along the distribution by adding some random values drawn from a random distribution ( right). Training a machine learning model on this data may result in us modeling the distribution exactly - however, in real-world applications, data rarely follows such a nice, neat distribution. Let’s consider Figure 2 ( left) of a normal distribution with zero mean and unit variance. This type of data augmentation increases the generalizability of our networks. Right: Adding a small amount of random “jitter” to the distribution. A simple data augmentation example Figure 2: Left: A sample of 250 data points that follow a normal distribution exactly. Given that our network is constantly seeing new, slightly modified versions of the input data, the network is able to learn more robust features.Īt testing time we do not apply data augmentation and simply evaluate our trained network on the unmodified testing data - in most cases, you’ll see an increase in testing accuracy, perhaps at the expense of a slight dip in training accuracy. Our goal when applying data augmentation is to increase the generalizability of the model. What is data augmentation?ĭata augmentation encompasses a wide range of techniques used to generate “new” training samples from the original ones by applying random jitters and perturbations (but at the same time ensuring that the class labels of the data are not changed).
Looking for the source code to this post? Jump Right To The Downloads Section Keras ImageDataGenerator and Data Augmentation To learn more about data augmentation, including using Keras’ ImageDataGenerator class, just keep reading!
Click here to download the source code to this post