survey_wsl_histology
survey_wsl_histology copied to clipboard
Pytorch 1.10.0 code for:
Deep Weakly-Supervised Learning Methods for Classification and Localization in Histology Images: A Survey
. Webpage, PDF
Poster MIDL 2023
Citation:
@article{rony2023deep,
title ={Deep Weakly-Supervised Learning Methods for Classification and Localization in Histology Images: A Survey},
author={Rony, J. and Belharbi, S. and Dolz, J. and Ben Ayed, I. and McCaffrey, L. and Granger, E.},
journal = "Machine Learning for Biomedical Imaging",
volume = "2",
year = "2023",
pages = "96--150"
}
Issues:
Please create a github issue.
Content:
- View
- Results
- Requirements
- Datasets
- Run code
Method:


Installed methods:
- GAP
- Max-Pooling
- LSE
- CAM
- HaS
- WILDCAT
- ACoL
- SPG
- Deep MIL
- PRM
- ADL
- CutMix
- TS-CAM
- MAXMIN
- NEGEV
- GradCAM
- GradCAM++
- Smooth-GradCAM++
- LayerCAM
- U-Net
Results:







Requirements:
- Python 3.7.10
- Pytorch 1.10.0
- torchvision 0.11.1
pip install torch==1.10.0 -f https://download.pytorch.org/whl/cu111/torch-1.10.0%2Bcu111-cp37-cp37m-linux_x86_64.whl
pip install torchvision==0.11.1 -f https://download.pytorch.org/whl/cu111/torchvision-0.11.1%2Bcu111-cp37-cp37m-linux_x86_64.whl
- Full dependencies
- Build and install CRF:
- Install Swig
- CRF (not used in this work, but it is part of the code.)
cdir=$(pwd)
cd dlib/crf/crfwrapper/bilateralfilter
swig -python -c++ bilateralfilter.i
python setup.py install
cd $cdir
cd dlib/crf/crfwrapper/colorbilateralfilter
swig -python -c++ colorbilateralfilter.i
python setup.py install
Download datasets :
2.1. Links to dataset:
2.2. Download datasets:
- GlaS: ./download-glas-dataset.sh.
You find the splits in ./folds.
2.3 Code for datasets split/sampling (+ patches sampling from WSI):
- See datasets-split.
- Detailed documentation: datasets-split/README.md.
Run code :
- CAM-method: CAM over GLAS using ResNet50:
cudaid=$1
export CUDA_VISIBLE_DEVICES=$cudaid
getfreeport() {
freeport=$(python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()')
}
export OMP_NUM_THREADS=50
export NCCL_BLOCKING_WAIT=1
plaunch=$(python -c "from os import path; import torch; print(path.join(path.dirname(torch.__file__), 'distributed', 'launch.py'))")
getfreeport
torchrun --nnodes=1 --node_rank=0 --nproc_per_node=1 \
--master_port=$freeport main_wsol.py \ --local_world_size=1 \
--task STD_CL \
--encoder_name resnet50 \
--arch STDClassifier \
--runmode final-mode \
--opt__name_optimizer sgd \
--batch_size 32 \
--eval_checkpoint_type best_localization \
--opt__step_size 250 \
--opt__gamma 0.1 \
--max_epochs 1000 \
--freeze_cl False \
--support_background True \
--method CAM \
--spatial_pooling WGAP \
--dataset GLAS \
--fold 0 \
--cudaid 0 \
--debug_subfolder None \
--amp True \
--opt__lr 0.003 \
--exp_id 11_19_2021_09_32_36_109051__423849