Clarifications about Image Data Augmentation


#1

As far as I understand, image data augmentation techniques (i.e. random cropping, mirroring, shearing etc) are commonly used in DL to artificially increase the training set size.
This concept is pretty clear to me.
Now, putting that in practice, say I have a 100-image dataset. If I apply mirroring to every one of them, I would expect the dataset to double in size, to 200 in total.
This is apparently not happening when I use ImageRecordIter.
So, iterating through the training set in this way

train_iter = mx.io.ImageRecordIter(path_imgrec='./train.rec',
                                   data_shape=(3, 75, 75),
                                   shuffle=True,
                                   batch_size=1)

or in this way

train_iter = mx.io.ImageRecordIter(path_imgrec='./train.rec',
                                   data_shape=(3, 75, 75),
                                   rand_crop=True,
                                   shuffle=True,
                                   batch_size=1,
                                   max_random_scale=1.5,
                                   min_random_scale=0.75,
                                   rand_mirror=True)

returns exactly the same number of images.
My confusion is clearly due to the fact that I don’t have a clear understanding of what happens under the hood when calling a batch and applying augmentation techniques over it.
Can someone provide help me with this one, please?


#2

According to the ImageRecordIter API documentation:
rand_mirror (boolean, optional, default=0) – Whether to randomly mirror images or not. If true, 50% of the images will be randomly mirrored (flipped along the horizontal axis)

Setting this argument to true, simply means that for every image a random boolean is drawn and the image is mirrored based on the outcome. It does not add to your dataset. However, statistically speaking, iterating over your dataset twice would be equivalent of doubling your data with mirroring. Given that neural networks are all about statistics, there is absolutely no need to double your data, just iterate through more epochs.