├── .DS_Store
├── README.md
├── cr_idx.m
├── cr_train_list.m
├── deploy.prototxt
├── f.sh
├── feature_ex.m
├── imagenet_wordvec.mat
├── inference.m
├── material
└── overview.png
├── prepare_image.m
├── solver.prototxt
├── source_target_img_name_lab.mat
└── train.prototxt
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiangeluo/fsl-hierarchy/f85e44316383a714449d58a8de2e5a6d38062fe9/.DS_Store
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Large-Scale Few-Shot Learning: Knowledge Transfer With Class Hierarchy
2 | Created by Aoxue Li*, Tiange Luo*, Zhiwu Lu, Tao Xiang, Liwei Wang
3 |
4 | 
5 |
6 | ## Usage
7 | 1. install caffe and matcaffe via https://github.com/BVLC/caffe
8 |
9 | 2. construct class hierarchy by cr_idx.m
10 |
11 | 3. obtain train images and their class/superclass labels by cr_train_list.m
12 |
13 | 4. train feature learning model by f.sh
14 |
15 | 5. feature extraction by feature_ex.m
16 |
17 | 6. label inference by the nearest neighbor search by run inference.m
18 |
19 | ## Citation
20 | If you find our work useful in your research, please consider citing:
21 | ```
22 | @inproceedings{li2019large,
23 | title={Large-Scale Few-Shot Learning: Knowledge Transfer With Class Hierarchy},
24 | author={Li, Aoxue and Luo, Tiange and Lu, Zhiwu and Xiang, Tao and Wang, Liwei},
25 | booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
26 | pages={7212--7220},
27 | year={2019}
28 | }
29 | ```
30 |
--------------------------------------------------------------------------------
/cr_idx.m:
--------------------------------------------------------------------------------
1 | %% create hierarchy
2 |
3 | load imagenet_wordvec.mat
4 | IDX=zeros(1000,3);
5 | t0=kmeans([imagenet1000wordvec],200);IDX(:,1)=t0';
6 | w2v1=zeros(200,1000);w2v2=zeros(40,1000);w2v3=zeros(8,1000);
7 | for i=1:200
8 | tmp=find(t0==i);
9 | w2v1(i,:)=mean(imagenet1000wordvec(tmp,:),1);
10 | end
11 | t1=kmeans(w2v1,40);
12 | for ii=1:40
13 | tmp1=find(t1==ii);
14 | w2v2(ii,:)=mean(w2v1(tmp1,:),1);
15 | end
16 | t2=kmeans(w2v2,8);
17 | for iii=1:8
18 | tmp2=find(t2==iii);
19 | w2v3(iii,:)=mean(w2v2(tmp2,:),1);
20 | end
21 | IDX(:,2)=t1(t0(1:1000))';IDX(:,3)=t2(t1(t0(1:1000)))';
22 |
23 | save('./IDX_4.mat','IDX');
24 |
25 |
--------------------------------------------------------------------------------
/cr_train_list.m:
--------------------------------------------------------------------------------
1 | clear
2 | clc
3 | root_dir='xxx'; % root dir, might be '/home/code/caffe_master'
4 | load source_target_img_name_lab.mat
5 | load IDX_4.mat
6 | image_dir_train=[root_dir '/KTCH/data/source'];
7 | tmp=randperm(200*1000);
8 | fid=fopen('train.txt','w');
9 | for i=1:length(source_img_name)
10 | imagename=[image_dir_train '/' source_img_name{tmp(i)}];
11 | fprintf(fid,'%s %d\n',imagename,source_label(tmp(i))-1);
12 | end
13 | fclose(fid);
14 |
15 | fid=fopen('train_1.txt','w');
16 | for i=1:length(source_img_name)
17 | imagename=[image_dir_train '/' source_img_name{tmp(i)}];
18 | fprintf(fid,'%s %d\n',imagename,IDX(source_label(tmp(i)),1)-1);
19 | end
20 | fclose(fid);
21 |
22 | fid=fopen('train_2.txt','w');
23 | for i=1:length(train_img_name)
24 | imagename=[image_dir_train '/' source_img_name{tmp(i)}];
25 | fprintf(fid,'%s %d\n',imagename,IDX(source_label(tmp(i)),2)-1);
26 | end
27 | fclose(fid);
28 |
29 | fid=fopen('train_3.txt','w');
30 | for i=1:length(train_img_name)
31 | imagename=[image_dir_train '/' source_img_name{tmp(i)}];
32 | fprintf(fid,'%s %d\n',imagename,IDX(source_label(tmp(i)),3)-1);
33 | end
34 | fclose(fid);
35 |
--------------------------------------------------------------------------------
/deploy.prototxt:
--------------------------------------------------------------------------------
1 | name: "ResNet-50"
2 | input: "data"
3 | input_dim: 1
4 | input_dim: 3
5 | input_dim: 224
6 | input_dim: 224
7 |
8 | layer {
9 | bottom: "data"
10 | top: "conv1"
11 | name: "conv1"
12 | type: "Convolution"
13 | convolution_param {
14 | num_output: 64
15 | kernel_size: 7
16 | pad: 3
17 | stride: 2
18 | }
19 | }
20 |
21 | layer {
22 | bottom: "conv1"
23 | top: "conv1"
24 | name: "bn_conv1"
25 | type: "BatchNorm"
26 | batch_norm_param {
27 | use_global_stats: true
28 | }
29 | }
30 |
31 | layer {
32 | bottom: "conv1"
33 | top: "conv1"
34 | name: "scale_conv1"
35 | type: "Scale"
36 | scale_param {
37 | bias_term: true
38 | }
39 | }
40 |
41 | layer {
42 | bottom: "conv1"
43 | top: "conv1"
44 | name: "conv1_relu"
45 | type: "ReLU"
46 | }
47 |
48 | layer {
49 | bottom: "conv1"
50 | top: "pool1"
51 | name: "pool1"
52 | type: "Pooling"
53 | pooling_param {
54 | kernel_size: 3
55 | stride: 2
56 | pool: MAX
57 | }
58 | }
59 |
60 | layer {
61 | bottom: "pool1"
62 | top: "res2a_branch1"
63 | name: "res2a_branch1"
64 | type: "Convolution"
65 | convolution_param {
66 | num_output: 256
67 | kernel_size: 1
68 | pad: 0
69 | stride: 1
70 | bias_term: false
71 | }
72 | }
73 |
74 | layer {
75 | bottom: "res2a_branch1"
76 | top: "res2a_branch1"
77 | name: "bn2a_branch1"
78 | type: "BatchNorm"
79 | batch_norm_param {
80 | use_global_stats: true
81 | }
82 | }
83 |
84 | layer {
85 | bottom: "res2a_branch1"
86 | top: "res2a_branch1"
87 | name: "scale2a_branch1"
88 | type: "Scale"
89 | scale_param {
90 | bias_term: true
91 | }
92 | }
93 |
94 | layer {
95 | bottom: "pool1"
96 | top: "res2a_branch2a"
97 | name: "res2a_branch2a"
98 | type: "Convolution"
99 | convolution_param {
100 | num_output: 64
101 | kernel_size: 1
102 | pad: 0
103 | stride: 1
104 | bias_term: false
105 | }
106 | }
107 |
108 | layer {
109 | bottom: "res2a_branch2a"
110 | top: "res2a_branch2a"
111 | name: "bn2a_branch2a"
112 | type: "BatchNorm"
113 | batch_norm_param {
114 | use_global_stats: true
115 | }
116 | }
117 |
118 | layer {
119 | bottom: "res2a_branch2a"
120 | top: "res2a_branch2a"
121 | name: "scale2a_branch2a"
122 | type: "Scale"
123 | scale_param {
124 | bias_term: true
125 | }
126 | }
127 |
128 | layer {
129 | bottom: "res2a_branch2a"
130 | top: "res2a_branch2a"
131 | name: "res2a_branch2a_relu"
132 | type: "ReLU"
133 | }
134 |
135 | layer {
136 | bottom: "res2a_branch2a"
137 | top: "res2a_branch2b"
138 | name: "res2a_branch2b"
139 | type: "Convolution"
140 | convolution_param {
141 | num_output: 64
142 | kernel_size: 3
143 | pad: 1
144 | stride: 1
145 | bias_term: false
146 | }
147 | }
148 |
149 | layer {
150 | bottom: "res2a_branch2b"
151 | top: "res2a_branch2b"
152 | name: "bn2a_branch2b"
153 | type: "BatchNorm"
154 | batch_norm_param {
155 | use_global_stats: true
156 | }
157 | }
158 |
159 | layer {
160 | bottom: "res2a_branch2b"
161 | top: "res2a_branch2b"
162 | name: "scale2a_branch2b"
163 | type: "Scale"
164 | scale_param {
165 | bias_term: true
166 | }
167 | }
168 |
169 | layer {
170 | bottom: "res2a_branch2b"
171 | top: "res2a_branch2b"
172 | name: "res2a_branch2b_relu"
173 | type: "ReLU"
174 | }
175 |
176 | layer {
177 | bottom: "res2a_branch2b"
178 | top: "res2a_branch2c"
179 | name: "res2a_branch2c"
180 | type: "Convolution"
181 | convolution_param {
182 | num_output: 256
183 | kernel_size: 1
184 | pad: 0
185 | stride: 1
186 | bias_term: false
187 | }
188 | }
189 |
190 | layer {
191 | bottom: "res2a_branch2c"
192 | top: "res2a_branch2c"
193 | name: "bn2a_branch2c"
194 | type: "BatchNorm"
195 | batch_norm_param {
196 | use_global_stats: true
197 | }
198 | }
199 |
200 | layer {
201 | bottom: "res2a_branch2c"
202 | top: "res2a_branch2c"
203 | name: "scale2a_branch2c"
204 | type: "Scale"
205 | scale_param {
206 | bias_term: true
207 | }
208 | }
209 |
210 | layer {
211 | bottom: "res2a_branch1"
212 | bottom: "res2a_branch2c"
213 | top: "res2a"
214 | name: "res2a"
215 | type: "Eltwise"
216 | }
217 |
218 | layer {
219 | bottom: "res2a"
220 | top: "res2a"
221 | name: "res2a_relu"
222 | type: "ReLU"
223 | }
224 |
225 | layer {
226 | bottom: "res2a"
227 | top: "res2b_branch2a"
228 | name: "res2b_branch2a"
229 | type: "Convolution"
230 | convolution_param {
231 | num_output: 64
232 | kernel_size: 1
233 | pad: 0
234 | stride: 1
235 | bias_term: false
236 | }
237 | }
238 |
239 | layer {
240 | bottom: "res2b_branch2a"
241 | top: "res2b_branch2a"
242 | name: "bn2b_branch2a"
243 | type: "BatchNorm"
244 | batch_norm_param {
245 | use_global_stats: true
246 | }
247 | }
248 |
249 | layer {
250 | bottom: "res2b_branch2a"
251 | top: "res2b_branch2a"
252 | name: "scale2b_branch2a"
253 | type: "Scale"
254 | scale_param {
255 | bias_term: true
256 | }
257 | }
258 |
259 | layer {
260 | bottom: "res2b_branch2a"
261 | top: "res2b_branch2a"
262 | name: "res2b_branch2a_relu"
263 | type: "ReLU"
264 | }
265 |
266 | layer {
267 | bottom: "res2b_branch2a"
268 | top: "res2b_branch2b"
269 | name: "res2b_branch2b"
270 | type: "Convolution"
271 | convolution_param {
272 | num_output: 64
273 | kernel_size: 3
274 | pad: 1
275 | stride: 1
276 | bias_term: false
277 | }
278 | }
279 |
280 | layer {
281 | bottom: "res2b_branch2b"
282 | top: "res2b_branch2b"
283 | name: "bn2b_branch2b"
284 | type: "BatchNorm"
285 | batch_norm_param {
286 | use_global_stats: true
287 | }
288 | }
289 |
290 | layer {
291 | bottom: "res2b_branch2b"
292 | top: "res2b_branch2b"
293 | name: "scale2b_branch2b"
294 | type: "Scale"
295 | scale_param {
296 | bias_term: true
297 | }
298 | }
299 |
300 | layer {
301 | bottom: "res2b_branch2b"
302 | top: "res2b_branch2b"
303 | name: "res2b_branch2b_relu"
304 | type: "ReLU"
305 | }
306 |
307 | layer {
308 | bottom: "res2b_branch2b"
309 | top: "res2b_branch2c"
310 | name: "res2b_branch2c"
311 | type: "Convolution"
312 | convolution_param {
313 | num_output: 256
314 | kernel_size: 1
315 | pad: 0
316 | stride: 1
317 | bias_term: false
318 | }
319 | }
320 |
321 | layer {
322 | bottom: "res2b_branch2c"
323 | top: "res2b_branch2c"
324 | name: "bn2b_branch2c"
325 | type: "BatchNorm"
326 | batch_norm_param {
327 | use_global_stats: true
328 | }
329 | }
330 |
331 | layer {
332 | bottom: "res2b_branch2c"
333 | top: "res2b_branch2c"
334 | name: "scale2b_branch2c"
335 | type: "Scale"
336 | scale_param {
337 | bias_term: true
338 | }
339 | }
340 |
341 | layer {
342 | bottom: "res2a"
343 | bottom: "res2b_branch2c"
344 | top: "res2b"
345 | name: "res2b"
346 | type: "Eltwise"
347 | }
348 |
349 | layer {
350 | bottom: "res2b"
351 | top: "res2b"
352 | name: "res2b_relu"
353 | type: "ReLU"
354 | }
355 |
356 | layer {
357 | bottom: "res2b"
358 | top: "res2c_branch2a"
359 | name: "res2c_branch2a"
360 | type: "Convolution"
361 | convolution_param {
362 | num_output: 64
363 | kernel_size: 1
364 | pad: 0
365 | stride: 1
366 | bias_term: false
367 | }
368 | }
369 |
370 | layer {
371 | bottom: "res2c_branch2a"
372 | top: "res2c_branch2a"
373 | name: "bn2c_branch2a"
374 | type: "BatchNorm"
375 | batch_norm_param {
376 | use_global_stats: true
377 | }
378 | }
379 |
380 | layer {
381 | bottom: "res2c_branch2a"
382 | top: "res2c_branch2a"
383 | name: "scale2c_branch2a"
384 | type: "Scale"
385 | scale_param {
386 | bias_term: true
387 | }
388 | }
389 |
390 | layer {
391 | bottom: "res2c_branch2a"
392 | top: "res2c_branch2a"
393 | name: "res2c_branch2a_relu"
394 | type: "ReLU"
395 | }
396 |
397 | layer {
398 | bottom: "res2c_branch2a"
399 | top: "res2c_branch2b"
400 | name: "res2c_branch2b"
401 | type: "Convolution"
402 | convolution_param {
403 | num_output: 64
404 | kernel_size: 3
405 | pad: 1
406 | stride: 1
407 | bias_term: false
408 | }
409 | }
410 |
411 | layer {
412 | bottom: "res2c_branch2b"
413 | top: "res2c_branch2b"
414 | name: "bn2c_branch2b"
415 | type: "BatchNorm"
416 | batch_norm_param {
417 | use_global_stats: true
418 | }
419 | }
420 |
421 | layer {
422 | bottom: "res2c_branch2b"
423 | top: "res2c_branch2b"
424 | name: "scale2c_branch2b"
425 | type: "Scale"
426 | scale_param {
427 | bias_term: true
428 | }
429 | }
430 |
431 | layer {
432 | bottom: "res2c_branch2b"
433 | top: "res2c_branch2b"
434 | name: "res2c_branch2b_relu"
435 | type: "ReLU"
436 | }
437 |
438 | layer {
439 | bottom: "res2c_branch2b"
440 | top: "res2c_branch2c"
441 | name: "res2c_branch2c"
442 | type: "Convolution"
443 | convolution_param {
444 | num_output: 256
445 | kernel_size: 1
446 | pad: 0
447 | stride: 1
448 | bias_term: false
449 | }
450 | }
451 |
452 | layer {
453 | bottom: "res2c_branch2c"
454 | top: "res2c_branch2c"
455 | name: "bn2c_branch2c"
456 | type: "BatchNorm"
457 | batch_norm_param {
458 | use_global_stats: true
459 | }
460 | }
461 |
462 | layer {
463 | bottom: "res2c_branch2c"
464 | top: "res2c_branch2c"
465 | name: "scale2c_branch2c"
466 | type: "Scale"
467 | scale_param {
468 | bias_term: true
469 | }
470 | }
471 |
472 | layer {
473 | bottom: "res2b"
474 | bottom: "res2c_branch2c"
475 | top: "res2c"
476 | name: "res2c"
477 | type: "Eltwise"
478 | }
479 |
480 | layer {
481 | bottom: "res2c"
482 | top: "res2c"
483 | name: "res2c_relu"
484 | type: "ReLU"
485 | }
486 |
487 | layer {
488 | bottom: "res2c"
489 | top: "res3a_branch1"
490 | name: "res3a_branch1"
491 | type: "Convolution"
492 | convolution_param {
493 | num_output: 512
494 | kernel_size: 1
495 | pad: 0
496 | stride: 2
497 | bias_term: false
498 | }
499 | }
500 |
501 | layer {
502 | bottom: "res3a_branch1"
503 | top: "res3a_branch1"
504 | name: "bn3a_branch1"
505 | type: "BatchNorm"
506 | batch_norm_param {
507 | use_global_stats: true
508 | }
509 | }
510 |
511 | layer {
512 | bottom: "res3a_branch1"
513 | top: "res3a_branch1"
514 | name: "scale3a_branch1"
515 | type: "Scale"
516 | scale_param {
517 | bias_term: true
518 | }
519 | }
520 |
521 | layer {
522 | bottom: "res2c"
523 | top: "res3a_branch2a"
524 | name: "res3a_branch2a"
525 | type: "Convolution"
526 | convolution_param {
527 | num_output: 128
528 | kernel_size: 1
529 | pad: 0
530 | stride: 2
531 | bias_term: false
532 | }
533 | }
534 |
535 | layer {
536 | bottom: "res3a_branch2a"
537 | top: "res3a_branch2a"
538 | name: "bn3a_branch2a"
539 | type: "BatchNorm"
540 | batch_norm_param {
541 | use_global_stats: true
542 | }
543 | }
544 |
545 | layer {
546 | bottom: "res3a_branch2a"
547 | top: "res3a_branch2a"
548 | name: "scale3a_branch2a"
549 | type: "Scale"
550 | scale_param {
551 | bias_term: true
552 | }
553 | }
554 |
555 | layer {
556 | bottom: "res3a_branch2a"
557 | top: "res3a_branch2a"
558 | name: "res3a_branch2a_relu"
559 | type: "ReLU"
560 | }
561 |
562 | layer {
563 | bottom: "res3a_branch2a"
564 | top: "res3a_branch2b"
565 | name: "res3a_branch2b"
566 | type: "Convolution"
567 | convolution_param {
568 | num_output: 128
569 | kernel_size: 3
570 | pad: 1
571 | stride: 1
572 | bias_term: false
573 | }
574 | }
575 |
576 | layer {
577 | bottom: "res3a_branch2b"
578 | top: "res3a_branch2b"
579 | name: "bn3a_branch2b"
580 | type: "BatchNorm"
581 | batch_norm_param {
582 | use_global_stats: true
583 | }
584 | }
585 |
586 | layer {
587 | bottom: "res3a_branch2b"
588 | top: "res3a_branch2b"
589 | name: "scale3a_branch2b"
590 | type: "Scale"
591 | scale_param {
592 | bias_term: true
593 | }
594 | }
595 |
596 | layer {
597 | bottom: "res3a_branch2b"
598 | top: "res3a_branch2b"
599 | name: "res3a_branch2b_relu"
600 | type: "ReLU"
601 | }
602 |
603 | layer {
604 | bottom: "res3a_branch2b"
605 | top: "res3a_branch2c"
606 | name: "res3a_branch2c"
607 | type: "Convolution"
608 | convolution_param {
609 | num_output: 512
610 | kernel_size: 1
611 | pad: 0
612 | stride: 1
613 | bias_term: false
614 | }
615 | }
616 |
617 | layer {
618 | bottom: "res3a_branch2c"
619 | top: "res3a_branch2c"
620 | name: "bn3a_branch2c"
621 | type: "BatchNorm"
622 | batch_norm_param {
623 | use_global_stats: true
624 | }
625 | }
626 |
627 | layer {
628 | bottom: "res3a_branch2c"
629 | top: "res3a_branch2c"
630 | name: "scale3a_branch2c"
631 | type: "Scale"
632 | scale_param {
633 | bias_term: true
634 | }
635 | }
636 |
637 | layer {
638 | bottom: "res3a_branch1"
639 | bottom: "res3a_branch2c"
640 | top: "res3a"
641 | name: "res3a"
642 | type: "Eltwise"
643 | }
644 |
645 | layer {
646 | bottom: "res3a"
647 | top: "res3a"
648 | name: "res3a_relu"
649 | type: "ReLU"
650 | }
651 |
652 | layer {
653 | bottom: "res3a"
654 | top: "res3b_branch2a"
655 | name: "res3b_branch2a"
656 | type: "Convolution"
657 | convolution_param {
658 | num_output: 128
659 | kernel_size: 1
660 | pad: 0
661 | stride: 1
662 | bias_term: false
663 | }
664 | }
665 |
666 | layer {
667 | bottom: "res3b_branch2a"
668 | top: "res3b_branch2a"
669 | name: "bn3b_branch2a"
670 | type: "BatchNorm"
671 | batch_norm_param {
672 | use_global_stats: true
673 | }
674 | }
675 |
676 | layer {
677 | bottom: "res3b_branch2a"
678 | top: "res3b_branch2a"
679 | name: "scale3b_branch2a"
680 | type: "Scale"
681 | scale_param {
682 | bias_term: true
683 | }
684 | }
685 |
686 | layer {
687 | bottom: "res3b_branch2a"
688 | top: "res3b_branch2a"
689 | name: "res3b_branch2a_relu"
690 | type: "ReLU"
691 | }
692 |
693 | layer {
694 | bottom: "res3b_branch2a"
695 | top: "res3b_branch2b"
696 | name: "res3b_branch2b"
697 | type: "Convolution"
698 | convolution_param {
699 | num_output: 128
700 | kernel_size: 3
701 | pad: 1
702 | stride: 1
703 | bias_term: false
704 | }
705 | }
706 |
707 | layer {
708 | bottom: "res3b_branch2b"
709 | top: "res3b_branch2b"
710 | name: "bn3b_branch2b"
711 | type: "BatchNorm"
712 | batch_norm_param {
713 | use_global_stats: true
714 | }
715 | }
716 |
717 | layer {
718 | bottom: "res3b_branch2b"
719 | top: "res3b_branch2b"
720 | name: "scale3b_branch2b"
721 | type: "Scale"
722 | scale_param {
723 | bias_term: true
724 | }
725 | }
726 |
727 | layer {
728 | bottom: "res3b_branch2b"
729 | top: "res3b_branch2b"
730 | name: "res3b_branch2b_relu"
731 | type: "ReLU"
732 | }
733 |
734 | layer {
735 | bottom: "res3b_branch2b"
736 | top: "res3b_branch2c"
737 | name: "res3b_branch2c"
738 | type: "Convolution"
739 | convolution_param {
740 | num_output: 512
741 | kernel_size: 1
742 | pad: 0
743 | stride: 1
744 | bias_term: false
745 | }
746 | }
747 |
748 | layer {
749 | bottom: "res3b_branch2c"
750 | top: "res3b_branch2c"
751 | name: "bn3b_branch2c"
752 | type: "BatchNorm"
753 | batch_norm_param {
754 | use_global_stats: true
755 | }
756 | }
757 |
758 | layer {
759 | bottom: "res3b_branch2c"
760 | top: "res3b_branch2c"
761 | name: "scale3b_branch2c"
762 | type: "Scale"
763 | scale_param {
764 | bias_term: true
765 | }
766 | }
767 |
768 | layer {
769 | bottom: "res3a"
770 | bottom: "res3b_branch2c"
771 | top: "res3b"
772 | name: "res3b"
773 | type: "Eltwise"
774 | }
775 |
776 | layer {
777 | bottom: "res3b"
778 | top: "res3b"
779 | name: "res3b_relu"
780 | type: "ReLU"
781 | }
782 |
783 | layer {
784 | bottom: "res3b"
785 | top: "res3c_branch2a"
786 | name: "res3c_branch2a"
787 | type: "Convolution"
788 | convolution_param {
789 | num_output: 128
790 | kernel_size: 1
791 | pad: 0
792 | stride: 1
793 | bias_term: false
794 | }
795 | }
796 |
797 | layer {
798 | bottom: "res3c_branch2a"
799 | top: "res3c_branch2a"
800 | name: "bn3c_branch2a"
801 | type: "BatchNorm"
802 | batch_norm_param {
803 | use_global_stats: true
804 | }
805 | }
806 |
807 | layer {
808 | bottom: "res3c_branch2a"
809 | top: "res3c_branch2a"
810 | name: "scale3c_branch2a"
811 | type: "Scale"
812 | scale_param {
813 | bias_term: true
814 | }
815 | }
816 |
817 | layer {
818 | bottom: "res3c_branch2a"
819 | top: "res3c_branch2a"
820 | name: "res3c_branch2a_relu"
821 | type: "ReLU"
822 | }
823 |
824 | layer {
825 | bottom: "res3c_branch2a"
826 | top: "res3c_branch2b"
827 | name: "res3c_branch2b"
828 | type: "Convolution"
829 | convolution_param {
830 | num_output: 128
831 | kernel_size: 3
832 | pad: 1
833 | stride: 1
834 | bias_term: false
835 | }
836 | }
837 |
838 | layer {
839 | bottom: "res3c_branch2b"
840 | top: "res3c_branch2b"
841 | name: "bn3c_branch2b"
842 | type: "BatchNorm"
843 | batch_norm_param {
844 | use_global_stats: true
845 | }
846 | }
847 |
848 | layer {
849 | bottom: "res3c_branch2b"
850 | top: "res3c_branch2b"
851 | name: "scale3c_branch2b"
852 | type: "Scale"
853 | scale_param {
854 | bias_term: true
855 | }
856 | }
857 |
858 | layer {
859 | bottom: "res3c_branch2b"
860 | top: "res3c_branch2b"
861 | name: "res3c_branch2b_relu"
862 | type: "ReLU"
863 | }
864 |
865 | layer {
866 | bottom: "res3c_branch2b"
867 | top: "res3c_branch2c"
868 | name: "res3c_branch2c"
869 | type: "Convolution"
870 | convolution_param {
871 | num_output: 512
872 | kernel_size: 1
873 | pad: 0
874 | stride: 1
875 | bias_term: false
876 | }
877 | }
878 |
879 | layer {
880 | bottom: "res3c_branch2c"
881 | top: "res3c_branch2c"
882 | name: "bn3c_branch2c"
883 | type: "BatchNorm"
884 | batch_norm_param {
885 | use_global_stats: true
886 | }
887 | }
888 |
889 | layer {
890 | bottom: "res3c_branch2c"
891 | top: "res3c_branch2c"
892 | name: "scale3c_branch2c"
893 | type: "Scale"
894 | scale_param {
895 | bias_term: true
896 | }
897 | }
898 |
899 | layer {
900 | bottom: "res3b"
901 | bottom: "res3c_branch2c"
902 | top: "res3c"
903 | name: "res3c"
904 | type: "Eltwise"
905 | }
906 |
907 | layer {
908 | bottom: "res3c"
909 | top: "res3c"
910 | name: "res3c_relu"
911 | type: "ReLU"
912 | }
913 |
914 | layer {
915 | bottom: "res3c"
916 | top: "res3d_branch2a"
917 | name: "res3d_branch2a"
918 | type: "Convolution"
919 | convolution_param {
920 | num_output: 128
921 | kernel_size: 1
922 | pad: 0
923 | stride: 1
924 | bias_term: false
925 | }
926 | }
927 |
928 | layer {
929 | bottom: "res3d_branch2a"
930 | top: "res3d_branch2a"
931 | name: "bn3d_branch2a"
932 | type: "BatchNorm"
933 | batch_norm_param {
934 | use_global_stats: true
935 | }
936 | }
937 |
938 | layer {
939 | bottom: "res3d_branch2a"
940 | top: "res3d_branch2a"
941 | name: "scale3d_branch2a"
942 | type: "Scale"
943 | scale_param {
944 | bias_term: true
945 | }
946 | }
947 |
948 | layer {
949 | bottom: "res3d_branch2a"
950 | top: "res3d_branch2a"
951 | name: "res3d_branch2a_relu"
952 | type: "ReLU"
953 | }
954 |
955 | layer {
956 | bottom: "res3d_branch2a"
957 | top: "res3d_branch2b"
958 | name: "res3d_branch2b"
959 | type: "Convolution"
960 | convolution_param {
961 | num_output: 128
962 | kernel_size: 3
963 | pad: 1
964 | stride: 1
965 | bias_term: false
966 | }
967 | }
968 |
969 | layer {
970 | bottom: "res3d_branch2b"
971 | top: "res3d_branch2b"
972 | name: "bn3d_branch2b"
973 | type: "BatchNorm"
974 | batch_norm_param {
975 | use_global_stats: true
976 | }
977 | }
978 |
979 | layer {
980 | bottom: "res3d_branch2b"
981 | top: "res3d_branch2b"
982 | name: "scale3d_branch2b"
983 | type: "Scale"
984 | scale_param {
985 | bias_term: true
986 | }
987 | }
988 |
989 | layer {
990 | bottom: "res3d_branch2b"
991 | top: "res3d_branch2b"
992 | name: "res3d_branch2b_relu"
993 | type: "ReLU"
994 | }
995 |
996 | layer {
997 | bottom: "res3d_branch2b"
998 | top: "res3d_branch2c"
999 | name: "res3d_branch2c"
1000 | type: "Convolution"
1001 | convolution_param {
1002 | num_output: 512
1003 | kernel_size: 1
1004 | pad: 0
1005 | stride: 1
1006 | bias_term: false
1007 | }
1008 | }
1009 |
1010 | layer {
1011 | bottom: "res3d_branch2c"
1012 | top: "res3d_branch2c"
1013 | name: "bn3d_branch2c"
1014 | type: "BatchNorm"
1015 | batch_norm_param {
1016 | use_global_stats: true
1017 | }
1018 | }
1019 |
1020 | layer {
1021 | bottom: "res3d_branch2c"
1022 | top: "res3d_branch2c"
1023 | name: "scale3d_branch2c"
1024 | type: "Scale"
1025 | scale_param {
1026 | bias_term: true
1027 | }
1028 | }
1029 |
1030 | layer {
1031 | bottom: "res3c"
1032 | bottom: "res3d_branch2c"
1033 | top: "res3d"
1034 | name: "res3d"
1035 | type: "Eltwise"
1036 | }
1037 |
1038 | layer {
1039 | bottom: "res3d"
1040 | top: "res3d"
1041 | name: "res3d_relu"
1042 | type: "ReLU"
1043 | }
1044 |
1045 | layer {
1046 | bottom: "res3d"
1047 | top: "res4a_branch1"
1048 | name: "res4a_branch1"
1049 | type: "Convolution"
1050 | convolution_param {
1051 | num_output: 1024
1052 | kernel_size: 1
1053 | pad: 0
1054 | stride: 2
1055 | bias_term: false
1056 | }
1057 | }
1058 |
1059 | layer {
1060 | bottom: "res4a_branch1"
1061 | top: "res4a_branch1"
1062 | name: "bn4a_branch1"
1063 | type: "BatchNorm"
1064 | batch_norm_param {
1065 | use_global_stats: true
1066 | }
1067 | }
1068 |
1069 | layer {
1070 | bottom: "res4a_branch1"
1071 | top: "res4a_branch1"
1072 | name: "scale4a_branch1"
1073 | type: "Scale"
1074 | scale_param {
1075 | bias_term: true
1076 | }
1077 | }
1078 |
1079 | layer {
1080 | bottom: "res3d"
1081 | top: "res4a_branch2a"
1082 | name: "res4a_branch2a"
1083 | type: "Convolution"
1084 | convolution_param {
1085 | num_output: 256
1086 | kernel_size: 1
1087 | pad: 0
1088 | stride: 2
1089 | bias_term: false
1090 | }
1091 | }
1092 |
1093 | layer {
1094 | bottom: "res4a_branch2a"
1095 | top: "res4a_branch2a"
1096 | name: "bn4a_branch2a"
1097 | type: "BatchNorm"
1098 | batch_norm_param {
1099 | use_global_stats: true
1100 | }
1101 | }
1102 |
1103 | layer {
1104 | bottom: "res4a_branch2a"
1105 | top: "res4a_branch2a"
1106 | name: "scale4a_branch2a"
1107 | type: "Scale"
1108 | scale_param {
1109 | bias_term: true
1110 | }
1111 | }
1112 |
1113 | layer {
1114 | bottom: "res4a_branch2a"
1115 | top: "res4a_branch2a"
1116 | name: "res4a_branch2a_relu"
1117 | type: "ReLU"
1118 | }
1119 |
1120 | layer {
1121 | bottom: "res4a_branch2a"
1122 | top: "res4a_branch2b"
1123 | name: "res4a_branch2b"
1124 | type: "Convolution"
1125 | convolution_param {
1126 | num_output: 256
1127 | kernel_size: 3
1128 | pad: 1
1129 | stride: 1
1130 | bias_term: false
1131 | }
1132 | }
1133 |
1134 | layer {
1135 | bottom: "res4a_branch2b"
1136 | top: "res4a_branch2b"
1137 | name: "bn4a_branch2b"
1138 | type: "BatchNorm"
1139 | batch_norm_param {
1140 | use_global_stats: true
1141 | }
1142 | }
1143 |
1144 | layer {
1145 | bottom: "res4a_branch2b"
1146 | top: "res4a_branch2b"
1147 | name: "scale4a_branch2b"
1148 | type: "Scale"
1149 | scale_param {
1150 | bias_term: true
1151 | }
1152 | }
1153 |
1154 | layer {
1155 | bottom: "res4a_branch2b"
1156 | top: "res4a_branch2b"
1157 | name: "res4a_branch2b_relu"
1158 | type: "ReLU"
1159 | }
1160 |
1161 | layer {
1162 | bottom: "res4a_branch2b"
1163 | top: "res4a_branch2c"
1164 | name: "res4a_branch2c"
1165 | type: "Convolution"
1166 | convolution_param {
1167 | num_output: 1024
1168 | kernel_size: 1
1169 | pad: 0
1170 | stride: 1
1171 | bias_term: false
1172 | }
1173 | }
1174 |
1175 | layer {
1176 | bottom: "res4a_branch2c"
1177 | top: "res4a_branch2c"
1178 | name: "bn4a_branch2c"
1179 | type: "BatchNorm"
1180 | batch_norm_param {
1181 | use_global_stats: true
1182 | }
1183 | }
1184 |
1185 | layer {
1186 | bottom: "res4a_branch2c"
1187 | top: "res4a_branch2c"
1188 | name: "scale4a_branch2c"
1189 | type: "Scale"
1190 | scale_param {
1191 | bias_term: true
1192 | }
1193 | }
1194 |
1195 | layer {
1196 | bottom: "res4a_branch1"
1197 | bottom: "res4a_branch2c"
1198 | top: "res4a"
1199 | name: "res4a"
1200 | type: "Eltwise"
1201 | }
1202 |
1203 | layer {
1204 | bottom: "res4a"
1205 | top: "res4a"
1206 | name: "res4a_relu"
1207 | type: "ReLU"
1208 | }
1209 |
1210 | layer {
1211 | bottom: "res4a"
1212 | top: "res4b_branch2a"
1213 | name: "res4b_branch2a"
1214 | type: "Convolution"
1215 | convolution_param {
1216 | num_output: 256
1217 | kernel_size: 1
1218 | pad: 0
1219 | stride: 1
1220 | bias_term: false
1221 | }
1222 | }
1223 |
1224 | layer {
1225 | bottom: "res4b_branch2a"
1226 | top: "res4b_branch2a"
1227 | name: "bn4b_branch2a"
1228 | type: "BatchNorm"
1229 | batch_norm_param {
1230 | use_global_stats: true
1231 | }
1232 | }
1233 |
1234 | layer {
1235 | bottom: "res4b_branch2a"
1236 | top: "res4b_branch2a"
1237 | name: "scale4b_branch2a"
1238 | type: "Scale"
1239 | scale_param {
1240 | bias_term: true
1241 | }
1242 | }
1243 |
1244 | layer {
1245 | bottom: "res4b_branch2a"
1246 | top: "res4b_branch2a"
1247 | name: "res4b_branch2a_relu"
1248 | type: "ReLU"
1249 | }
1250 |
1251 | layer {
1252 | bottom: "res4b_branch2a"
1253 | top: "res4b_branch2b"
1254 | name: "res4b_branch2b"
1255 | type: "Convolution"
1256 | convolution_param {
1257 | num_output: 256
1258 | kernel_size: 3
1259 | pad: 1
1260 | stride: 1
1261 | bias_term: false
1262 | }
1263 | }
1264 |
1265 | layer {
1266 | bottom: "res4b_branch2b"
1267 | top: "res4b_branch2b"
1268 | name: "bn4b_branch2b"
1269 | type: "BatchNorm"
1270 | batch_norm_param {
1271 | use_global_stats: true
1272 | }
1273 | }
1274 |
1275 | layer {
1276 | bottom: "res4b_branch2b"
1277 | top: "res4b_branch2b"
1278 | name: "scale4b_branch2b"
1279 | type: "Scale"
1280 | scale_param {
1281 | bias_term: true
1282 | }
1283 | }
1284 |
1285 | layer {
1286 | bottom: "res4b_branch2b"
1287 | top: "res4b_branch2b"
1288 | name: "res4b_branch2b_relu"
1289 | type: "ReLU"
1290 | }
1291 |
1292 | layer {
1293 | bottom: "res4b_branch2b"
1294 | top: "res4b_branch2c"
1295 | name: "res4b_branch2c"
1296 | type: "Convolution"
1297 | convolution_param {
1298 | num_output: 1024
1299 | kernel_size: 1
1300 | pad: 0
1301 | stride: 1
1302 | bias_term: false
1303 | }
1304 | }
1305 |
1306 | layer {
1307 | bottom: "res4b_branch2c"
1308 | top: "res4b_branch2c"
1309 | name: "bn4b_branch2c"
1310 | type: "BatchNorm"
1311 | batch_norm_param {
1312 | use_global_stats: true
1313 | }
1314 | }
1315 |
1316 | layer {
1317 | bottom: "res4b_branch2c"
1318 | top: "res4b_branch2c"
1319 | name: "scale4b_branch2c"
1320 | type: "Scale"
1321 | scale_param {
1322 | bias_term: true
1323 | }
1324 | }
1325 |
1326 | layer {
1327 | bottom: "res4a"
1328 | bottom: "res4b_branch2c"
1329 | top: "res4b"
1330 | name: "res4b"
1331 | type: "Eltwise"
1332 | }
1333 |
1334 | layer {
1335 | bottom: "res4b"
1336 | top: "res4b"
1337 | name: "res4b_relu"
1338 | type: "ReLU"
1339 | }
1340 |
1341 | layer {
1342 | bottom: "res4b"
1343 | top: "res4c_branch2a"
1344 | name: "res4c_branch2a"
1345 | type: "Convolution"
1346 | convolution_param {
1347 | num_output: 256
1348 | kernel_size: 1
1349 | pad: 0
1350 | stride: 1
1351 | bias_term: false
1352 | }
1353 | }
1354 |
1355 | layer {
1356 | bottom: "res4c_branch2a"
1357 | top: "res4c_branch2a"
1358 | name: "bn4c_branch2a"
1359 | type: "BatchNorm"
1360 | batch_norm_param {
1361 | use_global_stats: true
1362 | }
1363 | }
1364 |
1365 | layer {
1366 | bottom: "res4c_branch2a"
1367 | top: "res4c_branch2a"
1368 | name: "scale4c_branch2a"
1369 | type: "Scale"
1370 | scale_param {
1371 | bias_term: true
1372 | }
1373 | }
1374 |
1375 | layer {
1376 | bottom: "res4c_branch2a"
1377 | top: "res4c_branch2a"
1378 | name: "res4c_branch2a_relu"
1379 | type: "ReLU"
1380 | }
1381 |
1382 | layer {
1383 | bottom: "res4c_branch2a"
1384 | top: "res4c_branch2b"
1385 | name: "res4c_branch2b"
1386 | type: "Convolution"
1387 | convolution_param {
1388 | num_output: 256
1389 | kernel_size: 3
1390 | pad: 1
1391 | stride: 1
1392 | bias_term: false
1393 | }
1394 | }
1395 |
1396 | layer {
1397 | bottom: "res4c_branch2b"
1398 | top: "res4c_branch2b"
1399 | name: "bn4c_branch2b"
1400 | type: "BatchNorm"
1401 | batch_norm_param {
1402 | use_global_stats: true
1403 | }
1404 | }
1405 |
1406 | layer {
1407 | bottom: "res4c_branch2b"
1408 | top: "res4c_branch2b"
1409 | name: "scale4c_branch2b"
1410 | type: "Scale"
1411 | scale_param {
1412 | bias_term: true
1413 | }
1414 | }
1415 |
1416 | layer {
1417 | bottom: "res4c_branch2b"
1418 | top: "res4c_branch2b"
1419 | name: "res4c_branch2b_relu"
1420 | type: "ReLU"
1421 | }
1422 |
1423 | layer {
1424 | bottom: "res4c_branch2b"
1425 | top: "res4c_branch2c"
1426 | name: "res4c_branch2c"
1427 | type: "Convolution"
1428 | convolution_param {
1429 | num_output: 1024
1430 | kernel_size: 1
1431 | pad: 0
1432 | stride: 1
1433 | bias_term: false
1434 | }
1435 | }
1436 |
1437 | layer {
1438 | bottom: "res4c_branch2c"
1439 | top: "res4c_branch2c"
1440 | name: "bn4c_branch2c"
1441 | type: "BatchNorm"
1442 | batch_norm_param {
1443 | use_global_stats: true
1444 | }
1445 | }
1446 |
1447 | layer {
1448 | bottom: "res4c_branch2c"
1449 | top: "res4c_branch2c"
1450 | name: "scale4c_branch2c"
1451 | type: "Scale"
1452 | scale_param {
1453 | bias_term: true
1454 | }
1455 | }
1456 |
1457 | layer {
1458 | bottom: "res4b"
1459 | bottom: "res4c_branch2c"
1460 | top: "res4c"
1461 | name: "res4c"
1462 | type: "Eltwise"
1463 | }
1464 |
1465 | layer {
1466 | bottom: "res4c"
1467 | top: "res4c"
1468 | name: "res4c_relu"
1469 | type: "ReLU"
1470 | }
1471 |
1472 | layer {
1473 | bottom: "res4c"
1474 | top: "res4d_branch2a"
1475 | name: "res4d_branch2a"
1476 | type: "Convolution"
1477 | convolution_param {
1478 | num_output: 256
1479 | kernel_size: 1
1480 | pad: 0
1481 | stride: 1
1482 | bias_term: false
1483 | }
1484 | }
1485 |
1486 | layer {
1487 | bottom: "res4d_branch2a"
1488 | top: "res4d_branch2a"
1489 | name: "bn4d_branch2a"
1490 | type: "BatchNorm"
1491 | batch_norm_param {
1492 | use_global_stats: true
1493 | }
1494 | }
1495 |
1496 | layer {
1497 | bottom: "res4d_branch2a"
1498 | top: "res4d_branch2a"
1499 | name: "scale4d_branch2a"
1500 | type: "Scale"
1501 | scale_param {
1502 | bias_term: true
1503 | }
1504 | }
1505 |
1506 | layer {
1507 | bottom: "res4d_branch2a"
1508 | top: "res4d_branch2a"
1509 | name: "res4d_branch2a_relu"
1510 | type: "ReLU"
1511 | }
1512 |
1513 | layer {
1514 | bottom: "res4d_branch2a"
1515 | top: "res4d_branch2b"
1516 | name: "res4d_branch2b"
1517 | type: "Convolution"
1518 | convolution_param {
1519 | num_output: 256
1520 | kernel_size: 3
1521 | pad: 1
1522 | stride: 1
1523 | bias_term: false
1524 | }
1525 | }
1526 |
1527 | layer {
1528 | bottom: "res4d_branch2b"
1529 | top: "res4d_branch2b"
1530 | name: "bn4d_branch2b"
1531 | type: "BatchNorm"
1532 | batch_norm_param {
1533 | use_global_stats: true
1534 | }
1535 | }
1536 |
1537 | layer {
1538 | bottom: "res4d_branch2b"
1539 | top: "res4d_branch2b"
1540 | name: "scale4d_branch2b"
1541 | type: "Scale"
1542 | scale_param {
1543 | bias_term: true
1544 | }
1545 | }
1546 |
1547 | layer {
1548 | bottom: "res4d_branch2b"
1549 | top: "res4d_branch2b"
1550 | name: "res4d_branch2b_relu"
1551 | type: "ReLU"
1552 | }
1553 |
1554 | layer {
1555 | bottom: "res4d_branch2b"
1556 | top: "res4d_branch2c"
1557 | name: "res4d_branch2c"
1558 | type: "Convolution"
1559 | convolution_param {
1560 | num_output: 1024
1561 | kernel_size: 1
1562 | pad: 0
1563 | stride: 1
1564 | bias_term: false
1565 | }
1566 | }
1567 |
1568 | layer {
1569 | bottom: "res4d_branch2c"
1570 | top: "res4d_branch2c"
1571 | name: "bn4d_branch2c"
1572 | type: "BatchNorm"
1573 | batch_norm_param {
1574 | use_global_stats: true
1575 | }
1576 | }
1577 |
1578 | layer {
1579 | bottom: "res4d_branch2c"
1580 | top: "res4d_branch2c"
1581 | name: "scale4d_branch2c"
1582 | type: "Scale"
1583 | scale_param {
1584 | bias_term: true
1585 | }
1586 | }
1587 |
1588 | layer {
1589 | bottom: "res4c"
1590 | bottom: "res4d_branch2c"
1591 | top: "res4d"
1592 | name: "res4d"
1593 | type: "Eltwise"
1594 | }
1595 |
1596 | layer {
1597 | bottom: "res4d"
1598 | top: "res4d"
1599 | name: "res4d_relu"
1600 | type: "ReLU"
1601 | }
1602 |
1603 | layer {
1604 | bottom: "res4d"
1605 | top: "res4e_branch2a"
1606 | name: "res4e_branch2a"
1607 | type: "Convolution"
1608 | convolution_param {
1609 | num_output: 256
1610 | kernel_size: 1
1611 | pad: 0
1612 | stride: 1
1613 | bias_term: false
1614 | }
1615 | }
1616 |
1617 | layer {
1618 | bottom: "res4e_branch2a"
1619 | top: "res4e_branch2a"
1620 | name: "bn4e_branch2a"
1621 | type: "BatchNorm"
1622 | batch_norm_param {
1623 | use_global_stats: true
1624 | }
1625 | }
1626 |
1627 | layer {
1628 | bottom: "res4e_branch2a"
1629 | top: "res4e_branch2a"
1630 | name: "scale4e_branch2a"
1631 | type: "Scale"
1632 | scale_param {
1633 | bias_term: true
1634 | }
1635 | }
1636 |
1637 | layer {
1638 | bottom: "res4e_branch2a"
1639 | top: "res4e_branch2a"
1640 | name: "res4e_branch2a_relu"
1641 | type: "ReLU"
1642 | }
1643 |
1644 | layer {
1645 | bottom: "res4e_branch2a"
1646 | top: "res4e_branch2b"
1647 | name: "res4e_branch2b"
1648 | type: "Convolution"
1649 | convolution_param {
1650 | num_output: 256
1651 | kernel_size: 3
1652 | pad: 1
1653 | stride: 1
1654 | bias_term: false
1655 | }
1656 | }
1657 |
1658 | layer {
1659 | bottom: "res4e_branch2b"
1660 | top: "res4e_branch2b"
1661 | name: "bn4e_branch2b"
1662 | type: "BatchNorm"
1663 | batch_norm_param {
1664 | use_global_stats: true
1665 | }
1666 | }
1667 |
1668 | layer {
1669 | bottom: "res4e_branch2b"
1670 | top: "res4e_branch2b"
1671 | name: "scale4e_branch2b"
1672 | type: "Scale"
1673 | scale_param {
1674 | bias_term: true
1675 | }
1676 | }
1677 |
1678 | layer {
1679 | bottom: "res4e_branch2b"
1680 | top: "res4e_branch2b"
1681 | name: "res4e_branch2b_relu"
1682 | type: "ReLU"
1683 | }
1684 |
1685 | layer {
1686 | bottom: "res4e_branch2b"
1687 | top: "res4e_branch2c"
1688 | name: "res4e_branch2c"
1689 | type: "Convolution"
1690 | convolution_param {
1691 | num_output: 1024
1692 | kernel_size: 1
1693 | pad: 0
1694 | stride: 1
1695 | bias_term: false
1696 | }
1697 | }
1698 |
1699 | layer {
1700 | bottom: "res4e_branch2c"
1701 | top: "res4e_branch2c"
1702 | name: "bn4e_branch2c"
1703 | type: "BatchNorm"
1704 | batch_norm_param {
1705 | use_global_stats: true
1706 | }
1707 | }
1708 |
1709 | layer {
1710 | bottom: "res4e_branch2c"
1711 | top: "res4e_branch2c"
1712 | name: "scale4e_branch2c"
1713 | type: "Scale"
1714 | scale_param {
1715 | bias_term: true
1716 | }
1717 | }
1718 |
1719 | layer {
1720 | bottom: "res4d"
1721 | bottom: "res4e_branch2c"
1722 | top: "res4e"
1723 | name: "res4e"
1724 | type: "Eltwise"
1725 | }
1726 |
1727 | layer {
1728 | bottom: "res4e"
1729 | top: "res4e"
1730 | name: "res4e_relu"
1731 | type: "ReLU"
1732 | }
1733 |
1734 | layer {
1735 | bottom: "res4e"
1736 | top: "res4f_branch2a"
1737 | name: "res4f_branch2a"
1738 | type: "Convolution"
1739 | convolution_param {
1740 | num_output: 256
1741 | kernel_size: 1
1742 | pad: 0
1743 | stride: 1
1744 | bias_term: false
1745 | }
1746 | }
1747 |
1748 | layer {
1749 | bottom: "res4f_branch2a"
1750 | top: "res4f_branch2a"
1751 | name: "bn4f_branch2a"
1752 | type: "BatchNorm"
1753 | batch_norm_param {
1754 | use_global_stats: true
1755 | }
1756 | }
1757 |
1758 | layer {
1759 | bottom: "res4f_branch2a"
1760 | top: "res4f_branch2a"
1761 | name: "scale4f_branch2a"
1762 | type: "Scale"
1763 | scale_param {
1764 | bias_term: true
1765 | }
1766 | }
1767 |
1768 | layer {
1769 | bottom: "res4f_branch2a"
1770 | top: "res4f_branch2a"
1771 | name: "res4f_branch2a_relu"
1772 | type: "ReLU"
1773 | }
1774 |
1775 | layer {
1776 | bottom: "res4f_branch2a"
1777 | top: "res4f_branch2b"
1778 | name: "res4f_branch2b"
1779 | type: "Convolution"
1780 | convolution_param {
1781 | num_output: 256
1782 | kernel_size: 3
1783 | pad: 1
1784 | stride: 1
1785 | bias_term: false
1786 | }
1787 | }
1788 |
1789 | layer {
1790 | bottom: "res4f_branch2b"
1791 | top: "res4f_branch2b"
1792 | name: "bn4f_branch2b"
1793 | type: "BatchNorm"
1794 | batch_norm_param {
1795 | use_global_stats: true
1796 | }
1797 | }
1798 |
1799 | layer {
1800 | bottom: "res4f_branch2b"
1801 | top: "res4f_branch2b"
1802 | name: "scale4f_branch2b"
1803 | type: "Scale"
1804 | scale_param {
1805 | bias_term: true
1806 | }
1807 | }
1808 |
1809 | layer {
1810 | bottom: "res4f_branch2b"
1811 | top: "res4f_branch2b"
1812 | name: "res4f_branch2b_relu"
1813 | type: "ReLU"
1814 | }
1815 |
1816 | layer {
1817 | bottom: "res4f_branch2b"
1818 | top: "res4f_branch2c"
1819 | name: "res4f_branch2c"
1820 | type: "Convolution"
1821 | convolution_param {
1822 | num_output: 1024
1823 | kernel_size: 1
1824 | pad: 0
1825 | stride: 1
1826 | bias_term: false
1827 | }
1828 | }
1829 |
1830 | layer {
1831 | bottom: "res4f_branch2c"
1832 | top: "res4f_branch2c"
1833 | name: "bn4f_branch2c"
1834 | type: "BatchNorm"
1835 | batch_norm_param {
1836 | use_global_stats: true
1837 | }
1838 | }
1839 |
1840 | layer {
1841 | bottom: "res4f_branch2c"
1842 | top: "res4f_branch2c"
1843 | name: "scale4f_branch2c"
1844 | type: "Scale"
1845 | scale_param {
1846 | bias_term: true
1847 | }
1848 | }
1849 |
1850 | layer {
1851 | bottom: "res4e"
1852 | bottom: "res4f_branch2c"
1853 | top: "res4f"
1854 | name: "res4f"
1855 | type: "Eltwise"
1856 | }
1857 |
1858 | layer {
1859 | bottom: "res4f"
1860 | top: "res4f"
1861 | name: "res4f_relu"
1862 | type: "ReLU"
1863 | }
1864 |
1865 | layer {
1866 | bottom: "res4f"
1867 | top: "res5a_branch1"
1868 | name: "res5a_branch1"
1869 | type: "Convolution"
1870 | convolution_param {
1871 | num_output: 2048
1872 | kernel_size: 1
1873 | pad: 0
1874 | stride: 2
1875 | bias_term: false
1876 | }
1877 | }
1878 |
1879 | layer {
1880 | bottom: "res5a_branch1"
1881 | top: "res5a_branch1"
1882 | name: "bn5a_branch1"
1883 | type: "BatchNorm"
1884 | batch_norm_param {
1885 | use_global_stats: true
1886 | }
1887 | }
1888 |
1889 | layer {
1890 | bottom: "res5a_branch1"
1891 | top: "res5a_branch1"
1892 | name: "scale5a_branch1"
1893 | type: "Scale"
1894 | scale_param {
1895 | bias_term: true
1896 | }
1897 | }
1898 |
1899 | layer {
1900 | bottom: "res4f"
1901 | top: "res5a_branch2a"
1902 | name: "res5a_branch2a"
1903 | type: "Convolution"
1904 | convolution_param {
1905 | num_output: 512
1906 | kernel_size: 1
1907 | pad: 0
1908 | stride: 2
1909 | bias_term: false
1910 | }
1911 | }
1912 |
1913 | layer {
1914 | bottom: "res5a_branch2a"
1915 | top: "res5a_branch2a"
1916 | name: "bn5a_branch2a"
1917 | type: "BatchNorm"
1918 | batch_norm_param {
1919 | use_global_stats: true
1920 | }
1921 | }
1922 |
1923 | layer {
1924 | bottom: "res5a_branch2a"
1925 | top: "res5a_branch2a"
1926 | name: "scale5a_branch2a"
1927 | type: "Scale"
1928 | scale_param {
1929 | bias_term: true
1930 | }
1931 | }
1932 |
1933 | layer {
1934 | bottom: "res5a_branch2a"
1935 | top: "res5a_branch2a"
1936 | name: "res5a_branch2a_relu"
1937 | type: "ReLU"
1938 | }
1939 |
1940 | layer {
1941 | bottom: "res5a_branch2a"
1942 | top: "res5a_branch2b"
1943 | name: "res5a_branch2b"
1944 | type: "Convolution"
1945 | convolution_param {
1946 | num_output: 512
1947 | kernel_size: 3
1948 | pad: 1
1949 | stride: 1
1950 | bias_term: false
1951 | }
1952 | }
1953 |
1954 | layer {
1955 | bottom: "res5a_branch2b"
1956 | top: "res5a_branch2b"
1957 | name: "bn5a_branch2b"
1958 | type: "BatchNorm"
1959 | batch_norm_param {
1960 | use_global_stats: true
1961 | }
1962 | }
1963 |
1964 | layer {
1965 | bottom: "res5a_branch2b"
1966 | top: "res5a_branch2b"
1967 | name: "scale5a_branch2b"
1968 | type: "Scale"
1969 | scale_param {
1970 | bias_term: true
1971 | }
1972 | }
1973 |
1974 | layer {
1975 | bottom: "res5a_branch2b"
1976 | top: "res5a_branch2b"
1977 | name: "res5a_branch2b_relu"
1978 | type: "ReLU"
1979 | }
1980 |
1981 | layer {
1982 | bottom: "res5a_branch2b"
1983 | top: "res5a_branch2c"
1984 | name: "res5a_branch2c"
1985 | type: "Convolution"
1986 | convolution_param {
1987 | num_output: 2048
1988 | kernel_size: 1
1989 | pad: 0
1990 | stride: 1
1991 | bias_term: false
1992 | }
1993 | }
1994 |
1995 | layer {
1996 | bottom: "res5a_branch2c"
1997 | top: "res5a_branch2c"
1998 | name: "bn5a_branch2c"
1999 | type: "BatchNorm"
2000 | batch_norm_param {
2001 | use_global_stats: true
2002 | }
2003 | }
2004 |
2005 | layer {
2006 | bottom: "res5a_branch2c"
2007 | top: "res5a_branch2c"
2008 | name: "scale5a_branch2c"
2009 | type: "Scale"
2010 | scale_param {
2011 | bias_term: true
2012 | }
2013 | }
2014 |
2015 | layer {
2016 | bottom: "res5a_branch1"
2017 | bottom: "res5a_branch2c"
2018 | top: "res5a"
2019 | name: "res5a"
2020 | type: "Eltwise"
2021 | }
2022 |
2023 | layer {
2024 | bottom: "res5a"
2025 | top: "res5a"
2026 | name: "res5a_relu"
2027 | type: "ReLU"
2028 | }
2029 |
2030 | layer {
2031 | bottom: "res5a"
2032 | top: "res5b_branch2a"
2033 | name: "res5b_branch2a"
2034 | type: "Convolution"
2035 | convolution_param {
2036 | num_output: 512
2037 | kernel_size: 1
2038 | pad: 0
2039 | stride: 1
2040 | bias_term: false
2041 | }
2042 | }
2043 |
2044 | layer {
2045 | bottom: "res5b_branch2a"
2046 | top: "res5b_branch2a"
2047 | name: "bn5b_branch2a"
2048 | type: "BatchNorm"
2049 | batch_norm_param {
2050 | use_global_stats: true
2051 | }
2052 | }
2053 |
2054 | layer {
2055 | bottom: "res5b_branch2a"
2056 | top: "res5b_branch2a"
2057 | name: "scale5b_branch2a"
2058 | type: "Scale"
2059 | scale_param {
2060 | bias_term: true
2061 | }
2062 | }
2063 |
2064 | layer {
2065 | bottom: "res5b_branch2a"
2066 | top: "res5b_branch2a"
2067 | name: "res5b_branch2a_relu"
2068 | type: "ReLU"
2069 | }
2070 |
2071 | layer {
2072 | bottom: "res5b_branch2a"
2073 | top: "res5b_branch2b"
2074 | name: "res5b_branch2b"
2075 | type: "Convolution"
2076 | convolution_param {
2077 | num_output: 512
2078 | kernel_size: 3
2079 | pad: 1
2080 | stride: 1
2081 | bias_term: false
2082 | }
2083 | }
2084 |
2085 | layer {
2086 | bottom: "res5b_branch2b"
2087 | top: "res5b_branch2b"
2088 | name: "bn5b_branch2b"
2089 | type: "BatchNorm"
2090 | batch_norm_param {
2091 | use_global_stats: true
2092 | }
2093 | }
2094 |
2095 | layer {
2096 | bottom: "res5b_branch2b"
2097 | top: "res5b_branch2b"
2098 | name: "scale5b_branch2b"
2099 | type: "Scale"
2100 | scale_param {
2101 | bias_term: true
2102 | }
2103 | }
2104 |
2105 | layer {
2106 | bottom: "res5b_branch2b"
2107 | top: "res5b_branch2b"
2108 | name: "res5b_branch2b_relu"
2109 | type: "ReLU"
2110 | }
2111 |
2112 | layer {
2113 | bottom: "res5b_branch2b"
2114 | top: "res5b_branch2c"
2115 | name: "res5b_branch2c"
2116 | type: "Convolution"
2117 | convolution_param {
2118 | num_output: 2048
2119 | kernel_size: 1
2120 | pad: 0
2121 | stride: 1
2122 | bias_term: false
2123 | }
2124 | }
2125 |
2126 | layer {
2127 | bottom: "res5b_branch2c"
2128 | top: "res5b_branch2c"
2129 | name: "bn5b_branch2c"
2130 | type: "BatchNorm"
2131 | batch_norm_param {
2132 | use_global_stats: true
2133 | }
2134 | }
2135 |
2136 | layer {
2137 | bottom: "res5b_branch2c"
2138 | top: "res5b_branch2c"
2139 | name: "scale5b_branch2c"
2140 | type: "Scale"
2141 | scale_param {
2142 | bias_term: true
2143 | }
2144 | }
2145 |
2146 | layer {
2147 | bottom: "res5a"
2148 | bottom: "res5b_branch2c"
2149 | top: "res5b"
2150 | name: "res5b"
2151 | type: "Eltwise"
2152 | }
2153 |
2154 | layer {
2155 | bottom: "res5b"
2156 | top: "res5b"
2157 | name: "res5b_relu"
2158 | type: "ReLU"
2159 | }
2160 |
2161 | layer {
2162 | bottom: "res5b"
2163 | top: "res5c_branch2a"
2164 | name: "res5c_branch2a"
2165 | type: "Convolution"
2166 | convolution_param {
2167 | num_output: 512
2168 | kernel_size: 1
2169 | pad: 0
2170 | stride: 1
2171 | bias_term: false
2172 | }
2173 | }
2174 |
2175 | layer {
2176 | bottom: "res5c_branch2a"
2177 | top: "res5c_branch2a"
2178 | name: "bn5c_branch2a"
2179 | type: "BatchNorm"
2180 | batch_norm_param {
2181 | use_global_stats: true
2182 | }
2183 | }
2184 |
2185 | layer {
2186 | bottom: "res5c_branch2a"
2187 | top: "res5c_branch2a"
2188 | name: "scale5c_branch2a"
2189 | type: "Scale"
2190 | scale_param {
2191 | bias_term: true
2192 | }
2193 | }
2194 |
2195 | layer {
2196 | bottom: "res5c_branch2a"
2197 | top: "res5c_branch2a"
2198 | name: "res5c_branch2a_relu"
2199 | type: "ReLU"
2200 | }
2201 |
2202 | layer {
2203 | bottom: "res5c_branch2a"
2204 | top: "res5c_branch2b"
2205 | name: "res5c_branch2b"
2206 | type: "Convolution"
2207 | convolution_param {
2208 | num_output: 512
2209 | kernel_size: 3
2210 | pad: 1
2211 | stride: 1
2212 | bias_term: false
2213 | }
2214 | }
2215 |
2216 | layer {
2217 | bottom: "res5c_branch2b"
2218 | top: "res5c_branch2b"
2219 | name: "bn5c_branch2b"
2220 | type: "BatchNorm"
2221 | batch_norm_param {
2222 | use_global_stats: true
2223 | }
2224 | }
2225 |
2226 | layer {
2227 | bottom: "res5c_branch2b"
2228 | top: "res5c_branch2b"
2229 | name: "scale5c_branch2b"
2230 | type: "Scale"
2231 | scale_param {
2232 | bias_term: true
2233 | }
2234 | }
2235 |
2236 | layer {
2237 | bottom: "res5c_branch2b"
2238 | top: "res5c_branch2b"
2239 | name: "res5c_branch2b_relu"
2240 | type: "ReLU"
2241 | }
2242 |
2243 | layer {
2244 | bottom: "res5c_branch2b"
2245 | top: "res5c_branch2c"
2246 | name: "res5c_branch2c"
2247 | type: "Convolution"
2248 | convolution_param {
2249 | num_output: 2048
2250 | kernel_size: 1
2251 | pad: 0
2252 | stride: 1
2253 | bias_term: false
2254 | }
2255 | }
2256 |
2257 | layer {
2258 | bottom: "res5c_branch2c"
2259 | top: "res5c_branch2c"
2260 | name: "bn5c_branch2c"
2261 | type: "BatchNorm"
2262 | batch_norm_param {
2263 | use_global_stats: true
2264 | }
2265 | }
2266 |
2267 | layer {
2268 | bottom: "res5c_branch2c"
2269 | top: "res5c_branch2c"
2270 | name: "scale5c_branch2c"
2271 | type: "Scale"
2272 | scale_param {
2273 | bias_term: true
2274 | }
2275 | }
2276 |
2277 | layer {
2278 | bottom: "res5b"
2279 | bottom: "res5c_branch2c"
2280 | top: "res5c"
2281 | name: "res5c"
2282 | type: "Eltwise"
2283 | }
2284 |
2285 | layer {
2286 | bottom: "res5c"
2287 | top: "res5c"
2288 | name: "res5c_relu"
2289 | type: "ReLU"
2290 | }
2291 |
2292 | layer {
2293 | bottom: "res5c"
2294 | top: "pool5"
2295 | name: "pool5"
2296 | type: "Pooling"
2297 | pooling_param {
2298 | kernel_size: 7
2299 | stride: 1
2300 | pool: AVE
2301 | }
2302 | }
2303 |
2304 | layer {
2305 | bottom: "pool5"
2306 | top: "fc1000"
2307 | name: "fc1000"
2308 | type: "InnerProduct"
2309 | inner_product_param {
2310 | num_output: 1000
2311 | }
2312 | }
2313 |
2314 | layer {
2315 | bottom: "fc1000"
2316 | top: "prob"
2317 | name: "prob"
2318 | type: "Softmax"
2319 | }
2320 |
2321 |
--------------------------------------------------------------------------------
/f.sh:
--------------------------------------------------------------------------------
1 | ./build/tools/caffe train -solver ./KTCH/solver.prototxt -weights xxxx.caffemodel --gpu 0
2 |
3 |
4 | # xxxx -- dir of imagenet2012 pretrain resnet50 caffemodel
5 |
6 |
7 |
--------------------------------------------------------------------------------
/feature_ex.m:
--------------------------------------------------------------------------------
1 |
2 | model='./ResNet-50-deploy.prototxt';
3 | weights=['./model/ktch.caffemodel'];
4 | root_dir=''; %might be '/home/code/caffe_master'
5 | addpath([ root_dir '/matlab']);
6 | caffe.set_mode_gpu(); % we use gpu
7 | gpu_id = 0; % we use the first gpu
8 | caffe.set_device(gpu_id);
9 | net1 = caffe.Net(model, weights, 'test');
10 |
11 | load('source_target_img_name_lab.mat'); % load source/target sample name
12 | image_dir_target='./data/target';
13 | F=zeros(size(target_img_name,1),2048);
14 | mean_data=cat(3,ones(224,224)*104,ones(224,224)*117,ones(224,224)*124);
15 | for i=1:size(target_img_name,1)
16 | im= imread([image_dir_target '/' target_img_name{i}]);
17 | input_data = {prepare_image(im,mean_data,256,224)};
18 | res1 = net1.forward(input_data);
19 | F(i,:)=net1.blobs('pool5').get_data();
20 | end
21 | save(['./model/target_class_sample.mat'],'F');
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/imagenet_wordvec.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiangeluo/fsl-hierarchy/f85e44316383a714449d58a8de2e5a6d38062fe9/imagenet_wordvec.mat
--------------------------------------------------------------------------------
/inference.m:
--------------------------------------------------------------------------------
1 | clear all
2 | clc
3 | addpath('./feature');
4 |
5 | load target_class_sample.mat
6 | load source_target_img_name_lab.mat
7 |
8 | %% spilt fewshot sample and test sample
9 | test_id=1:size(F,1);
10 | fs_num=5;supp_id=[];
11 | F_te_pro=zeros(360,size(F,2));% target class reference
12 | for ii=1:360
13 | tmp=(ii-1)*150+1:(ii-1)*150+fs_num;
14 | supp_id=[supp_id;tmp];
15 | F_te_pro(ii,:)=mean(F(tmp,:),1);
16 | end
17 | test_id(supp_id)=[];
18 |
19 |
20 | X_te=F(test_id,:);
21 | Y_te=target_label(test_id);
22 |
23 | %%% nearest neighbor
24 | dist = (pdist2(X_te,F_te_pro, 'cosine')) ;
25 | HITK = 5;
26 | Y_hit5 = zeros(size(dist,1),HITK);
27 | for i = 1:size(dist,1)
28 | [sort_dist_i, I] = sort(dist(i,:));
29 | Y_hit5(i,:) = I(1:HITK);
30 | end
31 | n = 0;
32 | for i = 1:size(dist,1)
33 | if ismember(Y_te(i),Y_hit5(i,:))
34 | n = n + 1;
35 | end
36 | end
37 | fsl_accuracy = n/size(dist,1)
38 |
--------------------------------------------------------------------------------
/material/overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiangeluo/fsl-hierarchy/f85e44316383a714449d58a8de2e5a6d38062fe9/material/overview.png
--------------------------------------------------------------------------------
/prepare_image.m:
--------------------------------------------------------------------------------
1 | function image = prepare_image(im,IMAGE_MEAN,IMAGE_DIM,CROPPED_DIM)
2 |
3 |
4 | indices = [0 IMAGE_DIM-CROPPED_DIM] + 1;
5 | center = floor(indices(2) / 2)+1;
6 | images = zeros(CROPPED_DIM,CROPPED_DIM,3,'single');
7 | im = single(im);
8 | im = imresize(im, [IMAGE_DIM IMAGE_DIM], 'bilinear');
9 | if size(im,3) == 1
10 | im = cat(3,im,im,im);
11 | end
12 | im = im(:,:,[3 2 1]) ;
13 | image= permute(im(center:center+CROPPED_DIM-1,center:center+CROPPED_DIM-1,:),[2 1 3]);
14 | image=image-IMAGE_MEAN;
15 |
--------------------------------------------------------------------------------
/solver.prototxt:
--------------------------------------------------------------------------------
1 | net: "./ktch/train.prototxt"
2 | max_iter: 30000
3 |
4 | lr_policy: "step"
5 | base_lr: 0.001
6 | stepsize: 15000
7 | iter_size: 4
8 | gama: 0.1
9 | momentum: 0.9
10 | weight_decay: 0.0005
11 | snapshot: 15000
12 | snapshot_prefix: "./KTCH/model/"
13 |
--------------------------------------------------------------------------------
/source_target_img_name_lab.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiangeluo/fsl-hierarchy/f85e44316383a714449d58a8de2e5a6d38062fe9/source_target_img_name_lab.mat
--------------------------------------------------------------------------------
/train.prototxt:
--------------------------------------------------------------------------------
1 | name: "ResNet-50"
2 |
3 |
4 | layer {
5 | name: "data"
6 | type: "ImageData"
7 | top: "data"
8 | top: "label"
9 | include {
10 | phase: TRAIN
11 | }
12 | transform_param {
13 | mirror: true
14 | crop_size: 224
15 | mean_value: 104.0
16 | mean_value: 117.0
17 | mean_value: 124.0
18 | }
19 | image_data_param {
20 | source: "./KTCH/train.txt"
21 | batch_size: 32
22 | new_height: 256
23 | new_width: 256
24 | }
25 | }
26 |
27 | layer {
28 | name: "data"
29 | type: "ImageData"
30 | top: "data_1"
31 | top: "label_1"
32 | include {
33 | phase: TRAIN
34 | }
35 | transform_param {
36 | mirror: true
37 | crop_size: 224
38 | mean_value: 104.0
39 | mean_value: 117.0
40 | mean_value: 124.0
41 | }
42 | image_data_param {
43 | source: "./KTCH/train_1.txt"
44 | batch_size: 32
45 | new_height: 256
46 | new_width: 256
47 | }
48 | }
49 |
50 | layer{
51 | name: "silence_data_1"
52 | type:"Silence"
53 | bottom:"data_1"
54 | include {
55 | phase: TRAIN
56 | }
57 | }
58 |
59 | layer {
60 | name: "data"
61 | type: "ImageData"
62 | top: "data_2"
63 | top: "label_2"
64 | include {
65 | phase: TRAIN
66 | }
67 | transform_param {
68 | mirror: true
69 | crop_size: 224
70 | mean_value: 104.0
71 | mean_value: 117.0
72 | mean_value: 124.0
73 | }
74 | image_data_param {
75 | source: "./KTCH/train_2.txt"
76 | batch_size: 32
77 | new_height: 256
78 | new_width: 256
79 | }
80 | }
81 |
82 | layer{
83 | name: "silence_data_2"
84 | type:"Silence"
85 | bottom:"data_2"
86 | include {
87 | phase: TRAIN
88 | }
89 | }
90 |
91 | layer {
92 | name: "data"
93 | type: "ImageData"
94 | top: "data_3"
95 | top: "label_3"
96 | include {
97 | phase: TRAIN
98 | }
99 | transform_param {
100 | mirror: true
101 | crop_size: 224
102 | mean_value: 104.0
103 | mean_value: 117.0
104 | mean_value: 124.0
105 | }
106 | image_data_param {
107 | source: "./KTCH/train_3.txt"
108 | batch_size: 32
109 | new_height: 256
110 | new_width: 256
111 | }
112 | }
113 |
114 | layer{
115 | name: "silence_data_3"
116 | type:"Silence"
117 | bottom:"data_3"
118 | include {
119 | phase: TRAIN
120 | }
121 | }
122 |
123 | layer {
124 | bottom: "data"
125 | top: "conv1"
126 | name: "conv1"
127 | type: "Convolution"
128 | convolution_param {
129 | num_output: 64
130 | kernel_size: 7
131 | pad: 3
132 | stride: 2
133 | }
134 | }
135 |
136 | layer {
137 | bottom: "conv1"
138 | top: "conv1"
139 | name: "bn_conv1"
140 | type: "BatchNorm"
141 | batch_norm_param {
142 | use_global_stats: false
143 | }
144 | }
145 |
146 | layer {
147 | bottom: "conv1"
148 | top: "conv1"
149 | name: "scale_conv1"
150 | type: "Scale"
151 | scale_param {
152 | bias_term: true
153 | }
154 | }
155 |
156 | layer {
157 | bottom: "conv1"
158 | top: "conv1"
159 | name: "conv1_relu"
160 | type: "ReLU"
161 | }
162 |
163 | layer {
164 | bottom: "conv1"
165 | top: "pool1"
166 | name: "pool1"
167 | type: "Pooling"
168 | pooling_param {
169 | kernel_size: 3
170 | stride: 2
171 | pool: MAX
172 | }
173 | }
174 |
175 | layer {
176 | bottom: "pool1"
177 | top: "res2a_branch1"
178 | name: "res2a_branch1"
179 | type: "Convolution"
180 |
181 |
182 | convolution_param {
183 | num_output: 256
184 | kernel_size: 1
185 | pad: 0
186 | stride: 1
187 | bias_term: false
188 | }
189 | }
190 |
191 | layer {
192 | bottom: "res2a_branch1"
193 | top: "res2a_branch1"
194 | name: "bn2a_branch1"
195 | type: "BatchNorm"
196 | batch_norm_param {
197 | use_global_stats: false
198 | }
199 | }
200 |
201 | layer {
202 | bottom: "res2a_branch1"
203 | top: "res2a_branch1"
204 | name: "scale2a_branch1"
205 | type: "Scale"
206 | scale_param {
207 | bias_term: true
208 | }
209 | }
210 |
211 | layer {
212 | bottom: "pool1"
213 | top: "res2a_branch2a"
214 | name: "res2a_branch2a"
215 | type: "Convolution"
216 |
217 |
218 | convolution_param {
219 | num_output: 64
220 | kernel_size: 1
221 | pad: 0
222 | stride: 1
223 | bias_term: false
224 | }
225 | }
226 |
227 | layer {
228 | bottom: "res2a_branch2a"
229 | top: "res2a_branch2a"
230 | name: "bn2a_branch2a"
231 | type: "BatchNorm"
232 | batch_norm_param {
233 | use_global_stats: false
234 | }
235 | }
236 |
237 | layer {
238 | bottom: "res2a_branch2a"
239 | top: "res2a_branch2a"
240 | name: "scale2a_branch2a"
241 | type: "Scale"
242 | scale_param {
243 | bias_term: true
244 | }
245 | }
246 |
247 | layer {
248 | bottom: "res2a_branch2a"
249 | top: "res2a_branch2a"
250 | name: "res2a_branch2a_relu"
251 | type: "ReLU"
252 | }
253 |
254 | layer {
255 | bottom: "res2a_branch2a"
256 | top: "res2a_branch2b"
257 | name: "res2a_branch2b"
258 | type: "Convolution"
259 |
260 | convolution_param {
261 | num_output: 64
262 | kernel_size: 3
263 | pad: 1
264 | stride: 1
265 | bias_term: false
266 | }
267 | }
268 |
269 | layer {
270 | bottom: "res2a_branch2b"
271 | top: "res2a_branch2b"
272 | name: "bn2a_branch2b"
273 | type: "BatchNorm"
274 | batch_norm_param {
275 | use_global_stats: false
276 | }
277 | }
278 |
279 | layer {
280 | bottom: "res2a_branch2b"
281 | top: "res2a_branch2b"
282 | name: "scale2a_branch2b"
283 | type: "Scale"
284 | scale_param {
285 | bias_term: true
286 | }
287 | }
288 |
289 | layer {
290 | bottom: "res2a_branch2b"
291 | top: "res2a_branch2b"
292 | name: "res2a_branch2b_relu"
293 | type: "ReLU"
294 | }
295 |
296 | layer {
297 | bottom: "res2a_branch2b"
298 | top: "res2a_branch2c"
299 | name: "res2a_branch2c"
300 | type: "Convolution"
301 |
302 | convolution_param {
303 | num_output: 256
304 | kernel_size: 1
305 | pad: 0
306 | stride: 1
307 | bias_term: false
308 | }
309 | }
310 |
311 | layer {
312 | bottom: "res2a_branch2c"
313 | top: "res2a_branch2c"
314 | name: "bn2a_branch2c"
315 | type: "BatchNorm"
316 | batch_norm_param {
317 | use_global_stats: false
318 | }
319 | }
320 |
321 | layer {
322 | bottom: "res2a_branch2c"
323 | top: "res2a_branch2c"
324 | name: "scale2a_branch2c"
325 | type: "Scale"
326 | scale_param {
327 | bias_term: true
328 | }
329 | }
330 |
331 | layer {
332 | bottom: "res2a_branch1"
333 | bottom: "res2a_branch2c"
334 | top: "res2a"
335 | name: "res2a"
336 | type: "Eltwise"
337 | }
338 |
339 | layer {
340 | bottom: "res2a"
341 | top: "res2a"
342 | name: "res2a_relu"
343 | type: "ReLU"
344 | }
345 |
346 | layer {
347 | bottom: "res2a"
348 | top: "res2b_branch2a"
349 | name: "res2b_branch2a"
350 | type: "Convolution"
351 |
352 | convolution_param {
353 | num_output: 64
354 | kernel_size: 1
355 | pad: 0
356 | stride: 1
357 | bias_term: false
358 | }
359 | }
360 |
361 | layer {
362 | bottom: "res2b_branch2a"
363 | top: "res2b_branch2a"
364 | name: "bn2b_branch2a"
365 | type: "BatchNorm"
366 | batch_norm_param {
367 | use_global_stats: false
368 | }
369 | }
370 |
371 | layer {
372 | bottom: "res2b_branch2a"
373 | top: "res2b_branch2a"
374 | name: "scale2b_branch2a"
375 | type: "Scale"
376 | scale_param {
377 | bias_term: true
378 | }
379 | }
380 |
381 | layer {
382 | bottom: "res2b_branch2a"
383 | top: "res2b_branch2a"
384 | name: "res2b_branch2a_relu"
385 | type: "ReLU"
386 | }
387 |
388 | layer {
389 | bottom: "res2b_branch2a"
390 | top: "res2b_branch2b"
391 | name: "res2b_branch2b"
392 | type: "Convolution"
393 |
394 | convolution_param {
395 | num_output: 64
396 | kernel_size: 3
397 | pad: 1
398 | stride: 1
399 | bias_term: false
400 | }
401 | }
402 |
403 | layer {
404 | bottom: "res2b_branch2b"
405 | top: "res2b_branch2b"
406 | name: "bn2b_branch2b"
407 | type: "BatchNorm"
408 | batch_norm_param {
409 | use_global_stats: false
410 | }
411 | }
412 |
413 | layer {
414 | bottom: "res2b_branch2b"
415 | top: "res2b_branch2b"
416 | name: "scale2b_branch2b"
417 | type: "Scale"
418 | scale_param {
419 | bias_term: true
420 | }
421 | }
422 |
423 | layer {
424 | bottom: "res2b_branch2b"
425 | top: "res2b_branch2b"
426 | name: "res2b_branch2b_relu"
427 | type: "ReLU"
428 | }
429 |
430 | layer {
431 | bottom: "res2b_branch2b"
432 | top: "res2b_branch2c"
433 | name: "res2b_branch2c"
434 | type: "Convolution"
435 |
436 | convolution_param {
437 | num_output: 256
438 | kernel_size: 1
439 | pad: 0
440 | stride: 1
441 | bias_term: false
442 | }
443 | }
444 |
445 | layer {
446 | bottom: "res2b_branch2c"
447 | top: "res2b_branch2c"
448 | name: "bn2b_branch2c"
449 | type: "BatchNorm"
450 | batch_norm_param {
451 | use_global_stats: false
452 | }
453 | }
454 |
455 | layer {
456 | bottom: "res2b_branch2c"
457 | top: "res2b_branch2c"
458 | name: "scale2b_branch2c"
459 | type: "Scale"
460 | scale_param {
461 | bias_term: true
462 | }
463 | }
464 |
465 | layer {
466 | bottom: "res2a"
467 | bottom: "res2b_branch2c"
468 | top: "res2b"
469 | name: "res2b"
470 | type: "Eltwise"
471 | }
472 |
473 | layer {
474 | bottom: "res2b"
475 | top: "res2b"
476 | name: "res2b_relu"
477 | type: "ReLU"
478 | }
479 |
480 | layer {
481 | bottom: "res2b"
482 | top: "res2c_branch2a"
483 | name: "res2c_branch2a"
484 | type: "Convolution"
485 |
486 | convolution_param {
487 | num_output: 64
488 | kernel_size: 1
489 | pad: 0
490 | stride: 1
491 | bias_term: false
492 | }
493 | }
494 |
495 | layer {
496 | bottom: "res2c_branch2a"
497 | top: "res2c_branch2a"
498 | name: "bn2c_branch2a"
499 | type: "BatchNorm"
500 | batch_norm_param {
501 | use_global_stats: false
502 | }
503 | }
504 |
505 | layer {
506 | bottom: "res2c_branch2a"
507 | top: "res2c_branch2a"
508 | name: "scale2c_branch2a"
509 | type: "Scale"
510 | scale_param {
511 | bias_term: true
512 | }
513 | }
514 |
515 | layer {
516 | bottom: "res2c_branch2a"
517 | top: "res2c_branch2a"
518 | name: "res2c_branch2a_relu"
519 | type: "ReLU"
520 | }
521 |
522 | layer {
523 | bottom: "res2c_branch2a"
524 | top: "res2c_branch2b"
525 | name: "res2c_branch2b"
526 | type: "Convolution"
527 |
528 | convolution_param {
529 | num_output: 64
530 | kernel_size: 3
531 | pad: 1
532 | stride: 1
533 | bias_term: false
534 | }
535 | }
536 |
537 | layer {
538 | bottom: "res2c_branch2b"
539 | top: "res2c_branch2b"
540 | name: "bn2c_branch2b"
541 | type: "BatchNorm"
542 | batch_norm_param {
543 | use_global_stats: false
544 | }
545 | }
546 |
547 | layer {
548 | bottom: "res2c_branch2b"
549 | top: "res2c_branch2b"
550 | name: "scale2c_branch2b"
551 | type: "Scale"
552 | scale_param {
553 | bias_term: true
554 | }
555 | }
556 |
557 | layer {
558 | bottom: "res2c_branch2b"
559 | top: "res2c_branch2b"
560 | name: "res2c_branch2b_relu"
561 | type: "ReLU"
562 | }
563 |
564 | layer {
565 | bottom: "res2c_branch2b"
566 | top: "res2c_branch2c"
567 | name: "res2c_branch2c"
568 | type: "Convolution"
569 |
570 | convolution_param {
571 | num_output: 256
572 | kernel_size: 1
573 | pad: 0
574 | stride: 1
575 | bias_term: false
576 | }
577 | }
578 |
579 | layer {
580 | bottom: "res2c_branch2c"
581 | top: "res2c_branch2c"
582 | name: "bn2c_branch2c"
583 | type: "BatchNorm"
584 | batch_norm_param {
585 | use_global_stats: false
586 | }
587 | }
588 |
589 | layer {
590 | bottom: "res2c_branch2c"
591 | top: "res2c_branch2c"
592 | name: "scale2c_branch2c"
593 | type: "Scale"
594 | scale_param {
595 | bias_term: true
596 | }
597 | }
598 |
599 | layer {
600 | bottom: "res2b"
601 | bottom: "res2c_branch2c"
602 | top: "res2c"
603 | name: "res2c"
604 | type: "Eltwise"
605 | }
606 |
607 | layer {
608 | bottom: "res2c"
609 | top: "res2c"
610 | name: "res2c_relu"
611 | type: "ReLU"
612 | }
613 |
614 | layer {
615 | bottom: "res2c"
616 | top: "res3a_branch1"
617 | name: "res3a_branch1"
618 | type: "Convolution"
619 |
620 | convolution_param {
621 | num_output: 512
622 | kernel_size: 1
623 | pad: 0
624 | stride: 2
625 | bias_term: false
626 | }
627 | }
628 |
629 | layer {
630 | bottom: "res3a_branch1"
631 | top: "res3a_branch1"
632 | name: "bn3a_branch1"
633 | type: "BatchNorm"
634 | batch_norm_param {
635 | use_global_stats: false
636 | }
637 | }
638 |
639 | layer {
640 | bottom: "res3a_branch1"
641 | top: "res3a_branch1"
642 | name: "scale3a_branch1"
643 | type: "Scale"
644 | scale_param {
645 | bias_term: true
646 | }
647 | }
648 |
649 | layer {
650 | bottom: "res2c"
651 | top: "res3a_branch2a"
652 | name: "res3a_branch2a"
653 | type: "Convolution"
654 |
655 | convolution_param {
656 | num_output: 128
657 | kernel_size: 1
658 | pad: 0
659 | stride: 2
660 | bias_term: false
661 | }
662 | }
663 |
664 | layer {
665 | bottom: "res3a_branch2a"
666 | top: "res3a_branch2a"
667 | name: "bn3a_branch2a"
668 | type: "BatchNorm"
669 | batch_norm_param {
670 | use_global_stats: false
671 | }
672 | }
673 |
674 | layer {
675 | bottom: "res3a_branch2a"
676 | top: "res3a_branch2a"
677 | name: "scale3a_branch2a"
678 | type: "Scale"
679 | scale_param {
680 | bias_term: true
681 | }
682 | }
683 |
684 | layer {
685 | bottom: "res3a_branch2a"
686 | top: "res3a_branch2a"
687 | name: "res3a_branch2a_relu"
688 | type: "ReLU"
689 | }
690 |
691 | layer {
692 | bottom: "res3a_branch2a"
693 | top: "res3a_branch2b"
694 | name: "res3a_branch2b"
695 | type: "Convolution"
696 |
697 | convolution_param {
698 | num_output: 128
699 | kernel_size: 3
700 | pad: 1
701 | stride: 1
702 | bias_term: false
703 | }
704 | }
705 |
706 | layer {
707 | bottom: "res3a_branch2b"
708 | top: "res3a_branch2b"
709 | name: "bn3a_branch2b"
710 | type: "BatchNorm"
711 | batch_norm_param {
712 | use_global_stats: false
713 | }
714 | }
715 |
716 | layer {
717 | bottom: "res3a_branch2b"
718 | top: "res3a_branch2b"
719 | name: "scale3a_branch2b"
720 | type: "Scale"
721 | scale_param {
722 | bias_term: true
723 | }
724 | }
725 |
726 | layer {
727 | bottom: "res3a_branch2b"
728 | top: "res3a_branch2b"
729 | name: "res3a_branch2b_relu"
730 | type: "ReLU"
731 | }
732 |
733 | layer {
734 | bottom: "res3a_branch2b"
735 | top: "res3a_branch2c"
736 | name: "res3a_branch2c"
737 | type: "Convolution"
738 |
739 | convolution_param {
740 | num_output: 512
741 | kernel_size: 1
742 | pad: 0
743 | stride: 1
744 | bias_term: false
745 | }
746 | }
747 |
748 | layer {
749 | bottom: "res3a_branch2c"
750 | top: "res3a_branch2c"
751 | name: "bn3a_branch2c"
752 | type: "BatchNorm"
753 | batch_norm_param {
754 | use_global_stats: false
755 | }
756 | }
757 |
758 | layer {
759 | bottom: "res3a_branch2c"
760 | top: "res3a_branch2c"
761 | name: "scale3a_branch2c"
762 | type: "Scale"
763 | scale_param {
764 | bias_term: true
765 | }
766 | }
767 |
768 | layer {
769 | bottom: "res3a_branch1"
770 | bottom: "res3a_branch2c"
771 | top: "res3a"
772 | name: "res3a"
773 | type: "Eltwise"
774 | }
775 |
776 | layer {
777 | bottom: "res3a"
778 | top: "res3a"
779 | name: "res3a_relu"
780 | type: "ReLU"
781 | }
782 |
783 | layer {
784 | bottom: "res3a"
785 | top: "res3b_branch2a"
786 | name: "res3b_branch2a"
787 | type: "Convolution"
788 |
789 | convolution_param {
790 | num_output: 128
791 | kernel_size: 1
792 | pad: 0
793 | stride: 1
794 | bias_term: false
795 | }
796 | }
797 |
798 | layer {
799 | bottom: "res3b_branch2a"
800 | top: "res3b_branch2a"
801 | name: "bn3b_branch2a"
802 | type: "BatchNorm"
803 | batch_norm_param {
804 | use_global_stats: false
805 | }
806 | }
807 |
808 | layer {
809 | bottom: "res3b_branch2a"
810 | top: "res3b_branch2a"
811 | name: "scale3b_branch2a"
812 | type: "Scale"
813 | scale_param {
814 | bias_term: true
815 | }
816 | }
817 |
818 | layer {
819 | bottom: "res3b_branch2a"
820 | top: "res3b_branch2a"
821 | name: "res3b_branch2a_relu"
822 | type: "ReLU"
823 | }
824 |
825 | layer {
826 | bottom: "res3b_branch2a"
827 | top: "res3b_branch2b"
828 | name: "res3b_branch2b"
829 | type: "Convolution"
830 |
831 | convolution_param {
832 | num_output: 128
833 | kernel_size: 3
834 | pad: 1
835 | stride: 1
836 | bias_term: false
837 | }
838 | }
839 |
840 | layer {
841 | bottom: "res3b_branch2b"
842 | top: "res3b_branch2b"
843 | name: "bn3b_branch2b"
844 | type: "BatchNorm"
845 | batch_norm_param {
846 | use_global_stats: false
847 | }
848 | }
849 |
850 | layer {
851 | bottom: "res3b_branch2b"
852 | top: "res3b_branch2b"
853 | name: "scale3b_branch2b"
854 | type: "Scale"
855 | scale_param {
856 | bias_term: true
857 | }
858 | }
859 |
860 | layer {
861 | bottom: "res3b_branch2b"
862 | top: "res3b_branch2b"
863 | name: "res3b_branch2b_relu"
864 | type: "ReLU"
865 | }
866 |
867 | layer {
868 | bottom: "res3b_branch2b"
869 | top: "res3b_branch2c"
870 | name: "res3b_branch2c"
871 | type: "Convolution"
872 |
873 | convolution_param {
874 | num_output: 512
875 | kernel_size: 1
876 | pad: 0
877 | stride: 1
878 | bias_term: false
879 | }
880 | }
881 |
882 | layer {
883 | bottom: "res3b_branch2c"
884 | top: "res3b_branch2c"
885 | name: "bn3b_branch2c"
886 | type: "BatchNorm"
887 | batch_norm_param {
888 | use_global_stats: false
889 | }
890 | }
891 |
892 | layer {
893 | bottom: "res3b_branch2c"
894 | top: "res3b_branch2c"
895 | name: "scale3b_branch2c"
896 | type: "Scale"
897 | scale_param {
898 | bias_term: true
899 | }
900 | }
901 |
902 | layer {
903 | bottom: "res3a"
904 | bottom: "res3b_branch2c"
905 | top: "res3b"
906 | name: "res3b"
907 | type: "Eltwise"
908 | }
909 |
910 | layer {
911 | bottom: "res3b"
912 | top: "res3b"
913 | name: "res3b_relu"
914 | type: "ReLU"
915 | }
916 |
917 | layer {
918 | bottom: "res3b"
919 | top: "res3c_branch2a"
920 | name: "res3c_branch2a"
921 | type: "Convolution"
922 |
923 | convolution_param {
924 | num_output: 128
925 | kernel_size: 1
926 | pad: 0
927 | stride: 1
928 | bias_term: false
929 | }
930 | }
931 |
932 | layer {
933 | bottom: "res3c_branch2a"
934 | top: "res3c_branch2a"
935 | name: "bn3c_branch2a"
936 | type: "BatchNorm"
937 | batch_norm_param {
938 | use_global_stats: false
939 | }
940 | }
941 |
942 | layer {
943 | bottom: "res3c_branch2a"
944 | top: "res3c_branch2a"
945 | name: "scale3c_branch2a"
946 | type: "Scale"
947 | scale_param {
948 | bias_term: true
949 | }
950 | }
951 |
952 | layer {
953 | bottom: "res3c_branch2a"
954 | top: "res3c_branch2a"
955 | name: "res3c_branch2a_relu"
956 | type: "ReLU"
957 | }
958 |
959 | layer {
960 | bottom: "res3c_branch2a"
961 | top: "res3c_branch2b"
962 | name: "res3c_branch2b"
963 | type: "Convolution"
964 |
965 | convolution_param {
966 | num_output: 128
967 | kernel_size: 3
968 | pad: 1
969 | stride: 1
970 | bias_term: false
971 | }
972 | }
973 |
974 | layer {
975 | bottom: "res3c_branch2b"
976 | top: "res3c_branch2b"
977 | name: "bn3c_branch2b"
978 | type: "BatchNorm"
979 | batch_norm_param {
980 | use_global_stats: false
981 | }
982 | }
983 |
984 | layer {
985 | bottom: "res3c_branch2b"
986 | top: "res3c_branch2b"
987 | name: "scale3c_branch2b"
988 | type: "Scale"
989 | scale_param {
990 | bias_term: true
991 | }
992 | }
993 |
994 | layer {
995 | bottom: "res3c_branch2b"
996 | top: "res3c_branch2b"
997 | name: "res3c_branch2b_relu"
998 | type: "ReLU"
999 | }
1000 |
1001 | layer {
1002 | bottom: "res3c_branch2b"
1003 | top: "res3c_branch2c"
1004 | name: "res3c_branch2c"
1005 | type: "Convolution"
1006 |
1007 | convolution_param {
1008 | num_output: 512
1009 | kernel_size: 1
1010 | pad: 0
1011 | stride: 1
1012 | bias_term: false
1013 | }
1014 | }
1015 |
1016 | layer {
1017 | bottom: "res3c_branch2c"
1018 | top: "res3c_branch2c"
1019 | name: "bn3c_branch2c"
1020 | type: "BatchNorm"
1021 | batch_norm_param {
1022 | use_global_stats: false
1023 | }
1024 | }
1025 |
1026 | layer {
1027 | bottom: "res3c_branch2c"
1028 | top: "res3c_branch2c"
1029 | name: "scale3c_branch2c"
1030 | type: "Scale"
1031 | scale_param {
1032 | bias_term: true
1033 | }
1034 | }
1035 |
1036 | layer {
1037 | bottom: "res3b"
1038 | bottom: "res3c_branch2c"
1039 | top: "res3c"
1040 | name: "res3c"
1041 | type: "Eltwise"
1042 | }
1043 |
1044 | layer {
1045 | bottom: "res3c"
1046 | top: "res3c"
1047 | name: "res3c_relu"
1048 | type: "ReLU"
1049 | }
1050 |
1051 | layer {
1052 | bottom: "res3c"
1053 | top: "res3d_branch2a"
1054 | name: "res3d_branch2a"
1055 | type: "Convolution"
1056 |
1057 | convolution_param {
1058 | num_output: 128
1059 | kernel_size: 1
1060 | pad: 0
1061 | stride: 1
1062 | bias_term: false
1063 | }
1064 | }
1065 |
1066 | layer {
1067 | bottom: "res3d_branch2a"
1068 | top: "res3d_branch2a"
1069 | name: "bn3d_branch2a"
1070 | type: "BatchNorm"
1071 | batch_norm_param {
1072 | use_global_stats: false
1073 | }
1074 | }
1075 |
1076 | layer {
1077 | bottom: "res3d_branch2a"
1078 | top: "res3d_branch2a"
1079 | name: "scale3d_branch2a"
1080 | type: "Scale"
1081 | scale_param {
1082 | bias_term: true
1083 | }
1084 | }
1085 |
1086 | layer {
1087 | bottom: "res3d_branch2a"
1088 | top: "res3d_branch2a"
1089 | name: "res3d_branch2a_relu"
1090 | type: "ReLU"
1091 | }
1092 |
1093 | layer {
1094 | bottom: "res3d_branch2a"
1095 | top: "res3d_branch2b"
1096 | name: "res3d_branch2b"
1097 | type: "Convolution"
1098 |
1099 | convolution_param {
1100 | num_output: 128
1101 | kernel_size: 3
1102 | pad: 1
1103 | stride: 1
1104 | bias_term: false
1105 | }
1106 | }
1107 |
1108 | layer {
1109 | bottom: "res3d_branch2b"
1110 | top: "res3d_branch2b"
1111 | name: "bn3d_branch2b"
1112 | type: "BatchNorm"
1113 | batch_norm_param {
1114 | use_global_stats: false
1115 | }
1116 | }
1117 |
1118 | layer {
1119 | bottom: "res3d_branch2b"
1120 | top: "res3d_branch2b"
1121 | name: "scale3d_branch2b"
1122 | type: "Scale"
1123 | scale_param {
1124 | bias_term: true
1125 | }
1126 | }
1127 |
1128 | layer {
1129 | bottom: "res3d_branch2b"
1130 | top: "res3d_branch2b"
1131 | name: "res3d_branch2b_relu"
1132 | type: "ReLU"
1133 | }
1134 |
1135 | layer {
1136 | bottom: "res3d_branch2b"
1137 | top: "res3d_branch2c"
1138 | name: "res3d_branch2c"
1139 | type: "Convolution"
1140 |
1141 | convolution_param {
1142 | num_output: 512
1143 | kernel_size: 1
1144 | pad: 0
1145 | stride: 1
1146 | bias_term: false
1147 | }
1148 | }
1149 |
1150 | layer {
1151 | bottom: "res3d_branch2c"
1152 | top: "res3d_branch2c"
1153 | name: "bn3d_branch2c"
1154 | type: "BatchNorm"
1155 | batch_norm_param {
1156 | use_global_stats: false
1157 | }
1158 | }
1159 |
1160 | layer {
1161 | bottom: "res3d_branch2c"
1162 | top: "res3d_branch2c"
1163 | name: "scale3d_branch2c"
1164 | type: "Scale"
1165 | scale_param {
1166 | bias_term: true
1167 | }
1168 | }
1169 |
1170 | layer {
1171 | bottom: "res3c"
1172 | bottom: "res3d_branch2c"
1173 | top: "res3d"
1174 | name: "res3d"
1175 | type: "Eltwise"
1176 | }
1177 |
1178 | layer {
1179 | bottom: "res3d"
1180 | top: "res3d"
1181 | name: "res3d_relu"
1182 | type: "ReLU"
1183 | }
1184 |
1185 | layer {
1186 | bottom: "res3d"
1187 | top: "res4a_branch1"
1188 | name: "res4a_branch1"
1189 | type: "Convolution"
1190 |
1191 | convolution_param {
1192 | num_output: 1024
1193 | kernel_size: 1
1194 | pad: 0
1195 | stride: 2
1196 | bias_term: false
1197 | }
1198 | }
1199 |
1200 | layer {
1201 | bottom: "res4a_branch1"
1202 | top: "res4a_branch1"
1203 | name: "bn4a_branch1"
1204 | type: "BatchNorm"
1205 | batch_norm_param {
1206 | use_global_stats: false
1207 | }
1208 | }
1209 |
1210 | layer {
1211 | bottom: "res4a_branch1"
1212 | top: "res4a_branch1"
1213 | name: "scale4a_branch1"
1214 | type: "Scale"
1215 | scale_param {
1216 | bias_term: true
1217 | }
1218 | }
1219 |
1220 | layer {
1221 | bottom: "res3d"
1222 | top: "res4a_branch2a"
1223 | name: "res4a_branch2a"
1224 | type: "Convolution"
1225 |
1226 | convolution_param {
1227 | num_output: 256
1228 | kernel_size: 1
1229 | pad: 0
1230 | stride: 2
1231 | bias_term: false
1232 | }
1233 | }
1234 |
1235 | layer {
1236 | bottom: "res4a_branch2a"
1237 | top: "res4a_branch2a"
1238 | name: "bn4a_branch2a"
1239 | type: "BatchNorm"
1240 | batch_norm_param {
1241 | use_global_stats: false
1242 | }
1243 | }
1244 |
1245 | layer {
1246 | bottom: "res4a_branch2a"
1247 | top: "res4a_branch2a"
1248 | name: "scale4a_branch2a"
1249 | type: "Scale"
1250 | scale_param {
1251 | bias_term: true
1252 | }
1253 | }
1254 |
1255 | layer {
1256 | bottom: "res4a_branch2a"
1257 | top: "res4a_branch2a"
1258 | name: "res4a_branch2a_relu"
1259 | type: "ReLU"
1260 | }
1261 |
1262 | layer {
1263 | bottom: "res4a_branch2a"
1264 | top: "res4a_branch2b"
1265 | name: "res4a_branch2b"
1266 | type: "Convolution"
1267 |
1268 | convolution_param {
1269 | num_output: 256
1270 | kernel_size: 3
1271 | pad: 1
1272 | stride: 1
1273 | bias_term: false
1274 | }
1275 | }
1276 |
1277 | layer {
1278 | bottom: "res4a_branch2b"
1279 | top: "res4a_branch2b"
1280 | name: "bn4a_branch2b"
1281 | type: "BatchNorm"
1282 | batch_norm_param {
1283 | use_global_stats: false
1284 | }
1285 | }
1286 |
1287 | layer {
1288 | bottom: "res4a_branch2b"
1289 | top: "res4a_branch2b"
1290 | name: "scale4a_branch2b"
1291 | type: "Scale"
1292 | scale_param {
1293 | bias_term: true
1294 | }
1295 | }
1296 |
1297 | layer {
1298 | bottom: "res4a_branch2b"
1299 | top: "res4a_branch2b"
1300 | name: "res4a_branch2b_relu"
1301 | type: "ReLU"
1302 | }
1303 |
1304 | layer {
1305 | bottom: "res4a_branch2b"
1306 | top: "res4a_branch2c"
1307 | name: "res4a_branch2c"
1308 | type: "Convolution"
1309 |
1310 | convolution_param {
1311 | num_output: 1024
1312 | kernel_size: 1
1313 | pad: 0
1314 | stride: 1
1315 | bias_term: false
1316 | }
1317 | }
1318 |
1319 | layer {
1320 | bottom: "res4a_branch2c"
1321 | top: "res4a_branch2c"
1322 | name: "bn4a_branch2c"
1323 | type: "BatchNorm"
1324 | batch_norm_param {
1325 | use_global_stats: false
1326 | }
1327 | }
1328 |
1329 | layer {
1330 | bottom: "res4a_branch2c"
1331 | top: "res4a_branch2c"
1332 | name: "scale4a_branch2c"
1333 | type: "Scale"
1334 | scale_param {
1335 | bias_term: true
1336 | }
1337 | }
1338 |
1339 | layer {
1340 | bottom: "res4a_branch1"
1341 | bottom: "res4a_branch2c"
1342 | top: "res4a"
1343 | name: "res4a"
1344 | type: "Eltwise"
1345 | }
1346 |
1347 | layer {
1348 | bottom: "res4a"
1349 | top: "res4a"
1350 | name: "res4a_relu"
1351 | type: "ReLU"
1352 | }
1353 |
1354 | layer {
1355 | bottom: "res4a"
1356 | top: "res4b_branch2a"
1357 | name: "res4b_branch2a"
1358 | type: "Convolution"
1359 |
1360 | convolution_param {
1361 | num_output: 256
1362 | kernel_size: 1
1363 | pad: 0
1364 | stride: 1
1365 | bias_term: false
1366 | }
1367 | }
1368 |
1369 | layer {
1370 | bottom: "res4b_branch2a"
1371 | top: "res4b_branch2a"
1372 | name: "bn4b_branch2a"
1373 | type: "BatchNorm"
1374 | batch_norm_param {
1375 | use_global_stats: false
1376 | }
1377 | }
1378 |
1379 | layer {
1380 | bottom: "res4b_branch2a"
1381 | top: "res4b_branch2a"
1382 | name: "scale4b_branch2a"
1383 | type: "Scale"
1384 | scale_param {
1385 | bias_term: true
1386 | }
1387 | }
1388 |
1389 | layer {
1390 | bottom: "res4b_branch2a"
1391 | top: "res4b_branch2a"
1392 | name: "res4b_branch2a_relu"
1393 | type: "ReLU"
1394 | }
1395 |
1396 | layer {
1397 | bottom: "res4b_branch2a"
1398 | top: "res4b_branch2b"
1399 | name: "res4b_branch2b"
1400 | type: "Convolution"
1401 |
1402 | convolution_param {
1403 | num_output: 256
1404 | kernel_size: 3
1405 | pad: 1
1406 | stride: 1
1407 | bias_term: false
1408 | }
1409 | }
1410 |
1411 | layer {
1412 | bottom: "res4b_branch2b"
1413 | top: "res4b_branch2b"
1414 | name: "bn4b_branch2b"
1415 | type: "BatchNorm"
1416 | batch_norm_param {
1417 | use_global_stats: false
1418 | }
1419 | }
1420 |
1421 | layer {
1422 | bottom: "res4b_branch2b"
1423 | top: "res4b_branch2b"
1424 | name: "scale4b_branch2b"
1425 | type: "Scale"
1426 | scale_param {
1427 | bias_term: true
1428 | }
1429 | }
1430 |
1431 | layer {
1432 | bottom: "res4b_branch2b"
1433 | top: "res4b_branch2b"
1434 | name: "res4b_branch2b_relu"
1435 | type: "ReLU"
1436 | }
1437 |
1438 | layer {
1439 | bottom: "res4b_branch2b"
1440 | top: "res4b_branch2c"
1441 | name: "res4b_branch2c"
1442 | type: "Convolution"
1443 |
1444 | convolution_param {
1445 | num_output: 1024
1446 | kernel_size: 1
1447 | pad: 0
1448 | stride: 1
1449 | bias_term: false
1450 | }
1451 | }
1452 |
1453 | layer {
1454 | bottom: "res4b_branch2c"
1455 | top: "res4b_branch2c"
1456 | name: "bn4b_branch2c"
1457 | type: "BatchNorm"
1458 | batch_norm_param {
1459 | use_global_stats: false
1460 | }
1461 | }
1462 |
1463 | layer {
1464 | bottom: "res4b_branch2c"
1465 | top: "res4b_branch2c"
1466 | name: "scale4b_branch2c"
1467 | type: "Scale"
1468 | scale_param {
1469 | bias_term: true
1470 | }
1471 | }
1472 |
1473 | layer {
1474 | bottom: "res4a"
1475 | bottom: "res4b_branch2c"
1476 | top: "res4b"
1477 | name: "res4b"
1478 | type: "Eltwise"
1479 | }
1480 |
1481 | layer {
1482 | bottom: "res4b"
1483 | top: "res4b"
1484 | name: "res4b_relu"
1485 | type: "ReLU"
1486 | }
1487 |
1488 | layer {
1489 | bottom: "res4b"
1490 | top: "res4c_branch2a"
1491 | name: "res4c_branch2a"
1492 | type: "Convolution"
1493 |
1494 | convolution_param {
1495 | num_output: 256
1496 | kernel_size: 1
1497 | pad: 0
1498 | stride: 1
1499 | bias_term: false
1500 | }
1501 | }
1502 |
1503 | layer {
1504 | bottom: "res4c_branch2a"
1505 | top: "res4c_branch2a"
1506 | name: "bn4c_branch2a"
1507 | type: "BatchNorm"
1508 | batch_norm_param {
1509 | use_global_stats: false
1510 | }
1511 | }
1512 |
1513 | layer {
1514 | bottom: "res4c_branch2a"
1515 | top: "res4c_branch2a"
1516 | name: "scale4c_branch2a"
1517 | type: "Scale"
1518 | scale_param {
1519 | bias_term: true
1520 | }
1521 | }
1522 |
1523 | layer {
1524 | bottom: "res4c_branch2a"
1525 | top: "res4c_branch2a"
1526 | name: "res4c_branch2a_relu"
1527 | type: "ReLU"
1528 | }
1529 |
1530 | layer {
1531 | bottom: "res4c_branch2a"
1532 | top: "res4c_branch2b"
1533 | name: "res4c_branch2b"
1534 | type: "Convolution"
1535 |
1536 | convolution_param {
1537 | num_output: 256
1538 | kernel_size: 3
1539 | pad: 1
1540 | stride: 1
1541 | bias_term: false
1542 | }
1543 | }
1544 |
1545 | layer {
1546 | bottom: "res4c_branch2b"
1547 | top: "res4c_branch2b"
1548 | name: "bn4c_branch2b"
1549 | type: "BatchNorm"
1550 | batch_norm_param {
1551 | use_global_stats: false
1552 | }
1553 | }
1554 |
1555 | layer {
1556 | bottom: "res4c_branch2b"
1557 | top: "res4c_branch2b"
1558 | name: "scale4c_branch2b"
1559 | type: "Scale"
1560 | scale_param {
1561 | bias_term: true
1562 | }
1563 | }
1564 |
1565 | layer {
1566 | bottom: "res4c_branch2b"
1567 | top: "res4c_branch2b"
1568 | name: "res4c_branch2b_relu"
1569 | type: "ReLU"
1570 | }
1571 |
1572 | layer {
1573 | bottom: "res4c_branch2b"
1574 | top: "res4c_branch2c"
1575 | name: "res4c_branch2c"
1576 | type: "Convolution"
1577 |
1578 | convolution_param {
1579 | num_output: 1024
1580 | kernel_size: 1
1581 | pad: 0
1582 | stride: 1
1583 | bias_term: false
1584 | }
1585 | }
1586 |
1587 | layer {
1588 | bottom: "res4c_branch2c"
1589 | top: "res4c_branch2c"
1590 | name: "bn4c_branch2c"
1591 | type: "BatchNorm"
1592 | batch_norm_param {
1593 | use_global_stats: false
1594 | }
1595 | }
1596 |
1597 | layer {
1598 | bottom: "res4c_branch2c"
1599 | top: "res4c_branch2c"
1600 | name: "scale4c_branch2c"
1601 | type: "Scale"
1602 | scale_param {
1603 | bias_term: true
1604 | }
1605 | }
1606 |
1607 | layer {
1608 | bottom: "res4b"
1609 | bottom: "res4c_branch2c"
1610 | top: "res4c"
1611 | name: "res4c"
1612 | type: "Eltwise"
1613 | }
1614 |
1615 | layer {
1616 | bottom: "res4c"
1617 | top: "res4c"
1618 | name: "res4c_relu"
1619 | type: "ReLU"
1620 | }
1621 |
1622 | layer {
1623 | bottom: "res4c"
1624 | top: "res4d_branch2a"
1625 | name: "res4d_branch2a"
1626 | type: "Convolution"
1627 |
1628 | convolution_param {
1629 | num_output: 256
1630 | kernel_size: 1
1631 | pad: 0
1632 | stride: 1
1633 | bias_term: false
1634 | }
1635 | }
1636 |
1637 | layer {
1638 | bottom: "res4d_branch2a"
1639 | top: "res4d_branch2a"
1640 | name: "bn4d_branch2a"
1641 | type: "BatchNorm"
1642 | batch_norm_param {
1643 | use_global_stats: false
1644 | }
1645 | }
1646 |
1647 | layer {
1648 | bottom: "res4d_branch2a"
1649 | top: "res4d_branch2a"
1650 | name: "scale4d_branch2a"
1651 | type: "Scale"
1652 | scale_param {
1653 | bias_term: true
1654 | }
1655 | }
1656 |
1657 | layer {
1658 | bottom: "res4d_branch2a"
1659 | top: "res4d_branch2a"
1660 | name: "res4d_branch2a_relu"
1661 | type: "ReLU"
1662 | }
1663 |
1664 | layer {
1665 | bottom: "res4d_branch2a"
1666 | top: "res4d_branch2b"
1667 | name: "res4d_branch2b"
1668 | type: "Convolution"
1669 |
1670 | convolution_param {
1671 | num_output: 256
1672 | kernel_size: 3
1673 | pad: 1
1674 | stride: 1
1675 | bias_term: false
1676 | }
1677 | }
1678 |
1679 | layer {
1680 | bottom: "res4d_branch2b"
1681 | top: "res4d_branch2b"
1682 | name: "bn4d_branch2b"
1683 | type: "BatchNorm"
1684 | batch_norm_param {
1685 | use_global_stats: false
1686 | }
1687 | }
1688 |
1689 | layer {
1690 | bottom: "res4d_branch2b"
1691 | top: "res4d_branch2b"
1692 | name: "scale4d_branch2b"
1693 | type: "Scale"
1694 | scale_param {
1695 | bias_term: true
1696 | }
1697 | }
1698 |
1699 | layer {
1700 | bottom: "res4d_branch2b"
1701 | top: "res4d_branch2b"
1702 | name: "res4d_branch2b_relu"
1703 | type: "ReLU"
1704 | }
1705 |
1706 | layer {
1707 | bottom: "res4d_branch2b"
1708 | top: "res4d_branch2c"
1709 | name: "res4d_branch2c"
1710 | type: "Convolution"
1711 |
1712 | convolution_param {
1713 | num_output: 1024
1714 | kernel_size: 1
1715 | pad: 0
1716 | stride: 1
1717 | bias_term: false
1718 | }
1719 | }
1720 |
1721 | layer {
1722 | bottom: "res4d_branch2c"
1723 | top: "res4d_branch2c"
1724 | name: "bn4d_branch2c"
1725 | type: "BatchNorm"
1726 | batch_norm_param {
1727 | use_global_stats: false
1728 | }
1729 | }
1730 |
1731 | layer {
1732 | bottom: "res4d_branch2c"
1733 | top: "res4d_branch2c"
1734 | name: "scale4d_branch2c"
1735 | type: "Scale"
1736 | scale_param {
1737 | bias_term: true
1738 | }
1739 | }
1740 |
1741 | layer {
1742 | bottom: "res4c"
1743 | bottom: "res4d_branch2c"
1744 | top: "res4d"
1745 | name: "res4d"
1746 | type: "Eltwise"
1747 | }
1748 |
1749 | layer {
1750 | bottom: "res4d"
1751 | top: "res4d"
1752 | name: "res4d_relu"
1753 | type: "ReLU"
1754 | }
1755 |
1756 | layer {
1757 | bottom: "res4d"
1758 | top: "res4e_branch2a"
1759 | name: "res4e_branch2a"
1760 | type: "Convolution"
1761 |
1762 | convolution_param {
1763 | num_output: 256
1764 | kernel_size: 1
1765 | pad: 0
1766 | stride: 1
1767 | bias_term: false
1768 | }
1769 | }
1770 |
1771 | layer {
1772 | bottom: "res4e_branch2a"
1773 | top: "res4e_branch2a"
1774 | name: "bn4e_branch2a"
1775 | type: "BatchNorm"
1776 | batch_norm_param {
1777 | use_global_stats: false
1778 | }
1779 | }
1780 |
1781 | layer {
1782 | bottom: "res4e_branch2a"
1783 | top: "res4e_branch2a"
1784 | name: "scale4e_branch2a"
1785 | type: "Scale"
1786 | scale_param {
1787 | bias_term: true
1788 | }
1789 | }
1790 |
1791 | layer {
1792 | bottom: "res4e_branch2a"
1793 | top: "res4e_branch2a"
1794 | name: "res4e_branch2a_relu"
1795 | type: "ReLU"
1796 | }
1797 |
1798 | layer {
1799 | bottom: "res4e_branch2a"
1800 | top: "res4e_branch2b"
1801 | name: "res4e_branch2b"
1802 | type: "Convolution"
1803 |
1804 | convolution_param {
1805 | num_output: 256
1806 | kernel_size: 3
1807 | pad: 1
1808 | stride: 1
1809 | bias_term: false
1810 | }
1811 | }
1812 |
1813 | layer {
1814 | bottom: "res4e_branch2b"
1815 | top: "res4e_branch2b"
1816 | name: "bn4e_branch2b"
1817 | type: "BatchNorm"
1818 | batch_norm_param {
1819 | use_global_stats: false
1820 | }
1821 | }
1822 |
1823 | layer {
1824 | bottom: "res4e_branch2b"
1825 | top: "res4e_branch2b"
1826 | name: "scale4e_branch2b"
1827 | type: "Scale"
1828 | scale_param {
1829 | bias_term: true
1830 | }
1831 | }
1832 |
1833 | layer {
1834 | bottom: "res4e_branch2b"
1835 | top: "res4e_branch2b"
1836 | name: "res4e_branch2b_relu"
1837 | type: "ReLU"
1838 | }
1839 |
1840 | layer {
1841 | bottom: "res4e_branch2b"
1842 | top: "res4e_branch2c"
1843 | name: "res4e_branch2c"
1844 | type: "Convolution"
1845 |
1846 | convolution_param {
1847 | num_output: 1024
1848 | kernel_size: 1
1849 | pad: 0
1850 | stride: 1
1851 | bias_term: false
1852 | }
1853 | }
1854 |
1855 | layer {
1856 | bottom: "res4e_branch2c"
1857 | top: "res4e_branch2c"
1858 | name: "bn4e_branch2c"
1859 | type: "BatchNorm"
1860 | batch_norm_param {
1861 | use_global_stats: false
1862 | }
1863 | }
1864 |
1865 | layer {
1866 | bottom: "res4e_branch2c"
1867 | top: "res4e_branch2c"
1868 | name: "scale4e_branch2c"
1869 | type: "Scale"
1870 | scale_param {
1871 | bias_term: true
1872 | }
1873 | }
1874 |
1875 | layer {
1876 | bottom: "res4d"
1877 | bottom: "res4e_branch2c"
1878 | top: "res4e"
1879 | name: "res4e"
1880 | type: "Eltwise"
1881 | }
1882 |
1883 | layer {
1884 | bottom: "res4e"
1885 | top: "res4e"
1886 | name: "res4e_relu"
1887 | type: "ReLU"
1888 | }
1889 |
1890 | layer {
1891 | bottom: "res4e"
1892 | top: "res4f_branch2a"
1893 | name: "res4f_branch2a"
1894 | type: "Convolution"
1895 |
1896 | convolution_param {
1897 | num_output: 256
1898 | kernel_size: 1
1899 | pad: 0
1900 | stride: 1
1901 | bias_term: false
1902 | }
1903 | }
1904 |
1905 | layer {
1906 | bottom: "res4f_branch2a"
1907 | top: "res4f_branch2a"
1908 | name: "bn4f_branch2a"
1909 | type: "BatchNorm"
1910 | batch_norm_param {
1911 | use_global_stats: false
1912 | }
1913 | }
1914 |
1915 | layer {
1916 | bottom: "res4f_branch2a"
1917 | top: "res4f_branch2a"
1918 | name: "scale4f_branch2a"
1919 | type: "Scale"
1920 | scale_param {
1921 | bias_term: true
1922 | }
1923 | }
1924 |
1925 | layer {
1926 | bottom: "res4f_branch2a"
1927 | top: "res4f_branch2a"
1928 | name: "res4f_branch2a_relu"
1929 | type: "ReLU"
1930 | }
1931 |
1932 | layer {
1933 | bottom: "res4f_branch2a"
1934 | top: "res4f_branch2b"
1935 | name: "res4f_branch2b"
1936 | type: "Convolution"
1937 |
1938 | convolution_param {
1939 | num_output: 256
1940 | kernel_size: 3
1941 | pad: 1
1942 | stride: 1
1943 | bias_term: false
1944 | }
1945 | }
1946 |
1947 | layer {
1948 | bottom: "res4f_branch2b"
1949 | top: "res4f_branch2b"
1950 | name: "bn4f_branch2b"
1951 | type: "BatchNorm"
1952 | batch_norm_param {
1953 | use_global_stats: false
1954 | }
1955 | }
1956 |
1957 | layer {
1958 | bottom: "res4f_branch2b"
1959 | top: "res4f_branch2b"
1960 | name: "scale4f_branch2b"
1961 | type: "Scale"
1962 | scale_param {
1963 | bias_term: true
1964 | }
1965 | }
1966 |
1967 | layer {
1968 | bottom: "res4f_branch2b"
1969 | top: "res4f_branch2b"
1970 | name: "res4f_branch2b_relu"
1971 | type: "ReLU"
1972 | }
1973 |
1974 | layer {
1975 | bottom: "res4f_branch2b"
1976 | top: "res4f_branch2c"
1977 | name: "res4f_branch2c"
1978 | type: "Convolution"
1979 |
1980 | convolution_param {
1981 | num_output: 1024
1982 | kernel_size: 1
1983 | pad: 0
1984 | stride: 1
1985 | bias_term: false
1986 | }
1987 | }
1988 |
1989 | layer {
1990 | bottom: "res4f_branch2c"
1991 | top: "res4f_branch2c"
1992 | name: "bn4f_branch2c"
1993 | type: "BatchNorm"
1994 | batch_norm_param {
1995 | use_global_stats: false
1996 | }
1997 | }
1998 |
1999 | layer {
2000 | bottom: "res4f_branch2c"
2001 | top: "res4f_branch2c"
2002 | name: "scale4f_branch2c"
2003 | type: "Scale"
2004 | scale_param {
2005 | bias_term: true
2006 | }
2007 | }
2008 |
2009 | layer {
2010 | bottom: "res4e"
2011 | bottom: "res4f_branch2c"
2012 | top: "res4f"
2013 | name: "res4f"
2014 | type: "Eltwise"
2015 | }
2016 |
2017 | layer {
2018 | bottom: "res4f"
2019 | top: "res4f"
2020 | name: "res4f_relu"
2021 | type: "ReLU"
2022 | }
2023 |
2024 | layer {
2025 | bottom: "res4f"
2026 | top: "res5a_branch1"
2027 | name: "res5a_branch1"
2028 | type: "Convolution"
2029 |
2030 | convolution_param {
2031 | num_output: 2048
2032 | kernel_size: 1
2033 | pad: 0
2034 | stride: 2
2035 | bias_term: false
2036 | }
2037 | }
2038 |
2039 | layer {
2040 | bottom: "res5a_branch1"
2041 | top: "res5a_branch1"
2042 | name: "bn5a_branch1"
2043 | type: "BatchNorm"
2044 | batch_norm_param {
2045 | use_global_stats: false
2046 | }
2047 | }
2048 |
2049 | layer {
2050 | bottom: "res5a_branch1"
2051 | top: "res5a_branch1"
2052 | name: "scale5a_branch1"
2053 | type: "Scale"
2054 | scale_param {
2055 | bias_term: true
2056 | }
2057 | }
2058 |
2059 | layer {
2060 | bottom: "res4f"
2061 | top: "res5a_branch2a"
2062 | name: "res5a_branch2a"
2063 | type: "Convolution"
2064 |
2065 | convolution_param {
2066 | num_output: 512
2067 | kernel_size: 1
2068 | pad: 0
2069 | stride: 2
2070 | bias_term: false
2071 | }
2072 | }
2073 |
2074 | layer {
2075 | bottom: "res5a_branch2a"
2076 | top: "res5a_branch2a"
2077 | name: "bn5a_branch2a"
2078 | type: "BatchNorm"
2079 | batch_norm_param {
2080 | use_global_stats: false
2081 | }
2082 | }
2083 |
2084 | layer {
2085 | bottom: "res5a_branch2a"
2086 | top: "res5a_branch2a"
2087 | name: "scale5a_branch2a"
2088 | type: "Scale"
2089 | scale_param {
2090 | bias_term: true
2091 | }
2092 | }
2093 |
2094 | layer {
2095 | bottom: "res5a_branch2a"
2096 | top: "res5a_branch2a"
2097 | name: "res5a_branch2a_relu"
2098 | type: "ReLU"
2099 | }
2100 |
2101 | layer {
2102 | bottom: "res5a_branch2a"
2103 | top: "res5a_branch2b"
2104 | name: "res5a_branch2b"
2105 | type: "Convolution"
2106 |
2107 | convolution_param {
2108 | num_output: 512
2109 | kernel_size: 3
2110 | pad: 1
2111 | stride: 1
2112 | bias_term: false
2113 | }
2114 | }
2115 |
2116 | layer {
2117 | bottom: "res5a_branch2b"
2118 | top: "res5a_branch2b"
2119 | name: "bn5a_branch2b"
2120 | type: "BatchNorm"
2121 | batch_norm_param {
2122 | use_global_stats: false
2123 | }
2124 | }
2125 |
2126 | layer {
2127 | bottom: "res5a_branch2b"
2128 | top: "res5a_branch2b"
2129 | name: "scale5a_branch2b"
2130 | type: "Scale"
2131 | scale_param {
2132 | bias_term: true
2133 | }
2134 | }
2135 |
2136 | layer {
2137 | bottom: "res5a_branch2b"
2138 | top: "res5a_branch2b"
2139 | name: "res5a_branch2b_relu"
2140 | type: "ReLU"
2141 | }
2142 |
2143 | layer {
2144 | bottom: "res5a_branch2b"
2145 | top: "res5a_branch2c"
2146 | name: "res5a_branch2c"
2147 | type: "Convolution"
2148 |
2149 | convolution_param {
2150 | num_output: 2048
2151 | kernel_size: 1
2152 | pad: 0
2153 | stride: 1
2154 | bias_term: false
2155 | }
2156 | }
2157 |
2158 | layer {
2159 | bottom: "res5a_branch2c"
2160 | top: "res5a_branch2c"
2161 | name: "bn5a_branch2c"
2162 | type: "BatchNorm"
2163 | batch_norm_param {
2164 | use_global_stats: false
2165 | }
2166 | }
2167 |
2168 | layer {
2169 | bottom: "res5a_branch2c"
2170 | top: "res5a_branch2c"
2171 | name: "scale5a_branch2c"
2172 | type: "Scale"
2173 | scale_param {
2174 | bias_term: true
2175 | }
2176 | }
2177 |
2178 | layer {
2179 | bottom: "res5a_branch1"
2180 | bottom: "res5a_branch2c"
2181 | top: "res5a"
2182 | name: "res5a"
2183 | type: "Eltwise"
2184 | }
2185 |
2186 | layer {
2187 | bottom: "res5a"
2188 | top: "res5a"
2189 | name: "res5a_relu"
2190 | type: "ReLU"
2191 | }
2192 |
2193 | layer {
2194 | bottom: "res5a"
2195 | top: "res5b_branch2a"
2196 | name: "res5b_branch2a"
2197 | type: "Convolution"
2198 |
2199 | convolution_param {
2200 | num_output: 512
2201 | kernel_size: 1
2202 | pad: 0
2203 | stride: 1
2204 | bias_term: false
2205 | }
2206 | }
2207 |
2208 | layer {
2209 | bottom: "res5b_branch2a"
2210 | top: "res5b_branch2a"
2211 | name: "bn5b_branch2a"
2212 | type: "BatchNorm"
2213 | batch_norm_param {
2214 | use_global_stats: false
2215 | }
2216 | }
2217 |
2218 | layer {
2219 | bottom: "res5b_branch2a"
2220 | top: "res5b_branch2a"
2221 | name: "scale5b_branch2a"
2222 | type: "Scale"
2223 | scale_param {
2224 | bias_term: true
2225 | }
2226 | }
2227 |
2228 | layer {
2229 | bottom: "res5b_branch2a"
2230 | top: "res5b_branch2a"
2231 | name: "res5b_branch2a_relu"
2232 | type: "ReLU"
2233 | }
2234 |
2235 | layer {
2236 | bottom: "res5b_branch2a"
2237 | top: "res5b_branch2b"
2238 | name: "res5b_branch2b"
2239 | type: "Convolution"
2240 |
2241 | convolution_param {
2242 | num_output: 512
2243 | kernel_size: 3
2244 | pad: 1
2245 | stride: 1
2246 | bias_term: false
2247 | }
2248 | }
2249 |
2250 | layer {
2251 | bottom: "res5b_branch2b"
2252 | top: "res5b_branch2b"
2253 | name: "bn5b_branch2b"
2254 | type: "BatchNorm"
2255 | batch_norm_param {
2256 | use_global_stats: false
2257 | }
2258 | }
2259 |
2260 | layer {
2261 | bottom: "res5b_branch2b"
2262 | top: "res5b_branch2b"
2263 | name: "scale5b_branch2b"
2264 | type: "Scale"
2265 | scale_param {
2266 | bias_term: true
2267 | }
2268 | }
2269 |
2270 | layer {
2271 | bottom: "res5b_branch2b"
2272 | top: "res5b_branch2b"
2273 | name: "res5b_branch2b_relu"
2274 | type: "ReLU"
2275 | }
2276 |
2277 | layer {
2278 | bottom: "res5b_branch2b"
2279 | top: "res5b_branch2c"
2280 | name: "res5b_branch2c"
2281 | type: "Convolution"
2282 |
2283 | convolution_param {
2284 | num_output: 2048
2285 | kernel_size: 1
2286 | pad: 0
2287 | stride: 1
2288 | bias_term: false
2289 | }
2290 | }
2291 |
2292 | layer {
2293 | bottom: "res5b_branch2c"
2294 | top: "res5b_branch2c"
2295 | name: "bn5b_branch2c"
2296 | type: "BatchNorm"
2297 | batch_norm_param {
2298 | use_global_stats: false
2299 | }
2300 | }
2301 |
2302 | layer {
2303 | bottom: "res5b_branch2c"
2304 | top: "res5b_branch2c"
2305 | name: "scale5b_branch2c"
2306 | type: "Scale"
2307 | scale_param {
2308 | bias_term: true
2309 | }
2310 | }
2311 |
2312 | layer {
2313 | bottom: "res5a"
2314 | bottom: "res5b_branch2c"
2315 | top: "res5b"
2316 | name: "res5b"
2317 | type: "Eltwise"
2318 | }
2319 |
2320 | layer {
2321 | bottom: "res5b"
2322 | top: "res5b"
2323 | name: "res5b_relu"
2324 | type: "ReLU"
2325 | }
2326 |
2327 | layer {
2328 | bottom: "res5b"
2329 | top: "res5c_branch2a"
2330 | name: "res5c_branch2a"
2331 | type: "Convolution"
2332 |
2333 | convolution_param {
2334 | num_output: 512
2335 | kernel_size: 1
2336 | pad: 0
2337 | stride: 1
2338 | bias_term: false
2339 | }
2340 | }
2341 |
2342 | layer {
2343 | bottom: "res5c_branch2a"
2344 | top: "res5c_branch2a"
2345 | name: "bn5c_branch2a"
2346 | type: "BatchNorm"
2347 | batch_norm_param {
2348 | use_global_stats: false
2349 | }
2350 | }
2351 |
2352 | layer {
2353 | bottom: "res5c_branch2a"
2354 | top: "res5c_branch2a"
2355 | name: "scale5c_branch2a"
2356 | type: "Scale"
2357 | scale_param {
2358 | bias_term: true
2359 | }
2360 | }
2361 |
2362 | layer {
2363 | bottom: "res5c_branch2a"
2364 | top: "res5c_branch2a"
2365 | name: "res5c_branch2a_relu"
2366 | type: "ReLU"
2367 | }
2368 |
2369 | layer {
2370 | bottom: "res5c_branch2a"
2371 | top: "res5c_branch2b"
2372 | name: "res5c_branch2b"
2373 | type: "Convolution"
2374 |
2375 | convolution_param {
2376 | num_output: 512
2377 | kernel_size: 3
2378 | pad: 1
2379 | stride: 1
2380 | bias_term: false
2381 | }
2382 | }
2383 |
2384 | layer {
2385 | bottom: "res5c_branch2b"
2386 | top: "res5c_branch2b"
2387 | name: "bn5c_branch2b"
2388 | type: "BatchNorm"
2389 | batch_norm_param {
2390 | use_global_stats: false
2391 | }
2392 | }
2393 |
2394 | layer {
2395 | bottom: "res5c_branch2b"
2396 | top: "res5c_branch2b"
2397 | name: "scale5c_branch2b"
2398 | type: "Scale"
2399 | scale_param {
2400 | bias_term: true
2401 | }
2402 | }
2403 |
2404 | layer {
2405 | bottom: "res5c_branch2b"
2406 | top: "res5c_branch2b"
2407 | name: "res5c_branch2b_relu"
2408 | type: "ReLU"
2409 | }
2410 |
2411 | layer {
2412 | bottom: "res5c_branch2b"
2413 | top: "res5c_branch2c"
2414 | name: "res5c_branch2c"
2415 | type: "Convolution"
2416 |
2417 | convolution_param {
2418 | num_output: 2048
2419 | kernel_size: 1
2420 | pad: 0
2421 | stride: 1
2422 | bias_term: false
2423 | }
2424 | }
2425 |
2426 | layer {
2427 | bottom: "res5c_branch2c"
2428 | top: "res5c_branch2c"
2429 | name: "bn5c_branch2c"
2430 | type: "BatchNorm"
2431 | batch_norm_param {
2432 | use_global_stats: false
2433 | }
2434 | }
2435 |
2436 | layer {
2437 | bottom: "res5c_branch2c"
2438 | top: "res5c_branch2c"
2439 | name: "scale5c_branch2c"
2440 | type: "Scale"
2441 | scale_param {
2442 | bias_term: true
2443 | }
2444 | }
2445 |
2446 | layer {
2447 | bottom: "res5b"
2448 | bottom: "res5c_branch2c"
2449 | top: "res5c"
2450 | name: "res5c"
2451 | type: "Eltwise"
2452 | }
2453 |
2454 | layer {
2455 | bottom: "res5c"
2456 | top: "res5c"
2457 | name: "res5c_relu"
2458 | type: "ReLU"
2459 | }
2460 |
2461 | layer {
2462 | bottom: "res5c"
2463 | top: "pool5"
2464 | name: "pool5"
2465 | type: "Pooling"
2466 | pooling_param {
2467 | kernel_size: 7
2468 | stride: 1
2469 | pool: AVE
2470 | }
2471 | }
2472 |
2473 | layer {
2474 | bottom: "pool5"
2475 | top: "fc1000"
2476 | name: "fc1000"
2477 | type: "InnerProduct"
2478 | inner_product_param {
2479 | num_output: 1000
2480 | }
2481 | }
2482 |
2483 |
2484 |
2485 | layer {
2486 | name: "loss0"
2487 | type: "SoftmaxWithLoss"
2488 | bottom: "fc1000"
2489 | bottom: "label"
2490 | top: "loss"
2491 | }
2492 | layer {
2493 | name: "accuracy0"
2494 | type: "Accuracy"
2495 | bottom: "fc1000"
2496 | bottom: "label"
2497 | top: "accuracy"
2498 | }
2499 |
2500 | #------------------------
2501 | layer {
2502 | name: "fc200"
2503 | type: "InnerProduct"
2504 | bottom: "pool5"
2505 | top: "fc200"
2506 | param {
2507 | lr_mult: 10.0
2508 | decay_mult: 1.0
2509 | }
2510 | param {
2511 | lr_mult: 10.0
2512 | decay_mult: 1.0
2513 | }
2514 | inner_product_param {
2515 | num_output: 200
2516 | weight_filler {
2517 | type: "gaussian"
2518 | std: 0.0001
2519 | }
2520 | bias_filler {
2521 | type: "constant"
2522 | value: 0.0
2523 | }
2524 | }
2525 | include {
2526 | phase: TRAIN
2527 | }
2528 | }
2529 |
2530 | layer{
2531 | name: "contact1"
2532 | type: "Concat"
2533 | bottom:"fc1000"
2534 | bottom:"fc200"
2535 | top: "contact1"
2536 | concat_param{
2537 | concat_dim:1
2538 | }
2539 | include {
2540 | phase: TRAIN
2541 | }
2542 | }
2543 |
2544 | layer {
2545 | name: "fc_s1_1"
2546 | type: "InnerProduct"
2547 | bottom: "contact1"
2548 | top: "fc_s1_1"
2549 | param {
2550 | lr_mult: 10.0
2551 | decay_mult: 1.0
2552 | }
2553 | param {
2554 | lr_mult: 10.0
2555 | decay_mult: 1.0
2556 | }
2557 | inner_product_param {
2558 | num_output: 200
2559 | weight_filler {
2560 | type: "gaussian"
2561 | std: 0.0001
2562 | }
2563 | bias_filler {
2564 | type: "constant"
2565 | value: 0.0
2566 | }
2567 | }
2568 | include {
2569 | phase: TRAIN
2570 | }
2571 | }
2572 |
2573 |
2574 | layer {
2575 | name: "fc_s1_2"
2576 | type: "InnerProduct"
2577 | bottom: "fc_s1_1"
2578 | top: "fc_s1_2"
2579 | param {
2580 | lr_mult: 10.0
2581 | decay_mult: 1.0
2582 | }
2583 | param {
2584 | lr_mult: 10.0
2585 | decay_mult: 1.0
2586 | }
2587 | inner_product_param {
2588 | num_output: 200
2589 | weight_filler {
2590 | type: "gaussian"
2591 | std: 0.0001
2592 | }
2593 | bias_filler {
2594 | type: "constant"
2595 | value: 0.0
2596 | }
2597 | }
2598 | include {
2599 | phase: TRAIN
2600 | }
2601 | }
2602 |
2603 |
2604 |
2605 | #-----------------------------------------
2606 |
2607 | layer {
2608 | name: "loss_s1"
2609 | type: "SoftmaxWithLoss"
2610 | bottom: "fc_s1_2"
2611 | bottom: "label_1"
2612 | top: "loss_s1"
2613 | include {
2614 | phase: TRAIN
2615 | }
2616 | }
2617 | layer {
2618 | name: "accuracy_s1"
2619 | type: "Accuracy"
2620 | bottom: "fc_s1_2"
2621 | bottom: "label_1"
2622 | top: "accuracy_s1"
2623 | include {
2624 | phase: TRAIN
2625 | }
2626 | }
2627 |
2628 | #------------------------------
2629 |
2630 |
2631 | layer {
2632 | name: "fc40"
2633 | type: "InnerProduct"
2634 | bottom: "pool5"
2635 | top: "fc40"
2636 | param {
2637 | lr_mult: 10.0
2638 | decay_mult: 1.0
2639 | }
2640 | param {
2641 | lr_mult: 10.0
2642 | decay_mult: 1.0
2643 | }
2644 | inner_product_param {
2645 | num_output: 40
2646 | weight_filler {
2647 | type: "gaussian"
2648 | std: 0.0001
2649 | }
2650 | bias_filler {
2651 | type: "constant"
2652 | value: 0.0
2653 | }
2654 | }
2655 | include {
2656 | phase: TRAIN
2657 | }
2658 | }
2659 |
2660 | layer{
2661 | name: "contact2"
2662 | type: "Concat"
2663 | bottom:"fc1000"
2664 | bottom:"fc200"
2665 | bottom:"fc40"
2666 | top: "contact2"
2667 | concat_param{
2668 | concat_dim:1
2669 | }
2670 | include {
2671 | phase: TRAIN
2672 | }
2673 | }
2674 |
2675 |
2676 | layer {
2677 | name: "fc_s2_1"
2678 | type: "InnerProduct"
2679 | bottom: "contact2"
2680 | top: "fc_s2_1"
2681 | param {
2682 | lr_mult: 10.0
2683 | decay_mult: 1.0
2684 | }
2685 | param {
2686 | lr_mult: 10.0
2687 | decay_mult: 1.0
2688 | }
2689 | inner_product_param {
2690 | num_output: 40
2691 | weight_filler {
2692 | type: "gaussian"
2693 | std: 0.0001
2694 | }
2695 | bias_filler {
2696 | type: "constant"
2697 | value: 0.0
2698 | }
2699 | }
2700 | include {
2701 | phase: TRAIN
2702 | }
2703 | }
2704 |
2705 | layer {
2706 | name: "fc_s2_2"
2707 | type: "InnerProduct"
2708 | bottom: "fc_s2_1"
2709 | top: "fc_s2_2"
2710 | param {
2711 | lr_mult: 10.0
2712 | decay_mult: 1.0
2713 | }
2714 | param {
2715 | lr_mult: 10.0
2716 | decay_mult: 1.0
2717 | }
2718 | inner_product_param {
2719 | num_output: 40
2720 | weight_filler {
2721 | type: "gaussian"
2722 | std: 0.0001
2723 | }
2724 | bias_filler {
2725 | type: "constant"
2726 | value: 0.0
2727 | }
2728 | }
2729 | include {
2730 | phase: TRAIN
2731 | }
2732 | }
2733 |
2734 | layer {
2735 | name: "loss_s2"
2736 | type: "SoftmaxWithLoss"
2737 | bottom: "fc_s2_2"
2738 | bottom: "label_2"
2739 | top: "loss_s2"
2740 | include {
2741 | phase: TRAIN
2742 | }
2743 | loss_weight:0.3
2744 | }
2745 | layer {
2746 | name: "accuracy_s2"
2747 | type: "Accuracy"
2748 | bottom: "fc_s2_2"
2749 | bottom: "label_2"
2750 | top: "accuracy_s2"
2751 | include {
2752 | phase: TRAIN
2753 | }
2754 | }
2755 |
2756 | #------------------------------
2757 |
2758 |
2759 | layer {
2760 | name: "fc8"
2761 | type: "InnerProduct"
2762 | bottom: "pool5"
2763 | top: "fc8"
2764 | param {
2765 | lr_mult: 10.0
2766 | decay_mult: 1.0
2767 | }
2768 | param {
2769 | lr_mult: 10.0
2770 | decay_mult: 1.0
2771 | }
2772 | inner_product_param {
2773 | num_output: 8
2774 | weight_filler {
2775 | type: "gaussian"
2776 | std: 0.0001
2777 | }
2778 | bias_filler {
2779 | type: "constant"
2780 | value: 0.0
2781 | }
2782 | }
2783 | include {
2784 | phase: TRAIN
2785 | }
2786 | }
2787 |
2788 | layer{
2789 | name: "contact3"
2790 | type: "Concat"
2791 | bottom:"fc1000"
2792 | bottom:"fc200"
2793 | bottom:"fc40"
2794 | bottom:"fc8"
2795 | top: "contact3"
2796 | concat_param{
2797 | concat_dim:1
2798 | }
2799 | include {
2800 | phase: TRAIN
2801 | }
2802 | }
2803 |
2804 |
2805 | layer {
2806 | name: "fc_s3_1"
2807 | type: "InnerProduct"
2808 | bottom: "contact3"
2809 | top: "fc_s3_1"
2810 | param {
2811 | lr_mult: 10.0
2812 | decay_mult: 1.0
2813 | }
2814 | param {
2815 | lr_mult: 10.0
2816 | decay_mult: 1.0
2817 | }
2818 | inner_product_param {
2819 | num_output: 8
2820 | weight_filler {
2821 | type: "gaussian"
2822 | std: 0.0001
2823 | }
2824 | bias_filler {
2825 | type: "constant"
2826 | value: 0.0
2827 | }
2828 | }
2829 | include {
2830 | phase: TRAIN
2831 | }
2832 | }
2833 |
2834 | layer {
2835 | name: "fc_s3_2"
2836 | type: "InnerProduct"
2837 | bottom: "fc_s3_1"
2838 | top: "fc_s3_2"
2839 | param {
2840 | lr_mult: 10.0
2841 | decay_mult: 1.0
2842 | }
2843 | param {
2844 | lr_mult: 10.0
2845 | decay_mult: 1.0
2846 | }
2847 | inner_product_param {
2848 | num_output: 8
2849 | weight_filler {
2850 | type: "gaussian"
2851 | std: 0.0001
2852 | }
2853 | bias_filler {
2854 | type: "constant"
2855 | value: 0.0
2856 | }
2857 | }
2858 | include {
2859 | phase: TRAIN
2860 | }
2861 | }
2862 |
2863 |
2864 | layer {
2865 | name: "loss_s3"
2866 | type: "SoftmaxWithLoss"
2867 | bottom: "fc_s3_s2"
2868 | bottom: "label_3"
2869 | top: "loss_fam"
2870 | include {
2871 | phase: TRAIN
2872 | }
2873 | }
2874 | layer {
2875 | name: "accuracy_s3"
2876 | type: "Accuracy"
2877 | bottom: "fc_s3_s2"
2878 | bottom: "label_3"
2879 | top: "accuracy_s3"
2880 | include {
2881 | phase: TRAIN
2882 | }
2883 | }
2884 |
2885 |
2886 |
--------------------------------------------------------------------------------