Project-MONAI / Project-MONAI/MONAI

Batch support for saliency maps

Open
#7,334 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Contribution wanted Feature request
Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description

Is your feature request related to a problem? Please describe.
Currently, classes to generate saliency maps like VanillaGrad, SmoothGrad, etc. support only running on a single input sample.

Giving a batch of samples results in a ValueError due to this
https://github.com/Project-MONAI/MONAI/blob/90d2acb54d5325e6727f2cc2329cb40adc8577af/monai/visualize/gradient_based.py#L90

Describe the solution you'd like
Batch support for saliency maps can speed up calculation when running over an entire dataset.

Describe alternatives you've considered
I'm currently calculating saliency on a large number of output features over a large number of samples, and this is quite slow despite naive parallelization.

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 in monai/visualize/gradient_based.py around line 90 and review the VanillaGrad and SmoothGrad entry points. Reproduce the ValueError with a batched input, then verify that saliency-map generation accepts batches and preserves the expected per-sample results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.