Improving the dataset with data augmentation
It's time to use data augmentation, and basically, increase the size of our dataset.
From this moment, we will no longer care about the accuracy of the training dataset, as this technique will reduce it, but we will focus on the validation accuracy, which is expected to improve.
We also expect to need more epochs, as our dataset is now more difficult, so we will now set the epochs to 500
(though we don't plan to reach it) and use EarlyStopping
with a patience of 7
.
Let's try with this augmentation:
ImageDataGenerator(rotation_range=15, width_shift_range=[-5, 0, 5],    horizontal_flip=True)
You should take care not to overdo things because the network might learn a dataset too different from validation, and in this case, you will see the validation accuracy stuck at 10%.
This is the result:
Epoch 00031: val_loss did not improve from 0.48613 Epoch 00031: early stopping Training time...