Unexpected results from training new model in Monai Label

Hi 3D slicer community,

We are working to train a new model to segment the heart. We have 6 pre-labelled scans which I am using for the initial training. I kept all the parameters on default except increasing the max_epoch to 1000. I am using a cloud GPU for the server (A100 (40 GB), 30 VCPUs, 200 GiB RAM, 512 GiB SSD) and SSH with port forwarding to my local 3Dslicer 5.0.3 r30893. I added the correct labels to the segmentation.py and turned the pre.trained model to “false”. My first model didn’t include a background label but however in my second run I included it but with no better results.

Here is what autosegmentation of a validation set looks like:

Here is a the labelled segmentations found in the (labels/final) folder.

Does anyone know how to improve this?

1 Like

Is that one of the labels you have used for training?

@rbumm yes thats correct, with a total of 6 labelled volumes

Did you include sternum, ribs, lungs, and airways on purpose? Maybe leave out those for the next test if acceptable

The “segmentation” model does not need a background label.

Ideally I would like to have these things segmented as well, but left them out for a test to see the results but not much changed. See results below:

Ok are you able to do the auto-segmentation on the trained volumes with better results?

Are all label numbers identical for your targets?

This last test volume seems to be a NIFTI format - did you train on NIFT images as well ?

So I ran the auto segmentation on a few volumes including the trained volumes and I seem to be getting the exact same result for all of them, The exact same segmentation like the one above.

Both the training and validation datasets are in NIFTI format

@diazandr3s could you have a look at this? Thank you.

1 Like

Many thanks for pinging me here, @rbumm - I haven’t seen this post.

@mahranahm welcome to the Slicer forum and thanks for posting this issue.

Could you please let us know which monai label version are you using?

If it is easy for you, I’d suggest you work directly with the GitHub repo. The reason for this is because it includes a more robust segmentation model called localization_spine - probably not the best name but I’m still working on this to make it generic :slight_smile:

The only two changes you have to make to this model before training are to update the label names here: MONAILabel/localization_spine.py at main · Project-MONAI/MONAILabel · GitHub - please don’t include background. you don’t need to segment it either.

And comment this line out: MONAILabel/localization_spine.py at main · Project-MONAI/MONAILabel · GitHub

Another question/comment is about the label numbering - have you checked that each segment in the database has the same number? i.e. the right lung should be represented by the same number in all volumes.

Hope this helps,

1 Like