# The validation loss < training loss and validation accuracy < training accuracy

I have a binary classification problem. I get the following results: a val_loss (far) lower than the train_loss, but the accuracy is also lower for the validation compared to the training set. How is that possible ?

Epoch 1/10
10708/10708 [=======] - loss: 0.6356 - acc: 0.8289 - val_loss: 0.4981 - val_acc: 0.7760
Epoch 2/10
10708/10708 [=======] - loss: 0.6243 - acc: 0.8248 - val_loss: 0.5075 - val_acc: 0.7609
Epoch 3/10
10708/10708 [=======] - loss: 0.6204 - acc: 0.8302 - val_loss: 0.5152 - val_acc: 0.7694
Epoch 4/10
10708/10708 [=======] - loss: 0.6215 - acc: 0.8307 - val_loss: 0.4981 - val_acc: 0.7824
Epoch 5/10
10708/10708 [=======] - loss: 0.6180 - acc: 0.8318 - val_loss: 0.4942 - val_acc: 0.7848


This is the Keras model I'm using:

model = Sequential()

model.compile(loss='categorical_crossentropy',
metrics=['accuracy'])

• Are you using mini-batches when you fit the model? – Tophat Jan 3 '18 at 21:59
• I am using a generator with model.fit_generator(). My batches are also not of the same size – vinzee Jan 3 '18 at 22:01