Skip to content
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

Change 2-class model to 3-class model #2

Open
hermancollin opened this issue Mar 31, 2023 · 1 comment
Open

Change 2-class model to 3-class model #2

hermancollin opened this issue Mar 31, 2023 · 1 comment

Comments

@hermancollin
Copy link
Collaborator

hermancollin commented Mar 31, 2023

At the moment, the model has 2 output channels for the axon and myelin masks. This formulation of the problem is not ideal because the classes are not mutually exclusive and the model gives lots of false positives for the background class. This could be mitigated by having a separate output channel for the background and using one-hot encoding for the loss/metrics computations.

The explanation related to this for the ivadomed implementation can be found in this comment

For reference, the current predictions look like this
Screenshot_20230331_151419

@hermancollin
Copy link
Collaborator Author

hermancollin commented Mar 31, 2023

After some preliminary tests on the loader (see updated notebook), I found it was tricky to merge the labels. Fortunately, we have the axonmyelin-manual labels included in our datasets. Note that we need to add these 2 transforms to the labels:

NormalizeIntensityd(keys="label", subtrahend=0, divisor=127, nonzero=True),
AsDiscreted(keys="label", rounding='torchrounding')

Otherwise, one-hot encoding will fail. The first transform will change the [0, 127, 255] values to [0, 1.something, 2.something], which we can then round with the latter transform to get discrete values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant