0
$\begingroup$

I was unable to find a complete description of the SegNet architecture for image segmentation (specifically, the decoder layers). Therefore, I would like to clarify the correctness of my implementation (schematically):

Input(x, x, 3)

Conv2d(64)+BatchNormalization+ReLU
Conv2d(64)+BatchNormalization+ReLU
MaxPoolWithArgMax

Conv2d(128)+BatchNormalization+ReLU
Conv2d(128)+BatchNormalization+ReLU
MaxPoolWithArgMax

Conv2d(256)+BatchNormalization+ReLU
Conv2d(256)+BatchNormalization+ReLU
Conv2d(256)+BatchNormalization+ReLU
MaxPoolWithArgMax

Conv2d(512)+BatchNormalization+ReLU
Conv2d(512)+BatchNormalization+ReLU
Conv2d(512)+BatchNormalization+ReLU
MaxPoolWithArgMax

Conv2d(512)+BatchNormalization+ReLU
Conv2d(512)+BatchNormalization+ReLU
Conv2d(512)+BatchNormalization+ReLU
MaxPoolWithArgMax

Conv2dTranspose(512)+BatchNormalization+ReLU
MaxUnpoolWithArgMax
Conv2dTranspose(512)+BatchNormalization+ReLU
Conv2dTranspose(512)+BatchNormalization+ReLU

Conv2dTranspose(512)+BatchNormalization+ReLU
MaxUnpoolWithArgMax
Conv2dTranspose(512)+BatchNormalization+ReLU
Conv2dTranspose(512)+BatchNormalization+ReLU

Conv2dTranspose(256)+BatchNormalization+ReLU
MaxUnpoolWithArgMax
Conv2dTranspose(256)+BatchNormalization+ReLU
Conv2dTranspose(256)+BatchNormalization+ReLU

Conv2dTranspose(128)+BatchNormalization+ReLU
MaxUnpoolWithArgMax
Conv2dTranspose(128)+BatchNormalization+ReLU

Conv2dTranspose(64)+BatchNormalization+ReLU
MaxUnpoolWithArgMax
Conv2dTranspose(64)+BatchNormalization+ReLU

Conv2dTranspose(1)+Softmax

Should I normalize the whole dataset (all images) or can I rely on batch normalization layers? The network will be trained to recognize one class and the training masks will have only 2 pixel-wise values: 0 and 1. Should there be any additional processing for the mask? When processing network output, is 0.5 appropriate as a threshold value for activation (i.e. >=0.5 - this input image pixel belongs to class, otherwise not)? Perhaps someone will tell me how to make this network easier, because it only need to recognize 1 class.

Is it possible to initialize the weights of encoder layers with VGG16 ImageNet weights to speed up training? But will the difference in the input size of the images become a problem (for ImageNet it was fixed size: 224x224)? All the images in the dataset are different sizes and I have to use ragged tensors.

$\endgroup$
3
  • $\begingroup$ There are some implementations of SegNet in github: this, this, this, this $\endgroup$
    – noe
    Apr 23 at 18:00
  • $\begingroup$ I have already studied all these repositories. This does not answer the question of whether I can use pretrained VGG16 layers and whether I should preprocess training images for this. It’s also not clear to me which activation function should be used if I have 1 class. Yes, we can make 2 output channels and use classic softmax, but I think this is unnecessary if 1 output channel is enough. Am I wrong? $\endgroup$
    – D .Stark
    Apr 24 at 10:44
  • $\begingroup$ I think it is possible to use sigmoid as the output layer activation function and use binary cross-entropy as the loss function. $\endgroup$
    – D .Stark
    Apr 24 at 12:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.