How it Works - rickyota/CSML GitHub Wiki
Contents
Overview
There are two steps in CSML, training step and inference step. In training step, classifier is trained. In inference step, segmention images are returned.
Training Step
In training step, FCN Classifier is trained based on training images and labeled images.
Images obtained by preprocessing are used as input of classifier.
Parameters for training
- N_train
Number of training images. Basically, the more, the better, but too large number leads overfitting and takes long time. Default is 20,000. - N_test
Number of testing images. - batchsize
Number of batch for classifier. - N_epoch
Number of epochs. - Height, Width
Height and Width of images cut out for input of classifier. Default is (64,64).
Inference Step
In inference, whole segmentation images are returned.
Images obtained by preprocessing are used as input of classifier. Whole segmentation images are obtained by postprocessing of inferred small images returned by classifier.
Parameters for inference
- Threshold of discard
Area of isolated part to be discarded. Default is 100. - Width of closing
Px width of closing. Default is 1.
Preprocessing
By preprocessing, small images are cut out from whole image and get normalized.
FCN Classifier
The FCN Classifier consists of
- two convolutional layers and relu layers
- batch normalization layer
- max pooling layer
- two convolutional layers and relu layers
- batch normalization layer
- convolutional layer
- deconvolutional layer
Postprocessing
By postprocessing, whole segmentation images are returned.
Each inferred whole image is obtained by merging two inferred images, one is a whole image made by the connection of small images, and the other is made by the connection of half of image size shifted images.
The whole segmentation images are acquired by discarding the isolated area under threshold of discard, dilating the image by width of dilation, filling the area under threshold of filling.