-Important:
2- We are working on a survey that will compile all the works on weakly and semi-supervised segmentation with deep models, which will be on arxiv within the next weeks.
This code was written for Python 3.5+. Most of the required packages include:
pytorch (tested with 0.4.0)
torchvision
numpy
scipy
matplotlib
tqdm
PIL
ImageMagick
(available by default on most Linux distributions) is required for the optional script generating the GIF displayed above.
The current version is implemented on python 3.5 and pytorch 0.4.0
python 7-WeaklySup_Segmentation.py --mode 0
python 7-WeaklySup_Segmentation.py --mode 1
python plotResults.py
./gifs.sh
For the old version:
python3 -O 7-WeaklySup_Segmentation.py --mode 0
python3 -O 7-WeaklySup_Segmentation.py --mode 1
python3 plotResults.py
./gifs.sh
The -O
is optionnal, as it is a switch do disable all the assertions and sanity checks within the code.
Results are stored in the following folder structure:
Results/
Images/
Results/Images/Weakly_Sup_CE_Loss/
yy_Ep_xxxx.png
...
Results/Images/Weakly_Sup_CE_Loss_SizePenalty/
...
Statistics/
Results/Images/Weakly_Sup_CE_Loss/
CE_Losses.npy
...
Results/Images/Weakly_Sup_CE_Loss_SizePenalty/
...
result.gif
If you are re-using this code in your research, and the material from this tutorial, please consider citing:
Hoel Kervadec, Jose Dolz, Meng Tang, Eric Granger, Yuri Boykov, and Ismail Ben Ayed. "Constrained-CNN losses for weakly supervised segmentation." Medical image analysis 54 (2019): 88-99
.
Ismail Ben Ayed, Christian Desrosiers and Jose Dolz. "Weakly Supervised CNN Segmentation: Models and Optimization."Medical Image Computing and Computer Assisted Intervention − MICCAI 2019 Tutorial
.