MIC-DKFZ / basic_unet_example

An example project of how to use a U-Net for segmentation on medical images with PyTorch.
Apache License 2.0
141 stars 38 forks source link

Trained model sharing and questions on test module #4

Closed JunMa11 closed 5 years ago

JunMa11 commented 5 years ago

Dear MIC-DKFZ,

Thanks for the great respo. I'm a pytorch starter, and I'm using this U-Net example as a beginning. Enviroment: Ubuntu 16.0, Titan XP, pytorch 1.0, batchgenerators 0.19

loggers={ "visdom": ("visdom", {"auto_start": c.start_visdom})}

The test module in experiments does not implement. It is a litter difficult for pytorch beginners to finish it. Would it be possible for you to complete the test module in U-Net 2D and 3D at your convenience? So this respo will be a complete U-Net example.

I think it is worth to enrich this great respo and make it to be a good begining/tutorial for pytorch starters in medical image segmentation, becuase I do not find such starter-friendly respo in github. Most of the U-Net respos are for CV rather than for medical image segmentation. Although I can not contribute the valuable code now, I can do the code testing work and share the trained model.

Looking forward to your reply! Best, Jun

elpequeno commented 5 years ago

Hi @JunMa11,

thank you for sharing your experience with our repo. I think I can provide an example "test()" method in the future. I'm on vacation for the next 2 weeks, but maybe after that. Thank you for testing the newest versions of the imported frameworks. I'll update the requirements.txt accordingly.

I'll contact you again in about 2 weeks. Cheers, André

JunMa11 commented 5 years ago

Hi @elpequeno , Thanks for your quick reply and approval. I wish you a very good journey.

elpequeno commented 5 years ago

Thank you :-D You are welcome. If you want to practice a little since you say you are a beginner: The test() method will look similar to the validation. You need to load your test data, iterate over them and calculate the metrics you are interested in. For a start, I would say DICE, IOU, precision, and recall. Of cause, there are many more, but that sounds like a good start for me.

JunMa11 commented 5 years ago

Thanks for your guidance. I will try it.

elpequeno commented 5 years ago

I added a test method to the 2D UNetExperiment. Results are printed in the terminal and also stored in a JSON file. Check it out and tell me if this helps. I'll close this task.

JunMa11 commented 5 years ago

Get it. Thank you very much.