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

How to train auto3dseg from scratch #44

Open
amitjc opened this issue Apr 18, 2024 · 5 comments
Open

How to train auto3dseg from scratch #44

amitjc opened this issue Apr 18, 2024 · 5 comments

Comments

@amitjc
Copy link

amitjc commented Apr 18, 2024

Dear Experts,

Is it possible to train auto3dseg on new data and labels? We plan to generate automatic liver, HCC/cholangiocarcinoma/metastases, PV and hepatic veins segmentations, for surgical planning.

@diazandr3s Thanks for your efforts to consider incorporating auto3dseg in MONAILabel #30. Perhaps this will potentially allow training auto3dseg from scratch?

Look forward to further inputs.

Thanks and Regards,
Amit.

@lassoan
Copy link
Owner

lassoan commented Apr 18, 2024

You can train from scratch - that's how all the existing models have been created. See step-by-step tutorials here; https://github.com/Project-MONAI/tutorials/blob/main/auto3dseg/README.md

@amitjc
Copy link
Author

amitjc commented Apr 19, 2024

You can train from scratch - that's how all the existing models have been created. See step-by-step tutorials here; https://github.com/Project-MONAI/tutorials/blob/main/auto3dseg/README.md

Thank you @lassoan for the prompt response. I was wondering if model training can be achieved through Slicer interface.

@diazandr3s
Copy link
Collaborator

Hi @amitjc,

Thanks for your interest in this extension.

As @lassoan highlighted, you could train the Auto3D using the tutorial shared above or by following these examples: https://github.com/Project-MONAI/tutorials/tree/main/auto3dseg/tasks

My additional suggestions for training are:

  • Create the YAML and JSON file to train Auto3DSeg on your dataset - JSON file will need at least two folds. You could repeat the folds using the whole training set on each fold

  • Only use the SegResNet architecture when training your model. It works great and makes the training faster. Here is an example of the script:

python -m monai.apps.auto3dseg AutoRunner run --input ./my_task.yaml --algos segresnet --work_dir ./outputs/output_my_task

  • Once it is trained, you'll find a model.pt file inside the ./outputs/output_my_task/segresnet_0/model folder. That's the one you could use in this extension.

  • The label indices representing the segments should match the number of segments and be consistent in the dataset. I mean, if you want to segment 4 regions (liver, HCC/cholangiocarcinoma/metastases, PV and hepatic veins), the higher index should be 4. And the segment indices should be consistent throughout the dataset (i.e. liver should always be index 1, PV should always be 3, etc)

With regards to this:

I was wondering if model training can be achieved through Slicer interface.

This extension was meant for inference only. Training happens offline and with the instructions presented above.

Hope this helps,

@amitjc
Copy link
Author

amitjc commented Apr 19, 2024

Thank you @diazandr3s from the prompt response.

"folds" = folders?

What are the differences / similarities of training Auto3DSeg and MONAILabel?

@diazandr3s
Copy link
Collaborator

Hi, @amitjc,

In this context, fold means a group of training samples. This concept is especially useful for cross validation.

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

3 participants