# VGG 16-layer network convolutional finetuning # Network modified to have smaller receptive field (128 pixels) # and smaller stride (8 pixels) when run in convolutional mode. # # In this model we also change max pooling size in the first 4 layers # from 2 to 3 while retaining stride = 2 # which makes it easier to exactly align responses at different layers. # name: "deeplab_vgg16" layer { name: "data" type: "ImageSegData" top: "data" top: "label" top: "data_dim" image_data_param { root_folder: "/home/m62tang/rloss/data/pascal_scribble/" source: "pascal_scribble/list/val.txt" batch_size: 1 #has_label: false label_type: PIXEL } transform_param { mean_value: 104.008 mean_value: 116.669 mean_value: 122.675 crop_size: 513 mirror: false } include: { phase: TEST } } ###################### DeepLab ########################## layer { name: "conv1_1" type: "Convolution" bottom: "data" top: "conv1_1" convolution_param { num_output: 64 pad: 1 kernel_size: 3 } } layer { name: "relu1_1" type: "ReLU" bottom: "conv1_1" top: "conv1_1" } layer { name: "conv1_2" type: "Convolution" bottom: "conv1_1" top: "conv1_2" convolution_param { num_output: 64 pad: 1 kernel_size: 3 } } layer { name: "relu1_2" type: "ReLU" bottom: "conv1_2" top: "conv1_2" } layer { name: "pool1" type: "Pooling" bottom: "conv1_2" top: "pool1" pooling_param { pool: MAX kernel_size: 3 stride: 2 pad: 1 } } layer { name: "conv2_1" type: "Convolution" bottom: "pool1" top: "conv2_1" convolution_param { num_output: 128 pad: 1 kernel_size: 3 } } layer { name: "relu2_1" type: "ReLU" bottom: "conv2_1" top: "conv2_1" } layer { name: "conv2_2" type: "Convolution" bottom: "conv2_1" top: "conv2_2" convolution_param { num_output: 128 pad: 1 kernel_size: 3 } } layer { name: "relu2_2" type: "ReLU" bottom: "conv2_2" top: "conv2_2" } layer { name: "pool2" type: "Pooling" bottom: "conv2_2" top: "pool2" pooling_param { pool: MAX kernel_size: 3 stride: 2 pad: 1 } } layer { name: "conv3_1" type: "Convolution" bottom: "pool2" top: "conv3_1" convolution_param { num_output: 256 pad: 1 kernel_size: 3 } } layer { name: "relu3_1" type: "ReLU" bottom: "conv3_1" top: "conv3_1" } layer { name: "conv3_2" type: "Convolution" bottom: "conv3_1" top: "conv3_2" convolution_param { num_output: 256 pad: 1 kernel_size: 3 } } layer { name: "relu3_2" type: "ReLU" bottom: "conv3_2" top: "conv3_2" } layer { name: "conv3_3" type: "Convolution" bottom: "conv3_2" top: "conv3_3" convolution_param { num_output: 256 pad: 1 kernel_size: 3 } } layer { name: "relu3_3" type: "ReLU" bottom: "conv3_3" top: "conv3_3" } layer { name: "pool3" type: "Pooling" bottom: "conv3_3" top: "pool3" pooling_param { pool: MAX kernel_size: 3 stride: 2 pad: 1 } } layer { name: "conv4_1" type: "Convolution" bottom: "pool3" top: "conv4_1" convolution_param { num_output: 512 pad: 1 kernel_size: 3 } } layer { name: "relu4_1" type: "ReLU" bottom: "conv4_1" top: "conv4_1" } layer { name: "conv4_2" type: "Convolution" bottom: "conv4_1" top: "conv4_2" convolution_param { num_output: 512 pad: 1 kernel_size: 3 } } layer { name: "relu4_2" type: "ReLU" bottom: "conv4_2" top: "conv4_2" } layer { name: "conv4_3" type: "Convolution" bottom: "conv4_2" top: "conv4_3" convolution_param { num_output: 512 pad: 1 kernel_size: 3 } } layer { name: "relu4_3" type: "ReLU" bottom: "conv4_3" top: "conv4_3" } layer { bottom: "conv4_3" top: "pool4" name: "pool4" type: "Pooling" pooling_param { pool: MAX kernel_size: 3 pad: 1 stride: 1 } } layer { name: "conv5_1" type: "Convolution" bottom: "pool4" top: "conv5_1" convolution_param { num_output: 512 pad: 2 kernel_size: 3 dilation: 2 } } layer { name: "relu5_1" type: "ReLU" bottom: "conv5_1" top: "conv5_1" } layer { name: "conv5_2" type: "Convolution" bottom: "conv5_1" top: "conv5_2" convolution_param { num_output: 512 pad: 2 kernel_size: 3 dilation: 2 } } layer { name: "relu5_2" type: "ReLU" bottom: "conv5_2" top: "conv5_2" } layer { name: "conv5_3" type: "Convolution" bottom: "conv5_2" top: "conv5_3" convolution_param { num_output: 512 pad: 2 kernel_size: 3 dilation: 2 } } layer { name: "relu5_3" type: "ReLU" bottom: "conv5_3" top: "conv5_3" } layer { bottom: "conv5_3" top: "pool5" name: "pool5" type: "Pooling" pooling_param { pool: MAX kernel_size: 3 stride: 1 pad: 1 } } ### hole = 6 layer { name: "fc6_1" type: "Convolution" bottom: "pool5" top: "fc6_1" convolution_param { num_output: 1024 pad: 6 kernel_size: 3 dilation: 6 } } layer { name: "relu6_1" type: "ReLU" bottom: "fc6_1" top: "fc6_1" } layer { name: "drop6_1" type: "Dropout" bottom: "fc6_1" top: "fc6_1" dropout_param { dropout_ratio: 0.5 } } layer { name: "fc7_1" type: "Convolution" bottom: "fc6_1" top: "fc7_1" convolution_param { num_output: 1024 kernel_size: 1 } } layer { name: "relu7_1" type: "ReLU" bottom: "fc7_1" top: "fc7_1" } layer { name: "drop7_1" type: "Dropout" bottom: "fc7_1" top: "fc7_1" dropout_param { dropout_ratio: 0.5 } } layer { name: "fc8_pascal_scribble_1" type: "Convolution" bottom: "fc7_1" top: "fc8_pascal_scribble_1" convolution_param { num_output: 21 kernel_size: 1 } } ### hole = 12 layer { name: "fc6_2" type: "Convolution" bottom: "pool5" top: "fc6_2" convolution_param { num_output: 1024 pad: 12 kernel_size: 3 dilation: 12 } } layer { name: "relu6_2" type: "ReLU" bottom: "fc6_2" top: "fc6_2" } layer { name: "drop6_2" type: "Dropout" bottom: "fc6_2" top: "fc6_2" dropout_param { dropout_ratio: 0.5 } } layer { name: "fc7_2" type: "Convolution" bottom: "fc6_2" top: "fc7_2" convolution_param { num_output: 1024 kernel_size: 1 } } layer { name: "relu7_2" type: "ReLU" bottom: "fc7_2" top: "fc7_2" } layer { name: "drop7_2" type: "Dropout" bottom: "fc7_2" top: "fc7_2" dropout_param { dropout_ratio: 0.5 } } layer { name: "fc8_pascal_scribble_2" type: "Convolution" bottom: "fc7_2" top: "fc8_pascal_scribble_2" convolution_param { num_output: 21 kernel_size: 1 } } ### hole = 18 layer { name: "fc6_3" type: "Convolution" bottom: "pool5" top: "fc6_3" convolution_param { num_output: 1024 pad: 18 kernel_size: 3 dilation: 18 } } layer { name: "relu6_3" type: "ReLU" bottom: "fc6_3" top: "fc6_3" } layer { name: "drop6_3" type: "Dropout" bottom: "fc6_3" top: "fc6_3" dropout_param { dropout_ratio: 0.5 } } layer { name: "fc7_3" type: "Convolution" bottom: "fc6_3" top: "fc7_3" convolution_param { num_output: 1024 kernel_size: 1 } } layer { name: "relu7_3" type: "ReLU" bottom: "fc7_3" top: "fc7_3" } layer { name: "drop7_3" type: "Dropout" bottom: "fc7_3" top: "fc7_3" dropout_param { dropout_ratio: 0.5 } } layer { name: "fc8_pascal_scribble_3" type: "Convolution" bottom: "fc7_3" top: "fc8_pascal_scribble_3" convolution_param { num_output: 21 kernel_size: 1 } } ### hole = 24 layer { name: "fc6_4" type: "Convolution" bottom: "pool5" top: "fc6_4" convolution_param { num_output: 1024 pad: 24 kernel_size: 3 dilation: 24 } } layer { name: "relu6_4" type: "ReLU" bottom: "fc6_4" top: "fc6_4" } layer { name: "drop6_4" type: "Dropout" bottom: "fc6_4" top: "fc6_4" dropout_param { dropout_ratio: 0.5 } } layer { name: "fc7_4" type: "Convolution" bottom: "fc6_4" top: "fc7_4" convolution_param { num_output: 1024 kernel_size: 1 } } layer { name: "relu7_4" type: "ReLU" bottom: "fc7_4" top: "fc7_4" } layer { name: "drop7_4" type: "Dropout" bottom: "fc7_4" top: "fc7_4" dropout_param { dropout_ratio: 0.5 } } layer { name: "fc8_pascal_scribble_4" type: "Convolution" bottom: "fc7_4" top: "fc8_pascal_scribble_4" convolution_param { num_output: 21 kernel_size: 1 } } ### SUM the four branches layer { bottom: "fc8_pascal_scribble_1" bottom: "fc8_pascal_scribble_2" bottom: "fc8_pascal_scribble_3" bottom: "fc8_pascal_scribble_4" top: "fc8_pascal_scribble" name: "fc8_pascal_scribble" type: "Eltwise" eltwise_param { operation: SUM } } ## original resolution layer { name: "fc8_interp" type: "Interp" bottom: "fc8_pascal_scribble" top: "fc8_interp" interp_param { zoom_factor: 8 } } # layer { # bottom: "fc8_interp" # top: "fc8_interp_argmax" # name: "fc8_interp_argmax" # type: "ArgMax" # argmax_param { # axis: 1 # } # } #layer { # name: "fc8_mat" # type: "MatWrite" # bottom: "fc8_interp_argmax" # bottom: "fc8_interp" # include { # phase: TEST # } # mat_write_param { # prefix: "pascal_scribble/features/deeplab_vgg16/val/fc8/" # source: "pascal_scribble/list/val_id.txt" # strip: 0 # period: 1 # } #} layer { name: "accuracy" type: "SegAccuracy" bottom: "fc8_interp" bottom: "label" top: "accuracy" seg_accuracy_param { ignore_label: 255 reset: false } } ########## DENSE CRF ############ #layer { # bottom: "fc8_interp" # bottom: "data_dim" # bottom: "data" # top: "crf_inf" # name: "crf" # type: "DenseCRF" # dense_crf_param { # max_iter: 10 # pos_w: 2 # pos_xy_std: 2 # bi_w: 4 # bi_xy_std: 65 # bi_rgb_std: 3 # } #} #layer { # name: "accuracyCRF" # type: "SegAccuracy" # bottom: "crf_inf" # bottom: "label" # top: "accuracyCRF" # seg_accuracy_param { # ignore_label: 255 # reset: false # } #} #layer { # name: "crf_mat" # type: "MatWrite" # bottom: "crf_inf" # include { # phase: TEST # } # mat_write_param { # prefix: "pascal_scribble/features/deeplab_vgg16/val/crf/" # source: "pascal_scribble/list/val_id.txt" # strip: 0 # period: 1 # } #}