Validation accuracy stuck around 50%


Things I have tried:

  1. I have already checked this extensive thread
  2. Also I have checked whether the files and corresponding labels are correct. (And I assume the intermediate features generated and the labels are also correct).
  3. I have also checked the data manually to see whether dogs and cats folders have respective images in both validation and training folders.

You can view the jupyter notebooks here. I am using Keras’ Vgg16 model.

I had 50% accuracy on the training set as well, but as the above thread and many other people suggested, I lowered my learning rate from 0.001 to 1e-6 and the training accuracy and loss improved in around 4 epochs as you can see in this file.

But the validation accuracy is still hovering around 50% and I can’t figure it for life!

Things I am trying right now: Since I am using Keras’ VGG16 model, will I need to preprocess the input before generating the features using predict_generator? (As given in the documentation)
If yes, then is including the preprocess_input function in the ImageDataGenerator enough?

Could anyone suggest what should I check for next?


Ok I solved it.

Including the preprocess_input function in the ImageDataGenerator constructor did the job for me. This is if you are using Keras’ VGG16 model.

Cheers :slight_smile: