-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MedicalNetPerceptualSimilarity: Add multi-channel #7568
MedicalNetPerceptualSimilarity: Add multi-channel #7568
Conversation
support for 3Dvolumes. The current version of the code in the dev branch already largely supports that besides the following: medicalnet_* require inputs to have a single channel. This PR passes the multi-channel volume channel-wise to the networks and concatenates the resulting feature vectors. The existing code takes care of averaging over channels and spatially. Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
The implementation appears to be done correctly and it successfully introduces multi-channel input support for PerceptualSimilarity. It effectively allows each channel to be processed independently, which is a substantial addition. |
Will adjust accordingly on monday, such that the return types are scalar or 1D array/tensor respectively. |
I tried to adapt it for RadNet and ResNet too, however as they expect 3 channel input and always output 2048 features, it's non trivial to treat the images channel-wise here. So I'd stick to MedicalNet for a channel-wise perceptual loss. Will squash the commits as soon as LGTY |
I, Fabian Klopfer <fabian.klopfer@ieee.org>, hereby add my Signed-off-by to this commit: dd84afc Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
…e mean over batch dimension only and squeeze the output of the perceptual function instead Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
@KumoLiu only the blossom-ci check hasn't passed. Can we merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick update, few comments inline.
…alnetperceptualsimilarity
Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
Hi @SomeUserName1, I noticed that you add me review the PR again. In case you didn't noticed the comment here. Looks a little confuse to me here. Could you please help explain it more? |
Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick update, overall looks good to me.
Only a small comment, will merge this ASAP.
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com> Signed-off-by: Fabian Klopfer <fabian.klopfer@ieee.org>
/build |
Fixes #7567 .
Description
MedicalNetPerceptualSimilarity: Add multi-channel support for 3Dvolumes.
The current version of the code in the dev branch already largely supports that besides the following:
medicalnet_* require inputs to have a single channel.
This PR passes the multi-channel volume channel-wise to the networks and concatenates the resulting feature vectors.
The existing code takes care of averaging over channels and spatially.
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests --disttests
.make html
command in thedocs/
folder.