Dataset generation and data expansion via data augmentation (less common).I’ll then cover the three types of data augmentation you’ll see when training deep neural networks: We’ll start this tutorial with a discussion of data augmentation and why we use it. Update: This blog post is now TensorFlow 2+ compatible!
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!
Learn how to apply data augmentation with Keras and the ImageDataGenerator class.Dispel any confusion you have surrounding data augmentation.Learn about three types of data augmentation.Inside the rest of today’s tutorial you will: I’ll help you clear up some of the confusion regarding data augmentation (and give you the context you need to successfully apply it). Technically, all the answers are correct - but the only way you know if a given definition of data augmentation is correct is via the context of its application. Instead, the ImageDataGenerator accepts the original data, randomly transforms it, and returns only the new, transformed data.īut remember how I said this was a trick question? It’s not taking the original data, randomly transforming it, and then returning both the original data and transformed data. That’s right - the Keras ImageDataGenerator class is not an “additive” operation. Training the CNN on this randomly transformed batch (i.e., the original data itself is not used for training).Replacing the original batch with the new, randomly transformed batch.
While the word “augment” means to make something “greater” or “increase” something (in this case, data), the Keras ImageDataGenerator class actually works by: Only 5% of respondents answered this trick question “correctly” (at least if you’re using Keras’ ImageDataGenerator class).Īgain, it’s a trick question so that’s not exactly a fair assessment, but here’s the deal: Here are the results: Figure 1: My twitter poll on the concept of Data Augmentation. The question was simple - data augmentation does which of the following? Knowing that I was going to write a tutorial on data augmentation, two weekends ago I decided to have some fun and purposely post a semi-trick question on my Twitter feed. I’ll also dispel common confusions surrounding what data augmentation is, why we use data augmentation, and what it does/does not do. In today’s tutorial, you will learn how to use Keras’ ImageDataGenerator class to perform data augmentation. Click here to download the source code to this post