MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

add support for UNET++

Open michalhg opened this issue 4 years ago • 14 comments

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

michalhg avatar Aug 12 '20 15:08 michalhg

Hi @michalhg ,

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

Thanks.

Nic-Ma avatar Aug 12 '20 22:08 Nic-Ma

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

yashika-git avatar Jun 04 '22 21:06 yashika-git

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!

Nic-Ma avatar Jun 05 '22 01:06 Nic-Ma

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

yashika-git avatar Jun 06 '22 09:06 yashika-git

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

yashika-git avatar Jun 13 '22 08:06 yashika-git

Hi @ericspod ,

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

Thanks in advance.

Nic-Ma avatar Jun 13 '22 11:06 Nic-Ma

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

ericspod avatar Jun 13 '22 12:06 ericspod

Thank you for the information, @ericspod.

yashika-git avatar Jun 13 '22 13:06 yashika-git

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 .

baibizhe avatar Jun 18 '22 10:06 baibizhe

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!

wyli avatar Jun 18 '22 11:06 wyli

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

yashika-git avatar Jun 18 '22 11:06 yashika-git

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...

wyli avatar Jun 18 '22 12:06 wyli

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

yashika-git avatar Jun 18 '22 12:06 yashika-git

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 !

baibizhe avatar Jun 18 '22 18:06 baibizhe