Solved – Overfitting in neural network

keraspythontensorflow

I am a newbie to neural network. i am using TensorFlow + Keras to model my neural network for classification of 12 logos. The model has 5 convolution layers.

I have trained a neural network model and got the following results.

with training,
loss = 0.0877   accuracy = 0.9780

with test data
loss = 0.0976   accuracy = 0.9646
  1. Is this model good or does it overfits the data?

  2. And how can i find out whether the model overfits the data or not?

after some help from replies i managed to draw two graphs from tensorboard data. and what funny is that,

  1. val_acc is higher than training_acc
  2. val_loss is lower than training_loss

Loss graph
accuracy graph

Best Answer

Without knowing a lot more about the model, nor the data used, it is hard to answer these questions with and rigour. That aside, the values you provide would make the think it is a reasonable model and does not necessarily overfit the training data.

for your second question, my first line of action would always be to plot the training and test accuracy over each epoch (iteration), then look at how the curves develop. I generally hope to see a test curve that shadows the training curve, always a little lower. Here is a diagram with a short explanation taken from the amazing cs231n course from Stanford.

enter image description here

Image source

Course Homepage

All the material and video lectures are freely available and would be a great place for you to improve your understanding whilst working on Deep Learning topics.

Related Question