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

Label smoothing in training option #2332

Closed
ptran1203 opened this issue Mar 2, 2021 · 5 comments · Fixed by #2344
Closed

Label smoothing in training option #2332

ptran1203 opened this issue Mar 2, 2021 · 5 comments · Fixed by #2344
Assignees
Labels
question Further information is requested

Comments

@ptran1203
Copy link
Contributor

Hi, I could not find any questions about label smoothing, so I wonder if there is label smoothing option in the training script?
I think it would be useful, as the authors (from this paper) demonstrated the performance boost.
image

@ptran1203 ptran1203 added the question Further information is requested label Mar 2, 2021
@glenn-jocher
Copy link
Member

@ptran1203 we do have a class label smoothing option, though we couldn't get better performance with it. You can experiment with it here, and let us know if it helps you!

I would also start with very small eps, i.e. 0.01 maybe for your experiments.

yolov5/utils/loss.py

Lines 99 to 101 in fab5085

# Class label smoothing https://arxiv.org/pdf/1902.04103.pdf eqn 3
self.cp, self.cn = smooth_BCE(eps=0.0)

@ptran1203
Copy link
Contributor Author

@glenn-jocher Thank you, I see, I will do some experiments with this.
And maybe it is useful when adding this option into hyper params config. If there is no problem, can you consider a pull request?

@ptran1203
Copy link
Contributor Author

@glenn-jocher , I saw hyp params already attached in the model and it can be easily obtained via h.get('label_smoothing_eps', 0.0)

@glenn-jocher
Copy link
Member

glenn-jocher commented Mar 2, 2021 via email

@Robotatron
Copy link

@ptran1203 Did you obtain better mAP results with label smoothing?

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

Successfully merging a pull request may close this issue.

3 participants