U-Net-Pytorch-0.4 is a custom U-Net implementation in python 2.7 for Pytorch 0.41. Furthermore, a custom dataloader is introduced, which can load the ISBI 2012 Dataset. Dataaugmentation is applied in the dataloader.
Details about the U-Net network can be found on the U-Net project page. The implementation in this repository is tested on Ubuntu 16.04 with Python 2.7
The implementation is freely available under the MIT License, meaning that you can basically do with the code whatever you want.
- Pytorch 0.4, Python 2.7, ( CUDA 9.1 for GPU acceleration ) scipy ( for data augmentation ), sacred ( https://github.com/IDSIA/sacred )
No building is required, just clone or download the github project in a directory. The programm is tested on Ubuntu 16.04 with a Geforce GTX 1070 8GB Nvidia Driver 390.48 CUDA 9.1, Python 2.7.14 and Pytorch 0.4
/python should start python 2.7 . You can check the version with python --version
usage: /python main.py
Sacred is a tool to help you configure, organize, log and reproduce experiments. All important settings can be changed in the config.json file. ( only the dataset direction is hardcoded into main.py at line 176 to 187. If you use another dataset, just change the used direction. )
batch_size
mini batch size (default: 1). For 8k memory on gpu, minibatchsize of 2-3 possible for ISBI 2012workers
number of data loading workers (default: 2)learningrate
initial learning rate (default: 0.001)momentum
momentum (default: 0.99)weightdecay
weight decay (L2 penalty ) (default:0)epochs
number of total epochs to run (default: 600)resume
relative path to latest checkpoint, load all needed data to resume the network (default: none)evaluate
evaluate model on validation setsaveimages
save the first image of output each epochecpu
use cpu instead of gpupadding
use padding at each 3x3 convolution to maintain image sizetxtinfo
save console output in txtclassweight
use classweights
Use the ISBI2012 dataset and run for 600 epochs. Use padding at each 3x3 convolution and save information about the used settings and losses each epoch in a txt file.
python main.py
the txt file looks like this:
Dataset : ISBI2012
Start Epoch : 0
End Epoch : 100
Learning rate: 0.001
Momentum : 0.99
Weight decay : 0
Use padding : True
Epoche [ 1] train_loss: 0.4911 val_loss: 0.4643 loop time: 9.96429
Epoche [ 2] train_loss: 0.4630 val_loss: 0.5017 loop time: 5.41091
Epoche [ 3] train_loss: 0.4460 val_loss: 0.4637 loop time: 5.45516
U-Net: Convolutional Networks for Biomedical Image Segmentation
https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/
Ronneberger, Olaf, Philipp Fischer, and Thomas Brox. "U-net: Convolutional networks for biomedical image segmentation." International Conference on Medical image computing and computer-assisted intervention. Springer, Cham, 2015.
ISBI 2012 Segmentation Challenge
http://brainiac2.mit.edu/isbi_challenge/home
Ignacio Arganda-Carreras, Srinivas C. Turaga, Daniel R. Berger, Dan Ciresan, Alessandro Giusti, Luca M. Gambardella, Jürgen Schmidhuber, Dmtry Laptev, Sarversh Dwivedi, Joachim M. Buhmann, Ting Liu, Mojtaba Seyedhosseini, Tolga Tasdizen, Lee Kamentsky, Radim Burget, Vaclav Uher, Xiao Tan, Chanming Sun, Tuan D. Pham, Eran Bas, Mustafa G. Uzunbas, Albert Cardona, Johannes Schindelin, and H. Sebastian Seung. Crowdsourcing the creation of image segmentation algorithms for connectomics. Frontiers in Neuroanatomy, vol. 9, no. 142, 2015.