Deep Learning Tensorflow Data Augmentation — Why? What? When? How?

Tamir Ciprut
2 min readSep 13, 2020

You must be familiar with that if you ever train a model with dataset of images

Why?
We use Data Augmentation Because we want more accuracy on our images based model.

What?
Data augmentation is such a great thing! We can expand our dataset of images just by adding a new images, But not the way you think about (not Take a new photos and label them manually — Boring! ).
We do it with nothing but rotate, flip, zoom, crop, varying (etc.) our existing images.
You know — these are many images from just one cute cat we already had:

Data Augmentation: How to use Deep Learning when you have Limited Data
from https://www.kdnuggets.com/

Easy Peasy — one image became six. In reality it becomes a lot more.

When?
We do it when we don’t have enough data in our dataset, or when we don’t get satisfied from our results (Sometimes it will give better results, and sometimes you will find that you just wasted your time. But it’s usually worth it.)

How?
Generally, we do it with object called ImageDataGenerator. I won’t waste my time on coding it because Tensorflow docs explain it really well — https://www.tensorflow.org/tutorials/images/data_augmentation
Wait.. Okay, I know it’s too long and doesn’t visualize anything (Who the hell writes documentation without visualizations in 2020? — just go to this blog post:
https://towardsdatascience.com/exploring-image-data-augmentation-with-keras-and-tensorflow-a8162d89b844

Have a great accuracy!

--

--