-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Implement automatic class weight calculation for imbalanced distributions #2814
base: main
Are you sure you want to change the base?
Conversation
CLA Assistant Lite bot All Contributors have signed the CLA. ✅ |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hello @AjibolaPy, thank you for submitting a YOLOv8 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:
- ✅ Verify your PR is up-to-date with
ultralytics/ultralytics
main
branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by runninggit pull
andgit merge main
locally. - ✅ Verify all YOLOv8 Continuous Integration (CI) checks are passing.
- ✅ Update YOLOv8 Docs for any new or updated features.
- ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee
See our Contributing Guide for details and let us know if you have any questions!
I have read the CLA Document and I sign the CLA |
1 similar comment
I have read the CLA Document and I sign the CLA |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
removed unused local variable
removed unused import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed unused imports
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed unused imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed unused import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed block "#"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed class_weight arg
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging
This pull request addresses #2703, introducing automatic class weight calculation for imbalanced datasets in the YOLOv8 project, specifically in the classification trainer. It improves model performance by dynamically determining class weights based on dataset analysis. Underrepresented classes receive higher weights, while overrepresented classes receive lower weights. Manual weight adjustments are no longer needed, streamlining the workflow and enhancing classification effectiveness. Thorough testing confirms significant improvements.
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
📊 Key Changes
class_weight
has been implemented for automatic class weight calculation.🎯 Purpose & Impact
🌟 Summary
"New feature to automatically calculate class weights for imbalanced datasets during model training, promoting better performance for minority classes." 🏋️♂️📈