-
Notifications
You must be signed in to change notification settings - Fork 443
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
Semi-SL Semantic Segmentation. Prototype View. #2156
Conversation
This PR includes new solution for Semi-SL approach. It is implemented for new models, SegNext. In the next PRs documentation will be updated with validation metrics on some public datasets used for validation. Also, experiments for tuning some hyperparameters are in progress in the background mode.
Experiments with bigger models in progress.
|
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Outdated
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Show resolved
Hide resolved
Could you please clarify which paper you've implemented, and provide a link to it? Am I correct in understanding that your implementation is based on "Semi-supervised Semantic Segmentation with Prototype-based Consistency Regularization" (https://arxiv.org/pdf/2210.04388.pdf)? If this is the case, would you consider adopting a step-by-step approach before fully integrating it? As you might be aware, the Mean Teacher model and CutMix-seg are commonly used baselines in academia. It might be beneficial to first explore the performance and training time trade-off for CutMix-seg and then incrementally add Prototype view functionalities. I would also suggest trying to keep changes to the MeanTeacherSegmentor to a minimum by defining other class for Prototype view, as it could serve as a standard baseline architecture for semi-supervised semantic segmentation. |
@JihwanEom Unfortunately, Cutmix-seg performs poorly in OTX, I conducted experiments with that including different probability as well as Soobee did and saw accuracy degradation. But, CutOut helped and in final solution I changed CutMix to CutOut. What do you mean step by step? I integrated Prototype network and enhanced a bit MT with CutOut and Filter pixels with high entropy. You can use standard MeanTeacher as always, just remove protohead from config. Also, old models (HrNets) use MT, I didn't change their configs. Many changes in that PR is just "black" some files |
Thank you for the detailed explanation. I agree that According to the CutMix-seg paper (https://arxiv.org/pdf/1906.01916.pdf), CutMix brings significant performance gains compared to CutOut even with only 100 labeled images. I don't think there is a significant difference in the environment between our situation and the one described in the paper. Even if CutMix does not work due to unknown issues and we use CutOut instead, we need to assess the net benefit of using CutOut without combining it with Prototype view. That was my intention for taking a step-by-step approach. Could you share the experiment results if you have already? You can continue using the standard MeanTeacher as usual, just remove protohead from the configuration. Also, the old models (HrNets) use MeanTeacher, and I haven't changed their configurations. |
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Outdated
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/segmentors/mean_teacher_segmentor.py
Outdated
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/utils/proto_utils.py
Outdated
Show resolved
Hide resolved
otx/algorithms/segmentation/adapters/mmseg/models/utils/proto_utils.py
Outdated
Show resolved
Hide resolved
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.
I think it's okay to keep use_prototype_head in original MeanTeacherSegmentor and enable it by parameter because it were eventually based on mean teacher as current @kprokofi's implementation. About Cutmix, even though I checked the transformed image is alright, I couldn't see the gain of it (but only 1-2% drop). In my investigation, at that time there were some doubtable points. First, it was needed to fix any confidence threshold for pseudo label. Second, inference needed to be done in teacher model which might more generalized than student. And I doubted the cross entropy loss using as consistency loss is affecting it, which it uses prediction from the model trained with few labeled model that might not well-generalized as gt. I don't exactly know what caused cutmix make worse but I hope these helped some for you to refer.
Could you add unit tests for prototype head and for changed mean teacher? |
LGTM, but as Soobee said, could you add unit test? |
@JihwanEom
|
I added unit tests + integration tests for Semi-SL and e2e for new model (we need to start validate it at least one template) |
Okay, thank you so much for experiment results and kind explanation. I understood. |
Could you set milestone for this PR? |
Done. Could you approve if it is OK? Let's finally merge this. |
Summary
How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.