I am training a deep learning model for binary image classification using Keras
and TensorFlow
. My model gave the highest acc
and lower loss
. The other metrics I used also have higher values like precision
and recall
.
As I used the generator and I mentioned the validation set during fitting the model. So the precision and recall
on validation
data are just 50%. But the Confusion metric
is not that much worse on test data. What should I assume that my model is overfitting?
Here is my few epochs logs:
Epoch 00042: LearningRateScheduler setting learning rate to 8.28633770088062e-06.
595/595 [==============================] - 1871s 3s/step - loss: 0.0162 - accuracy: 0.9952 - precision_m: 0.9958 - recall_m: 0.9936 - f1_m: 0.9942 - val_loss: 0.1693 - val_accuracy: 0.9637 - val_precision_m: 0.5000 - val_recall_m: 0.4797 - val_f1_m: 0.4891
Epoch 00042: saving model to /home/ali/Desktop/pneumonia classification/Final Dataset/RSNA/model_training_512_finetune_3.h5
Epoch 43/50
Epoch 00043: LearningRateScheduler setting learning rate to 7.497788410238852e-06.
595/595 [==============================] - 2167s 4s/step - loss: 0.0147 - accuracy: 0.9952 - precision_m: 0.9968 - recall_m: 0.9944 - f1_m: 0.9953 - val_loss: 0.1673 - val_accuracy: 0.9645 - val_precision_m: 0.5000 - val_recall_m: 0.4823 - val_f1_m: 0.4904
Epoch 00043: saving model to /home/ali/Desktop/pneumonia classification/Final Dataset/RSNA/model_training_512_finetune_3.h5
Epoch 44/50
Epoch 00044: LearningRateScheduler setting learning rate to 6.784279506100467e-06.
595/595 [==============================] - 2405s 4s/step - loss: 0.0125 - accuracy: 0.9967 - precision_m: 0.9982 - recall_m: 0.9958 - f1_m: 0.9968 - val_loss: 0.1676 - val_accuracy: 0.9671 - val_precision_m: 0.5000 - val_recall_m: 0.4831 - val_f1_m: 0.4909