0
$\begingroup$

I am starting in the world of deep neural networks and doing a series of tests with a convolutional model, I have found the following case:

The accuracy in the training set is much better (around 0.85) than in the validation set (around 0.58), but, when looking at the loss results, it is observed that in both data sets, the loss is 0.

My question is: How can it be that the loss in both sets is so low, and yet the accuracy is not perfect? Doesn't the loss function measure the difference between the prediction and the actual class and indicate how well the model is predicting?

I am performing a multiclassing task and my loss function is categorical cross entropy

I would be grateful if someone could clarify these concepts for me.

$\endgroup$
2
  • $\begingroup$ your message is hinting at overfitting, but you aren't providing enough detail to help you. $\endgroup$ Jan 10, 2023 at 8:54
  • $\begingroup$ This does seem suspicious; are you sure you're measuring loss and accuracy correctly? $\endgroup$
    – Ben Reiniger
    Jan 11, 2023 at 13:47

1 Answer 1

1
$\begingroup$

A potential reason could be class imbalance in the validation set. If the validation set is heavily imbalanced, with a much larger proportion of examples belonging to one class compared to the other, the model may achieve a low validation loss by simply predicting the majority class all the time. This would result in poor accuracy overall, even though the loss is low.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.