Data Augmentation
In the previous section, you were introduced to data generators that can do a lot of the heavy lifting, such as feeding the model from folders rather than columnar data for you regarding data processing for neural networks. So far, we have seen how to create them, load data from a structured folder, and feed the model by batch. We only performed one image transformation with it: rescaling. However, data generators can perform many more image transformations.
But why do we need to perform data augmentation? The answer is quite simple: to prevent overfitting. By performing data augmentation, we are increasing the number of images in a dataset. For one image, we can generate, for instance, 10 different variants of the same image. So, the size of your dataset will be multiplied by 10.
Also, with data augmentation, we have a set of images with a broader range of visuals. For example, selfie pictures can be taken from different angles, but if your dataset only contains...