Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The confidence loss (obj_loss) scales of the training and validation sets are inconsistent. #13012

Open
1 task done
ayitime opened this issue May 15, 2024 · 1 comment
Open
1 task done
Labels
question Further information is requested

Comments

@ayitime
Copy link

ayitime commented May 15, 2024

Search before asking

Question

Hi, recently I discovered an issue when using the YOLOv5 S model to train my dataset. Although the confidence loss (obj_loss) of the model has decreased in both the training and validation sets, the validation set loss is approximately twice that of the training set loss. However, the bounding box regression loss (box_loss) does not have such an issue. I carefully checked the code and confirmed that the calculation of the loss was correct. May I ask what is the reason for the different scales? Looking forward to your answer.
1715745536625

Additional

No response

@ayitime ayitime added the question Further information is requested label May 15, 2024
@glenn-jocher
Copy link
Member

@ayitime hi there! 😊

Thanks for bringing up your observation regarding the inconsistency in the confidence loss scales between training and validation. This kind of difference generally suggests that the model might be overfitting to the training data, especially if the validation loss remains significantly higher throughout the training process.

Here’s a quick suggestion:

  1. Regularization: Try implementing or adjusting forms of regularization like data augmentation or dropout to see if these help generalize better.
  2. Hyperparameter tuning: Particularly, you may consider tweaking the learning rate or the optimizer settings.
  3. Balance the dataset: Ensure both your training and validation datasets are similarly representative of the problem space.

If you have already tuned these aspects and the issue persists, it would be helpful to experiment with a different split of the data or potentially even reassess whether the validation data is annotated consistently with the training data.

Let us know how it goes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants