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

  1. 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.
  2. N_test
    Number of testing images.
  3. batchsize
    Number of batch for classifier.
  4. N_epoch
    Number of epochs.
  5. 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

  1. Threshold of discard
    Area of isolated part to be discarded. Default is 100.
  2. 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

  1. two convolutional layers and relu layers
  2. batch normalization layer
  3. max pooling layer
  4. two convolutional layers and relu layers
  5. batch normalization layer
  6. convolutional layer
  7. 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.