├── AnnoTool
├── install.m
├── readme.md
└── skeletonLabeler_v2.m
├── SRN
├── solver.prototxt
├── solve.py
├── SRNtest.py
├── deploy.prototxt
└── train_val.prototxt
├── MT-SRN
├── solver_contour_stage1.prototxt
├── solver_contour_stage2.prototxt
├── solver_contour_stage3.prototxt
├── solver_contour_stage4.prototxt
├── solver_contour_stage5.prototxt
├── solver_symmetry_stage1.prototxt
├── solver_symmetry_stage2.prototxt
├── solver_symmetry_stage3.prototxt
├── solver_symmetry_stage4.prototxt
├── solver_symmetry_stage5.prototxt
├── readme.md
├── solve.py
├── train_val_contour.prototxt
├── train_val_symmetry.prototxt
└── deploy.prototxt
├── LICENSE
└── README.md
/AnnoTool/install.m:
--------------------------------------------------------------------------------
1 | rootpath = strrep(fileparts(mfilename('fullpath')),'\','/');
2 |
3 | % add the external toolbox: edges-master, piotr_toolbox, LBPcode
4 | addpath(genpath([rootpath '/External/']));
5 |
6 | % add the VOCdevkit
7 | VOC2011Path = '\\samba.ee.oulu.fi\r-imag\personal\wke\VOC2011';
8 | addpath(genpath(VOC2007Path));
--------------------------------------------------------------------------------
/SRN/solver.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 0.00000001
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "SRN"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/AnnoTool/readme.md:
--------------------------------------------------------------------------------
1 | This annotation toolbox is used for object reflection symmetry in natural images.
2 |
3 | ### preparation
4 |
5 | Download VOC2011 dataset, and change the path in `install.m`.
6 |
7 |
8 | Download three matlab toolboxes and put them into `Extrenal`.
9 | - [Piotr's Image & Video Matlab Toolbox](https://github.com/pdollar/toolbox)
10 | - [edges](https://github.com/pdollar/edges)
11 | - [BPR](http://wei-shen.weebly.com/uploads/2/3/8/2/23825939/shenskeletonpruningbpr.zip)
12 |
13 | ### Running
14 |
15 | Step1: run `imstall.m`
16 |
17 | Step2: run `skeletonLabeler_v2.m`
18 |
--------------------------------------------------------------------------------
/MT-SRN/solver_contour_stage1.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_contour.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-6
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage1_srn_contour"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/MT-SRN/solver_contour_stage2.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_contour.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-6
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage2_srn_contour"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/MT-SRN/solver_contour_stage3.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_contour.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-8
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage3_srn_contour"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/MT-SRN/solver_contour_stage4.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_contour.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-8
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage4_srn_contour"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/MT-SRN/solver_contour_stage5.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_contour.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-8
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage5_srn_contour"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/MT-SRN/solver_symmetry_stage1.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_symmetry.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-6
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage1_srn_symmetry"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/MT-SRN/solver_symmetry_stage2.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_symmetry.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-8
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage2_srn_symmetry"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/MT-SRN/solver_symmetry_stage3.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_symmetry.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-8
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage3_srn_symmetry"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/MT-SRN/solver_symmetry_stage4.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_symmetry.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-8
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage4_srn_symmetry"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/MT-SRN/solver_symmetry_stage5.prototxt:
--------------------------------------------------------------------------------
1 | net: "train_val_symmetry.prototxt"
2 | test_iter: 0
3 | test_interval: 1000000
4 | # lr for fine-tuning should be lower than when starting from scratch
5 | #debug_info: true
6 | base_lr: 1e-8
7 | lr_policy: "step"
8 | gamma: 0.1
9 | iter_size: 10
10 | # stepsize should also be lower, as we're closer to being done
11 | stepsize: 10000
12 | display: 20
13 | max_iter: 30001
14 | momentum: 0.9
15 | weight_decay: 0.0002
16 | snapshot: 1000
17 | snapshot_prefix: "stage5_srn_symmetry"
18 | # uncomment the following to default to CPU mode solving
19 | # solver_mode: CPU
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Wei Ke
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/MT-SRN/readme.md:
--------------------------------------------------------------------------------
1 | MT-SRN is updated from SRN for joint edge and symmetry detection. The architecture is
2 | 
3 |
4 | We take alternative training on edge branch and symmetry branch. Interestingly, the performance of joint learned MT-SRN is better than the individual SRN.
5 |
6 |
7 |
8 |
9 | |
10 | Datasets |
11 | ODS (edge) |
12 | F-measure (symmetry) |
13 |
14 |
15 | | SRN |
16 | BSDS500 |
17 | 0.782 |
18 | —— |
19 |
20 |
21 | |
22 | SYMMAX |
23 | —— |
24 | 0.446 |
25 |
26 |
27 | |
28 | WH-SYMMAX |
29 | —— |
30 | 0.78 |
31 |
32 |
33 | |
34 | SK506 |
35 | —— |
36 | 0.632 |
37 |
38 |
39 | |
40 | Sym-PASCAL |
41 | —— |
42 | 0.443 |
43 |
44 |
45 | | MT-SRN |
46 | BSDS500+SYMMAX |
47 | 0.785 |
48 | 0.464 |
49 |
50 |
51 | |
52 | BSDS500+WHSYMMAX |
53 | 0.779 |
54 | 0.807 |
55 |
56 |
57 | |
58 | BSDS500+SK506 |
59 | 0.786 |
60 | 0.639 |
61 |
62 |
63 | |
64 | BSDS500+Sym-PASCAL |
65 | 0.784 |
66 | 0.453 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/SRN/solve.py:
--------------------------------------------------------------------------------
1 | from __future__ import division
2 | import numpy as np
3 | import sys
4 | caffe_root = '../../'
5 | sys.path.insert(0, caffe_root + 'python')
6 | import caffe
7 | import matplotlib.pyplot as plt
8 | import scipy.io as scio
9 |
10 | # make a bilinear interpolation kernel
11 | # credit @longjon
12 | def upsample_filt(size):
13 | factor = (size + 1) // 2
14 | if size % 2 == 1:
15 | center = factor - 1
16 | else:
17 | center = factor - 0.5
18 | og = np.ogrid[:size, :size]
19 | return (1 - abs(og[0] - center) / factor) * \
20 | (1 - abs(og[1] - center) / factor)
21 |
22 | # set parameters s.t. deconvolutional layers compute bilinear interpolation
23 | # N.B. this is for deconvolution without groups
24 | def interp_surgery(net, layers):
25 | for l in layers:
26 | m, k, h, w = net.params[l][0].data.shape
27 | if m != k:
28 | print 'input + output channels need to be the same'
29 | raise
30 | if h != w:
31 | print 'filters need to be square'
32 | raise
33 | filt = upsample_filt(h)
34 | net.params[l][0].data[range(m), range(k), :, :] = filt
35 |
36 | # base net -- follow the editing model parameters example to make
37 | # a fully convolutional VGG16 net.
38 | # http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/net_surgery.ipynb
39 | # base_weights = '5stage-vgg.caffemodel'
40 | base_weights = '5stage-vgg.caffemodel'
41 |
42 | # init
43 | caffe.set_mode_gpu()
44 | caffe.set_device(3)
45 |
46 | solver = caffe.SGDSolver('solver.prototxt')
47 |
48 | # do net surgery to set the deconvolution weights for bilinear interpolation
49 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
50 | interp_surgery(solver.net, interp_layers)
51 |
52 | # copy base weights for fine-tuning
53 | #solver.restore('dsn-full-res-3-scales_iter_29000.solverstate')
54 | solver.net.copy_from(base_weights)
55 |
56 | # solve straight through -- a better approach is to define a solving loop to
57 | # 1. take SGD steps
58 | # 2. score the model by the test net `solver.test_nets[0]`
59 | # 3. repeat until satisfied
60 |
61 |
62 | solver.step(20000) # SGD by Caffe
63 |
64 |
65 |
--------------------------------------------------------------------------------
/SRN/SRNtest.py:
--------------------------------------------------------------------------------
1 |
2 | '''
3 | Created on Jan 27, 2016
4 | for one model
5 | @author: wke
6 | '''
7 |
8 | import numpy as np
9 | import matplotlib.pyplot as plt
10 | import matplotlib.pylab as pylab
11 | import matplotlib.cm as cm
12 | import scipy.misc
13 | from PIL import Image
14 | import scipy.io as scio
15 | import os
16 | from pylab import * # for showing
17 | from termios import VMIN
18 | import datetime
19 |
20 | caffe_root = '../../'
21 | import sys
22 | sys.path.insert(0, caffe_root + 'python')
23 | import caffe
24 |
25 |
26 | data_root = '../../data/datasets_original/SymPASCAL/'
27 | with open(data_root+'test.lst') as f:
28 | test_lst = f.readlines()
29 | test_lst = [data_root+'/images/test/'+x.strip()+'.jpg' for x in test_lst]
30 |
31 | im_lst = []
32 | for i in range(0, len(test_lst)):
33 | im = Image.open(test_lst[i])
34 | in_ = np.array(im, dtype=np.float32)
35 | in_ = in_[:,:,::-1]
36 | in_ -= np.array((104.00698793,116.66876762,122.67891434))
37 | im_lst.append(in_)
38 |
39 | #Visualization
40 | def plot_single_scale(scale_lst, size):
41 | pylab.rcParams['figure.figsize'] = size, size/2
42 |
43 | plt.figure()
44 | for i in range(0, len(scale_lst)):
45 | s=plt.subplot(1,5,i+1)
46 | plt.imshow(1-scale_lst[i], cmap = cm.Greys_r)
47 | #plt.imshow(1-scale_lst[i])
48 | s.set_xticklabels([])
49 | s.set_yticklabels([])
50 | s.yaxis.set_ticks_position('none')
51 | s.xaxis.set_ticks_position('none')
52 | plt.tight_layout()
53 |
54 |
55 | idx = 18
56 |
57 | in_ = im_lst[idx]
58 | in_ = in_.transpose((2,0,1))
59 | #remove the following two lines if testing with cpu
60 | caffe.set_mode_gpu()
61 | caffe.set_device(0)
62 |
63 | # load net
64 | model_root = './'
65 | net = caffe.Net(model_root+'deploy.prototxt', model_root+'san_iter_18000.caffemodel', caffe.TEST)
66 |
67 | net.blobs['data'].reshape(1, *in_.shape)
68 | net.blobs['data'].data[...] = in_
69 | net.forward()
70 | #out1 = net.blobs['sigmoid-dsn1'].data[0][0,:,:]
71 | out2 = net.blobs['sigmoid-dsn2'].data[0][0,:,:]
72 | out3 = net.blobs['sigmoid-dsn3'].data[0][0,:,:]
73 | out4 = net.blobs['sigmoid-dsn4'].data[0][0,:,:]
74 | out5 = net.blobs['sigmoid-dsn5'].data[0][0,:,:]
75 | fuse = net.blobs['sigmoid-fuse'].data[0][0,:,:]
76 |
77 |
78 | scale_lst = [fuse]
79 | plot_single_scale(scale_lst, 22)
80 | scale_lst = [out2, out3, out4, out5]
81 | plot_single_scale(scale_lst, 10)
82 | show()
83 |
84 |
85 | starttime = datetime.datetime.now()
86 | for iidx in range(0, len(test_lst)):
87 | print(iidx)
88 | in_ = im_lst[iidx]
89 | in_ = in_.transpose((2,0,1))
90 | net.blobs['data'].reshape(1, *in_.shape)
91 | net.blobs['data'].data[...] = in_
92 | net.forward()
93 | fuse = net.blobs['sigmoid-fuse'].data[0][0,:,:]
94 |
95 | endtime = datetime.datetime.now()
96 | interval=(endtime - starttime).seconds
97 | print interval
98 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This code is for the CVPR17 paper "Side-output Residual Network for Object Symmetry Detection in the Wild" [pdf](https://openaccess.thecvf.com/content_cvpr_2017/papers/Ke_SRN_Side-output_Residual_CVPR_2017_paper.pdf) and TNNLS paper "SRN: Side-Output Residual Network for Object Reflection Symmetry Detection and Beyond" [pdf](https://ieeexplore.ieee.org/document/9103933).
2 |
3 | # Introduction
4 |
5 | SRN is build on Holistically-Nested Edge Detection (HED) [1] with Residual Unit (RU). RU is used to compute the residual between output image and side-output of SRN. The comparision of the symmetry results of HED and SRN are shown below. The first row is from our SRN and the second row is from HED. From left to right, it illustrates the final output, the side-output1 to side-output5, respectively.
6 |
7 |
8 |
9 | From the results, it's easily to understande that the output residual decreases orderly from the deepest side-ouput to the final output (ringht-to-left).
10 |
11 | # Getting started
12 |
13 | ## Installing
14 | 1. Install prerequisites for Caffe (http://caffe.berkeleyvision.org/installation.html#prequequisites).
15 | 1. Build HED (https://github.com/s9xie/hed). Supposing the root directory of HED is `$HED`.
16 | 1. Copy the folder `SRN` to `$HED/example/`.
17 |
18 | ## Data preparation
19 | 1. Download benchmark **Sym-PASCAL** trainning and testing set [*(OneDrive)*](https://1drv.ms/u/s!AtLMd2E51FVrhRydfW0V-u-bLOgv) or [*(BaiduYun)*](http://pan.baidu.com/s/1slO0v73). Our dataset Sym-PASCAL derived from PASCAL 2011 segmentation dataset [1]. The annotation and statistics are detailed in the Section 3 in our paper.
20 |
21 | ## Training
22 | 1. Download the Pre-trained VGG [3] model [*(VGG19)*](https://gist.github.com/ksimonyan/3785162f95cd2d5fee77#file-readme-md). Copy it to `$HED/example/SRN/`
23 | 1. Change the dataset path in '$HED/example/SRN/train_val.prototxt'
24 | 1. Run `solve.py` in shell (or you could use IDE like Eclipse)
25 | ```
26 | cd $HED/example/SRN/
27 | python solver.py
28 | ```
29 |
30 | ## Testing
31 | 1. Change the dataset path in `$HED/example/SRNtest.py`.
32 | 1. run `SRNtest.py`.
33 |
34 | ## Evaluation
35 |
36 | We use the evaluation code of [3] to draw the PR curve. The code can be download [spb-mil](https://github.com/tsogkas/spb-mil).
37 |
38 | **NOTE:** Before evaluation, the NMS is utilized. We use the NMS code in Piotr's [edges-master](https://github.com/pdollar/edges).
39 |
40 |
41 | # Model zoo
42 |
43 | ## model
44 | SRN model on Sym-PASCAL
45 | Pre-trained SRN model on Sym-PASCAL: [*(OneDrive)*](https://1drv.ms/u/s!AtLMd2E51FVrhR25fGZTs4NbgRXj) or [*(BaiduYun)*](http://pan.baidu.com/s/1c1Rs1xu)
46 |
47 | ## results
48 | ### The PR curve data for symmetry detection
49 | Sym-PASCAL: [*(OneDrive)*](https://1drv.ms/f/s!AtLMd2E51FVrhSKfoRdUk7lSPqF7) or [*(BaiduYun)*](http://pan.baidu.com/s/1gf5GYS7)
50 |
51 | SYMMAX: [*(OneDrive)*](https://1drv.ms/f/s!AtLMd2E51FVrhR8DjbOJtK7YV_tE) or [*(BaiduYun)*](http://pan.baidu.com/s/1i4Rbys9)
52 |
53 | WH-SYMMAX: [*(OneDrive)*](https://1drv.ms/f/s!AtLMd2E51FVrhR8DjbOJtK7YV_tE) or [*(BaiduYun)*](http://pan.baidu.com/s/1o7UUUk6) mostly taken from http://wei-shen.weebly.com/publications.html
54 |
55 | SK506: [*(OneDrive)*](https://1drv.ms/f/s!AtLMd2E51FVrhR8DjbOJtK7YV_tE) or [*(BaiduYun)*](http://pan.baidu.com/s/1nuMP0hz) mostly taken from http://wei-shen.weebly.com/publications.html
56 |
57 | ### The PR curve data for edge detection
58 | BSDS500: [*(OneDrive)*](https://1drv.ms/f/s!AtLMd2E51FVrhiMs1PJcfHb48dbZ)
59 |
60 |
61 | # Repository Contributor
62 | Wei Ke ([@KevinKecc](https://github.com/KevinKecc))
63 | wei.ke@xjtu.edu.cn
64 |
65 | # Citation
66 | @inproceedings{conf/cvpr/KeCJZY17,
67 | author = {Wei Ke and Jie Chen and Jianbin Jiao and Guoying Zhao and Qixiang Ye},
68 | title = {{SRN:} Side-Output Residual Network for Object Symmetry Detection in the Wild},
69 | booktitle = {{IEEE} Conference on Computer Vision and Pattern Recognition},
70 | pages = {302--310},
71 | year = {2017}
72 | }
73 | @article{journals/tnn/KeCJZY21,
74 | author = {Wei Ke and Jie Chen and Jianbin Jiao and Guoying Zhao and Qixiang Ye},
75 | title = {{SRN:} Side-Output Residual Network for Object Reflection Symmetry Detection and Beyond},
76 | journal = {{IEEE} Trans. Neural Networks Learn. Syst.},
77 | volume = {32},
78 | number = {5},
79 | pages = {1881--1895},
80 | year = {2021}
81 | }
82 |
83 |
84 | **Ref**
85 |
86 | [1] S. Xie and Z. Tu. Holistically-nested edge detection. In International Conference on Computer Vision, 2015
87 |
88 | [2] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2011 (VOC2011) Results. http://www.pascal-network.org/challenges/VOC/voc2011/workshop/index.html.
89 |
90 | [3] S. Tsogkas and I. Kokkinos. Learning-based symmetry detection in natural images. In European Conference on Computer Vision
91 |
--------------------------------------------------------------------------------
/MT-SRN/solve.py:
--------------------------------------------------------------------------------
1 | from __future__ import division
2 | import numpy as np
3 | import sys
4 | caffe_root = '../../'
5 | sys.path.insert(0, caffe_root + 'python')
6 | import caffe
7 |
8 | # make a bilinear interpolation kernel
9 | # credit @longjon
10 | def upsample_filt(size):
11 | factor = (size + 1) // 2
12 | if size % 2 == 1:
13 | center = factor - 1
14 | else:
15 | center = factor - 0.5
16 | og = np.ogrid[:size, :size]
17 | return (1 - abs(og[0] - center) / factor) * \
18 | (1 - abs(og[1] - center) / factor)
19 |
20 | # set parameters s.t. deconvolutional layers compute bilinear interpolation
21 | # N.B. this is for deconvolution without groups
22 | def interp_surgery(net, layers):
23 | for l in layers:
24 | m, k, h, w = net.params[l][0].data.shape
25 | if m != k:
26 | print 'input + output channels need to be the same'
27 | raise
28 | if h != w:
29 | print 'filters need to be square'
30 | raise
31 | filt = upsample_filt(h)
32 | net.params[l][0].data[range(m), range(k), :, :] = filt
33 |
34 | # base net -- follow the editing model parameters example to make
35 | # a fully convolutional VGG16 net.
36 | # http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/net_surgery.ipynb
37 |
38 |
39 | # init
40 | caffe.set_mode_gpu()
41 | caffe.set_device(0)
42 |
43 | ## stage 1 for contour
44 | solver = caffe.SGDSolver('solver_contour_stage1.prototxt')
45 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
46 | interp_surgery(solver.net, interp_layers)
47 | base_weights = '5stage-vgg.caffemodel'
48 | solver.net.copy_from(base_weights)
49 | solver.step(8000)
50 |
51 | ## stage 2 for symmetry
52 | solver = caffe.SGDSolver('solver_symmetry_stage1.prototxt')
53 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
54 | interp_surgery(solver.net, interp_layers)
55 | base_weights = 'stage1_srn_contour_iter_8000.caffemodel'
56 | solver.net.copy_from(base_weights)
57 | solver.step(8000)
58 |
59 | ## stage 3 for contour
60 | solver = caffe.SGDSolver('solver_contour_stage2.prototxt')
61 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
62 | interp_surgery(solver.net, interp_layers)
63 | base_weights = 'stage1_srn_contour_iter_8000.caffemodel'
64 | base_weights1 = 'stage1_srn_symmetry_iter_8000.caffemodel'
65 | solver.net.copy_from(base_weights)
66 | solver.net.copy_from(base_weights1)
67 | solver.step(6000)
68 |
69 | ## stage 4 for contour
70 | solver = caffe.SGDSolver('solver_symmetry_stage2.prototxt')
71 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
72 | interp_surgery(solver.net, interp_layers)
73 | base_weights = 'stage1_srn_symmetry_iter_8000.caffemodel'
74 | base_weights1 = 'stage2_srn_contour_iter_6000.caffemodel'
75 | solver.net.copy_from(base_weights)
76 | solver.net.copy_from(base_weights1)
77 | solver.step(6000)
78 |
79 | ## stage 5 for contour
80 | solver = caffe.SGDSolver('solver_contour_stage3.prototxt')
81 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
82 | interp_surgery(solver.net, interp_layers)
83 | base_weights = 'stage2_srn_contour_iter_6000.caffemodel'
84 | base_weights1 = 'stage2_srn_symmetry_iter_6000.caffemodel'
85 | solver.net.copy_from(base_weights)
86 | solver.net.copy_from(base_weights1)
87 | solver.step(4000)
88 |
89 | ## stage 6 for contour
90 | solver = caffe.SGDSolver('solver_symmetry_stage3.prototxt')
91 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
92 | interp_surgery(solver.net, interp_layers)
93 | base_weights = 'stage2_srn_symmetry_iter_6000.caffemodel'
94 | base_weights1 = 'stage3_srn_contour_iter_4000.caffemodel'
95 | solver.net.copy_from(base_weights)
96 | solver.net.copy_from(base_weights1)
97 | solver.step(4000)
98 |
99 | ## stage 7 for contour
100 | solver = caffe.SGDSolver('solver_contour_stage4.prototxt')
101 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
102 | interp_surgery(solver.net, interp_layers)
103 | base_weights = 'stage3_srn_contour_iter_4000.caffemodel'
104 | base_weights1 = 'stage3_srn_symmetry_iter_4000.caffemodel'
105 | solver.net.copy_from(base_weights)
106 | solver.net.copy_from(base_weights1)
107 | solver.step(2000)
108 |
109 | ## stage 8 for contour
110 | solver = caffe.SGDSolver('solver_symmetry_stage4.prototxt')
111 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
112 | interp_surgery(solver.net, interp_layers)
113 | base_weights = 'stage3_srn_symmetry_iter_4000.caffemodel'
114 | base_weights1 = 'stage4_srn_contour_iter_2000.caffemodel'
115 | solver.net.copy_from(base_weights)
116 | solver.net.copy_from(base_weights1)
117 | solver.step(2000)
118 |
119 | ## stage 9 for contour
120 | solver = caffe.SGDSolver('solver_contour_stage5.prototxt')
121 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
122 | interp_surgery(solver.net, interp_layers)
123 | base_weights = 'stage4_srn_contour_iter_2000.caffemodel'
124 | base_weights1 = 'stage4_srn_symmetry_iter_2000.caffemodel'
125 | solver.net.copy_from(base_weights)
126 | solver.net.copy_from(base_weights1)
127 | solver.step(1000)
128 |
129 | ## stage 10 for contour
130 | solver = caffe.SGDSolver('solver_symmetry_stage5.prototxt')
131 | interp_layers = [k for k in solver.net.params.keys() if 'up' in k]
132 | interp_surgery(solver.net, interp_layers)
133 | base_weights = 'stage4_srn_symmetry_iter_2000.caffemodel'
134 | base_weights1 = 'stage5_srn_contour_iter_1000.caffemodel'
135 | solver.net.copy_from(base_weights)
136 | solver.net.copy_from(base_weights1)
137 | solver.step(1000)
--------------------------------------------------------------------------------
/SRN/deploy.prototxt:
--------------------------------------------------------------------------------
1 | name: "HED"
2 |
3 | input: "data"
4 | input_dim: 1
5 | input_dim: 3
6 | input_dim: 500
7 | input_dim: 500
8 |
9 |
10 | layer { bottom: 'data' top: 'conv1_1' name: 'conv1_1' type: "Convolution"
11 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
12 | convolution_param { engine: CAFFE num_output: 64 pad: 35 kernel_size: 3 } }
13 | layer { bottom: 'conv1_1' top: 'conv1_1' name: 'relu1_1' type: "ReLU" }
14 | layer { bottom: 'conv1_1' top: 'conv1_2' name: 'conv1_2' type: "Convolution"
15 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
16 | convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 } }
17 | layer { bottom: 'conv1_2' top: 'conv1_2' name: 'relu1_2' type: "ReLU" }
18 | layer { name: 'pool1' bottom: 'conv1_2' top: 'pool1' type: "Pooling"
19 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
20 |
21 | layer { name: 'conv2_1' bottom: 'pool1' top: 'conv2_1' type: "Convolution"
22 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
23 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
24 | layer { bottom: 'conv2_1' top: 'conv2_1' name: 'relu2_1' type: "ReLU" }
25 | layer { bottom: 'conv2_1' top: 'conv2_2' name: 'conv2_2' type: "Convolution"
26 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
27 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
28 | layer { bottom: 'conv2_2' top: 'conv2_2' name: 'relu2_2' type: "ReLU" }
29 | layer { bottom: 'conv2_2' top: 'pool2' name: 'pool2' type: "Pooling"
30 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
31 |
32 | layer { bottom: 'pool2' top: 'conv3_1' name: 'conv3_1' type: "Convolution"
33 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
34 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
35 | layer { bottom: 'conv3_1' top: 'conv3_1' name: 'relu3_1' type: "ReLU" }
36 | layer { bottom: 'conv3_1' top: 'conv3_2' name: 'conv3_2' type: "Convolution"
37 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
38 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
39 | layer { bottom: 'conv3_2' top: 'conv3_2' name: 'relu3_2' type: "ReLU" }
40 | layer { bottom: 'conv3_2' top: 'conv3_3' name: 'conv3_3' type: "Convolution"
41 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
42 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
43 | layer { bottom: 'conv3_3' top: 'conv3_3' name: 'relu3_3' type: "ReLU" }
44 | layer { bottom: 'conv3_3' top: 'pool3' name: 'pool3' type: "Pooling"
45 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
46 |
47 | layer { bottom: 'pool3' top: 'conv4_1' name: 'conv4_1' type: "Convolution"
48 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
49 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
50 | layer { bottom: 'conv4_1' top: 'conv4_1' name: 'relu4_1' type: "ReLU" }
51 | layer { bottom: 'conv4_1' top: 'conv4_2' name: 'conv4_2' type: "Convolution"
52 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
53 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
54 | layer { bottom: 'conv4_2' top: 'conv4_2' name: 'relu4_2' type: "ReLU" }
55 | layer { bottom: 'conv4_2' top: 'conv4_3' name: 'conv4_3' type: "Convolution"
56 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
57 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
58 | layer { bottom: 'conv4_3' top: 'conv4_3' name: 'relu4_3' type: "ReLU" }
59 | layer { bottom: 'conv4_3' top: 'pool4' name: 'pool4' type: "Pooling"
60 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
61 |
62 | layer { bottom: 'pool4' top: 'conv5_1' name: 'conv5_1' type: "Convolution"
63 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
64 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
65 | layer { bottom: 'conv5_1' top: 'conv5_1' name: 'relu5_1' type: "ReLU" }
66 | layer { bottom: 'conv5_1' top: 'conv5_2' name: 'conv5_2' type: "Convolution"
67 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
68 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
69 | layer { bottom: 'conv5_2' top: 'conv5_2' name: 'relu5_2' type: "ReLU" }
70 | layer { bottom: 'conv5_2' top: 'conv5_3' name: 'conv5_3' type: "Convolution"
71 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
72 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
73 | layer { bottom: 'conv5_3' top: 'conv5_3' name: 'relu5_3' type: "ReLU" }
74 |
75 | #-----
76 | #----
77 | layer { name: 'score-dsn2' type: "Convolution" bottom: 'conv2_2' top: 'score-dsn2'
78 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
79 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
80 | #---
81 | layer { name: 'score-dsn3' type: "Convolution" bottom: 'conv3_3' top: 'score-dsn3'
82 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
83 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
84 | #--
85 | layer { name: 'score-dsn4' type: "Convolution" bottom: 'conv4_3' top: 'score-dsn4'
86 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
87 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
88 | #-
89 | layer { name: 'score-dsn-5' type: "Convolution" bottom: 'conv5_3' top: 'score-dsn5'
90 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
91 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1} }
92 |
93 | layer{
94 | type: "Slice" name: "slice5"
95 | bottom: "score-dsn5"
96 | top: "score-dsn5-slice1"
97 | top: "score-dsn5-slice2"
98 | slice_param {
99 | axis: 1
100 | slice_point: 1
101 | }
102 | }
103 |
104 | # side output5
105 | layer { type: "Deconvolution" name: 'upsample_16' bottom: 'score-dsn5-slice2' top: 'concat5-score-up-loss'
106 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
107 | convolution_param { kernel_size: 32 stride: 16 num_output: 1 } }
108 | layer { type: "Crop" name: 'crop5-loss' bottom: 'concat5-score-up-loss' bottom: 'data' top: 'concat5-score-loss' }
109 | layer { type: "Sigmoid" name: "sigmoid-dsn5" bottom: "concat5-score-loss" top:"sigmoid-dsn5"}
110 |
111 | #-
112 | # 2x
113 | layer { type: "Deconvolution" name: 'upsample_5_4' bottom: 'score-dsn5-slice1' top: 'score-dsn5-up'
114 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
115 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
116 | layer { type: "Crop" name: 'crop5' bottom: 'score-dsn5-up' bottom: 'score-dsn4' top: 'upscore-dsn5' }
117 |
118 | layer { name: "concat_5_4" bottom: "upscore-dsn5" bottom: "score-dsn4" top: "concat-upscore4" type: "Concat"
119 | concat_param { concat_dim: 1} }
120 | layer {
121 | name: 'cat4-score' type: "Convolution"
122 | bottom: 'concat-upscore4' top: 'concat4-score'
123 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
124 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 }
125 | }
126 |
127 | layer{
128 | type: "Slice" name: "slice4"
129 | bottom: "concat4-score"
130 | top: "concat4-score-slice1"
131 | top: "concat4-score-slice2"
132 | slice_param {
133 | axis: 1
134 | slice_point: 1
135 | }
136 | }
137 |
138 | # side output4
139 | layer { type: "Deconvolution" name: 'upsample_8' bottom: 'concat4-score-slice2' top: 'concat4-score-up-loss'
140 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
141 | convolution_param { kernel_size: 16 stride: 8 num_output: 1 } }
142 | layer { type: "Crop" name: 'crop4-loss' bottom: 'concat4-score-up-loss' bottom: 'data' top: 'concat4-score-loss' }
143 | layer { type: "Sigmoid" name: "sigmoid-dsn4" bottom: "concat4-score-loss" top:"sigmoid-dsn4"}
144 |
145 | #--
146 | # 2x
147 | layer { type: "Deconvolution" name: 'upsample_4_3' bottom: 'concat4-score-slice1' top: 'score-dsn4-up'
148 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
149 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
150 | layer { type: "Crop" name: 'crop4' bottom: 'score-dsn4-up' bottom: 'score-dsn3' top: 'upscore-dsn4' }
151 | layer { name: "concat_4_3" bottom: "upscore-dsn4" bottom: "score-dsn3" top: "concat-upscore3" type: "Concat"
152 | concat_param { concat_dim: 1} }
153 | layer {
154 | name: 'cat3-score' type: "Convolution"
155 | bottom: 'concat-upscore3' top: 'concat3-score'
156 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
157 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 }
158 | }
159 |
160 | layer{
161 | type: "Slice" name: "slice3"
162 | bottom: "concat3-score"
163 | top: "concat3-score-slice1"
164 | top: "concat3-score-slice2"
165 | slice_param {
166 | axis: 1
167 | slice_point: 1
168 | }
169 | }
170 |
171 | # side output3
172 | layer { type: "Deconvolution" name: 'upsample_4' bottom: 'concat3-score-slice2' top: 'concat3-score-up-loss'
173 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
174 | convolution_param { kernel_size: 8 stride: 4 num_output: 1 } }
175 | layer { type: "Crop" name: 'crop3-loss' bottom: 'concat3-score-up-loss' bottom: 'data' top: 'concat3-score-loss' }
176 | layer { type: "Sigmoid" name: "sigmoid-dsn3" bottom: "concat3-score-loss" top:"sigmoid-dsn3"}
177 |
178 | #---
179 | # 2x
180 | layer { type: "Deconvolution" name: 'upsample_3_2' bottom: 'concat3-score-slice1' top: 'score-dsn3-up'
181 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
182 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
183 | layer { type: "Crop" name: 'crop3' bottom: 'score-dsn3-up' bottom: 'score-dsn2' top: 'upscore-dsn3' }
184 | layer { name: "concat_3_2" bottom: "upscore-dsn3" bottom: "score-dsn2" top: "concat-upscore2" type: "Concat"
185 | concat_param { concat_dim: 1} }
186 | layer {
187 | name: 'cat2-score' type: "Convolution"
188 | bottom: 'concat-upscore2' top: 'concat2-score'
189 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
190 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 }
191 | }
192 |
193 |
194 | # side output2
195 | layer { type: "Deconvolution" name: 'upsample_2' bottom: 'concat2-score' top: 'concat2-score-up-loss'
196 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
197 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
198 | layer { type: "Crop" name: 'crop2-loss' bottom: 'concat2-score-up-loss' bottom: 'data' top: 'concat2-score-loss' }
199 | layer { type: "Sigmoid" name: "sigmoid-dsn2" bottom: "concat2-score-loss" top:"sigmoid-dsn2"}
200 |
201 | #----
202 |
203 | #-----
204 |
205 |
206 | #-----------------------------------------------------------
207 | ### Concat and multiscale weight layer ###
208 | layer { name: "concat" bottom: "concat2-score-loss" bottom: "concat3-score-loss"
209 | bottom: "concat4-score-loss" bottom: "concat5-score-loss" top: "concat-upscore" type: "Concat"
210 | concat_param { concat_dim: 1} }
211 | layer { name: 'new-score-weighting' type: "Convolution" bottom: 'concat-upscore' top: 'upscore-fuse'
212 | param { lr_mult: 0.001 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
213 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
214 | layer { type: "Sigmoid" name: "sigmoid-fuse" bottom: "upscore-fuse" top:"sigmoid-fuse"}
215 |
216 |
--------------------------------------------------------------------------------
/SRN/train_val.prototxt:
--------------------------------------------------------------------------------
1 | name: "HED"
2 | layer {
3 | name: "data"
4 | type: "ImageLabelmapData"
5 | top: "data"
6 | top: "label"
7 | include {
8 | phase: TRAIN
9 | }
10 | transform_param {
11 | mirror: false
12 | mean_value: 104.00699
13 | mean_value: 116.66877
14 | mean_value: 122.67892
15 | }
16 | image_data_param {
17 | root_folder: "../../data/SymPASCAL/"
18 | source: "../../data/SymPASCAL/train_pair.lst"
19 | batch_size: 1
20 | shuffle: true
21 | new_height: 0
22 | new_width: 0
23 | }
24 | }
25 | layer {
26 | name: "data"
27 | type: "ImageLabelmapData"
28 | top: "data"
29 | top: "label"
30 | include {
31 | phase: TEST
32 | }
33 | transform_param {
34 | mirror: false
35 | mean_value: 104.00699
36 | mean_value: 116.66877
37 | mean_value: 122.67892
38 | }
39 | image_data_param {
40 | root_folder: "../../data/SymPASCAL/"
41 | source: "../../data/SymPASCAL/train_pair.lst"
42 | #Just setup the network. No real online testing
43 | batch_size: 1
44 | shuffle: true
45 | new_height: 0
46 | new_width: 0
47 | }
48 | }
49 |
50 | layer { bottom: 'data' top: 'conv1_1' name: 'conv1_1' type: "Convolution"
51 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
52 | convolution_param { engine: CAFFE num_output: 64 pad: 35 kernel_size: 3 } }
53 | layer { bottom: 'conv1_1' top: 'conv1_1' name: 'relu1_1' type: "ReLU" }
54 | layer { bottom: 'conv1_1' top: 'conv1_2' name: 'conv1_2' type: "Convolution"
55 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
56 | convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 } }
57 | layer { bottom: 'conv1_2' top: 'conv1_2' name: 'relu1_2' type: "ReLU" }
58 | layer { name: 'pool1' bottom: 'conv1_2' top: 'pool1' type: "Pooling"
59 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
60 |
61 | layer { name: 'conv2_1' bottom: 'pool1' top: 'conv2_1' type: "Convolution"
62 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
63 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
64 | layer { bottom: 'conv2_1' top: 'conv2_1' name: 'relu2_1' type: "ReLU" }
65 | layer { bottom: 'conv2_1' top: 'conv2_2' name: 'conv2_2' type: "Convolution"
66 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
67 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
68 | layer { bottom: 'conv2_2' top: 'conv2_2' name: 'relu2_2' type: "ReLU" }
69 | layer { bottom: 'conv2_2' top: 'pool2' name: 'pool2' type: "Pooling"
70 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
71 |
72 | layer { bottom: 'pool2' top: 'conv3_1' name: 'conv3_1' type: "Convolution"
73 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
74 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
75 | layer { bottom: 'conv3_1' top: 'conv3_1' name: 'relu3_1' type: "ReLU" }
76 | layer { bottom: 'conv3_1' top: 'conv3_2' name: 'conv3_2' type: "Convolution"
77 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
78 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
79 | layer { bottom: 'conv3_2' top: 'conv3_2' name: 'relu3_2' type: "ReLU" }
80 | layer { bottom: 'conv3_2' top: 'conv3_3' name: 'conv3_3' type: "Convolution"
81 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
82 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
83 | layer { bottom: 'conv3_3' top: 'conv3_3' name: 'relu3_3' type: "ReLU" }
84 | layer { bottom: 'conv3_3' top: 'pool3' name: 'pool3' type: "Pooling"
85 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
86 |
87 | layer { bottom: 'pool3' top: 'conv4_1' name: 'conv4_1' type: "Convolution"
88 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
89 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
90 | layer { bottom: 'conv4_1' top: 'conv4_1' name: 'relu4_1' type: "ReLU" }
91 | layer { bottom: 'conv4_1' top: 'conv4_2' name: 'conv4_2' type: "Convolution"
92 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
93 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
94 | layer { bottom: 'conv4_2' top: 'conv4_2' name: 'relu4_2' type: "ReLU" }
95 | layer { bottom: 'conv4_2' top: 'conv4_3' name: 'conv4_3' type: "Convolution"
96 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
97 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
98 | layer { bottom: 'conv4_3' top: 'conv4_3' name: 'relu4_3' type: "ReLU" }
99 | layer { bottom: 'conv4_3' top: 'pool4' name: 'pool4' type: "Pooling"
100 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
101 |
102 | layer { bottom: 'pool4' top: 'conv5_1' name: 'conv5_1' type: "Convolution"
103 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
104 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
105 | layer { bottom: 'conv5_1' top: 'conv5_1' name: 'relu5_1' type: "ReLU" }
106 | layer { bottom: 'conv5_1' top: 'conv5_2' name: 'conv5_2' type: "Convolution"
107 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
108 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
109 | layer { bottom: 'conv5_2' top: 'conv5_2' name: 'relu5_2' type: "ReLU" }
110 | layer { bottom: 'conv5_2' top: 'conv5_3' name: 'conv5_3' type: "Convolution"
111 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
112 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
113 | layer { bottom: 'conv5_3' top: 'conv5_3' name: 'relu5_3' type: "ReLU" }
114 |
115 | #-----
116 |
117 | #----
118 | layer { name: 'score-dsn2' type: "Convolution" bottom: 'conv2_2' top: 'score-dsn2'
119 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
120 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
121 | #---
122 | layer { name: 'score-dsn3' type: "Convolution" bottom: 'conv3_3' top: 'score-dsn3'
123 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
124 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
125 | #--
126 | layer { name: 'score-dsn4' type: "Convolution" bottom: 'conv4_3' top: 'score-dsn4'
127 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
128 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
129 | #-
130 | layer { name: 'score-dsn-5' type: "Convolution" bottom: 'conv5_3' top: 'score-dsn5'
131 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
132 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1} }
133 |
134 | layer{
135 | type: "Slice" name: "slice5"
136 | bottom: "score-dsn5"
137 | top: "score-dsn5-slice1"
138 | top: "score-dsn5-slice2"
139 | slice_param {
140 | axis: 1
141 | slice_point: 1
142 | }
143 | }
144 |
145 | # the loss of side output5
146 | layer { type: "Deconvolution" name: 'upsample_16' bottom: 'score-dsn5-slice2' top: 'concat5-score-up-loss'
147 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
148 | convolution_param { kernel_size: 32 stride: 16 num_output: 1 } }
149 | layer { type: "Crop" name: 'crop5-loss' bottom: 'concat5-score-up-loss' bottom: 'data' top: 'concat5-score-loss' }
150 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn5_loss' bottom: 'concat5-score-loss' bottom: 'label' top:'dsn5_loss' loss_weight: 1}
151 |
152 | #-
153 | # 2x
154 | layer { type: "Deconvolution" name: 'upsample_5_4' bottom: 'score-dsn5-slice1' top: 'score-dsn5-up'
155 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
156 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
157 | layer { type: "Crop" name: 'crop5' bottom: 'score-dsn5-up' bottom: 'score-dsn4' top: 'upscore-dsn5' }
158 |
159 | layer { name: "concat_5_4" bottom: "upscore-dsn5" bottom: "score-dsn4" top: "concat-upscore4" type: "Concat"
160 | concat_param { concat_dim: 1} }
161 | layer {
162 | name: 'cat4-score' type: "Convolution"
163 | bottom: 'concat-upscore4' top: 'concat4-score'
164 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
165 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
166 | }
167 |
168 | layer{
169 | type: "Slice" name: "slice4"
170 | bottom: "concat4-score"
171 | top: "concat4-score-slice1"
172 | top: "concat4-score-slice2"
173 | slice_param {
174 | axis: 1
175 | slice_point: 1
176 | }
177 | }
178 |
179 | # the loss of side output4
180 | layer { type: "Deconvolution" name: 'upsample_8' bottom: 'concat4-score-slice2' top: 'concat4-score-up-loss'
181 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
182 | convolution_param { kernel_size: 16 stride: 8 num_output: 1 } }
183 | layer { type: "Crop" name: 'crop4-loss' bottom: 'concat4-score-up-loss' bottom: 'data' top: 'concat4-score-loss' }
184 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn4_loss' bottom: 'concat4-score-loss' bottom: 'label' top:'dsn4_loss' loss_weight: 1}
185 |
186 | #--
187 | # 2x
188 | layer { type: "Deconvolution" name: 'upsample_4_3' bottom: 'concat4-score-slice1' top: 'score-dsn4-up'
189 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
190 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
191 | layer { type: "Crop" name: 'crop4' bottom: 'score-dsn4-up' bottom: 'score-dsn3' top: 'upscore-dsn4' }
192 | layer { name: "concat_4_3" bottom: "upscore-dsn4" bottom: "score-dsn3" top: "concat-upscore3" type: "Concat"
193 | concat_param { concat_dim: 1} }
194 | layer {
195 | name: 'cat3-score' type: "Convolution"
196 | bottom: 'concat-upscore3' top: 'concat3-score'
197 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
198 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
199 | }
200 |
201 | layer{
202 | type: "Slice" name: "slice3"
203 | bottom: "concat3-score"
204 | top: "concat3-score-slice1"
205 | top: "concat3-score-slice2"
206 | slice_param {
207 | axis: 1
208 | slice_point: 1
209 | }
210 | }
211 |
212 | # the loss of side output3
213 | layer { type: "Deconvolution" name: 'upsample_4' bottom: 'concat3-score-slice2' top: 'concat3-score-up-loss'
214 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
215 | convolution_param { kernel_size: 8 stride: 4 num_output: 1 } }
216 | layer { type: "Crop" name: 'crop3-loss' bottom: 'concat3-score-up-loss' bottom: 'data' top: 'concat3-score-loss' }
217 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn3_loss' bottom: 'concat3-score-loss' bottom: 'label' top:'dsn3_loss' loss_weight: 1}
218 |
219 | #---
220 | # 2x
221 | layer { type: "Deconvolution" name: 'upsample_3_2' bottom: 'concat3-score-slice1' top: 'score-dsn3-up'
222 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
223 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
224 | layer { type: "Crop" name: 'crop3' bottom: 'score-dsn3-up' bottom: 'score-dsn2' top: 'upscore-dsn3' }
225 | layer { name: "concat_3_2" bottom: "upscore-dsn3" bottom: "score-dsn2" top: "concat-upscore2" type: "Concat"
226 | concat_param { concat_dim: 1} }
227 | layer {
228 | name: 'cat2-score' type: "Convolution"
229 | bottom: 'concat-upscore2' top: 'concat2-score'
230 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
231 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
232 | }
233 |
234 | # the loss of side output2
235 | layer { type: "Deconvolution" name: 'upsample_2' bottom: 'concat2-score' top: 'concat2-score-up-loss'
236 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
237 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
238 | layer { type: "Crop" name: 'crop2-loss' bottom: 'concat2-score-up-loss' bottom: 'data' top: 'concat2-score-loss' }
239 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn2_loss' bottom: 'concat2-score-loss' bottom: 'label' top:'dsn2_loss' loss_weight: 1}
240 | #----
241 |
242 | #-----
243 |
244 |
245 | #-----------------------------------------------------------
246 | ### Concat and multiscale weight layer ###
247 | layer { name: "concat" bottom: "concat2-score-loss" bottom: "concat3-score-loss"
248 | bottom: "concat4-score-loss" bottom: "concat5-score-loss" top: "concat-upscore" type: "Concat"
249 | concat_param { concat_dim: 1} }
250 | layer { name: 'new-score-weighting' type: "Convolution" bottom: 'concat-upscore' top: 'upscore-fuse'
251 | param { lr_mult: 0.001 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
252 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.2} } }
253 | layer { type: "SigmoidCrossEntropyLoss" bottom: "upscore-fuse" bottom: "label" top:"fuse_loss" loss_weight: 1}
254 |
255 |
--------------------------------------------------------------------------------
/MT-SRN/train_val_contour.prototxt:
--------------------------------------------------------------------------------
1 | name: "HED"
2 | layer {
3 | name: "data"
4 | type: "ImageLabelmapData"
5 | top: "data"
6 | top: "label"
7 | include {
8 | phase: TRAIN
9 | }
10 | transform_param {
11 | mirror: false
12 | mean_value: 104.00699
13 | mean_value: 116.66877
14 | mean_value: 122.67892
15 | }
16 | image_data_param {
17 | root_folder: "../../data/HED-BSDS/"
18 | source: "../../data/HED-BSDS/train_pair.lst"
19 | batch_size: 1
20 | shuffle: true
21 | new_height: 0
22 | new_width: 0
23 | }
24 | }
25 | layer {
26 | name: "data"
27 | type: "ImageLabelmapData"
28 | top: "data"
29 | top: "label"
30 | include {
31 | phase: TEST
32 | }
33 | transform_param {
34 | mirror: false
35 | mean_value: 104.00699
36 | mean_value: 116.66877
37 | mean_value: 122.67892
38 | }
39 | image_data_param {
40 | root_folder: "../../data/HED-BSDS/"
41 | source: "../../data/HED-BSDS/train_pair.lst"
42 | #Just setup the network. No real online testing
43 | batch_size: 1
44 | shuffle: true
45 | new_height: 0
46 | new_width: 0
47 | }
48 | }
49 |
50 | layer { bottom: 'data' top: 'conv1_1' name: 'conv1_1' type: "Convolution"
51 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
52 | convolution_param { engine: CAFFE num_output: 64 pad: 35 kernel_size: 3 } }
53 | layer { bottom: 'conv1_1' top: 'conv1_1' name: 'relu1_1' type: "ReLU" }
54 | layer { bottom: 'conv1_1' top: 'conv1_2' name: 'conv1_2' type: "Convolution"
55 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
56 | convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 } }
57 | layer { bottom: 'conv1_2' top: 'conv1_2' name: 'relu1_2' type: "ReLU" }
58 | layer { name: 'pool1' bottom: 'conv1_2' top: 'pool1' type: "Pooling"
59 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
60 |
61 | layer { name: 'conv2_1' bottom: 'pool1' top: 'conv2_1' type: "Convolution"
62 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
63 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
64 | layer { bottom: 'conv2_1' top: 'conv2_1' name: 'relu2_1' type: "ReLU" }
65 | layer { bottom: 'conv2_1' top: 'conv2_2' name: 'conv2_2' type: "Convolution"
66 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
67 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
68 | layer { bottom: 'conv2_2' top: 'conv2_2' name: 'relu2_2' type: "ReLU" }
69 | layer { bottom: 'conv2_2' top: 'pool2' name: 'pool2' type: "Pooling"
70 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
71 |
72 | layer { bottom: 'pool2' top: 'conv3_1' name: 'conv3_1' type: "Convolution"
73 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
74 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
75 | layer { bottom: 'conv3_1' top: 'conv3_1' name: 'relu3_1' type: "ReLU" }
76 | layer { bottom: 'conv3_1' top: 'conv3_2' name: 'conv3_2' type: "Convolution"
77 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
78 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
79 | layer { bottom: 'conv3_2' top: 'conv3_2' name: 'relu3_2' type: "ReLU" }
80 | layer { bottom: 'conv3_2' top: 'conv3_3' name: 'conv3_3' type: "Convolution"
81 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
82 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
83 | layer { bottom: 'conv3_3' top: 'conv3_3' name: 'relu3_3' type: "ReLU" }
84 | layer { bottom: 'conv3_3' top: 'pool3' name: 'pool3' type: "Pooling"
85 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
86 |
87 | layer { bottom: 'pool3' top: 'conv4_1' name: 'conv4_1' type: "Convolution"
88 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
89 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
90 | layer { bottom: 'conv4_1' top: 'conv4_1' name: 'relu4_1' type: "ReLU" }
91 | layer { bottom: 'conv4_1' top: 'conv4_2' name: 'conv4_2' type: "Convolution"
92 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
93 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
94 | layer { bottom: 'conv4_2' top: 'conv4_2' name: 'relu4_2' type: "ReLU" }
95 | layer { bottom: 'conv4_2' top: 'conv4_3' name: 'conv4_3' type: "Convolution"
96 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
97 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
98 | layer { bottom: 'conv4_3' top: 'conv4_3' name: 'relu4_3' type: "ReLU" }
99 | layer { bottom: 'conv4_3' top: 'pool4' name: 'pool4' type: "Pooling"
100 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
101 |
102 | layer { bottom: 'pool4' top: 'conv5_1' name: 'conv5_1' type: "Convolution"
103 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
104 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
105 | layer { bottom: 'conv5_1' top: 'conv5_1' name: 'relu5_1' type: "ReLU" }
106 | layer { bottom: 'conv5_1' top: 'conv5_2' name: 'conv5_2' type: "Convolution"
107 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
108 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
109 | layer { bottom: 'conv5_2' top: 'conv5_2' name: 'relu5_2' type: "ReLU" }
110 | layer { bottom: 'conv5_2' top: 'conv5_3' name: 'conv5_3' type: "Convolution"
111 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
112 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
113 | layer { bottom: 'conv5_3' top: 'conv5_3' name: 'relu5_3' type: "ReLU" }
114 |
115 | ## buffer layers
116 | layer { bottom: 'conv1_2' top: 'conv_cbuf_1' name: 'conv_cbuf_1' type: "Convolution"
117 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
118 | convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
119 | layer { bottom: 'conv_cbuf_1' top: 'conv_cbuf_1' name: 'relu_cbuf_1' type: "ReLU" }
120 | layer { bottom: 'conv2_2' top: 'conv_cbuf_2' name: 'conv_cbuf_2' type: "Convolution"
121 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
122 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
123 | layer { bottom: 'conv_cbuf_2' top: 'conv_cbuf_2' name: 'relu_cbuf_2' type: "ReLU" }
124 | layer { bottom: 'conv3_3' top: 'conv_cbuf_3' name: 'conv_cbuf_3' type: "Convolution"
125 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
126 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
127 | layer { bottom: 'conv_cbuf_3' top: 'conv_cbuf_3' name: 'relu_cbuf_3' type: "ReLU" }
128 | layer { bottom: 'conv4_3' top: 'conv_cbuf_4' name: 'conv_cbuf_4' type: "Convolution"
129 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
130 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
131 | layer { bottom: 'conv_cbuf_4' top: 'conv_cbuf_4' name: 'relu_cbuf_4' type: "ReLU" }
132 | layer { bottom: 'conv5_3' top: 'conv_cbuf_5' name: 'conv_cbuf_5' type: "Convolution"
133 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
134 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
135 | layer { bottom: 'conv_cbuf_5' top: 'conv_cbuf_5' name: 'relu_cbuf_5' type: "ReLU" }
136 |
137 | #-----
138 | layer { name: 'score-cbuf_dsn1' type: "Convolution" bottom: 'conv_cbuf_1' top: 'score-cbuf_dsn1'
139 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
140 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
141 | #----
142 | layer { name: 'score-cbuf_dsn2' type: "Convolution" bottom: 'conv_cbuf_2' top: 'score-cbuf_dsn2'
143 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
144 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
145 | #---
146 | layer { name: 'score-cbuf_dsn3' type: "Convolution" bottom: 'conv_cbuf_3' top: 'score-cbuf_dsn3'
147 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
148 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
149 | #--
150 | layer { name: 'score-cbuf_dsn4' type: "Convolution" bottom: 'conv_cbuf_4' top: 'score-cbuf_dsn4'
151 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
152 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
153 | #-
154 | layer { name: 'score-cbuf_dsn5' type: "Convolution" bottom: 'conv_cbuf_5' top: 'score-cbuf_dsn5'
155 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
156 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1} }
157 |
158 | layer{
159 | type: "Slice" name: "cbuf_slice5"
160 | bottom: "score-cbuf_dsn5"
161 | top: "score-cbuf_dsn5-slice1"
162 | top: "score-cbuf_dsn5-slice2"
163 | slice_param {
164 | axis: 1
165 | slice_point: 1
166 | }
167 | }
168 |
169 | # the loss of side output5
170 | layer { type: "Deconvolution" name: 'upsamplec_16' bottom: 'score-cbuf_dsn5-slice2' top: 'concat5-cbuf_score-up-loss'
171 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
172 | convolution_param { kernel_size: 32 stride: 16 num_output: 1 } }
173 | layer { type: "Crop" name: 'crop5-cbuf_loss' bottom: 'concat5-cbuf_score-up-loss' bottom: 'data' top: 'concat5-cbuf_score-loss' }
174 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn5_cbuf_loss' bottom: 'concat5-cbuf_score-loss' bottom: 'label' top:'dsn5_cbuf_loss' loss_weight: 1}
175 |
176 | #-
177 | # 2x
178 | layer { type: "Deconvolution" name: 'upsamplec_5_4' bottom: 'score-cbuf_dsn5-slice1' top: 'score-cbuf_dsn5-up'
179 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
180 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
181 | layer { type: "Crop" name: 'cbuf_crop5' bottom: 'score-cbuf_dsn5-up' bottom: 'score-cbuf_dsn4' top: 'upscore-cbuf_dsn5' }
182 |
183 | layer { name: "concat_cbuf_5_4" bottom: "upscore-cbuf_dsn5" bottom: "score-cbuf_dsn4" top: "concat-cbuf_upscore4" type: "Concat"
184 | concat_param { concat_dim: 1} }
185 | layer {
186 | name: 'cat4-cbuf_score' type: "Convolution"
187 | bottom: 'concat-cbuf_upscore4' top: 'concat4-cbuf_score'
188 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
189 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
190 | }
191 |
192 | layer{
193 | type: "Slice" name: "scbuf_lice4"
194 | bottom: "concat4-cbuf_score"
195 | top: "concat4-cbuf_score-slice1"
196 | top: "concat4-cbuf_score-slice2"
197 | slice_param {
198 | axis: 1
199 | slice_point: 1
200 | }
201 | }
202 |
203 | # the loss of side output4
204 | layer { type: "Deconvolution" name: 'upsamplec_8' bottom: 'concat4-cbuf_score-slice2' top: 'concat4-cbuf_score-up-loss'
205 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
206 | convolution_param { kernel_size: 16 stride: 8 num_output: 1 } }
207 | layer { type: "Crop" name: 'crop4-cbuf_loss' bottom: 'concat4-cbuf_score-up-loss' bottom: 'data' top: 'concat4-cbuf_score-loss' }
208 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn4_cbuf_loss' bottom: 'concat4-cbuf_score-loss' bottom: 'label' top:'dsn4_cbuf_loss' loss_weight: 1}
209 |
210 | #--
211 | # 2x
212 | layer { type: "Deconvolution" name: 'upsamplec_4_3' bottom: 'concat4-cbuf_score-slice1' top: 'score-cbuf_dsn4-up'
213 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
214 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
215 | layer { type: "Crop" name: 'cbuf_crop4' bottom: 'score-cbuf_dsn4-up' bottom: 'score-cbuf_dsn3' top: 'upscore-cbuf_dsn4' }
216 | layer { name: "concat_cbuf_4_3" bottom: "upscore-cbuf_dsn4" bottom: "score-cbuf_dsn3" top: "concat-cbuf_upscore3" type: "Concat"
217 | concat_param { concat_dim: 1} }
218 | layer {
219 | name: 'cat3-cbuf_score' type: "Convolution"
220 | bottom: 'concat-cbuf_upscore3' top: 'concat3-cbuf_score'
221 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
222 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
223 | }
224 |
225 | layer{
226 | type: "Slice" name: "cbuf_slice3"
227 | bottom: "concat3-cbuf_score"
228 | top: "concat3-cbuf_score-slice1"
229 | top: "concat3-cbuf_score-slice2"
230 | slice_param {
231 | axis: 1
232 | slice_point: 1
233 | }
234 | }
235 |
236 | # the loss of side output3
237 | layer { type: "Deconvolution" name: 'upsamplec_4' bottom: 'concat3-cbuf_score-slice2' top: 'concat3-cbuf_score-up-loss'
238 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
239 | convolution_param { kernel_size: 8 stride: 4 num_output: 1 } }
240 | layer { type: "Crop" name: 'crop3-cbuf_loss' bottom: 'concat3-cbuf_score-up-loss' bottom: 'data' top: 'concat3-cbuf_score-loss' }
241 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn3_cbuf_loss' bottom: 'concat3-cbuf_score-loss' bottom: 'label' top:'dsn3_cbuf_loss' loss_weight: 1}
242 |
243 | #---
244 | # 2x
245 | layer { type: "Deconvolution" name: 'upsamplec_3_2' bottom: 'concat3-cbuf_score-slice1' top: 'score-cbuf_dsn3-up'
246 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
247 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
248 | layer { type: "Crop" name: 'cbuf_crop3' bottom: 'score-cbuf_dsn3-up' bottom: 'score-cbuf_dsn2' top: 'upscore-cbuf_dsn3' }
249 | layer { name: "concat_cbuf_3_2" bottom: "upscore-cbuf_dsn3" bottom: "score-cbuf_dsn2" top: "concat-cbuf_upscore2" type: "Concat"
250 | concat_param { concat_dim: 1} }
251 | layer {
252 | name: 'cat2-cbuf_score' type: "Convolution"
253 | bottom: 'concat-cbuf_upscore2' top: 'concat2-cbuf_score'
254 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
255 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
256 | }
257 |
258 | layer{
259 | type: "Slice" name: "cbuf_slice2"
260 | bottom: "concat2-cbuf_score"
261 | top: "concat2-cbuf_score-slice1"
262 | top: "concat2-cbuf_score-slice2"
263 | slice_param {
264 | axis: 1
265 | slice_point: 1
266 | }
267 | }
268 |
269 | # the loss of side output2
270 | layer { type: "Deconvolution" name: 'upsamplec_2' bottom: 'concat2-cbuf_score-slice2' top: 'concat2-cbuf_score-up-loss'
271 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
272 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
273 | layer { type: "Crop" name: 'crop2-cbuf_loss' bottom: 'concat2-cbuf_score-up-loss' bottom: 'data' top: 'concat2-cbuf_score-loss' }
274 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn2_cbuf_loss' bottom: 'concat2-cbuf_score-loss' bottom: 'label' top:'dsn2_cbuf_loss' loss_weight: 1}
275 | #----
276 | layer { type: "Deconvolution" name: 'upsamplec_2_1' bottom: 'concat2-cbuf_score-slice1' top: 'score-cbuf_dsn2-up'
277 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
278 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
279 | layer { type: "Crop" name: 'cbuf_crop2' bottom: 'score-cbuf_dsn2-up' bottom: 'score-cbuf_dsn1' top: 'upscore-cbuf_dsn2' }
280 | layer { name: "concat_cbuf_2_1" bottom: "upscore-cbuf_dsn2" bottom: "score-cbuf_dsn1" top: "concat-cbuf_upscore1" type: "Concat"
281 | concat_param { concat_dim: 1} }
282 | layer {
283 | name: 'cat1-cbuf_score' type: "Convolution"
284 | bottom: 'concat-cbuf_upscore1' top: 'concat1-cbuf_score'
285 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
286 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
287 | }
288 |
289 | # the loss of side output1
290 | layer { type: "Crop" name: 'crop1-cbuf_loss' bottom: 'concat1-cbuf_score' bottom: 'data' top: 'concat1-cbuf_score-loss' }
291 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn1_cbuf_loss' bottom: 'concat1-cbuf_score-loss' bottom: 'label' top:'dsn1_cbuf_loss' loss_weight: 1}
292 |
293 | #-----
294 |
295 |
296 | #-----------------------------------------------------------
297 | ### Concat and multiscale weight layer ###
298 | layer { name: "cbuf_concat" bottom: "concat1-cbuf_score-loss" bottom: "concat2-cbuf_score-loss" bottom: "concat3-cbuf_score-loss"
299 | bottom: "concat4-cbuf_score-loss" bottom: "concat5-cbuf_score-loss" top: "concat-cbuf_upscore" type: "Concat"
300 | concat_param { concat_dim: 1} }
301 | layer { name: 'new-cbuf_score-weighting' type: "Convolution" bottom: 'concat-cbuf_upscore' top: 'upscore-cbuf_fuse'
302 | param { lr_mult: 0.001 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
303 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.2} } }
304 | layer { type: "SigmoidCrossEntropyLoss" bottom: "upscore-cbuf_fuse" bottom: "label" top:"fuse_cbuf_loss" loss_weight: 1 name: 'fuse_cbuf_loss' }
--------------------------------------------------------------------------------
/MT-SRN/train_val_symmetry.prototxt:
--------------------------------------------------------------------------------
1 | name: "HED"
2 | layer {
3 | name: "data"
4 | type: "ImageLabelmapData"
5 | top: "data"
6 | top: "label"
7 | include {
8 | phase: TRAIN
9 | }
10 | transform_param {
11 | mirror: false
12 | mean_value: 104.00699
13 | mean_value: 116.66877
14 | mean_value: 122.67892
15 | }
16 | image_data_param {
17 | root_folder: "../../data/SymPASCAL/"
18 | source: "../../data/SymPASCAL/train_pair.lst"
19 | batch_size: 1
20 | shuffle: true
21 | new_height: 0
22 | new_width: 0
23 | }
24 | }
25 | layer {
26 | name: "data"
27 | type: "ImageLabelmapData"
28 | top: "data"
29 | top: "label"
30 | include {
31 | phase: TEST
32 | }
33 | transform_param {
34 | mirror: false
35 | mean_value: 104.00699
36 | mean_value: 116.66877
37 | mean_value: 122.67892
38 | }
39 | image_data_param {
40 | root_folder: "../../data/SymPASCAL/"
41 | source: "../../data/SymPASCAL/train_pair.lst"
42 | #Just setup the network. No real online testing
43 | batch_size: 1
44 | shuffle: true
45 | new_height: 0
46 | new_width: 0
47 | }
48 | }
49 |
50 | layer { bottom: 'data' top: 'conv1_1' name: 'conv1_1' type: "Convolution"
51 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
52 | convolution_param { engine: CAFFE num_output: 64 pad: 35 kernel_size: 3 } }
53 | layer { bottom: 'conv1_1' top: 'conv1_1' name: 'relu1_1' type: "ReLU" }
54 | layer { bottom: 'conv1_1' top: 'conv1_2' name: 'conv1_2' type: "Convolution"
55 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
56 | convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 } }
57 | layer { bottom: 'conv1_2' top: 'conv1_2' name: 'relu1_2' type: "ReLU" }
58 | layer { name: 'pool1' bottom: 'conv1_2' top: 'pool1' type: "Pooling"
59 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
60 |
61 | layer { name: 'conv2_1' bottom: 'pool1' top: 'conv2_1' type: "Convolution"
62 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
63 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
64 | layer { bottom: 'conv2_1' top: 'conv2_1' name: 'relu2_1' type: "ReLU" }
65 | layer { bottom: 'conv2_1' top: 'conv2_2' name: 'conv2_2' type: "Convolution"
66 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
67 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
68 | layer { bottom: 'conv2_2' top: 'conv2_2' name: 'relu2_2' type: "ReLU" }
69 | layer { bottom: 'conv2_2' top: 'pool2' name: 'pool2' type: "Pooling"
70 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
71 |
72 | layer { bottom: 'pool2' top: 'conv3_1' name: 'conv3_1' type: "Convolution"
73 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
74 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
75 | layer { bottom: 'conv3_1' top: 'conv3_1' name: 'relu3_1' type: "ReLU" }
76 | layer { bottom: 'conv3_1' top: 'conv3_2' name: 'conv3_2' type: "Convolution"
77 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
78 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
79 | layer { bottom: 'conv3_2' top: 'conv3_2' name: 'relu3_2' type: "ReLU" }
80 | layer { bottom: 'conv3_2' top: 'conv3_3' name: 'conv3_3' type: "Convolution"
81 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
82 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
83 | layer { bottom: 'conv3_3' top: 'conv3_3' name: 'relu3_3' type: "ReLU" }
84 | layer { bottom: 'conv3_3' top: 'pool3' name: 'pool3' type: "Pooling"
85 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
86 |
87 | layer { bottom: 'pool3' top: 'conv4_1' name: 'conv4_1' type: "Convolution"
88 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
89 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
90 | layer { bottom: 'conv4_1' top: 'conv4_1' name: 'relu4_1' type: "ReLU" }
91 | layer { bottom: 'conv4_1' top: 'conv4_2' name: 'conv4_2' type: "Convolution"
92 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
93 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
94 | layer { bottom: 'conv4_2' top: 'conv4_2' name: 'relu4_2' type: "ReLU" }
95 | layer { bottom: 'conv4_2' top: 'conv4_3' name: 'conv4_3' type: "Convolution"
96 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
97 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
98 | layer { bottom: 'conv4_3' top: 'conv4_3' name: 'relu4_3' type: "ReLU" }
99 | layer { bottom: 'conv4_3' top: 'pool4' name: 'pool4' type: "Pooling"
100 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
101 |
102 | layer { bottom: 'pool4' top: 'conv5_1' name: 'conv5_1' type: "Convolution"
103 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
104 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
105 | layer { bottom: 'conv5_1' top: 'conv5_1' name: 'relu5_1' type: "ReLU" }
106 | layer { bottom: 'conv5_1' top: 'conv5_2' name: 'conv5_2' type: "Convolution"
107 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
108 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
109 | layer { bottom: 'conv5_2' top: 'conv5_2' name: 'relu5_2' type: "ReLU" }
110 | layer { bottom: 'conv5_2' top: 'conv5_3' name: 'conv5_3' type: "Convolution"
111 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
112 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
113 | layer { bottom: 'conv5_3' top: 'conv5_3' name: 'relu5_3' type: "ReLU" }
114 |
115 | ## buffer layers
116 | layer { bottom: 'conv1_2' top: 'conv_sbuf_1' name: 'conv_sbuf_1' type: "Convolution"
117 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
118 | convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
119 | layer { bottom: 'conv_sbuf_1' top: 'conv_sbuf_1' name: 'relu_sbuf_1' type: "ReLU" }
120 | layer { bottom: 'conv2_2' top: 'conv_sbuf_2' name: 'conv_sbuf_2' type: "Convolution"
121 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
122 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
123 | layer { bottom: 'conv_sbuf_2' top: 'conv_sbuf_2' name: 'relu_sbuf_2' type: "ReLU" }
124 | layer { bottom: 'conv3_3' top: 'conv_sbuf_3' name: 'conv_sbuf_3' type: "Convolution"
125 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
126 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
127 | layer { bottom: 'conv_sbuf_3' top: 'conv_sbuf_3' name: 'relu_sbuf_3' type: "ReLU" }
128 | layer { bottom: 'conv4_3' top: 'conv_sbuf_4' name: 'conv_sbuf_4' type: "Convolution"
129 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
130 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
131 | layer { bottom: 'conv_sbuf_4' top: 'conv_sbuf_4' name: 'relu_sbuf_4' type: "ReLU" }
132 | layer { bottom: 'conv5_3' top: 'conv_sbuf_5' name: 'conv_sbuf_5' type: "Convolution"
133 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
134 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 weight_filler {type: 'gaussian' mean: 0.0 std: 0.01} bias_filler {type: "constant" value: 0}} }
135 | layer { bottom: 'conv_sbuf_5' top: 'conv_sbuf_5' name: 'relu_sbuf_5' type: "ReLU" }
136 |
137 |
138 |
139 | #-----
140 | layer { name: 'score-sbuf_dsn1' type: "Convolution" bottom: 'conv_sbuf_1' top: 'score-sbuf_dsn1'
141 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
142 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
143 | #----
144 | layer { name: 'score-sbuf_dsn2' type: "Convolution" bottom: 'conv_sbuf_2' top: 'score-sbuf_dsn2'
145 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
146 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
147 | #---
148 | layer { name: 'score-sbuf_dsn3' type: "Convolution" bottom: 'conv_sbuf_3' top: 'score-sbuf_dsn3'
149 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
150 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
151 | #--
152 | layer { name: 'score-sbuf_dsn4' type: "Convolution" bottom: 'conv_sbuf_4' top: 'score-sbuf_dsn4'
153 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
154 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
155 | #-
156 | layer { name: 'score-sbuf_dsn5' type: "Convolution" bottom: 'conv_sbuf_5' top: 'score-sbuf_dsn5'
157 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
158 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1} }
159 |
160 | layer{
161 | type: "Slice" name: "sbuf_slice5"
162 | bottom: "score-sbuf_dsn5"
163 | top: "score-sbuf_dsn5-slice1"
164 | top: "score-sbuf_dsn5-slice2"
165 | slice_param {
166 | axis: 1
167 | slice_point: 1
168 | }
169 | }
170 |
171 | # the loss of side output5
172 | layer { type: "Deconvolution" name: 'upsamples_16' bottom: 'score-sbuf_dsn5-slice2' top: 'concat5-sbuf_score-up-loss'
173 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
174 | convolution_param { kernel_size: 32 stride: 16 num_output: 1 } }
175 | layer { type: "Crop" name: 'crop5-sbuf_loss' bottom: 'concat5-sbuf_score-up-loss' bottom: 'data' top: 'concat5-sbuf_score-loss' }
176 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn5_sbuf_loss' bottom: 'concat5-sbuf_score-loss' bottom: 'label' top:'dsn5_sbuf_loss' loss_weight: 1}
177 |
178 | #-
179 | # 2x
180 | layer { type: "Deconvolution" name: 'upsamples_5_4' bottom: 'score-sbuf_dsn5-slice1' top: 'score-sbuf_dsn5-up'
181 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
182 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
183 | layer { type: "Crop" name: 'sbuf_crop5' bottom: 'score-sbuf_dsn5-up' bottom: 'score-sbuf_dsn4' top: 'upscore-sbuf_dsn5' }
184 |
185 | layer { name: "concat_sbuf_5_4" bottom: "upscore-sbuf_dsn5" bottom: "score-sbuf_dsn4" top: "concat-sbuf_upscore4" type: "Concat"
186 | concat_param { concat_dim: 1} }
187 | layer {
188 | name: 'cat4-sbuf_score' type: "Convolution"
189 | bottom: 'concat-sbuf_upscore4' top: 'concat4-sbuf_score'
190 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
191 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
192 | }
193 |
194 | layer{
195 | type: "Slice" name: "ssbuf_lice4"
196 | bottom: "concat4-sbuf_score"
197 | top: "concat4-sbuf_score-slice1"
198 | top: "concat4-sbuf_score-slice2"
199 | slice_param {
200 | axis: 1
201 | slice_point: 1
202 | }
203 | }
204 |
205 | # the loss of side output4
206 | layer { type: "Deconvolution" name: 'upsamples_8' bottom: 'concat4-sbuf_score-slice2' top: 'concat4-sbuf_score-up-loss'
207 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
208 | convolution_param { kernel_size: 16 stride: 8 num_output: 1 } }
209 | layer { type: "Crop" name: 'crop4-sbuf_loss' bottom: 'concat4-sbuf_score-up-loss' bottom: 'data' top: 'concat4-sbuf_score-loss' }
210 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn4_sbuf_loss' bottom: 'concat4-sbuf_score-loss' bottom: 'label' top:'dsn4_sbuf_loss' loss_weight: 1}
211 |
212 | #--
213 | # 2x
214 | layer { type: "Deconvolution" name: 'upsamples_4_3' bottom: 'concat4-sbuf_score-slice1' top: 'score-sbuf_dsn4-up'
215 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
216 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
217 | layer { type: "Crop" name: 'sbuf_crop4' bottom: 'score-sbuf_dsn4-up' bottom: 'score-sbuf_dsn3' top: 'upscore-sbuf_dsn4' }
218 | layer { name: "concat_sbuf_4_3" bottom: "upscore-sbuf_dsn4" bottom: "score-sbuf_dsn3" top: "concat-sbuf_upscore3" type: "Concat"
219 | concat_param { concat_dim: 1} }
220 | layer {
221 | name: 'cat3-sbuf_score' type: "Convolution"
222 | bottom: 'concat-sbuf_upscore3' top: 'concat3-sbuf_score'
223 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
224 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
225 | }
226 |
227 | layer{
228 | type: "Slice" name: "sbuf_slice3"
229 | bottom: "concat3-sbuf_score"
230 | top: "concat3-sbuf_score-slice1"
231 | top: "concat3-sbuf_score-slice2"
232 | slice_param {
233 | axis: 1
234 | slice_point: 1
235 | }
236 | }
237 |
238 | # the loss of side output3
239 | layer { type: "Deconvolution" name: 'upsamples_4' bottom: 'concat3-sbuf_score-slice2' top: 'concat3-sbuf_score-up-loss'
240 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
241 | convolution_param { kernel_size: 8 stride: 4 num_output: 1 } }
242 | layer { type: "Crop" name: 'crop3-sbuf_loss' bottom: 'concat3-sbuf_score-up-loss' bottom: 'data' top: 'concat3-sbuf_score-loss' }
243 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn3_sbuf_loss' bottom: 'concat3-sbuf_score-loss' bottom: 'label' top:'dsn3_sbuf_loss' loss_weight: 1}
244 |
245 | #---
246 | # 2x
247 | layer { type: "Deconvolution" name: 'upsamples_3_2' bottom: 'concat3-sbuf_score-slice1' top: 'score-sbuf_dsn3-up'
248 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
249 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
250 | layer { type: "Crop" name: 'sbuf_crop3' bottom: 'score-sbuf_dsn3-up' bottom: 'score-sbuf_dsn2' top: 'upscore-sbuf_dsn3' }
251 | layer { name: "concat_sbuf_3_2" bottom: "upscore-sbuf_dsn3" bottom: "score-sbuf_dsn2" top: "concat-sbuf_upscore2" type: "Concat"
252 | concat_param { concat_dim: 1} }
253 | layer {
254 | name: 'cat2-sbuf_score' type: "Convolution"
255 | bottom: 'concat-sbuf_upscore2' top: 'concat2-sbuf_score'
256 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
257 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
258 | }
259 |
260 | layer{
261 | type: "Slice" name: "sbuf_slice2"
262 | bottom: "concat2-sbuf_score"
263 | top: "concat2-sbuf_score-slice1"
264 | top: "concat2-sbuf_score-slice2"
265 | slice_param {
266 | axis: 1
267 | slice_point: 1
268 | }
269 | }
270 |
271 | # the loss of side output2
272 | layer { type: "Deconvolution" name: 'upsamples_2' bottom: 'concat2-sbuf_score-slice2' top: 'concat2-sbuf_score-up-loss'
273 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
274 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
275 | layer { type: "Crop" name: 'crop2-sbuf_loss' bottom: 'concat2-sbuf_score-up-loss' bottom: 'data' top: 'concat2-sbuf_score-loss' }
276 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn2_sbuf_loss' bottom: 'concat2-sbuf_score-loss' bottom: 'label' top:'dsn2_sbuf_loss' loss_weight: 1}
277 | #----
278 | layer { type: "Deconvolution" name: 'upsamples_2_1' bottom: 'concat2-sbuf_score-slice1' top: 'score-sbuf_dsn2-up'
279 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
280 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
281 | layer { type: "Crop" name: 'sbuf_crop2' bottom: 'score-sbuf_dsn2-up' bottom: 'score-sbuf_dsn1' top: 'upscore-sbuf_dsn2' }
282 | layer { name: "concat_sbuf_2_1" bottom: "upscore-sbuf_dsn2" bottom: "score-sbuf_dsn1" top: "concat-sbuf_upscore1" type: "Concat"
283 | concat_param { concat_dim: 1} }
284 | layer {
285 | name: 'cat1-sbuf_score' type: "Convolution"
286 | bottom: 'concat-sbuf_upscore1' top: 'concat1-sbuf_score'
287 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
288 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
289 | }
290 |
291 | # the loss of side output1
292 | layer { type: "Crop" name: 'crop1-sbuf_loss' bottom: 'concat1-sbuf_score' bottom: 'data' top: 'concat1-sbuf_score-loss' }
293 | layer { type: "SigmoidCrossEntropyLoss" name: 'dsn1_sbuf_loss' bottom: 'concat1-sbuf_score-loss' bottom: 'label' top:'dsn1_sbuf_loss' loss_weight: 1}
294 |
295 | #-----
296 |
297 |
298 | #-----------------------------------------------------------
299 | ### Concat and multiscale weight layer ###
300 | layer { name: "sbuf_concat" bottom: "concat1-sbuf_score-loss" bottom: "concat2-sbuf_score-loss" bottom: "concat3-sbuf_score-loss"
301 | bottom: "concat4-sbuf_score-loss" bottom: "concat5-sbuf_score-loss" top: "concat-sbuf_upscore" type: "Concat"
302 | concat_param { concat_dim: 1} }
303 | layer { name: 'new-sbuf_score-weighting' type: "Convolution" bottom: 'concat-sbuf_upscore' top: 'upscore-sbuf_fuse'
304 | param { lr_mult: 0.001 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
305 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.2} } }
306 | layer { type: "SigmoidCrossEntropyLoss" bottom: "upscore-sbuf_fuse" bottom: "label" top:"fuse_sbuf_loss" loss_weight: 1 name: 'fuse_sbuf_loss' }
307 |
--------------------------------------------------------------------------------
/AnnoTool/skeletonLabeler_v2.m:
--------------------------------------------------------------------------------
1 | function skeletonLabeler( objTypes, vidNm, annNm )
2 | % Video bound box (vbb) Labeler.
3 | %
4 | % USAGE
5 | % vbbLabeler( [objTypes], [vidNm], [annNm] )
6 | %
7 | % INPUTS
8 | % objTypes - [{'object'}] list of object types to annotate
9 | % imgDir - [] initial video to load
10 | % resDir - [] initial annotation to load
11 | %
12 |
13 | % defaults
14 | if(nargin<1 || isempty(objTypes)), objTypes={'object'}; end
15 | if(nargin<2 || isempty(vidNm)), vidNm=''; end
16 | if(nargin<3 || isempty(annNm)), annNm=''; end
17 |
18 | % handles to gui objects / other globals
19 | [hFig, pSet, pCp, pMp] = deal([]);
20 | [curInd,curSeg, setApi,dispApi] = deal([]);
21 |
22 | makeLayout();
23 | setApi = setMakeApi(); % set the parameters
24 | dispApi = dispMakeApi(); % display & update
25 | setApi.closeVid();
26 | set(hFig,'Visible','on');
27 | drawnow;
28 |
29 |
30 | % optionally load default data
31 | if(~isempty(vidNm)), setApi.openVid(vidNm); end
32 | if(~isempty(annNm)), setApi.openAnn(annNm); end
33 |
34 | function makeLayout()
35 | % hFig: main figure
36 | set(0,'Units','pixels'); ss=get(0,'ScreenSize');
37 | if( ss(3)<800 || ss(4)<600 ), error('screen too small'); end
38 | pos = [(ss(3)-580-400)/2 (ss(4)-650-200)/2 580+400 680+200];
39 | hFig = figure( 'Name','Labeler', 'NumberTitle','off', ...
40 | 'Toolbar','auto', 'MenuBar','none', 'Resize','on', ...
41 | 'Color','k', 'Visible','off', 'DeleteFcn',@exitLb, 'Position',pos, ...
42 | 'keyPressFcn',@keyPress );
43 |
44 | % pSet: top panel containing setting
45 | pSet.h=uipanel('Units','pixels', 'BackgroundColor',[.1 .1 .1],'BorderType','none','Position', [8 645+200 580 30], 'Parent',hFig);
46 | pSet.hOpen = uicontrol(pSet.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position', [5 3 90 20],'String','Open');
47 | pSet.nImgLbl = uicontrol(pSet.h,'Style','text','FontSize',8,'BackgroundColor',[.1 .1 .1],'ForegroundColor','w','Position',[185 0 50 20],'HorizontalAlignment','Left', 'String', '/');
48 | pSet.IndLbl = uicontrol(pSet.h,'Style','edit','FontSize',8,'BackgroundColor',[.1 .1 .1],'ForegroundColor','w','Position',[135 3 50 20],'HorizontalAlignment','Right');
49 | pSet.hImageName = uicontrol(pSet.h,'Style','text','FontSize',8,'BackgroundColor',[.1 .1 .1],'ForegroundColor','w','Position',[240 0 90 20],'HorizontalAlignment','Left');
50 |
51 | % pCp: control pannel
52 | pCp.h=uipanel('Units','pixels', 'BackgroundColor',[.1 .1 .1],'BorderType','none','Position', [8 613+200 580 30],'Parent',hFig);
53 | pCp.hBtPrvImg = uicontrol(pCp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position', [5 3 90 25],'String','PreviousImage');
54 | pCp.hBtShowImg = uicontrol(pCp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position', [100 3 90 25],'String','ShowImage');
55 | pCp.hBtShowMask = uicontrol(pCp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position', [195 3 80 25],'String','ShowMask');
56 | pCp.hBtShowSkel = uicontrol(pCp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position', [280 3 90 25],'String','ShowSkeleton');
57 | pCp.hBtNextImg = uicontrol(pCp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position', [375 3 80 25],'String','NextImage');
58 | pCp.hBtAnnSave = uicontrol(pCp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position', [460 3 95 25],'String','AnnotationSave');
59 |
60 | % pMp main panel
61 | pMp.h=uipanel('Units','pixels', 'BackgroundColor',[.1 .1 .1],'BorderType','none','Position', [8 8 580+400 604+200],'Parent',hFig);
62 | pMp.hAx=axes('Units','pixels', 'Position', [5 40 560+400 560+200], 'Parent',pMp.h, 'Color', [1 1 1]);
63 | pMp.hBtPrvObj = uicontrol(pMp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position', [5 3 90 25],'String','PreviousObject');
64 | pMp.hBtOriMask = uicontrol(pMp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position',[100 3 90 25],'String','OriginalMask');
65 | pMp.hBtExdDisc = uicontrol(pMp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position',[195 3 80 25],'String','ExtendDisc');
66 | pMp.hBtExdPoly = uicontrol(pMp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position',[280 3 80 25],'String','ExtendPoly');
67 | pMp.hBtAnn = uicontrol(pMp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position',[365 3 80 25],'String','Annotation');
68 | pMp.hBtNxtObj = uicontrol(pMp.h,'BackgroundColor',[.7 .7 .7],'FontSize', 10, 'Position',[450 3 80 25],'String','NextObject');
69 |
70 |
71 | function exitLb( h, e ) %#ok
72 | setApi.closeVid();
73 | end
74 |
75 | function keyPress( h, evnt ) %#ok
76 | char=int8(evnt.Character); if(isempty(char)), char=0; end;
77 | if( char==28 ), dispApi.setPlay(-inf); end
78 | if( char==29 ), dispApi.setPlay(+inf); end
79 | if( char==31 ), dispApi.setPlay(0); end
80 | end
81 | end
82 |
83 | function api = setMakeApi()
84 | % variables
85 | [imgPath, segPath, imgLst] = deal([]);
86 | [imgROI, seg, segIdx, skeGt,skeInst, extIdx] = deal([]);
87 | [segMask, extMask, skelFlag, annFlag] = deal([]);
88 | [h, w] = deal([]);
89 |
90 | imgPath = [VOC2011Path '\VOCdevkit\VOC2011\JPEGImages';
91 | segPath = [VOC2011Path '\VOCdevkit\VOC2011\SegmentationObject';
92 | imgLstPath = [VOC2011Path '\VOCdevkit\VOC2011\ImageSets\Segmentation\train.txt';
93 | f=fopen(imgLstPath); imgLst=textscan(f,'%s %*s'); imgLst=imgLst{1}; fclose(f);
94 | set(pSet.nImgLbl, 'String', ['\' num2str(length(imgLst))]);
95 |
96 | % callbacks
97 | set(pSet.hOpen, 'callback', @(h,e) imgOpen());
98 | set(pCp.hBtNextImg, 'callback', @(h,e) nextImg());
99 | set(pCp.hBtPrvImg, 'callback', @(h,e) previousImg());
100 | set(pCp.hBtShowImg, 'callback', @(h,e) showImg());
101 | set(pCp.hBtShowMask, 'callback', @(h,e) showMask());
102 | set(pCp.hBtShowSkel, 'callback', @(h,e) showSkel());
103 | set(pCp.hBtAnnSave, 'callback', @(h,e) annSave());
104 |
105 | set(pMp.hBtPrvObj, 'callback', @(h,e) previousObj());
106 | set(pMp.hBtNxtObj, 'callback', @(h,e) nextObj());
107 | set(pMp.hBtOriMask, 'callback', @(h,e) oriMask());
108 | set(pMp.hBtExdDisc, 'callback', @(h,e) exdMaskDisc());
109 | set(pMp.hBtExdPoly, 'callback', @(h,e) exdMaskPoly());
110 | set(pMp.hBtAnn, 'callback', @(h,e) annotation());
111 |
112 | % create api
113 | api=struct('imgSet',@imgSet, ...
114 | 'imgOpen',@imgOpen, 'closeVid', @closeVid);
115 |
116 | function imgShow()
117 | curSeg = 0;
118 | set(pSet.IndLbl, 'String', num2str(curInd));
119 | set(pSet.hImageName, 'String', [imgLst{curInd} '.jpg']);
120 | set(pCp.hBtShowSkel, 'Enable','off');
121 | set(pCp.hBtAnnSave, 'Enable','off');
122 |
123 | cla(pMp.hAx); set(pMp.hAx,'XTick',[],'YTick',[]);
124 | set( hFig, 'CurrentAxes', pMp.hAx );
125 | imgROI = imread([imgPath '\' imgLst{curInd} '.jpg']);
126 | [h,w,~] =size(imgROI);
127 | set( pMp.hAx, 'Position', [5 40 980 804]);
128 | img = uint8(50*ones(804,980,3));
129 | img(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,1) = imgROI(:,:,1);
130 | img(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,2) = imgROI(:,:,2);
131 | img(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,3) = imgROI(:,:,3);
132 | image(img); axis off;
133 | seg = imread([segPath '\' imgLst{curInd} '.png']);
134 | segIdx = unique(seg);
135 | skeGt = false(h,w);
136 | extMask = cell(50,1);
137 | skeInst = cell(length(segIdx)-2,1);
138 | skelFlag= false(length(segIdx)-2,1);
139 | segMask = false(804,980);
140 | end
141 |
142 | function segShow(segmask)
143 | tmp = uint8(50*ones(804,980,3));
144 | tmp(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,1) = imgROI(:,:,1);
145 | tmp(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,2) = imgROI(:,:,2);
146 | tmp(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,3) = imgROI(:,:,3);
147 | tmp(:,:,1) = tmp(:,:,1).*uint8(~segmask);
148 | tmp(:,:,2) = tmp(:,:,2).*uint8(~segmask);
149 | tmp(:,:,3) = tmp(:,:,3).*uint8(~segmask);
150 | image(tmp);
151 | axis off;
152 | end
153 |
154 | function imgOpen()
155 | num = get(pSet.IndLbl, 'String');
156 | if(isempty(num))
157 | curInd = 1;
158 | else
159 | curInd = uint16(str2num(num));
160 | end
161 | imgShow();
162 | end
163 |
164 | function nextImg()
165 | if(curInd < 1112)
166 | curInd = curInd+1;
167 | end
168 | imgShow();
169 | end
170 |
171 | function previousImg()
172 | if(curInd>1)
173 | curInd = curInd-1;
174 | end
175 | imgShow();
176 | end
177 |
178 | function showImg()
179 | imgROI = imread([imgPath '\' imgLst{curInd} '.jpg']);
180 | [h,w,~] =size(imgROI);
181 | set( pMp.hAx, 'Position', [5 40 980 804]);
182 | img = uint8(50*ones(804,980,3));
183 | img(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,1) = imgROI(:,:,1);
184 | img(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,2) = imgROI(:,:,2);
185 | img(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,3) = imgROI(:,:,3);
186 | image(img); axis off;
187 | end
188 |
189 | function showMask()
190 | segMaskROI = seg == segIdx(length(segIdx));
191 | segMask(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w) = segMaskROI;
192 | segShow(segMask);
193 | end
194 |
195 | function showSkel()
196 | for i= 1:length(segIdx)-2
197 | skeGt = skeGt|skeInst{i};
198 | end
199 |
200 | tmp = uint8(50*ones(804,980,3));
201 | tmp(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,1) = imgROI(:,:,1);
202 | tmp(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,2) = imgROI(:,:,2);
203 | tmp(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,3) = imgROI(:,:,3);
204 | tmpMask = false(804,980);
205 | tmpMask(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w)= seg>0;
206 | tmpGt = false(804,980);
207 | tmpGt(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w) = skeGt;
208 | tmpMask = uint8(~tmpMask);
209 | tmpMask(tmpGt) = 255;
210 |
211 | tmp(:,:,1) = tmp(:,:,1).*tmpMask;
212 | tmp(:,:,2) = tmp(:,:,2).*tmpMask;
213 | tmp(:,:,3) = tmp(:,:,3).*tmpMask;
214 | image(tmp);axis off;
215 |
216 | set(pCp.hBtAnnSave, 'Enable','on');
217 | end
218 |
219 | function annSave()
220 | sym = skeGt;
221 | save(['skeGt/' imgLst{curInd} '.mat'], 'sym');
222 | msgbox('save sucessed.');
223 | end
224 |
225 | function previousObj()
226 | if(curSeg>1)
227 | curSeg = curSeg-1;
228 | else
229 | curSeg = 1;
230 | end
231 | annFlag = true;
232 | segMaskROI = seg == segIdx(curSeg+1);
233 | segMask(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w) = segMaskROI;
234 | segShow(segMask);
235 | extIdx = 1;
236 | end
237 |
238 | function nextObj()
239 | if(curSeg0
257 | [x,y] = ginput(2);
258 | if(length(x)<2)
259 | return;
260 | end
261 |
262 | tmpMask = false(size(segMask));
263 | % extend by disc
264 | dot1 = [x(1) y(1)];
265 | dot2 = [x(2) y(2)];
266 | tmpMask = extendDisc(tmpMask, dot1, dot2);
267 |
268 | tmpMask = imfill(tmpMask, 'holes');
269 |
270 | if extIdx==1
271 | extMask{extIdx} = tmpMask;
272 | else
273 | extMask{extIdx} = extMask{extIdx-1}|tmpMask;
274 | end
275 | tmpMask = segMask|extMask{extIdx};
276 | segShow(tmpMask);
277 | if (extIdx<51)
278 | extIdx = extIdx+1;
279 | end
280 | end
281 | end
282 |
283 | function exdMaskPoly()
284 | if curSeg >0
285 | [x,y] = ginput(4);
286 | if(length(x)<2)
287 | return;
288 | end
289 | tmpMask = false(size(segMask));
290 | % extend by polygon
291 | x = [x(1) x(2) x(3) x(4)];
292 | y = [y(1) y(2) y(3) y(4)];
293 | tmpMask = extendPolygon(tmpMask, x, y);
294 | tmpMask = imfill(tmpMask, 'holes');
295 | if extIdx==1
296 | extMask{extIdx} = tmpMask;
297 | else
298 | extMask{extIdx} = extMask{extIdx-1}|tmpMask;
299 | end
300 | tmpMask = segMask|extMask{extIdx};
301 | segShow(tmpMask);
302 | if (extIdx<51)
303 | extIdx = extIdx+1;
304 | end
305 | end
306 | end
307 |
308 | function annotation()
309 | if curSeg >0
310 | if(extIdx>1)
311 | tmpMask = extMask{extIdx-1};
312 | tmpMask = segMask|tmpMask;
313 | else
314 | tmpMask = segMask;
315 | end
316 |
317 | try
318 |
319 | epsilon = 0.8;
320 | skel = skel_pruning_bpr(tmpMask, epsilon, 9);
321 | skel = skel>0;
322 |
323 | tmp = uint8(50*ones(804,980,3));
324 | tmp(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,1) = imgROI(:,:,1);
325 | tmp(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,2) = imgROI(:,:,2);
326 | tmp(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w,3) = imgROI(:,:,3);
327 |
328 | if annFlag
329 | tmpMask = uint8(~tmpMask);
330 | else
331 | skel = skel & segMask;
332 | tmpMask = uint8(~segMask);
333 | end
334 |
335 | tmpMask(skel) = 255;
336 |
337 | tmp(:,:,1) = tmp(:,:,1).*tmpMask;
338 | tmp(:,:,2) = tmp(:,:,2).*tmpMask;
339 | tmp(:,:,3) = tmp(:,:,3).*tmpMask;
340 | image(tmp);axis off;
341 | annFlag = ~annFlag;
342 |
343 | skelFlag(curSeg) = true;
344 | skeInst{curSeg} = skel(420-floor(h/2):419-floor(h/2)+h,485-floor(w/2):484-floor(w/2)+w);
345 |
346 | if all(skelFlag==true)
347 | set(pCp.hBtShowSkel, 'Enable','on');
348 | end
349 | end
350 | end
351 | end
352 |
353 | function mask = extendDisc(extMask, dot1, dot2)
354 | dot1 = double(dot1);
355 | dot2 = double(dot2);
356 | mask = extMask;
357 | x0 = (dot1(1)+dot2(1))/2;
358 | y0 = (dot1(2)+dot2(2))/2;
359 | R0 = sqrt((dot1(1)-dot2(1))^2+(dot1(2)-dot2(2))^2)/2;
360 | dy = dot2(2)-dot1(2);
361 | dx = dot2(1)-dot1(1);
362 | theta0 = atan((dot2(2)-dot1(2))/(dot2(1)-dot1(1)));
363 | if dot2(2)-dot1(2)>=0 && dot2(1)-dot1(1)<0
364 | theta0 = atan((dot2(2)-dot1(2))/(dot2(1)-dot1(1)))-pi;
365 | elseif dot2(2)-dot1(2)>=0 && dot2(1)-dot1(1)>0
366 | theta0 = atan((dot2(2)-dot1(2))/(dot2(1)-dot1(1)));
367 | elseif dot2(2)-dot1(2)<0 && dot2(1)-dot1(1)<0
368 | theta0 = atan((dot2(2)-dot1(2))/(dot2(1)-dot1(1)))-pi;
369 | elseif dot2(2)-dot1(2)<0 && dot2(1)-dot1(1)>0
370 | theta0 = atan((dot2(2)-dot1(2))/(dot2(1)-dot1(1)));
371 | elseif dot2(2)-dot1(2)<0 && dot2(1)-dot1(1)==0
372 | theta0 = -pi/2;
373 | elseif dot2(2)-dot1(2)>0 && dot2(1)-dot1(1)==0
374 | theta0 = pi/2;
375 | end
376 |
377 | Theta=linspace(theta0,theta0+pi,1000);
378 | x = x0+ cos(Theta)*R0;
379 | y = y0 + sin(Theta)*R0;
380 | for ii=1:1000
381 | mask(round(y(ii)),round(x(ii)))=true;
382 | end
383 | x = linspace(dot1(1),dot2(1),500);
384 | y = linspace(dot1(2),dot2(2),500);
385 | for ii=1:500
386 | mask(round(y(ii)),round(x(ii)))=true;
387 | end
388 |
389 | end
390 |
391 | function mask = extendPolygon(extMask, x, y)
392 | mask = extMask;
393 | a = [linspace(x(1),x(2),500) linspace(x(2),x(3),500) linspace(x(3),x(4),500) linspace(x(4),x(1),500)];
394 | b = [linspace(y(1),y(2),500) linspace(y(2),y(3),500) linspace(y(3),y(4),500) linspace(y(4),y(1),500)];
395 | for ii=1:2000
396 | mask(round(b(ii)),round(a(ii)))=true;
397 | end
398 | end
399 |
400 |
401 | function closeVid()
402 | % dispApi.init([]);
403 | end
404 | end
405 |
406 | function api = dispMakeApi()
407 | api=struct( 'showImage',@showImage, 'imgSet',@imgSet, ...
408 | 'imgOpen',@imgOpen);
409 |
410 | end
411 |
412 | end
413 |
414 |
415 |
416 |
417 |
--------------------------------------------------------------------------------
/MT-SRN/deploy.prototxt:
--------------------------------------------------------------------------------
1 | name: "FCN"
2 |
3 | input: "data"
4 | input_dim: 1
5 | input_dim: 3
6 | input_dim: 423
7 | input_dim: 480
8 |
9 | layer { bottom: 'data' top: 'conv1_1' name: 'conv1_1' type: "Convolution"
10 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
11 | convolution_param { engine: CAFFE num_output: 64 pad: 35 kernel_size: 3 } }
12 | layer { bottom: 'conv1_1' top: 'conv1_1' name: 'relu1_1' type: "ReLU" }
13 | layer { bottom: 'conv1_1' top: 'conv1_2' name: 'conv1_2' type: "Convolution"
14 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
15 | convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 } }
16 | layer { bottom: 'conv1_2' top: 'conv1_2' name: 'relu1_2' type: "ReLU" }
17 | layer { name: 'pool1' bottom: 'conv1_2' top: 'pool1' type: "Pooling"
18 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
19 |
20 | layer { name: 'conv2_1' bottom: 'pool1' top: 'conv2_1' type: "Convolution"
21 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
22 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
23 | layer { bottom: 'conv2_1' top: 'conv2_1' name: 'relu2_1' type: "ReLU" }
24 | layer { bottom: 'conv2_1' top: 'conv2_2' name: 'conv2_2' type: "Convolution"
25 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
26 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
27 | layer { bottom: 'conv2_2' top: 'conv2_2' name: 'relu2_2' type: "ReLU" }
28 | layer { bottom: 'conv2_2' top: 'pool2' name: 'pool2' type: "Pooling"
29 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
30 |
31 | layer { bottom: 'pool2' top: 'conv3_1' name: 'conv3_1' type: "Convolution"
32 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
33 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
34 | layer { bottom: 'conv3_1' top: 'conv3_1' name: 'relu3_1' type: "ReLU" }
35 | layer { bottom: 'conv3_1' top: 'conv3_2' name: 'conv3_2' type: "Convolution"
36 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
37 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
38 | layer { bottom: 'conv3_2' top: 'conv3_2' name: 'relu3_2' type: "ReLU" }
39 | layer { bottom: 'conv3_2' top: 'conv3_3' name: 'conv3_3' type: "Convolution"
40 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
41 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
42 | layer { bottom: 'conv3_3' top: 'conv3_3' name: 'relu3_3' type: "ReLU" }
43 | layer { bottom: 'conv3_3' top: 'pool3' name: 'pool3' type: "Pooling"
44 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
45 |
46 | layer { bottom: 'pool3' top: 'conv4_1' name: 'conv4_1' type: "Convolution"
47 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
48 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
49 | layer { bottom: 'conv4_1' top: 'conv4_1' name: 'relu4_1' type: "ReLU" }
50 | layer { bottom: 'conv4_1' top: 'conv4_2' name: 'conv4_2' type: "Convolution"
51 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
52 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
53 | layer { bottom: 'conv4_2' top: 'conv4_2' name: 'relu4_2' type: "ReLU" }
54 | layer { bottom: 'conv4_2' top: 'conv4_3' name: 'conv4_3' type: "Convolution"
55 | param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
56 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
57 | layer { bottom: 'conv4_3' top: 'conv4_3' name: 'relu4_3' type: "ReLU" }
58 | layer { bottom: 'conv4_3' top: 'pool4' name: 'pool4' type: "Pooling"
59 | pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
60 |
61 | layer { bottom: 'pool4' top: 'conv5_1' name: 'conv5_1' type: "Convolution"
62 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
63 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
64 | layer { bottom: 'conv5_1' top: 'conv5_1' name: 'relu5_1' type: "ReLU" }
65 | layer { bottom: 'conv5_1' top: 'conv5_2' name: 'conv5_2' type: "Convolution"
66 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
67 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
68 | layer { bottom: 'conv5_2' top: 'conv5_2' name: 'relu5_2' type: "ReLU" }
69 | layer { bottom: 'conv5_2' top: 'conv5_3' name: 'conv5_3' type: "Convolution"
70 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
71 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
72 | layer { bottom: 'conv5_3' top: 'conv5_3' name: 'relu5_3' type: "ReLU" }
73 |
74 | ## buffer layers for contour
75 | layer { bottom: 'conv1_2' top: 'conv_cbuf_1' name: 'conv_cbuf_1' type: "Convolution"
76 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
77 | convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 }}
78 | layer { bottom: 'conv_cbuf_1' top: 'conv_cbuf_1' name: 'relu_cbuf_1' type: "ReLU" }
79 | layer { bottom: 'conv2_2' top: 'conv_cbuf_2' name: 'conv_cbuf_2' type: "Convolution"
80 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
81 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 }}
82 | layer { bottom: 'conv_cbuf_2' top: 'conv_cbuf_2' name: 'relu_cbuf_2' type: "ReLU" }
83 | layer { bottom: 'conv3_3' top: 'conv_cbuf_3' name: 'conv_cbuf_3' type: "Convolution"
84 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
85 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 }}
86 | layer { bottom: 'conv_cbuf_3' top: 'conv_cbuf_3' name: 'relu_cbuf_3' type: "ReLU" }
87 | layer { bottom: 'conv4_3' top: 'conv_cbuf_4' name: 'conv_cbuf_4' type: "Convolution"
88 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
89 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 }}
90 | layer { bottom: 'conv_cbuf_4' top: 'conv_cbuf_4' name: 'relu_cbuf_4' type: "ReLU" }
91 | layer { bottom: 'conv5_3' top: 'conv_cbuf_5' name: 'conv_cbuf_5' type: "Convolution"
92 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
93 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 }}
94 | layer { bottom: 'conv_cbuf_5' top: 'conv_cbuf_5' name: 'relu_cbuf_5' type: "ReLU" }
95 |
96 | #-----
97 | layer { name: 'score-cbuf_dsn1' type: "Convolution" bottom: 'conv_cbuf_1' top: 'score-cbuf_dsn1'
98 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
99 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
100 | #----
101 | layer { name: 'score-cbuf_dsn2' type: "Convolution" bottom: 'conv_cbuf_2' top: 'score-cbuf_dsn2'
102 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
103 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
104 | #---
105 | layer { name: 'score-cbuf_dsn3' type: "Convolution" bottom: 'conv_cbuf_3' top: 'score-cbuf_dsn3'
106 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
107 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
108 | #--
109 | layer { name: 'score-cbuf_dsn4' type: "Convolution" bottom: 'conv_cbuf_4' top: 'score-cbuf_dsn4'
110 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
111 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
112 | #-
113 | layer { name: 'score-cbuf_dsn5' type: "Convolution" bottom: 'conv_cbuf_5' top: 'score-cbuf_dsn5'
114 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
115 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1} }
116 |
117 | layer{
118 | type: "Slice" name: "cbuf_slice5"
119 | bottom: "score-cbuf_dsn5"
120 | top: "score-cbuf_dsn5-slice1"
121 | top: "score-cbuf_dsn5-slice2"
122 | slice_param {
123 | axis: 1
124 | slice_point: 1
125 | }
126 | }
127 |
128 | # the loss of side output5
129 | layer { type: "Deconvolution" name: 'upsamplec_16' bottom: 'score-cbuf_dsn5-slice2' top: 'concat5-cbuf_score-up-loss'
130 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
131 | convolution_param { kernel_size: 32 stride: 16 num_output: 1 } }
132 | layer { type: "Crop" name: 'crop5-cbuf_loss' bottom: 'concat5-cbuf_score-up-loss' bottom: 'data' top: 'concat5-cbuf_score-loss' }
133 | layer { type: "Sigmoid" name: "sigmoid-cbuf_dsn5" bottom: "concat5-cbuf_score-loss" top:"sigmoid-cbuf_dsn5"}
134 |
135 | #-
136 | # 2x
137 | layer { type: "Deconvolution" name: 'upsamplec_5_4' bottom: 'score-cbuf_dsn5-slice1' top: 'score-cbuf_dsn5-up'
138 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
139 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
140 | layer { type: "Crop" name: 'cbuf_crop5' bottom: 'score-cbuf_dsn5-up' bottom: 'score-cbuf_dsn4' top: 'upscore-cbuf_dsn5' }
141 |
142 | layer { name: "concat_cbuf_5_4" bottom: "upscore-cbuf_dsn5" bottom: "score-cbuf_dsn4" top: "concat-cbuf_upscore4" type: "Concat"
143 | concat_param { concat_dim: 1} }
144 | layer {
145 | name: 'cat4-cbuf_score' type: "Convolution"
146 | bottom: 'concat-cbuf_upscore4' top: 'concat4-cbuf_score'
147 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
148 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
149 | }
150 |
151 | layer{
152 | type: "Slice" name: "scbuf_lice4"
153 | bottom: "concat4-cbuf_score"
154 | top: "concat4-cbuf_score-slice1"
155 | top: "concat4-cbuf_score-slice2"
156 | slice_param {
157 | axis: 1
158 | slice_point: 1
159 | }
160 | }
161 |
162 | # the loss of side output4
163 | layer { type: "Deconvolution" name: 'upsamplec_8' bottom: 'concat4-cbuf_score-slice2' top: 'concat4-cbuf_score-up-loss'
164 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
165 | convolution_param { kernel_size: 16 stride: 8 num_output: 1 } }
166 | layer { type: "Crop" name: 'crop4-cbuf_loss' bottom: 'concat4-cbuf_score-up-loss' bottom: 'data' top: 'concat4-cbuf_score-loss' }
167 | layer { type: "Sigmoid" name: "sigmoid-cbuf_dsn4" bottom: "concat4-cbuf_score-loss" top:"sigmoid-cbuf_dsn4"}
168 |
169 | #--
170 | # 2x
171 | layer { type: "Deconvolution" name: 'upsamplec_4_3' bottom: 'concat4-cbuf_score-slice1' top: 'score-cbuf_dsn4-up'
172 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
173 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
174 | layer { type: "Crop" name: 'cbuf_crop4' bottom: 'score-cbuf_dsn4-up' bottom: 'score-cbuf_dsn3' top: 'upscore-cbuf_dsn4' }
175 | layer { name: "concat_cbuf_4_3" bottom: "upscore-cbuf_dsn4" bottom: "score-cbuf_dsn3" top: "concat-cbuf_upscore3" type: "Concat"
176 | concat_param { concat_dim: 1} }
177 | layer {
178 | name: 'cat3-cbuf_score' type: "Convolution"
179 | bottom: 'concat-cbuf_upscore3' top: 'concat3-cbuf_score'
180 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
181 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
182 | }
183 |
184 | layer{
185 | type: "Slice" name: "cbuf_slice3"
186 | bottom: "concat3-cbuf_score"
187 | top: "concat3-cbuf_score-slice1"
188 | top: "concat3-cbuf_score-slice2"
189 | slice_param {
190 | axis: 1
191 | slice_point: 1
192 | }
193 | }
194 |
195 | # the loss of side output3
196 | layer { type: "Deconvolution" name: 'upsamplec_4' bottom: 'concat3-cbuf_score-slice2' top: 'concat3-cbuf_score-up-loss'
197 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
198 | convolution_param { kernel_size: 8 stride: 4 num_output: 1 } }
199 | layer { type: "Crop" name: 'crop3-cbuf_loss' bottom: 'concat3-cbuf_score-up-loss' bottom: 'data' top: 'concat3-cbuf_score-loss' }
200 | layer { type: "Sigmoid" name: "sigmoid-cbuf_dsn3" bottom: "concat3-cbuf_score-loss" top:"sigmoid-cbuf_dsn3"}
201 |
202 | #---
203 | # 2x
204 | layer { type: "Deconvolution" name: 'upsamplec_3_2' bottom: 'concat3-cbuf_score-slice1' top: 'score-cbuf_dsn3-up'
205 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
206 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
207 | layer { type: "Crop" name: 'cbuf_crop3' bottom: 'score-cbuf_dsn3-up' bottom: 'score-cbuf_dsn2' top: 'upscore-cbuf_dsn3' }
208 | layer { name: "concat_cbuf_3_2" bottom: "upscore-cbuf_dsn3" bottom: "score-cbuf_dsn2" top: "concat-cbuf_upscore2" type: "Concat"
209 | concat_param { concat_dim: 1} }
210 | layer {
211 | name: 'cat2-cbuf_score' type: "Convolution"
212 | bottom: 'concat-cbuf_upscore2' top: 'concat2-cbuf_score'
213 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
214 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
215 | }
216 |
217 | layer{
218 | type: "Slice" name: "cbuf_slice2"
219 | bottom: "concat2-cbuf_score"
220 | top: "concat2-cbuf_score-slice1"
221 | top: "concat2-cbuf_score-slice2"
222 | slice_param {
223 | axis: 1
224 | slice_point: 1
225 | }
226 | }
227 |
228 | # the loss of side output2
229 | layer { type: "Deconvolution" name: 'upsamplec_2' bottom: 'concat2-cbuf_score-slice2' top: 'concat2-cbuf_score-up-loss'
230 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
231 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
232 | layer { type: "Crop" name: 'crop2-cbuf_loss' bottom: 'concat2-cbuf_score-up-loss' bottom: 'data' top: 'concat2-cbuf_score-loss' }
233 | layer { type: "Sigmoid" name: "sigmoid-cbuf_dsn2" bottom: "concat2-cbuf_score-loss" top:"sigmoid-cbuf_dsn2"}
234 | #----
235 | layer { type: "Deconvolution" name: 'upsamplec_2_1' bottom: 'concat2-cbuf_score-slice1' top: 'score-cbuf_dsn2-up'
236 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
237 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
238 | layer { type: "Crop" name: 'cbuf_crop2' bottom: 'score-cbuf_dsn2-up' bottom: 'score-cbuf_dsn1' top: 'upscore-cbuf_dsn2' }
239 | layer { name: "concat_cbuf_2_1" bottom: "upscore-cbuf_dsn2" bottom: "score-cbuf_dsn1" top: "concat-cbuf_upscore1" type: "Concat"
240 | concat_param { concat_dim: 1} }
241 | layer {
242 | name: 'cat1-cbuf_score' type: "Convolution"
243 | bottom: 'concat-cbuf_upscore1' top: 'concat1-cbuf_score'
244 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
245 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
246 | }
247 |
248 | # the loss of side output1
249 | layer { type: "Crop" name: 'crop1-cbuf_loss' bottom: 'concat1-cbuf_score' bottom: 'data' top: 'concat1-cbuf_score-loss' }
250 | layer { type: "Sigmoid" name: "sigmoid-cbuf_dsn1" bottom: "concat1-cbuf_score-loss" top:"sigmoid-cbuf_dsn1"}
251 |
252 | #-----
253 |
254 |
255 | #-----------------------------------------------------------
256 | ### Concat and multiscale weight layer ###
257 | layer { name: "cbuf_concat" bottom: "concat1-cbuf_score-loss" bottom: "concat2-cbuf_score-loss" bottom: "concat3-cbuf_score-loss"
258 | bottom: "concat4-cbuf_score-loss" bottom: "concat5-cbuf_score-loss" top: "concat-cbuf_upscore" type: "Concat"
259 | concat_param { concat_dim: 1} }
260 | layer { name: 'new-cbuf_score-weighting' type: "Convolution" bottom: 'concat-cbuf_upscore' top: 'upscore-cbuf_fuse'
261 | param { lr_mult: 0.001 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
262 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.2} } }
263 | layer { type: "Sigmoid" name: "sigmoid-cbuf_fuse" bottom: "upscore-cbuf_fuse" top:"sigmoid-cbuf_fuse"}
264 |
265 |
266 |
267 | ## buffer layers for symmetry
268 | layer { bottom: 'conv1_2' top: 'conv_sbuf_1' name: 'conv_sbuf_1' type: "Convolution"
269 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
270 | convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 }}
271 | layer { bottom: 'conv_sbuf_1' top: 'conv_sbuf_1' name: 'relu_sbuf_1' type: "ReLU" }
272 | layer { bottom: 'conv2_2' top: 'conv_sbuf_2' name: 'conv_sbuf_2' type: "Convolution"
273 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
274 | convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 }}
275 | layer { bottom: 'conv_sbuf_2' top: 'conv_sbuf_2' name: 'relu_sbuf_2' type: "ReLU" }
276 | layer { bottom: 'conv3_3' top: 'conv_sbuf_3' name: 'conv_sbuf_3' type: "Convolution"
277 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
278 | convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 }}
279 | layer { bottom: 'conv_sbuf_3' top: 'conv_sbuf_3' name: 'relu_sbuf_3' type: "ReLU" }
280 | layer { bottom: 'conv4_3' top: 'conv_sbuf_4' name: 'conv_sbuf_4' type: "Convolution"
281 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
282 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 }}
283 | layer { bottom: 'conv_sbuf_4' top: 'conv_sbuf_4' name: 'relu_sbuf_4' type: "ReLU" }
284 | layer { bottom: 'conv5_3' top: 'conv_sbuf_5' name: 'conv_sbuf_5' type: "Convolution"
285 | param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
286 | convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 }}
287 | layer { bottom: 'conv_sbuf_5' top: 'conv_sbuf_5' name: 'relu_sbuf_5' type: "ReLU" }
288 |
289 |
290 |
291 | #-----
292 | layer { name: 'score-sbuf_dsn1' type: "Convolution" bottom: 'conv_sbuf_1' top: 'score-sbuf_dsn1'
293 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
294 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
295 | #----
296 | layer { name: 'score-sbuf_dsn2' type: "Convolution" bottom: 'conv_sbuf_2' top: 'score-sbuf_dsn2'
297 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
298 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
299 | #---
300 | layer { name: 'score-sbuf_dsn3' type: "Convolution" bottom: 'conv_sbuf_3' top: 'score-sbuf_dsn3'
301 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
302 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
303 | #--
304 | layer { name: 'score-sbuf_dsn4' type: "Convolution" bottom: 'conv_sbuf_4' top: 'score-sbuf_dsn4'
305 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
306 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 } }
307 | #-
308 | layer { name: 'score-sbuf_dsn5' type: "Convolution" bottom: 'conv_sbuf_5' top: 'score-sbuf_dsn5'
309 | param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
310 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1} }
311 |
312 | layer{
313 | type: "Slice" name: "sbuf_slice5"
314 | bottom: "score-sbuf_dsn5"
315 | top: "score-sbuf_dsn5-slice1"
316 | top: "score-sbuf_dsn5-slice2"
317 | slice_param {
318 | axis: 1
319 | slice_point: 1
320 | }
321 | }
322 |
323 | # the loss of side output5
324 | layer { type: "Deconvolution" name: 'upsamples_16' bottom: 'score-sbuf_dsn5-slice2' top: 'concat5-sbuf_score-up-loss'
325 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
326 | convolution_param { kernel_size: 32 stride: 16 num_output: 1 } }
327 | layer { type: "Crop" name: 'crop5-sbuf_loss' bottom: 'concat5-sbuf_score-up-loss' bottom: 'data' top: 'concat5-sbuf_score-loss' }
328 | layer { type: "Sigmoid" name: "sigmoid-sbuf_dsn5" bottom: "concat5-sbuf_score-loss" top:"sigmoid-sbuf_dsn5"}
329 |
330 | #-
331 | # 2x
332 | layer { type: "Deconvolution" name: 'upsamples_5_4' bottom: 'score-sbuf_dsn5-slice1' top: 'score-sbuf_dsn5-up'
333 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
334 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
335 | layer { type: "Crop" name: 'sbuf_crop5' bottom: 'score-sbuf_dsn5-up' bottom: 'score-sbuf_dsn4' top: 'upscore-sbuf_dsn5' }
336 |
337 | layer { name: "concat_sbuf_5_4" bottom: "upscore-sbuf_dsn5" bottom: "score-sbuf_dsn4" top: "concat-sbuf_upscore4" type: "Concat"
338 | concat_param { concat_dim: 1} }
339 | layer {
340 | name: 'cat4-sbuf_score' type: "Convolution"
341 | bottom: 'concat-sbuf_upscore4' top: 'concat4-sbuf_score'
342 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
343 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
344 | }
345 |
346 | layer{
347 | type: "Slice" name: "ssbuf_lice4"
348 | bottom: "concat4-sbuf_score"
349 | top: "concat4-sbuf_score-slice1"
350 | top: "concat4-sbuf_score-slice2"
351 | slice_param {
352 | axis: 1
353 | slice_point: 1
354 | }
355 | }
356 |
357 | # the loss of side output4
358 | layer { type: "Deconvolution" name: 'upsamples_8' bottom: 'concat4-sbuf_score-slice2' top: 'concat4-sbuf_score-up-loss'
359 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
360 | convolution_param { kernel_size: 16 stride: 8 num_output: 1 } }
361 | layer { type: "Crop" name: 'crop4-sbuf_loss' bottom: 'concat4-sbuf_score-up-loss' bottom: 'data' top: 'concat4-sbuf_score-loss' }
362 | layer { type: "Sigmoid" name: "sigmoid-sbuf_dsn4" bottom: "concat4-sbuf_score-loss" top:"sigmoid-sbuf_dsn4"}
363 |
364 | #--
365 | # 2x
366 | layer { type: "Deconvolution" name: 'upsamples_4_3' bottom: 'concat4-sbuf_score-slice1' top: 'score-sbuf_dsn4-up'
367 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
368 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
369 | layer { type: "Crop" name: 'sbuf_crop4' bottom: 'score-sbuf_dsn4-up' bottom: 'score-sbuf_dsn3' top: 'upscore-sbuf_dsn4' }
370 | layer { name: "concat_sbuf_4_3" bottom: "upscore-sbuf_dsn4" bottom: "score-sbuf_dsn3" top: "concat-sbuf_upscore3" type: "Concat"
371 | concat_param { concat_dim: 1} }
372 | layer {
373 | name: 'cat3-sbuf_score' type: "Convolution"
374 | bottom: 'concat-sbuf_upscore3' top: 'concat3-sbuf_score'
375 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
376 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
377 | }
378 |
379 | layer{
380 | type: "Slice" name: "sbuf_slice3"
381 | bottom: "concat3-sbuf_score"
382 | top: "concat3-sbuf_score-slice1"
383 | top: "concat3-sbuf_score-slice2"
384 | slice_param {
385 | axis: 1
386 | slice_point: 1
387 | }
388 | }
389 |
390 | # the loss of side output3
391 | layer { type: "Deconvolution" name: 'upsamples_4' bottom: 'concat3-sbuf_score-slice2' top: 'concat3-sbuf_score-up-loss'
392 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
393 | convolution_param { kernel_size: 8 stride: 4 num_output: 1 } }
394 | layer { type: "Crop" name: 'crop3-sbuf_loss' bottom: 'concat3-sbuf_score-up-loss' bottom: 'data' top: 'concat3-sbuf_score-loss' }
395 | layer { type: "Sigmoid" name: "sigmoid-sbuf_dsn3" bottom: "concat3-sbuf_score-loss" top:"sigmoid-sbuf_dsn3"}
396 |
397 | #---
398 | # 2x
399 | layer { type: "Deconvolution" name: 'upsamples_3_2' bottom: 'concat3-sbuf_score-slice1' top: 'score-sbuf_dsn3-up'
400 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
401 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
402 | layer { type: "Crop" name: 'sbuf_crop3' bottom: 'score-sbuf_dsn3-up' bottom: 'score-sbuf_dsn2' top: 'upscore-sbuf_dsn3' }
403 | layer { name: "concat_sbuf_3_2" bottom: "upscore-sbuf_dsn3" bottom: "score-sbuf_dsn2" top: "concat-sbuf_upscore2" type: "Concat"
404 | concat_param { concat_dim: 1} }
405 | layer {
406 | name: 'cat2-sbuf_score' type: "Convolution"
407 | bottom: 'concat-sbuf_upscore2' top: 'concat2-sbuf_score'
408 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
409 | convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
410 | }
411 |
412 | layer{
413 | type: "Slice" name: "sbuf_slice2"
414 | bottom: "concat2-sbuf_score"
415 | top: "concat2-sbuf_score-slice1"
416 | top: "concat2-sbuf_score-slice2"
417 | slice_param {
418 | axis: 1
419 | slice_point: 1
420 | }
421 | }
422 |
423 | # the loss of side output2
424 | layer { type: "Deconvolution" name: 'upsamples_2' bottom: 'concat2-sbuf_score-slice2' top: 'concat2-sbuf_score-up-loss'
425 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
426 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
427 | layer { type: "Crop" name: 'crop2-sbuf_loss' bottom: 'concat2-sbuf_score-up-loss' bottom: 'data' top: 'concat2-sbuf_score-loss' }
428 | layer { type: "Sigmoid" name: "sigmoid-sbuf_dsn2" bottom: "concat2-sbuf_score-loss" top:"sigmoid-sbuf_dsn2"}
429 | #----
430 | layer { type: "Deconvolution" name: 'upsamples_2_1' bottom: 'concat2-sbuf_score-slice1' top: 'score-sbuf_dsn2-up'
431 | param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
432 | convolution_param { kernel_size: 4 stride: 2 num_output: 1 } }
433 | layer { type: "Crop" name: 'sbuf_crop2' bottom: 'score-sbuf_dsn2-up' bottom: 'score-sbuf_dsn1' top: 'upscore-sbuf_dsn2' }
434 | layer { name: "concat_sbuf_2_1" bottom: "upscore-sbuf_dsn2" bottom: "score-sbuf_dsn1" top: "concat-sbuf_upscore1" type: "Concat"
435 | concat_param { concat_dim: 1} }
436 | layer {
437 | name: 'cat1-sbuf_score' type: "Convolution"
438 | bottom: 'concat-sbuf_upscore1' top: 'concat1-sbuf_score'
439 | param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
440 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
441 | }
442 |
443 | # the loss of side output1
444 | layer { type: "Crop" name: 'crop1-sbuf_loss' bottom: 'concat1-sbuf_score' bottom: 'data' top: 'concat1-sbuf_score-loss' }
445 | layer { type: "Sigmoid" name: "sigmoid-sbuf_dsn1" bottom: "concat1-sbuf_score-loss" top:"sigmoid-sbuf_dsn1"}
446 |
447 | #-----
448 |
449 |
450 | #-----------------------------------------------------------
451 | ### Concat and multiscale weight layer ###
452 | layer { name: "sbuf_concat" bottom: "concat1-sbuf_score-loss" bottom: "concat2-sbuf_score-loss" bottom: "concat3-sbuf_score-loss"
453 | bottom: "concat4-sbuf_score-loss" bottom: "concat5-sbuf_score-loss" top: "concat-sbuf_upscore" type: "Concat"
454 | concat_param { concat_dim: 1} }
455 | layer { name: 'new-sbuf_score-weighting' type: "Convolution" bottom: 'concat-sbuf_upscore' top: 'upscore-sbuf_fuse'
456 | param { lr_mult: 0.001 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
457 | convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.2} } }
458 | layer { type: "Sigmoid" name: "sigmoid-sbuf_fuse" bottom: "upscore-sbuf_fuse" top:"sigmoid-sbuf_fuse"}
--------------------------------------------------------------------------------