keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
61.42k stars 19.4k forks source link

Addition of GradCAM visualization option for output visualization of CNNs #15704

Closed MrinalTyagi closed 2 years ago

MrinalTyagi commented 2 years ago

System information.

TensorFlow version (you are using): 2.7.0 Are you willing to contribute it (Yes/No) : Yes

Describe the feature and the current behavior/state. GradCAM visualization is a great algorithm to showcase the activation part of an image from a CNN. As described in this paper(https://arxiv.org/pdf/1610.02391.pdf), it can allow users to visualize the issues their model is making in a more interactive way and fix the models. There are some 3rd party implementations (https://github.com/keisen/tf-keras-vis) but to have them on core API would be great.

Describe the feature clearly here. Be sure to convey here why the requested feature is needed. Any brief description about the use-case would help.

Will this change the current api? How? Yes, it will change the current API by the addition of a GradCAM visualization function in utils or the addition of a new visualization module itself. Depends on the admins.

Who will benefit from this feature? It will help users who are using CNN to visualize the issue their model is making in a more interactive way by looking at the class activation map of the image and having a look at which part of the image the model gets activated to predict the class.

Contributing

MrinalTyagi commented 2 years ago

@jvishnuvardhan Please tell if should proceed with the feature addition or not as I think it will be a great addition to the library

mattdangerw commented 2 years ago

Triage notes: We don't have other visualization on image tools like this and would not want to add them into core Keras at this time. A 3rd party library for visualization on top of Keras seems like the correct place for this.