tensorflow / tensorflow/tensorboard

Add a 'saliency' plugin for showing saliency maps.

Open
#555 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature (new plugin)
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.

screen shot 2017-09-21 at 11 45 35 am

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.