U-SegNet is a segmentation network proposed by the research group of the Indraprastha Institute of Information Technology-Delhi. It is based on U-Net and SegNet architectures.
From U-Net:
- skip connection on the first layer.
From SegNet:
- downsamping using pooling;
- upsampling using unpooling with indices from pool operation.
Network consists of 2 blocks:
- Block for downsampling consists of: N times (in this implenentation - 2) of block [Convolution -> Batch Normalization -> RELU] and Pooling operation.
- Block for upsampling consists of: an UnPooling operation and N times (in this implenentation - 2) of block [Convolution -> Batch Normalization -> RELU].
To do unpooling you need to save indices from pooling operation.
Next image illustrates architecture proposed in paper.
In paper from IIIT-Delhi you can see that they use sliding window to predict every pixel's class, but I've implemented it for one single image.
- Put train and test data into data/u_segnet folder.
Path to train images and masks should be as follows:
data/u_segnet/(train, test)/(images, masks)
- Via command line run commands below. It will take some time to create folders for train/dev/test splits with resized images in them.
cd home/$user/**path/to/project**/data/u_segnet/
python prepare_u_segnet.py --config ../../configs/u_segnet.json
- Next commands will change your working dirrectory and start training cycle.
cd home/$user/**path/to/project**/mains/
python u_segnet_runner.py --config ../configs/u_segnet.json