-
Notifications
You must be signed in to change notification settings - Fork 436
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
Add early stopping with warmup. Remove mandatory background label in semantic segmentation task #3515
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3515 +/- ##
===========================================
- Coverage 82.99% 82.86% -0.14%
===========================================
Files 253 254 +1
Lines 25163 24945 -218
===========================================
- Hits 20885 20670 -215
+ Misses 4278 4275 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
LGTM
Summary
Motivation:
Early stopping from lightning doesn't have a warmup parameter and it leads to underfitting when training on small Geti target datasets. I added two thresholds to have invariant for small datasets that can fit in one batch and for larger data
Inserting a background label actually can lead to class mismatches for the Segmentation head, sometimes datasets don't have background classes at all. I tried to divide the Geti case with polygons and ordinary training from file masks. When dm_dataset represents annotations with Polygons -> we insert a background label and create a head with num_classes + 1. For other cases, dataset_meta.json should explicitly reflect all classes for training. So, the number of indices in masks == num categories in dataset_meta.json.
Before these changes, if we add a background class to dataset_meta.json, the training will fail, because OTX deletes the background class during prefiltering. Now, the background class must be presented in a metadata file when needed.
How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.