How many images are created during data augmentation?

Hello everybody,

I have two questions about data augmentation in computer vision: Is it correct that exactly one transformation per epoch is applied to an image? Meaning that from one image only one transformation is created?

I have circular images that abstractly look like this:

Here, I could make 360 new images from a single one by rotating the image by 1 degree at a time. This would increase the size of the training dataset immensely. Is it possible to make 360 new images for training from one such circular image in fastai?

Thank you very much for your help.



I am very interested in this answer too. Is it the case that data augmentation is performed at the moment that a minibatch is provided by the DataLoaders object (for example, using first(dls.train) or dls.one_batch())? If true, this means each training image is transformed differently at each epoch, so effectively the number of “new” images produced by augmentation is proportional to the number of epochs that are run. It seems that fastai does not include a mechanism for including multiple augmentation transforms of the same image in one epoch.

If anyone can confirm that this interpretation is correct, that would be super helpful!

As an aside, I’m wondering if anyone can suggest how I might be able to track down these answers using the documentation. The documentation (that I was able to find) for DataLoaders, one_batch(), first(), etc. does not address this question. In particular, I’m wondering how it is the case that every time I call first(dls.train) I get a different set of images. According to the documentation for first, the function is supposed to return the first element of its argument. So why is it different every time I call it? Is this a behavior of first or of DataLoaders?

Thanks in advance!