Quiz question: what is the reason that the training is a little slower

When training with augmentation, you noticed that the training is a little slower. Why?

Could someone explain the answer of this question?

As I understood it, there is an additionnal preprocessing step for the image generator (flipping, cropping, skewing, etc…) which is all done at runtime (during execution).

Observing the number of images in the training set and validation set: with data augmentation, the number of images in both sets remains the same as that without augmentation. So it looks like data augmentation just randomly changes the existing images in the original data set on the fly, instead of adding the changed images into the existing data set. Indeed, there is no parameters about how many new, augmented images should be added, so the above guess sounds reasonable.

Thus, the reason that training is a little slower is because of the image processing when augmenting the data.

I think in each epoch, it will generate different augmented images randomly, so this is equivalent to have a larger data set. It is better than pre-creating the augmented images and adding to the data set, because otherwise it may introduce another kind of overfitting: you may create too many similar images by augmentation.

Data augmentation feeds both the original images and augmented images to the model. While augmenting images does take some time, training is slower mostly because the model is using a larger number of training examples.