bappak
bappak

Reputation: 1044

Do data augmentations by Tensorflow Object Detection API result in more samples than original?

So let's say my original raw dataset has 100 images. And I apply random_horizontal_flip data augmentation, which by default horizontally flips with 50% probability. So just for the sake of example, lets say it flips 50 of the 100 images. So,

  1. Does that mean my algorithm will now be trained with 150 images (100 original and 50 flipped versions) or does it mean it will be trained with 100 images still, but 50 of them will be the flipped versions of the originals?
  2. Is the answer to question #1 generalizable to all data augmentation options provided by Tensorflow object detection API?

I read as much official documentation as possible, and looked into preprocessor code, but couldn't find my answer.

Upvotes: 3

Views: 1175

Answers (1)

Gorkem Polat
Gorkem Polat

Reputation: 114

Default augmentation probability, which is 50%, is independenetly applied to each image. Number of images that your model/algorithm is trained on depends on the number of epochs.

  • Let's say your batch size is 1 and total number of epoch is 100: Your algoirthm will be trained on 100 images, 50 of them will be flipped version of the original images. In this case, model will not see the original 50 images because your epoch is too low.

  • Let's say your batch size is 1 and total number of epoch is 200: Your algoirthm will be trained on 200 images, 100 of them will be flipped version of the original images.

As a result, as long as your epoch size is not limiting your dataset, with the probability of 50%, you will see an effect as if you have doubled the dataset by flipping each item.

In addition to the horizontal flip, if you add the vertical flip (random_vertical_flip) too, you triple your dataset.

Upvotes: 1

Related Questions