-
Notifications
You must be signed in to change notification settings - Fork 688
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
adds gradcam tutorial #83
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@rijobro I tried the occlusion sensitivity it's currently very slow for 3D, I guess we need something to occlude with a user-specified step, so that the map will be generated at a low resolution, then we can upsample the final map to the original image size |
Thanks, I'll have a look now! Yes, generating a low-resolution grid followed by upsampling would be great. I think so far I sidestepped the slowness by allowing the user to optionally occlude within a bounding box, meaning you could just occlude a 2D slice if you wanted. |
Just made a PR with some suggested changes. Few things I noticed:
Just had a look at occlusion sensitivity and you're right, it's currently too slow. I'll have a look at adding a stride to it tomorrow. |
Hi @Nic-Ma this is ready, could you review? (the pip command will need an update later) |
thanks, I'll double check the colour encoding, maybe there's an issue with GradCAM. |
I was just thinking that the non-lesions are tricky since, when a lesion is present, the visualisations should hopefully point towards those lesions. In the absence of lesions, I guess it will check the whole image, which is why the images in the middle column are largely uniform. For the colours, I think the reason is that for the occlusion sensitivity I did |
The scores are calculated relative to the true label of that image. As a sanity check, I checked that the network predicted the correct class, which I printed in the title of the first row. In these cases, the network was correct for all of them. It would be interesting to find an example in which the network was wrong. |
Thanks for the nice notebook. Thanks. |
in my notebook I used |
the patches' original masks are also included in the patch dataset as |
Hi @wyli , May I know the status of this PR? Is it OK for review and release in v0.4? Thanks. |
thanks @rijobro ! (for some reason I don't get any notification of that PR) |
@wyli i notice you've switched to |
None means using the argmax over the predicted logits, I think it's the same as your version? btw I still feel the CAM result is not as good as the occ., want to tune it but I don't have time today... |
Sounds good.
I agree. The two sets of images should convey similar information, and I'm not convinced that they do at the moment. Also we should have a chat about intensities. Since 0.4.0 has already been released, we're in less of a rush for this, so let's have a chat via Slack whenever you're free? |
previously I could get this I feel the previous results are nicer. but I couldn't replicate them (note that the input images+random aug. in both cases I've been able to reproduce the original images but note the gradcam results) do you have any clue @rijobro ? |
the difference comes from |
To me it looks like there's a thresholding taking place in the lower set of images, and then if the colourmap is from Perhaps you should disable the postprocessing (which by default normalises betwen 0 and 1), so that you get a feel for the range of the results? Could plot with colourbars. |
sure @rijobro I'll try those suggestions. probably it's the batchnorm layers causing the difference for this particular demo, but |
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Ok, looks good to me. This PR: Unify visualisation Project-MONAI/MONAI#1381 will use |
sure, could have another iteration later, could you approve this if it looks ok |
adds gradcam and occlusion sensitivity tutorial
fixes #76