Skip to content
/ wsl Public
forked from mehak-agr/wsl

Weakly Supervised Localization

License

Notifications You must be signed in to change notification settings

nishanthta/wsl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Towards Trainable Saliency Maps in Medical Imaging

Directory Structure

Data

Each image location is presumed to be as follows:
wsl_data_dir / data / id.extension
where,

  • data is specified as argument during run time itself - currently supports rsna and chexpert
  • id each unique study or image is accessed by this label - first column of each csv is Id - confirm in wsl_csv_dir
  • extension is also specified as argument during runtime - it is decoupled from id since each extension requires slightly different loading function

CSVs

wsl_csv_dir / data / file_name.csv
Each csv directory 4 main files - info, train, valid, test
info.csv - first column is Id, the rest are ground truths

  • 0/1 for binary classification, simple integers for regression
  • for binary classification if the 0 and 1 are represent different characterstics, name the column 0_1
    e.g. Male_Female where 0 stands for Male and 1 for Female in the column
  • for a > 1 classes, make a single column with a list of ground-truth labels for each Id
  • todo: include support for multi-class regression and multi-class + multi-label ground truths
    train.csv, valid.csv test.csv - single column csv which contains ids to use for current data split
    original.csv - (optional) csv from which info.csv was derived

Model

Please refer to wsl / wsl / train.py for how the models are named

Summary

Used for storing combined results upon testing of all models - ease of comparison for different architectures and variants

What to change?

Go to wsl / locations.py Use user variable to reflect your name
Add to the if-else bock to add the location of storage - maintainer recommends using full paths to avoid confusion
The paths added here can be called all over the repo, do not use actual paths anywhere else
TODO: make setting this a part of docker setup

How to run?

Login to the machine

Occurs on your remote / local machine

Make a folder A where your repository will reside - $ mkdir folder-A
Go to foler-A - $ cd folder-A
Inside folder-A - $ git clone https://github.com/mehak-agr/wsl.git
Make a docker - $ sudo docker run --gpus all --ipc=host -it -v /home/mehak.aggarwal/mnt/:/data --name m_wsl projectmonai/monai:latest

Occurs inside docker m_wsl

Go to folder-A - $ cd /data/2015P002510/...folder-A
Install wsl as a package - $ pip install -e wsl
To train a debug model to ensure things work fine - $ wsl medinet --debug

You can find a comprehensive list of commands and arguments in wsl/main.py
Your trained model will be here - wsl_model_dir / models /

Upcoming updates

  • UNet for segmentation

Citation

If you use this code for your research, please cite our paper:

@inproceedings{Medinet2020,
  title={Towards Trainable Saliency Maps in Medical Imaging},
  author={Mehak Aggarwal, Nishanth Arun, Sharut Gupta, Ashwin Vaswani, Bryan Chen, Matthew Li, Ken Chang, Jay Patel, Katherine Hoebel, Mishka Gidwan, Jayashree Kalpathy-Cramer, Praveer Singh},
  booktitle={Machine Learning 4 Health, 2020 Neural Information Processing Systems (NeurIPS)},
  year={2020}
}

About

Weakly Supervised Localization

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 58.4%
  • Python 38.4%
  • Shell 2.7%
  • Dockerfile 0.5%