tensorflow / tensorflow/tensorboard
Add a 'saliency' plugin for showing saliency maps.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 1
Description
Saliency maps (or sensitivity masks) visualize which inputs contribute towards a model decision. They are generated from gradient-based methods such as integrated gradients, guided back propagation, or SmoothGrad (original link). Teams including the diabetic retinopathy folks have asked for TensorBoard to show them.
PAIR has a wonderful library for computing saliency maps. The main challenge with making a plugin that makes use of the library's output is that the gradient-based methods operate at a level higher than the model run, making summary ops not conducive towards collecting data. For instance, integrated gradients runs a graph several (say 50 or 100) times with inputs that vary, and the saliency library outputs a 2D numpy array of sensitivity values.
In response to that challenge, I think this 'saliency' plugin could deviate from other plugins and have a python helper method that takes that numpy array and writes it into a summary. That has several advantages. TensorBoard's bazel targets would not have to depend on the saliency library - we rely on the user to install and use it. This lets users use the saliency library as expected and just slip the output into a TensorBoard summary.
At the end of the day, the frontend UI could let the user impose saliency maps atop images and toggle the map and the image. The map could be semi-transparent, and users could change the color tinge. Cards in the UI could mimic the examples shown in the SmoothGrad page: https://pair-code.github.io/saliency/
@wchargin @jart @dandelionmane
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the PAIR saliency library and its example visualizations, then inspect TensorBoard's existing summary and plugin patterns. Define the helper's summary input and the frontend behavior from the requested image overlay, toggling, color tint, and card examples. Done means saliency arrays can be written as summaries and displayed interactively in TensorBoard.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- frontend, machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100