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

Replace of seg_ms_lesion_mp2rage by UNIseg model on sct_deepseg #82

Merged
merged 12 commits into from
Sep 6, 2024

Conversation

Nilser3
Copy link
Contributor

@Nilser3 Nilser3 commented May 29, 2024

Description

This PR replace the current seg_ms_lesion_mp2rage model by UNIseg (single-class 3D nnUnet model discused here #75 ) keeping the same name: seg_ms_lesion_mp2rage (after comparisons these models see #81 )
Updates also the README file, explaining how to use the model, datasets for training and acknowledgments to the collaborators.

@jcohenadad jcohenadad self-requested a review June 7, 2024 14:15
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nilser3 indicate where to find model to test

Nilser3 and others added 3 commits June 10, 2024 17:59
Co-authored-by: Julien Cohen-Adad <[email protected]>
Co-authored-by: Julien Cohen-Adad <[email protected]>
Co-authored-by: Julien Cohen-Adad <[email protected]>
@Nilser3
Copy link
Contributor Author

Nilser3 commented Jun 10, 2024

@Nilser3 indicate where to find model to test

Thanks you @jcohenadad
The model is here https://github.com/ivadomed/model_seg_ms_mp2rage/releases/tag/r20240610

I have already replaced the seg_ms_lesion_mp2rage model and it is ready to be tested this branch:

branch on SCT: nlm/update-_seg_ms_lesion_mp2rage-model
commit: b64340b4259aa99734a4ef809edf4af882261409

@jcohenadad
Copy link
Member

Getting this message during inference:

/Users/julien/code/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/nnunetv2/utilities/plans_handling/plans_handler.py:37: UserWarning: Detected old nnU-Net plans format. Attempting to reconstruct network architecture parameters. If this fails, rerun nnUNetv2_plan_experiment for your dataset. If you use a custom architecture, please downgrade nnU-Net to the version you implemented this or update your implementation + plans.
  warnings.warn("Detected old nnU-Net plans format. Attempting to reconstruct network architecture "

any concerns?

@jcohenadad
Copy link
Member

Another message, possibly concerning:

Found Intel OpenMP ('libiomp') and LLVM OpenMP ('libomp') loaded at
the same time. Both libraries are known to be incompatible and this
can cause random crashes or deadlocks on Linux when loaded in the
same Python program.
Using threadpoolctl may cause crashes or deadlocks. For more
information and possible workarounds, please see
    https://github.com/joblib/threadpoolctl/blob/master/multiple_openmp.md

Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The zipped model does not seem to include the list of subjects used for training and the version of the dataset used to train the model. It is required.

@jcohenadad
Copy link
Member

jcohenadad commented Jun 11, 2024

Inference time is pretty long... I've tried without cropping on the basel data, inference time was 4min 6s.

With cropping: 7s 😊

@jcohenadad
Copy link
Member

Comparison with previous model, and current model with various crop sizes:

ezgif-6-1f1309b0b4

Conclusion: too narrow cropping (5x5x5) leads to bad segmentation. A minimum cropping size is required. What size? @Nilser3 that's a follow-up investigation

@jcohenadad
Copy link
Member

Conclusion: too narrow cropping (5x5x5) leads to bad segmentation. A minimum cropping size is required. What size? @Nilser3 that's a follow-up investigation

follow-up idea: given that the inference is sliiiiightly different across crop sizes, how about computing a soft segmentation based on the inference performed across various crop sizes?

@Nilser3
Copy link
Contributor Author

Nilser3 commented Jun 17, 2024

The zipped model does not seem to include the list of subjects used for training and the version of the dataset used to train the model. It is required.

Thank you @jcohenadad,
Ok, the release r20240610 has been updated with the needed information!

joshuacwnewton added a commit to spinalcordtoolbox/spinalcordtoolbox that referenced this pull request Jul 18, 2024
…ct_deepseg` (#4554)

PR for replace seg_ms_lesion_mp2rage deepseg model for a single-class nnUnet model

[Model
repo](https://github.com/ivadomed/model_seg_ms_mp2rage/tree/nlm/nnunet_ms_lesion)
was updated, explaining their use and Slicer implementation.

## Linked issues

Fixes ivadomed/model_seg_ms_mp2rage#75
Fixes #4522 

Related to ivadomed/model_seg_ms_mp2rage#81
Related to ivadomed/model_seg_ms_mp2rage#82

---------

Co-authored-by: Joshua Newton <[email protected]>
@jcohenadad
Copy link
Member

jcohenadad commented Sep 5, 2024

@Nilser3 any update? this is becoming urgent: https://forum.spinalcordmri.org/t/segmentation-of-spinal-cord-lesion-on-mp2rage-uni-images-doesnt-work/1302

@Nilser3
Copy link
Contributor Author

Nilser3 commented Sep 6, 2024

@Nilser3 any update? this is becoming urgent: https://forum.spinalcordmri.org/t/segmentation-of-spinal-cord-lesion-on-mp2rage-uni-images-doesnt-work/1302

The model was replaced in the release 6.4, this branch is ok for PR.

@Nilser3 Nilser3 merged commit 14ec175 into main Sep 6, 2024
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

Successfully merging this pull request may close these issues.

2 participants