sayakpaul / portfolio

Personal site of Sayak Paul. Deployed here 👉
https://sayak.dev/
24 stars 16 forks source link

Different data augmentation recipes in tf.keras for image classification | Sayak Paul #2

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

Different data augmentation recipes in tf.keras for image classification | Sayak Paul

Learn about different ways of doing data augmentation when training an image classifier in tf.keras.

https://sayak.dev/tf.keras/data_augmentation/image/2020/05/10/augmemtation-recipes.html

abhinavsp0730 commented 4 years ago

Awesome and very useful 🎊

sayakpaul commented 4 years ago

Glad you liked it.

martin-gorner commented 4 years ago

Great article Sayak ! By the way, have you tried using the new data augmentation layers in your tf.data.Dataset pipeline ?

sayakpaul commented 4 years ago

Thank you so much, Martin!

Were you referring to these layers: https://www.tensorflow.org/api_docs/python/tf/keras/layers/experimental/preprocessing?

If so, then yes, I used it here.

adroit91 commented 4 years ago

Hi Sayak, good write up.

Why would you have data augmentation as part of the network itself? Doesn't it make it tedious to skip augmentation at test time?

sayakpaul commented 4 years ago

There are some existing works that utilize augmentations like center crops, flips, etc. during test time. That is why.

JonasImazon commented 3 years ago

Hello Sayak, It was a good reading

But I have some question regarding th usage of tf.data API. When I use that approach, the data augmentation is applied only once, right? It is not applied during training time per each epoch. If that is true, how can I do it during training to apply variety to my dataset each time it changes epoch?

I really appreciate your work and thank you for you attention.

sayakpaul commented 3 years ago

It's applied during each epoch actually. You can verify that by adding random augmentation transformations like random size cropping and plotting the augmented images after a fixed number of steps. This would roughly replicate how images will be fed to your network during training.