-
Notifications
You must be signed in to change notification settings - Fork 2
Multi class and Multi label segmentation #6
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
base: main
Are you sure you want to change the base?
Multi class and Multi label segmentation #6
Conversation
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.
@TimPaquaij please check my comments and changes.
Mind removing extra lines and spaces, while maintaining the style with spaces and lines. For example:
- variables should be set like "x = 1" but not "x= 1" or "x =1".
- Between classes and functions definitions leave 2 empty lines.
- On new function definition inside a class leave 1 empty line.
Also,
- Add init.py on tests/collections/segmentation/losses
e5e42bd
to
9cbfdd8
Compare
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.
@TimPaquaij apart from minor changes I am thinking if we should have a multitask/mls
collection instead of merging it to multitask/rs
. What do you think?
@TimPaquaij please also check the CodeCov/Tox errors. It seems like there is an issue with importing the new losses. |
I think it is not valid to make a new collection, since that would suggest that this is a different task. Whereas I think it is a different approach to achieving the same task. For some datasets, the multi-label approach would be more beneficial, think of detecting strokes within the brain. In this case, you have 2 labels which can be both valid. One pixel can be brain and there could be a lesion. However, even for this dataset, you can also determine the areas of the lesions with a multi-class approach since eventually, we are interested in the locations and the size of the specific lesions. |
7da9a13
to
046d7f7
Compare
55dd560
to
ce34aef
Compare
So to be clear, the original segmentation method you implemented was based on a multi-label segmentation (MLS) approach. Where, each class is handled separately and is not influenced by another class (see thresholding in inference_step). For the SKMTEA dataset and for the upcoming spatially adaptive semantic guidance module (SASG), the segmentation needs to be in a multi-class segmentation form where the classes are 'related' (and can be transformed into probabilities). So this is why I wanted to have a variable which can be set to a specific segmentation approach. Since then I can use this variable later on to create warnings when different techniques are combined which can not be combined. |
This is also different from combining the classes like in the process_segmentation_labels, right? |
So multi-label and multi-class is a type of approach. So it includes the way you should pre-process your data, determine the loss and asses the final prediction. In the case of multi-class segmentation it is not possible that an pixel is defined as no class. So we need to make sure that the background/not a class is also defined as an seperate class. Whereas the multi-label does not need this and can have the same number of classes |
This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days. |
This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days. |
This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days. |
What does this PR do ?
This PR makes it possible to use Multi-Class Segmentation and Multi-label Segmentation. Furthermore, several losses have been added for unbalanced segmentation tasks.
Collections:
MTL
Changelog
Usage
Before your PR is "Ready for review"
Pre checks:
Make sure you read and followed Contributor guidelines
Did you write any new necessary tests?
[] Did you add or update any necessary documentation?
[] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information