# Good model but bad confusion matrix?

I am trying to understand the code here.

The output [12] shows that the model accuracy is above 90% even for the validation set, but the confusion matrix in [16] ca not even achieve 50% accuracy, and it is also on the validation set, so I do not understand this low accuracy on the confusion matrix. I think it may be due to data augmentation, but I would be thankful if someone could explain it to me and tell me how I could then have a confusion matrix in adequacy with the learning curves. Thanks in advance.

• The 90%+ accuracy is an evaluation based on Keras' model.evaluate_generator method and NOT on validation set, where accuracy is that as shown in confusion matrix May 28, 2021 at 16:56
• @NikosM. Thank you for your answer, but how to interpret this ? If we rely on the curves, the model seems good, but if we rely on the confusion matrix the model is bad. How should I interpret these results ? May 28, 2021 at 17:35
• The confusion matrix (and other metrics like precision/recall/etc..) is what counts and all those agree that the model is average May 28, 2021 at 17:37
• But if we rely on the confusion matrix, we don't even have 50% of accuracy, so classifying randomly would be better. I don't really understand how this model could be so bad after fine-tuning. May 28, 2021 at 17:53
• Me neither, but as it seems this is the case, it is hardly better than random guessing May 28, 2021 at 17:54