Data Augmentation is decreasing my accuracy?

In the transfer learning programming exercise i was playing around when i found out that instead of using data augmentation on dataset and directly passing the dataset to preprocessing of mobileNetV2 is actually increasing my accuracy in contrast using data augmentation is decreasing my accuracy. why is it happening?

without data augmentation -

with data augmentation -

Perhaps your accuracy is decreasing because your model does not fit the more complicated dataset as well.

Essentially, the un-augmented data may have caused overfitting.

but the difference between train and validation loss & accuracy is ~2%, can that be considered overfitting ?

Perhaps not.

But a more complex data set (i.e. one that you’ve augmented) may require a more complex model.

@shreyas_yesade as already explained by the @TMosh
There can be several factors :

  1. When we apply data augmentation the data distribution of the images is changed (i.e., we use random rotations, brightness changes, and flips etc), therefore making it harder for the model to learn meaningful patterns. This may be one of the reason for getting the lower accuracy.
  2. Since you are using the transfer learning approach the model already has learned useful features from ImageNet, and additional variations may introduce noise rather than meaningful diversity.

Now, a very important point, Since you were doing some sort of experiments with and without data augmentation and you were expecting the accuracy was droping unexpectedly, then you should try clearing the Cache.
3. So, clearing the cache is a good troubleshooting step.

If the result remain the same then you have to examine with the dataset that how you’ve augmented it. :melting_face:

That is an excellent point by @Prashant_Upadhyaya.

Any time you modify code that affects either the model or the dataset, you must restart the kernel and re-run all of the cells.

1 Like