8000 Multi class and Multi label segmentation by TimPaquaij · Pull Request #6 · wdika/atommic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

TimPaquaij
Copy link

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

  • There are too many changes to add specific lines

Usage

  • See train/mtrls.yaml for usage within the model
  • see tests/segmentation/losses for using the separate losses

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)

    • [] Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

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

  • Related to # (issue)

Copy link
Owner
@wdika wdika left a 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

@TimPaquaij TimPaquaij requested a review from wdika November 5, 2024 11:05
@TimPaquaij TimPaquaij force-pushed the multi-class-samantic-segmentation branch 7 times, most recently from e5e42bd to 9cbfdd8 Compare November 8, 2024 09:37
Copy link
Owner
@wdika wdika left a 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?

@wdika
Copy link
Owner
wdika commented Nov 11, 2024

@TimPaquaij please also check the CodeCov/Tox errors. It seems like there is an issue with importing the new losses.

@TimPaquaij
Copy link
Author

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.

@TimPaquaij TimPaquaij force-pushed the multi-class-samantic-segmentation branch from 7da9a13 to 046d7f7 Compare November 12, 2024 09:38
@wdika wdika added the enhancement New feature or request label Nov 12, 2024
@TimPaquaij TimPaquaij force-pushed the multi-class-samantic-segmentation branch from 55dd560 to ce34aef Compare November 12, 2024 13:46
@TimPaquaij
Copy link
Author

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.

@wdika
Copy link
Owner
wdika commented Nov 12, 2024

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?

@TimPaquaij
Copy link
Author

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

@github-actions github-actions bot removed the Stale label Mar 7, 2025
@github-actions github-actions bot added the Stale label Mar 21, 2025
@github-actions github-actions bot closed this Mar 28, 2025
@wdika wdika reopened this Mar 28, 2025
@github-actions github-actions bot removed the Stale label Mar 29, 2025
@github-actions github-actions bot added the Stale label Apr 12, 2025
@wdika wdika added help wanted Extra attention is needed and removed Stale labels Apr 14, 2025
@github-actions github-actions bot added the Stale label Apr 29, 2025
@wdika wdika removed the Stale label Apr 29, 2025
@github-actions github-actions bot added the Stale label May 14, 2025
Repository owner deleted a comment from github-actions bot May 14, 2025
Repository owner deleted a comment from github-actions bot May 14, 2025
Repository owner deleted a comment from github-actions bot May 14, 2025
Repository owner deleted a comment from github-actions bot May 14, 2025
Repository owner deleted a comment from github-actions bot May 14, 2025
Repository owner deleted a comment from github-actions bot May 14, 2025
Repository owner deleted a comment from github-actions bot May 14, 2025
Repository owner deleted a comment from github-actions bot May 14, 2025
Repository owner deleted a comment from github-actions bot May 14, 2025
@wdika wdika removed the Stale label May 14, 2025
Copy link

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.

@github-actions github-actions bot added the Stale label May 29, 2025
@wdika wdika removed the Stale label May 30, 2025
Copy link

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.

@github-actions github-actions bot added the Stale label Jun 14, 2025
@wdika wdika removed the Stale label Jun 17, 2025
Copy link
github-actions bot commented Jul 2, 2025

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.

@github-actions github-actions bot added the Stale label Jul 2, 2025
@wdika wdika removed the Stale label Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common enhancement New feature or request help wanted Extra attention is needed MTL SEG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0