Data Augmentation vs Number of Epochs

As far as I understood, if we use data augmentation, then at each epoch, a slightly different version of each picture will be used for training. If my understanding is correct, I have two questions:

First, why do not we use all the versions that data augmentation generates for us at each epoch? why do we only use one version of them at each epoch?

Second, if we use let’s say only 3 epochs, then only 3 slightly different versions of our pictures have the chance to be used during the training process. So, shouldn’t we use more epochs when we do data augmentation?

4 Likes

I think time is probably the biggest factor here. How do you decide how many versions of augmentation to put into a new training set? You could have a very large number of images when doing this. You also could do this if you wanted to. I would be curious to see how good of a result you got if you had 10 epochs with a set of 10 different augmentations for each epoch versus just doing 10 epochs with each having 1 augmentation of the image (or would you want to do 100 epochs?). Somebody else will probably have a better answer, but I am interested to know if that is a useful technique. I think doing 10 augmentations and training those 10 epochs would give you the same tier of result as doing 1 augmentation and training them 100 epochs. You would have the same number of mini-batches so I think it would be comparable.

I think you would want to do more epochs and data augmentation allows you to do so.

My understanding is that all permutations of augmented images gets applied in each epoch.
So even one epoch would have 6 (or whatever count of augmented images generated) images applied.

Isn’t it the case?

2 Likes

actually I’m not hundred percent sure, hopefuly some advanced students or even @jeremy will clarify this!

You can check that this is possibly not true; Have a look at the notebook 1, after augmentation. Notice that the learning rate (cyclical) plot shows around 1000 iterations. That is 1000 minibatches of 64, so 1 epoch= 64x1000/3 = around 21.000 images. That is only one pass per epoch.

So, my understanding on the topic of this thread… number of images per epoch is not increased, only variety is added when you consider you use more than one epoch. (Glad to hear more expert opinions :slight_smile: )

1 Like

Actually you have an infinite number of augmented images, every time you get an image with a random zoom (up to the specified max zoom), random rotation and many more changes (brightness, shear, etc…). So each epoch includes only one augmented version of each image.

2 Likes

Exactly right :slight_smile:

1 Like