PyHealth icon indicating copy to clipboard operation
PyHealth copied to clipboard

Adding Basic Saliency Mapping

Open Nimanui opened this issue 8 months ago • 2 comments

Adding a function to allow Gradient saliency to be applied to Pyhealth models that work with image data. I have also included a python notebook demonstrating this function being used, and the visual output. This is a bit of a proof of concept that we can apply saliency to some of the Pyhealth models, although would only be the start if there was a desire to add additional saliency techniques (this was the simplest of the ones I tried in my paper replication). by fitzpa15

Nimanui avatar May 08 '25 03:05 Nimanui

This contribution is for CS598 DLH. For my paper replication project I focused on learning saliency mapping techniques and applying them in noevel ways to out-of-the-box deep learning models. This seemed a good starting point for saliency mapping as it is among the most basic and easiest to implement.

Nimanui avatar May 08 '25 03:05 Nimanui

Please view the python notebook for a test case on how to use it, if it helps contact me and I can work on adapting the notebook test to something more reusable, but that was the easiest method I came up to test it initially. The files in here are the Notebook, a new file with the saliency mapping function (maybe there is a better place to put it?) and an update to the init file to allow for the function to be imported. To use it in the notebook, you will need to clone into the notebook a version of pyhealth that contains the init file changes and the new saliency file (I did this with my local fork before creating the pull request).

Nimanui avatar May 08 '25 03:05 Nimanui

Closing this PR as it lacks proper labeling. Please add appropriate labels and reopen if needed.

jhnwu3 avatar Aug 04 '25 01:08 jhnwu3

I'm not sure what you mean by proper labels. Please clarify and I can make the needed edits.

Nimanui avatar Aug 04 '25 18:08 Nimanui

Hey sorry about that. I had automatically closed a bunch of PRs that since many of them came from a course that were inactive. If you can, we have an interpret/ directory in our pyhealth/

It would be good to add more docs and other things to it. We can discuss more on discord if you're still interested in contributing an interp method.

jhnwu3 avatar Aug 04 '25 22:08 jhnwu3

Absolutely, that makes a ton of sense. I'll take a look and reach out through discord. I have some time next week to dive back in and make some changes. Just need to wrap up a summer class.

Nimanui avatar Aug 05 '25 14:08 Nimanui