5386 Update HoverNet structure#5405
Conversation
Signed-off-by: Yiheng Wang <[email protected]>
|
The changed HoverNet is still not 100% the same as the reference version on the encoder side, since we use conv layers to do the padding but the referred version defines Hi @JHancox , could you please share some experiences of the difference here? In my point of view, it's more convenient to use your method since we do not need to maintain more layers within the network. |
Signed-off-by: Yiheng Wang <[email protected]>
…heng-wang-nv/MONAI into 5386-modify-hovernet-and-add-pretrain
Signed-off-by: Yiheng Wang <[email protected]>
|
Hi @KumoLiu , Could you please help verify the PR in your draft training pipeline? Thanks in advance. |
Thanks @yiheng-wang-nv. In their PyTorch code, they tried to emulate their original Tensorflow code, which used Tensorflow's simpler padding/cropping implementation. As you say, this resulted in additional layers that I felt could be eliminated in a more elegant way. So, although there are differences, it's the consistent output that is important. |
Signed-off-by: Yiheng Wang <[email protected]>
…heng-wang-nv/MONAI into 5386-modify-hovernet-and-add-pretrain
Signed-off-by: Yiheng Wang <[email protected]>
|
@JHancox will give @yiheng-wang-nv new unittests by Nov 1 to be added to this PR. |
Thanks @JHancox @drbeh . I already received the code of unit tests from Jonny, I will update them into this PR soon. |
Signed-off-by: Yiheng Wang <[email protected]>
Signed-off-by: Yiheng Wang <[email protected]>
|
Also for the output channel in NP branch, it seems to be hard-coded in 2. Maybe we should make it not hard-code here? MONAI/monai/networks/nets/hovernet.py Lines 520 to 523 in 52525a8 Thanks! |
|
Hi @KumoLiu
|
|
Hi @JHancox
Yes, I am talking about the number of channels in the NP branch. I think it can be not only 2, but also 1 or other values. Thanks! |
I don't think that there is a need to generalize this, because the purpose of the branch is pretty specific. However, as you mentioned previously, there is a good argument to simply make it a 1 channel output and then apply a sigmoid to the output, rather than having 2 channels with softmax. |
@KumoLiu @yiheng-wang-nv, I agree with @JHancox here since we already have another branch ( |
Even if there is only a choice of 1 or 2, maybe we can also make it not hard-code here? |
|
@KumoLiu, having 2 classes where they are mutually exclusive is identical to having one class. I believe it has been a mistake that the original authors have used 2 classes. |
Hi, I think add an arg to control the output channel of NP branch makes sense, for reproducing the original result, just need to keep the default setting. |
|
Update: according to the latest discussion, the current version will be updated and the load pretrained weights part will be removed due to the license issue. |
Signed-off-by: Yiheng Wang <[email protected]>
Signed-off-by: Yiheng Wang <[email protected]>
KumoLiu
left a comment
There was a problem hiding this comment.
Thanks for the update, looks good to me now!
Signed-off-by: Yiheng Wang <[email protected]>
Signed-off-by: Yiheng Wang <[email protected]>
|
/build |
1 similar comment
|
/build |
Signed-off-by: Yiheng Wang <[email protected]> Fixes Project-MONAI#5386 Project-MONAI#5387 . ### Description This PR modifies HoverNet via change the kernel size and padding size in order to be consistent with the reference source. This PR also enables to output same shape as the input when using fast mode (takes the conic branch version (see: https://github.com/vqdang/hover_net/tree/conic) for reference). What's more, the functionality of loading pretrained weights is added, users need to add the url which contains the weights that follow the format of the encoder. Finally, this PR adds the `np_out_channels` arg to control the output channels of the nucleus prediction branch. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Breaking change (fix or new feature that would cause existing functionality to change). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Yiheng Wang <[email protected]> Co-authored-by: Behrooz Hashemian <[email protected]> Signed-off-by: Behrooz <[email protected]>
Signed-off-by: Yiheng Wang [email protected]
Fixes #5386 #5387 .
Description
This PR modifies HoverNet via change the kernel size and padding size in order to be consistent with the reference source.
This PR also enables to output same shape as the input when using fast mode (takes the conic branch version (see: https://github.com/vqdang/hover_net/tree/conic) for reference).
What's more, the functionality of loading pretrained weights is added, users need to add the url which contains the weights that follow the format of the encoder.
Finally, this PR adds the
np_out_channelsarg to control the output channels of the nucleus prediction branch.Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.