(WIP) Integration of gradcam #feature36 #123
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
As a data scientist, I want to know why a model makes a certain prediction. A heatmap can help me understand where the model is looking at in the input image. This can serve as a sanity check for our models.
Goal
Integrate gradcam code in cgm-rg height workflow and display results in tagging tool.
Implementation
create height results along with gradcam heatmap
_generate height results + gradcam in test notebook (like in cgm-rg)
_use second gradcam implementation from here: https://gist.github.com/RaphaelMeudec/e9a805fa82880876f8d89766f0690b54, to better understand it, read here: https://www.sicara.ai/blog/2019-08-28-interpretability-deep-learning-tensorflow
_write function that returns name of last conv layer
_write own function to overlay depthmap and heatmap for debugging
integrate in cgm-rg
_re-write function to take on numpy_array only
_make grad_model global in cgm-rg
_adapt all relevant files
_add extract_last_conv_layer_name function
_add get_height_prediction_and_heatmap_local
_add/adapt json file in src/workflows
_complete actual workflow code in src/result_generation/height/height_plaincnn.py
Checklist: