This repository is under continous updates.
- Ubuntu 20
- Python 3.6/3.7
- CUDA 11.0
- Pytorch 1.7.1
conda env create --name wsshisto python=3.6
conda activate wsshisto
```
- run
pip install -r requirements.txt
- Download WSI daatasets e.g. Camelyon16
- Place datasets in appropriate locations.
- Preprocess WSI to generate WSI thumbnails (normal/tumor) e.g. save as '001_tissue_fig.png', tumor mask from 'xml' annotations (001_tumor.png) all in a single folder (e.g. /cm16/WSI_ALL)
- Refer to CLAM & DSMIL for pre-processing.
- Extract patches from all training WSIs. Save patches and normalize (e.g. save in cm16/train/patches_norm/train/0). The folder (patches_norm/train/0) contains WSIs as folders (001/xx_patch.png .... xx_patch..png), each containing all the patches for that slide.
- Train the patch encoder (see configs/patch_enc.yml)
- run
python graph_research/train.py --config /path/to/patch_enc.yml
- To compress WSIs using the trained encoder refer to Tellez et al. NIC
- Save the compressed WSIs in a folder i.e., (/path/to/compressed/all/wsi/001.npy) as well as the masks (/path/to/compressed/all/label/001.npy)
- Train/test the benchmark UNet
- run
python graph_research/{train/test}.py --config ./graph_research/configs/wsi/neu_seg/wsi_seg.yml
- Train/test proposed WSS-SS
- run
python graph_research/{train/test}.py --config ./graph_research/configs/wsi/neu_seg/wsi_ss_mask.yml
- To see more details on the proposed algorithm, refer to models/pooling/seam.py and trainers/wsi_ss_trainer.py
Our implementation builds upon several existing publicly available code.