Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging
https://monai.io/
Apache License 2.0
5.79k stars 1.07k forks source link

add support for UNET++ #896

Closed michalhg closed 2 years ago

michalhg commented 4 years ago

UNET++ ustilizes skip connections to exploit multi-scale features for image segmentation. it added dense skip connection adn deep supervision to the original UNET https://arxiv.org/pdf/1912.05074.pdf

please add this network to the networks file. official keras implementation is given in : https://github.com/MrGiovanni/UNetPlusPlus

other pytorch implemetation is also given in : https://towardsdatascience.com/biomedical-image-segmentation-unet-991d075a3a4b

Nic-Ma commented 4 years ago

Hi @michalhg ,

Thanks for your feedback. I marked this request for working group discussion.

Thanks.

yashika-git commented 2 years ago

Hi @Nic-Ma,

I would love to add UNet++ to MONAI. Though I have never contributed code in open-source, I'm excited to get started. Will it be possible for you to guide me a little if I get stuck somewhere?

Thank You

Nic-Ma commented 2 years ago

Hi @yashika-git ,

Of course, please go ahead to submit a PR, we can work together to address issues later. You can refer to our contribution guide: https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md

Thanks for your contribution!

yashika-git commented 2 years ago

@Nic-Ma, Sure, I'm at it. Read about UNET++ yesterday, need sometime to understand it properly in order to implement.

yashika-git commented 2 years ago

Hi @Nic-Ma,

I was going through some codes in order to get an idea of how to implement UNet++. I had a doubt, in the below line of the file convolutions.py: https://github.com/Project-MONAI/MONAI/blob/0b97bb6172f967c4b4dd1de92263e26186db54b9/monai/networks/blocks/convolutions.py#L129 If the user input for padding is None, a same_padding is applied. I was wondering if user should be given an option to also apply a valid_padding (or no padding) ?

Thank You

Nic-Ma commented 2 years ago

Hi @ericspod ,

Could you please help share some suggestions here? I think you are the expert on the UNet implementation.

Thanks in advance.

ericspod commented 2 years ago

You can provide a padding value of 0 to not pad or some other value calculated as a valid pad value.

yashika-git commented 2 years ago

Thank you for the information, @ericspod.

baibizhe commented 2 years ago

Thank you for the information, @ericspod.

Hello .I would really like to do contibution on this issues. Is there anything that I could do about this issue? I am not familiar with MONAI , but I am familiar with pytorch,python and UNET. If you need any help, please contact me .

wyli commented 2 years ago

Hi @baibizhe, thanks for your interest here. There's a basic UNet implementation in MONAI, the goal was to create an easy-to-understand baseline but with some price in flexibility https://github.com/Project-MONAI/MONAI/blob/78509ae55ef98660907544e92713e44897bb7e48/monai/networks/nets/basic_unet.py#L189

as you can see the forward function is straightforward with a hard-coded structure https://github.com/Project-MONAI/MONAI/blob/78509ae55ef98660907544e92713e44897bb7e48/monai/networks/nets/basic_unet.py#L286-L300

but the activations/dropout are quite flexible using the MONAI APIs: https://github.com/Project-MONAI/MONAI/blob/78509ae55ef98660907544e92713e44897bb7e48/monai/networks/nets/basic_unet.py#L199-L203

A unet++ implementation following a similar style (emphasising code readability) would also be quite helpful for the community. is this something that you could contribute? thanks!

yashika-git commented 2 years ago

Thank you for sharing this @wyli. Can I and @baibizhe work together on this issue?

wyli commented 2 years ago

Hi @yashika-git, I'd recommend avoiding duplicated efforts. There's a UNet with better flexibility and used in many of our examples/tutorials https://github.com/Project-MONAI/MONAI/blob/78509ae55ef98660907544e92713e44897bb7e48/monai/networks/nets/unet.py#L28

It would be great to follow that style, and create a fully configurable unet++, if you are interested...

yashika-git commented 2 years ago

Alright, thank you @wyli. I'll try creating a fully configurable unet++.

baibizhe commented 2 years ago

Hi @baibizhe, thanks for your interest here. There's a basic UNet implementation in MONAI, the goal was to create an easy-to-understand baseline but with some price in flexibility

https://github.com/Project-MONAI/MONAI/blob/78509ae55ef98660907544e92713e44897bb7e48/monai/networks/nets/basic_unet.py#L189

as you can see the forward function is straightforward with a hard-coded structure

https://github.com/Project-MONAI/MONAI/blob/78509ae55ef98660907544e92713e44897bb7e48/monai/networks/nets/basic_unet.py#L286-L300

but the activations/dropout are quite flexible using the MONAI APIs:

https://github.com/Project-MONAI/MONAI/blob/78509ae55ef98660907544e92713e44897bb7e48/monai/networks/nets/basic_unet.py#L199-L203

A unet++ implementation following a similar style (emphasising code readability) would also be quite helpful for the community. is this something that you could contribute? thanks!

Yes. This is something I would like to contibute !