├── LICENSE ├── README.md ├── mobilenet_v3_large_1.0.prototxt └── mobilenet_v3_small_1.0.prototxt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 jixing0415 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # caffe-mobilenet-v3 2 | ### Introduction 3 | This is a personal Caffe implementation of MobileNetV3. For details, please read the original papers: [Searching for MobileNetV3](https://arxiv.org/pdf/1905.02244.pdf). 4 | 5 | ### How to use 6 | 1. Requirements for `Caffe` (see: [Caffe installation instructions](http://caffe.berkeleyvision.org/installation.html)) 7 | 2. Add new caffe layers and rebuild the caffe: 8 | - **Depthwise Convolutional Layer** from [yonghenglh6/DepthwiseConvolution](https://github.com/yonghenglh6/DepthwiseConvolution) 9 | - **ReLU6 Layer** from [RuiminChen/Caffe-MobileNetV2-ReLU6](https://github.com/RuiminChen/Caffe-MobileNetV2-ReLU6) 10 | 3. Run test 11 | ```Shell 12 | CPU: 13 | $CAFFE_ROOT/build/tools/caffe time -model mobilenet_v3_large_1.0.prototxt 14 | GPU: 15 | $CAFFE_ROOT/build/tools/caffe time -model mobilenet_v3_large_1.0.prototxt -gpu 0 16 | ``` 17 | 18 | ### Performance on MobileNetV3 19 | | Backbone | CPU-Forward | CPU-Backward | GPU-Forward | GPU-Backward | 20 | | ------------------- |:---------: | :---------: | :---------: | :---------: | 21 | | V3-Large 1.0 | 134.55 ms | 140.23 ms | 15.44 ms | 21.79 ms | 22 | | V3-Small 1.0 | 58.64 ms | 59.30 ms | 11.49 ms | 12.58 ms | 23 | 24 | 25 | ### TODO 26 | - More MobileNetV3 architectures. 27 | - Traning & validation. 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /mobilenet_v3_large_1.0.prototxt: -------------------------------------------------------------------------------- 1 | name: "mobilenet v3" 2 | input: "data" 3 | input_dim: 1 4 | input_dim: 3 5 | input_dim: 224 6 | input_dim: 224 7 | #################### stage 1 #################### 8 | layer { 9 | name: "conv1" 10 | type: "Convolution" 11 | bottom: "data" 12 | top: "conv1" 13 | param { 14 | lr_mult: 1 15 | decay_mult: 1 16 | } 17 | convolution_param { 18 | num_output: 16 19 | pad: 1 20 | bias_term: false 21 | kernel_size: 3 22 | stride: 2 23 | weight_filler { 24 | type: "msra" 25 | } 26 | } 27 | } 28 | layer { 29 | name: "conv1-bn" 30 | type: "BatchNorm" 31 | bottom: "conv1" 32 | top: "conv1" 33 | } 34 | layer { 35 | name: "conv1-bn-scale" 36 | type: "Scale" 37 | bottom: "conv1" 38 | top: "conv1" 39 | scale_param { 40 | bias_term: true 41 | } 42 | } 43 | # H-swish 44 | layer { 45 | name: "conv1/shift" 46 | type: "Power" 47 | bottom: "conv1" 48 | top: "conv1/shift" 49 | power_param { 50 | power: 1 51 | scale: 1 52 | shift: 3 53 | } 54 | } 55 | layer { 56 | name: "conv1/shift-relu" 57 | type: "ReLU6" 58 | bottom: "conv1/shift" 59 | top: "conv1/shift" 60 | } 61 | layer { 62 | name: "conv1/shift-div" 63 | type: "Power" 64 | bottom: "conv1/shift" 65 | top: "conv1/shift-div" 66 | power_param { 67 | power: 1 68 | scale: 0.1666666667 69 | shift: 0 70 | } 71 | } 72 | layer { 73 | name: "conv1/hswish" 74 | type: "Eltwise" 75 | bottom: "conv1" 76 | bottom: "conv1/shift-div" 77 | top: "conv1/hswish" 78 | eltwise_param { 79 | operation: PROD 80 | } 81 | } 82 | 83 | #################### stage 2-1 #################### 84 | layer { 85 | name: "conv2-1/expand" 86 | type: "Convolution" 87 | bottom: "conv1/hswish" 88 | top: "conv2-1/expand" 89 | param { 90 | lr_mult: 1 91 | decay_mult: 1 92 | } 93 | convolution_param { 94 | num_output: 16 95 | pad: 0 96 | bias_term: false 97 | kernel_size: 1 98 | stride: 1 99 | weight_filler { 100 | type: "msra" 101 | } 102 | } 103 | } 104 | layer { 105 | name: "conv2-1/expand-bn" 106 | type: "BatchNorm" 107 | bottom: "conv2-1/expand" 108 | top: "conv2-1/expand" 109 | } 110 | layer { 111 | name: "conv2-1/expand-bn-scale" 112 | type: "Scale" 113 | bottom: "conv2-1/expand" 114 | top: "conv2-1/expand" 115 | scale_param { 116 | bias_term: true 117 | } 118 | } 119 | layer { 120 | name: "conv2-1/expand-relu" 121 | type: "ReLU6" 122 | bottom: "conv2-1/expand" 123 | top: "conv2-1/expand" 124 | } 125 | 126 | layer { 127 | name: "conv2-1/dwise" 128 | #type: "Convolution" 129 | type: "DepthwiseConvolution" 130 | bottom: "conv2-1/expand" 131 | top: "conv2-1/dwise" 132 | param { 133 | lr_mult: 1 134 | decay_mult: 1 135 | } 136 | convolution_param { 137 | num_output: 16 138 | group: 16 139 | pad: 1 140 | bias_term: false 141 | kernel_size: 3 142 | stride: 1 143 | weight_filler { 144 | type: "msra" 145 | } 146 | engine: CAFFE 147 | } 148 | } 149 | layer { 150 | name: "conv2-1/dwise-bn" 151 | type: "BatchNorm" 152 | bottom: "conv2-1/dwise" 153 | top: "conv2-1/dwise" 154 | } 155 | layer { 156 | name: "conv2-1/dwise-bn-scale" 157 | type: "Scale" 158 | bottom: "conv2-1/dwise" 159 | top: "conv2-1/dwise" 160 | scale_param { 161 | bias_term: true 162 | } 163 | } 164 | layer { 165 | name: "conv2-1/dwise-relu" 166 | type: "ReLU6" 167 | bottom: "conv2-1/dwise" 168 | top: "conv2-1/dwise" 169 | } 170 | 171 | layer { 172 | name: "conv2-1/linear" 173 | type: "Convolution" 174 | bottom: "conv2-1/dwise" 175 | top: "conv2-1/linear" 176 | param { 177 | lr_mult: 1 178 | decay_mult: 1 179 | } 180 | convolution_param { 181 | num_output: 16 182 | pad: 0 183 | bias_term: false 184 | kernel_size: 1 185 | stride: 1 186 | weight_filler { 187 | type: "msra" 188 | } 189 | } 190 | } 191 | layer { 192 | name: "conv2-1/linear-bn" 193 | type: "BatchNorm" 194 | bottom: "conv2-1/linear" 195 | top: "conv2-1/linear" 196 | } 197 | layer { 198 | name: "conv2-1/linear-bn-scale" 199 | type: "Scale" 200 | bottom: "conv2-1/linear" 201 | top: "conv2-1/linear" 202 | scale_param { 203 | bias_term: true 204 | } 205 | } 206 | 207 | layer { 208 | name: "block2-1" 209 | type: "Eltwise" 210 | bottom: "conv1/hswish" 211 | bottom: "conv2-1/linear" 212 | top: "block2-1" 213 | } 214 | 215 | #################### stage 2-2 #################### 216 | layer { 217 | name: "conv2-2/expand" 218 | type: "Convolution" 219 | bottom: "block2-1" 220 | top: "conv2-2/expand" 221 | param { 222 | lr_mult: 1 223 | decay_mult: 1 224 | } 225 | convolution_param { 226 | num_output: 64 227 | pad: 0 228 | bias_term: false 229 | kernel_size: 1 230 | stride: 1 231 | weight_filler { 232 | type: "msra" 233 | } 234 | } 235 | } 236 | layer { 237 | name: "conv2-2/expand-bn" 238 | type: "BatchNorm" 239 | bottom: "conv2-2/expand" 240 | top: "conv2-2/expand" 241 | } 242 | layer { 243 | name: "conv2-2/expand-bn-scale" 244 | type: "Scale" 245 | bottom: "conv2-2/expand" 246 | top: "conv2-2/expand" 247 | scale_param { 248 | bias_term: true 249 | } 250 | } 251 | layer { 252 | name: "conv2-2/expand-relu" 253 | type: "ReLU6" 254 | bottom: "conv2-2/expand" 255 | top: "conv2-2/expand" 256 | } 257 | 258 | layer { 259 | name: "conv2-2/dwise" 260 | #type: "Convolution" 261 | type: "DepthwiseConvolution" 262 | bottom: "conv2-2/expand" 263 | top: "conv2-2/dwise" 264 | param { 265 | lr_mult: 1 266 | decay_mult: 1 267 | } 268 | convolution_param { 269 | num_output: 64 270 | group: 64 271 | pad: 1 272 | bias_term: false 273 | kernel_size: 3 274 | stride: 2 275 | weight_filler { 276 | type: "msra" 277 | } 278 | engine: CAFFE 279 | } 280 | } 281 | layer { 282 | name: "conv2-2/dwise-bn" 283 | type: "BatchNorm" 284 | bottom: "conv2-2/dwise" 285 | top: "conv2-2/dwise" 286 | } 287 | layer { 288 | name: "conv2-2/dwise-bn-scale" 289 | type: "Scale" 290 | bottom: "conv2-2/dwise" 291 | top: "conv2-2/dwise" 292 | scale_param { 293 | bias_term: true 294 | } 295 | } 296 | layer { 297 | name: "conv2-2/dwise-relu" 298 | type: "ReLU6" 299 | bottom: "conv2-2/dwise" 300 | top: "conv2-2/dwise" 301 | } 302 | 303 | layer { 304 | name: "conv2-2/linear" 305 | type: "Convolution" 306 | bottom: "conv2-2/dwise" 307 | top: "conv2-2/linear" 308 | param { 309 | lr_mult: 1 310 | decay_mult: 1 311 | } 312 | convolution_param { 313 | num_output: 24 314 | pad: 0 315 | bias_term: false 316 | kernel_size: 1 317 | stride: 1 318 | weight_filler { 319 | type: "msra" 320 | } 321 | } 322 | } 323 | layer { 324 | name: "conv2-2/linear-bn" 325 | type: "BatchNorm" 326 | bottom: "conv2-2/linear" 327 | top: "conv2-2/linear" 328 | } 329 | layer { 330 | name: "conv2-2/linear-bn-scale" 331 | type: "Scale" 332 | bottom: "conv2-2/linear" 333 | top: "conv2-2/linear" 334 | scale_param { 335 | bias_term: true 336 | } 337 | } 338 | 339 | #################### stage 3-1 #################### 340 | layer { 341 | name: "conv3-1/expand" 342 | type: "Convolution" 343 | bottom: "conv2-2/linear" 344 | top: "conv3-1/expand" 345 | param { 346 | lr_mult: 1 347 | decay_mult: 1 348 | } 349 | convolution_param { 350 | num_output: 72 351 | pad: 0 352 | bias_term: false 353 | kernel_size: 1 354 | stride: 1 355 | weight_filler { 356 | type: "msra" 357 | } 358 | } 359 | } 360 | layer { 361 | name: "conv3-1/expand-bn" 362 | type: "BatchNorm" 363 | bottom: "conv3-1/expand" 364 | top: "conv3-1/expand" 365 | } 366 | layer { 367 | name: "conv3-1/expand-bn-scale" 368 | type: "Scale" 369 | bottom: "conv3-1/expand" 370 | top: "conv3-1/expand" 371 | scale_param { 372 | bias_term: true 373 | } 374 | } 375 | layer { 376 | name: "conv3-1/expand-relu" 377 | type: "ReLU6" 378 | bottom: "conv3-1/expand" 379 | top: "conv3-1/expand" 380 | } 381 | 382 | layer { 383 | name: "conv3-1/dwise" 384 | #type: "Convolution" 385 | type: "DepthwiseConvolution" 386 | bottom: "conv3-1/expand" 387 | top: "conv3-1/dwise" 388 | param { 389 | lr_mult: 1 390 | decay_mult: 1 391 | } 392 | convolution_param { 393 | num_output: 72 394 | group: 72 395 | pad: 1 396 | bias_term: false 397 | kernel_size: 3 398 | stride: 1 399 | weight_filler { 400 | type: "msra" 401 | } 402 | engine: CAFFE 403 | } 404 | } 405 | layer { 406 | name: "conv3-1/dwise-bn" 407 | type: "BatchNorm" 408 | bottom: "conv3-1/dwise" 409 | top: "conv3-1/dwise" 410 | } 411 | layer { 412 | name: "conv3-1/dwise-bn-scale" 413 | type: "Scale" 414 | bottom: "conv3-1/dwise" 415 | top: "conv3-1/dwise" 416 | scale_param { 417 | bias_term: true 418 | } 419 | } 420 | layer { 421 | name: "conv3-1/dwise-relu" 422 | type: "ReLU6" 423 | bottom: "conv3-1/dwise" 424 | top: "conv3-1/dwise" 425 | } 426 | 427 | layer { 428 | name: "conv3-1/linear" 429 | type: "Convolution" 430 | bottom: "conv3-1/dwise" 431 | top: "conv3-1/linear" 432 | param { 433 | lr_mult: 1 434 | decay_mult: 1 435 | } 436 | convolution_param { 437 | num_output: 24 438 | pad: 0 439 | bias_term: false 440 | kernel_size: 1 441 | stride: 1 442 | weight_filler { 443 | type: "msra" 444 | } 445 | } 446 | } 447 | layer { 448 | name: "conv3-1/linear-bn" 449 | type: "BatchNorm" 450 | bottom: "conv3-1/linear" 451 | top: "conv3-1/linear" 452 | } 453 | layer { 454 | name: "conv3-1/linear-bn-scale" 455 | type: "Scale" 456 | bottom: "conv3-1/linear" 457 | top: "conv3-1/linear" 458 | scale_param { 459 | bias_term: true 460 | } 461 | } 462 | 463 | layer { 464 | name: "block3-1" 465 | type: "Eltwise" 466 | bottom: "conv2-2/linear" 467 | bottom: "conv3-1/linear" 468 | top: "block3-1" 469 | } 470 | 471 | #################### stage 3-2 #################### 472 | layer { 473 | name: "conv3-2/expand" 474 | type: "Convolution" 475 | bottom: "block3-1" 476 | top: "conv3-2/expand" 477 | param { 478 | lr_mult: 1 479 | decay_mult: 1 480 | } 481 | convolution_param { 482 | num_output: 72 483 | pad: 0 484 | bias_term: false 485 | kernel_size: 1 486 | stride: 1 487 | weight_filler { 488 | type: "msra" 489 | } 490 | } 491 | } 492 | layer { 493 | name: "conv3-2/expand-bn" 494 | type: "BatchNorm" 495 | bottom: "conv3-2/expand" 496 | top: "conv3-2/expand" 497 | } 498 | layer { 499 | name: "conv3-2/expand-bn-scale" 500 | type: "Scale" 501 | bottom: "conv3-2/expand" 502 | top: "conv3-2/expand" 503 | scale_param { 504 | bias_term: true 505 | } 506 | } 507 | layer { 508 | name: "conv3-2/expand-relu" 509 | type: "ReLU6" 510 | bottom: "conv3-2/expand" 511 | top: "conv3-2/expand" 512 | } 513 | 514 | layer { 515 | name: "conv3-2/dwise" 516 | #type: "Convolution" 517 | type: "DepthwiseConvolution" 518 | bottom: "conv3-2/expand" 519 | top: "conv3-2/dwise" 520 | param { 521 | lr_mult: 1 522 | decay_mult: 1 523 | } 524 | convolution_param { 525 | num_output: 72 526 | group: 72 527 | pad: 2 528 | bias_term: false 529 | kernel_size: 5 530 | stride: 2 531 | weight_filler { 532 | type: "msra" 533 | } 534 | engine: CAFFE 535 | } 536 | } 537 | layer { 538 | name: "conv3-2/dwise-bn" 539 | type: "BatchNorm" 540 | bottom: "conv3-2/dwise" 541 | top: "conv3-2/dwise" 542 | } 543 | layer { 544 | name: "conv3-2/dwise-bn-scale" 545 | type: "Scale" 546 | bottom: "conv3-2/dwise" 547 | top: "conv3-2/dwise" 548 | scale_param { 549 | bias_term: true 550 | } 551 | } 552 | 553 | # se 554 | layer { 555 | name: "conv3-2/dwise-se-pool" 556 | type: "Pooling" 557 | bottom: "conv3-2/dwise" 558 | top: "conv3-2/dwise-se-pool" 559 | pooling_param { 560 | pool: AVE 561 | global_pooling: true 562 | } 563 | } 564 | layer { 565 | name: "conv3-2/dwise-se-fc1" 566 | type: "InnerProduct" 567 | bottom: "conv3-2/dwise-se-pool" 568 | top:"conv3-2/dwise-se-fc1" 569 | param { 570 | lr_mult: 1 571 | decay_mult: 1 572 | } 573 | param { 574 | lr_mult: 2 575 | decay_mult: 0 576 | } 577 | inner_product_param { 578 | num_output: 18 579 | weight_filler { 580 | type: "msra" 581 | } 582 | bias_filler { 583 | type: "constant" 584 | value: 0 585 | } 586 | } 587 | } 588 | layer { 589 | name: "conv3-2/dwise-se-fc1-relu" 590 | type: "ReLU6" 591 | bottom: "conv3-2/dwise-se-fc1" 592 | top: "conv3-2/dwise-se-fc1" 593 | } 594 | layer { 595 | name: "conv3-2/dwise-se-fc2" 596 | type: "InnerProduct" 597 | bottom: "conv3-2/dwise-se-fc1" 598 | top:"conv3-2/dwise-se-fc2" 599 | param { 600 | lr_mult: 1 601 | decay_mult: 1 602 | } 603 | param { 604 | lr_mult: 2 605 | decay_mult: 0 606 | } 607 | inner_product_param { 608 | num_output: 72 609 | weight_filler { 610 | type: "msra" 611 | } 612 | bias_filler { 613 | type: "constant" 614 | value: 0 615 | } 616 | } 617 | } 618 | # H-sigmoid 619 | layer { 620 | name: "conv3-2/dwise-se-fc2/shift" 621 | type: "Power" 622 | bottom: "conv3-2/dwise-se-fc2" 623 | top: "conv3-2/dwise-se-fc2/shift" 624 | power_param { 625 | power: 1 626 | scale: 1 627 | shift: 3 628 | } 629 | } 630 | layer { 631 | name: "conv3-2/dwise-se-fc2/shift-relu" 632 | type: "ReLU6" 633 | bottom: "conv3-2/dwise-se-fc2/shift" 634 | top: "conv3-2/dwise-se-fc2/shift" 635 | } 636 | layer { 637 | name: "conv3-2/dwise-se-fc2/shift-div" 638 | type: "Power" 639 | bottom: "conv3-2/dwise-se-fc2/shift" 640 | top: "conv3-2/dwise-se-fc2/shift-div" 641 | power_param { 642 | power: 1 643 | scale: 0.1666666667 644 | shift: 0 645 | } 646 | } 647 | layer { 648 | name: "conv3-2/dwise/scale" 649 | type: "Scale" 650 | bottom: "conv3-2/dwise" 651 | bottom: "conv3-2/dwise-se-fc2/shift-div" 652 | top: "conv3-2/dwise/scale" 653 | scale_param{ 654 | axis: 0 655 | } 656 | } 657 | layer { 658 | name: "conv3-2/dwise/scale-relu" 659 | type: "ReLU6" 660 | bottom: "conv3-2/dwise/scale" 661 | top: "conv3-2/dwise/scale" 662 | } 663 | 664 | layer { 665 | name: "conv3-2/linear" 666 | type: "Convolution" 667 | bottom: "conv3-2/dwise/scale" 668 | top: "conv3-2/linear" 669 | param { 670 | lr_mult: 1 671 | decay_mult: 1 672 | } 673 | convolution_param { 674 | num_output: 40 675 | pad: 0 676 | bias_term: false 677 | kernel_size: 1 678 | stride: 1 679 | weight_filler { 680 | type: "msra" 681 | } 682 | } 683 | } 684 | layer { 685 | name: "conv3-2/linear-bn" 686 | type: "BatchNorm" 687 | bottom: "conv3-2/linear" 688 | top: "conv3-2/linear" 689 | } 690 | layer { 691 | name: "conv3-2/linear-bn-scale" 692 | type: "Scale" 693 | bottom: "conv3-2/linear" 694 | top: "conv3-2/linear" 695 | scale_param { 696 | bias_term: true 697 | } 698 | } 699 | 700 | #################### stage 4-1 #################### 701 | layer { 702 | name: "conv4-1/expand" 703 | type: "Convolution" 704 | bottom: "conv3-2/linear" 705 | top: "conv4-1/expand" 706 | param { 707 | lr_mult: 1 708 | decay_mult: 1 709 | } 710 | convolution_param { 711 | num_output: 120 712 | pad: 0 713 | bias_term: false 714 | kernel_size: 1 715 | stride: 1 716 | weight_filler { 717 | type: "msra" 718 | } 719 | } 720 | } 721 | layer { 722 | name: "conv4-1/expand-bn" 723 | type: "BatchNorm" 724 | bottom: "conv4-1/expand" 725 | top: "conv4-1/expand" 726 | } 727 | layer { 728 | name: "conv4-1/expand-bn-scale" 729 | type: "Scale" 730 | bottom: "conv4-1/expand" 731 | top: "conv4-1/expand" 732 | scale_param { 733 | bias_term: true 734 | } 735 | } 736 | layer { 737 | name: "conv4-1/expand-relu" 738 | type: "ReLU6" 739 | bottom: "conv4-1/expand" 740 | top: "conv4-1/expand" 741 | } 742 | 743 | layer { 744 | name: "conv4-1/dwise" 745 | #type: "Convolution" 746 | type: "DepthwiseConvolution" 747 | bottom: "conv4-1/expand" 748 | top: "conv4-1/dwise" 749 | param { 750 | lr_mult: 1 751 | decay_mult: 1 752 | } 753 | convolution_param { 754 | num_output: 120 755 | group: 120 756 | pad: 2 757 | bias_term: false 758 | kernel_size: 5 759 | stride: 1 760 | weight_filler { 761 | type: "msra" 762 | } 763 | engine: CAFFE 764 | } 765 | } 766 | layer { 767 | name: "conv4-1/dwise-bn" 768 | type: "BatchNorm" 769 | bottom: "conv4-1/dwise" 770 | top: "conv4-1/dwise" 771 | } 772 | layer { 773 | name: "conv4-1/dwise-bn-scale" 774 | type: "Scale" 775 | bottom: "conv4-1/dwise" 776 | top: "conv4-1/dwise" 777 | scale_param { 778 | bias_term: true 779 | } 780 | } 781 | 782 | # se 783 | layer { 784 | name: "conv4-1/dwise-se-pool" 785 | type: "Pooling" 786 | bottom: "conv4-1/dwise" 787 | top: "conv4-1/dwise-se-pool" 788 | pooling_param { 789 | pool: AVE 790 | global_pooling: true 791 | } 792 | } 793 | layer { 794 | name: "conv4-1/dwise-se-fc1" 795 | type: "InnerProduct" 796 | bottom: "conv4-1/dwise-se-pool" 797 | top:"conv4-1/dwise-se-fc1" 798 | param { 799 | lr_mult: 1 800 | decay_mult: 1 801 | } 802 | param { 803 | lr_mult: 2 804 | decay_mult: 0 805 | } 806 | inner_product_param { 807 | num_output: 30 808 | weight_filler { 809 | type: "msra" 810 | } 811 | bias_filler { 812 | type: "constant" 813 | value: 0 814 | } 815 | } 816 | } 817 | layer { 818 | name: "conv4-1/dwise-se-fc1-relu" 819 | type: "ReLU6" 820 | bottom: "conv4-1/dwise-se-fc1" 821 | top: "conv4-1/dwise-se-fc1" 822 | } 823 | layer { 824 | name: "conv4-1/dwise-se-fc2" 825 | type: "InnerProduct" 826 | bottom: "conv4-1/dwise-se-fc1" 827 | top:"conv4-1/dwise-se-fc2" 828 | param { 829 | lr_mult: 1 830 | decay_mult: 1 831 | } 832 | param { 833 | lr_mult: 2 834 | decay_mult: 0 835 | } 836 | inner_product_param { 837 | num_output: 120 838 | weight_filler { 839 | type: "msra" 840 | } 841 | bias_filler { 842 | type: "constant" 843 | value: 0 844 | } 845 | } 846 | } 847 | # H-sigmoid 848 | layer { 849 | name: "conv4-1/dwise-se-fc2/shift" 850 | type: "Power" 851 | bottom: "conv4-1/dwise-se-fc2" 852 | top: "conv4-1/dwise-se-fc2/shift" 853 | power_param { 854 | power: 1 855 | scale: 1 856 | shift: 3 857 | } 858 | } 859 | layer { 860 | name: "conv4-1/dwise-se-fc2/shift-relu" 861 | type: "ReLU6" 862 | bottom: "conv4-1/dwise-se-fc2/shift" 863 | top: "conv4-1/dwise-se-fc2/shift" 864 | } 865 | layer { 866 | name: "conv4-1/dwise-se-fc2/shift-div" 867 | type: "Power" 868 | bottom: "conv4-1/dwise-se-fc2/shift" 869 | top: "conv4-1/dwise-se-fc2/shift-div" 870 | power_param { 871 | power: 1 872 | scale: 0.1666666667 873 | shift: 0 874 | } 875 | } 876 | layer { 877 | name: "conv4-1/dwise/scale" 878 | type: "Scale" 879 | bottom: "conv4-1/dwise" 880 | bottom: "conv4-1/dwise-se-fc2/shift-div" 881 | top: "conv4-1/dwise/scale" 882 | scale_param{ 883 | axis: 0 884 | } 885 | } 886 | layer { 887 | name: "conv4-1/dwise/scale-relu" 888 | type: "ReLU6" 889 | bottom: "conv4-1/dwise/scale" 890 | top: "conv4-1/dwise/scale" 891 | } 892 | 893 | layer { 894 | name: "conv4-1/linear" 895 | type: "Convolution" 896 | bottom: "conv4-1/dwise/scale" 897 | top: "conv4-1/linear" 898 | param { 899 | lr_mult: 1 900 | decay_mult: 1 901 | } 902 | convolution_param { 903 | num_output: 40 904 | pad: 0 905 | bias_term: false 906 | kernel_size: 1 907 | stride: 1 908 | weight_filler { 909 | type: "msra" 910 | } 911 | } 912 | } 913 | layer { 914 | name: "conv4-1/linear-bn" 915 | type: "BatchNorm" 916 | bottom: "conv4-1/linear" 917 | top: "conv4-1/linear" 918 | } 919 | layer { 920 | name: "conv4-1/linear-bn-scale" 921 | type: "Scale" 922 | bottom: "conv4-1/linear" 923 | top: "conv4-1/linear" 924 | scale_param { 925 | bias_term: true 926 | } 927 | } 928 | 929 | layer { 930 | name: "block4-1" 931 | type: "Eltwise" 932 | bottom: "conv3-2/linear" 933 | bottom: "conv4-1/linear" 934 | top: "block4-1" 935 | } 936 | 937 | #################### stage 4-2 #################### 938 | layer { 939 | name: "conv4-2/expand" 940 | type: "Convolution" 941 | bottom: "block4-1" 942 | top: "conv4-2/expand" 943 | param { 944 | lr_mult: 1 945 | decay_mult: 1 946 | } 947 | convolution_param { 948 | num_output: 120 949 | pad: 0 950 | bias_term: false 951 | kernel_size: 1 952 | stride: 1 953 | weight_filler { 954 | type: "msra" 955 | } 956 | } 957 | } 958 | layer { 959 | name: "conv4-2/expand-bn" 960 | type: "BatchNorm" 961 | bottom: "conv4-2/expand" 962 | top: "conv4-2/expand" 963 | } 964 | layer { 965 | name: "conv4-2/expand-bn-scale" 966 | type: "Scale" 967 | bottom: "conv4-2/expand" 968 | top: "conv4-2/expand" 969 | scale_param { 970 | bias_term: true 971 | } 972 | } 973 | layer { 974 | name: "conv4-2/expand-relu" 975 | type: "ReLU6" 976 | bottom: "conv4-2/expand" 977 | top: "conv4-2/expand" 978 | } 979 | 980 | layer { 981 | name: "conv4-2/dwise" 982 | #type: "Convolution" 983 | type: "DepthwiseConvolution" 984 | bottom: "conv4-2/expand" 985 | top: "conv4-2/dwise" 986 | param { 987 | lr_mult: 1 988 | decay_mult: 1 989 | } 990 | convolution_param { 991 | num_output: 120 992 | group: 120 993 | pad: 2 994 | bias_term: false 995 | kernel_size: 5 996 | stride: 1 997 | weight_filler { 998 | type: "msra" 999 | } 1000 | engine: CAFFE 1001 | } 1002 | } 1003 | layer { 1004 | name: "conv4-2/dwise-bn" 1005 | type: "BatchNorm" 1006 | bottom: "conv4-2/dwise" 1007 | top: "conv4-2/dwise" 1008 | } 1009 | layer { 1010 | name: "conv4-2/dwise-bn-scale" 1011 | type: "Scale" 1012 | bottom: "conv4-2/dwise" 1013 | top: "conv4-2/dwise" 1014 | scale_param { 1015 | bias_term: true 1016 | } 1017 | } 1018 | 1019 | # se 1020 | layer { 1021 | name: "conv4-2/dwise-se-pool" 1022 | type: "Pooling" 1023 | bottom: "conv4-2/dwise" 1024 | top: "conv4-2/dwise-se-pool" 1025 | pooling_param { 1026 | pool: AVE 1027 | global_pooling: true 1028 | } 1029 | } 1030 | layer { 1031 | name: "conv4-2/dwise-se-fc1" 1032 | type: "InnerProduct" 1033 | bottom: "conv4-2/dwise-se-pool" 1034 | top:"conv4-2/dwise-se-fc1" 1035 | param { 1036 | lr_mult: 1 1037 | decay_mult: 1 1038 | } 1039 | param { 1040 | lr_mult: 2 1041 | decay_mult: 0 1042 | } 1043 | inner_product_param { 1044 | num_output: 30 1045 | weight_filler { 1046 | type: "msra" 1047 | } 1048 | bias_filler { 1049 | type: "constant" 1050 | value: 0 1051 | } 1052 | } 1053 | } 1054 | layer { 1055 | name: "conv4-2/dwise-se-fc1-relu" 1056 | type: "ReLU6" 1057 | bottom: "conv4-2/dwise-se-fc1" 1058 | top: "conv4-2/dwise-se-fc1" 1059 | } 1060 | layer { 1061 | name: "conv4-2/dwise-se-fc2" 1062 | type: "InnerProduct" 1063 | bottom: "conv4-2/dwise-se-fc1" 1064 | top:"conv4-2/dwise-se-fc2" 1065 | param { 1066 | lr_mult: 1 1067 | decay_mult: 1 1068 | } 1069 | param { 1070 | lr_mult: 2 1071 | decay_mult: 0 1072 | } 1073 | inner_product_param { 1074 | num_output: 120 1075 | weight_filler { 1076 | type: "msra" 1077 | } 1078 | bias_filler { 1079 | type: "constant" 1080 | value: 0 1081 | } 1082 | } 1083 | } 1084 | # H-sigmoid 1085 | layer { 1086 | name: "conv4-2/dwise-se-fc2/shift" 1087 | type: "Power" 1088 | bottom: "conv4-2/dwise-se-fc2" 1089 | top: "conv4-2/dwise-se-fc2/shift" 1090 | power_param { 1091 | power: 1 1092 | scale: 1 1093 | shift: 3 1094 | } 1095 | } 1096 | layer { 1097 | name: "conv4-2/dwise-se-fc2/shift-relu" 1098 | type: "ReLU6" 1099 | bottom: "conv4-2/dwise-se-fc2/shift" 1100 | top: "conv4-2/dwise-se-fc2/shift" 1101 | } 1102 | layer { 1103 | name: "conv4-2/dwise-se-fc2/shift-div" 1104 | type: "Power" 1105 | bottom: "conv4-2/dwise-se-fc2/shift" 1106 | top: "conv4-2/dwise-se-fc2/shift-div" 1107 | power_param { 1108 | power: 1 1109 | scale: 0.1666666667 1110 | shift: 0 1111 | } 1112 | } 1113 | layer { 1114 | name: "conv4-2/dwise/scale" 1115 | type: "Scale" 1116 | bottom: "conv4-2/dwise" 1117 | bottom: "conv4-2/dwise-se-fc2/shift-div" 1118 | top: "conv4-2/dwise/scale" 1119 | scale_param{ 1120 | axis: 0 1121 | } 1122 | } 1123 | layer { 1124 | name: "conv4-2/dwise/scale-relu" 1125 | type: "ReLU6" 1126 | bottom: "conv4-2/dwise/scale" 1127 | top: "conv4-2/dwise/scale" 1128 | } 1129 | 1130 | layer { 1131 | name: "conv4-2/linear" 1132 | type: "Convolution" 1133 | bottom: "conv4-2/dwise/scale" 1134 | top: "conv4-2/linear" 1135 | param { 1136 | lr_mult: 1 1137 | decay_mult: 1 1138 | } 1139 | convolution_param { 1140 | num_output: 40 1141 | pad: 0 1142 | bias_term: false 1143 | kernel_size: 1 1144 | stride: 1 1145 | weight_filler { 1146 | type: "msra" 1147 | } 1148 | } 1149 | } 1150 | layer { 1151 | name: "conv4-2/linear-bn" 1152 | type: "BatchNorm" 1153 | bottom: "conv4-2/linear" 1154 | top: "conv4-2/linear" 1155 | } 1156 | layer { 1157 | name: "conv4-2/linear-bn-scale" 1158 | type: "Scale" 1159 | bottom: "conv4-2/linear" 1160 | top: "conv4-2/linear" 1161 | scale_param { 1162 | bias_term: true 1163 | } 1164 | } 1165 | 1166 | layer { 1167 | name: "block4-2" 1168 | type: "Eltwise" 1169 | bottom: "block4-1" 1170 | bottom: "conv4-2/linear" 1171 | top: "block4-2" 1172 | } 1173 | 1174 | #################### stage 4-3 #################### 1175 | layer { 1176 | name: "conv4-3/expand" 1177 | type: "Convolution" 1178 | bottom: "block4-2" 1179 | top: "conv4-3/expand" 1180 | param { 1181 | lr_mult: 1 1182 | decay_mult: 1 1183 | } 1184 | convolution_param { 1185 | num_output: 240 1186 | pad: 0 1187 | bias_term: false 1188 | kernel_size: 1 1189 | stride: 1 1190 | weight_filler { 1191 | type: "msra" 1192 | } 1193 | } 1194 | } 1195 | layer { 1196 | name: "conv4-3/expand-bn" 1197 | type: "BatchNorm" 1198 | bottom: "conv4-3/expand" 1199 | top: "conv4-3/expand" 1200 | } 1201 | layer { 1202 | name: "conv4-3/expand-bn-scale" 1203 | type: "Scale" 1204 | bottom: "conv4-3/expand" 1205 | top: "conv4-3/expand" 1206 | scale_param { 1207 | bias_term: true 1208 | } 1209 | } 1210 | # H-swish 1211 | layer { 1212 | name: "conv4-3/expand/shift" 1213 | type: "Power" 1214 | bottom: "conv4-3/expand" 1215 | top: "conv4-3/expand/shift" 1216 | power_param { 1217 | power: 1 1218 | scale: 1 1219 | shift: 3 1220 | } 1221 | } 1222 | layer { 1223 | name: "conv4-3/expand/shift-relu" 1224 | type: "ReLU6" 1225 | bottom: "conv4-3/expand/shift" 1226 | top: "conv4-3/expand/shift" 1227 | } 1228 | layer { 1229 | name: "conv4-3/expand/shift-div" 1230 | type: "Power" 1231 | bottom: "conv4-3/expand/shift" 1232 | top: "conv4-3/expand/shift-div" 1233 | power_param { 1234 | power: 1 1235 | scale: 0.1666666667 1236 | shift: 0 1237 | } 1238 | } 1239 | layer { 1240 | name: "conv4-3/expand/hswish" 1241 | type: "Eltwise" 1242 | bottom: "conv4-3/expand" 1243 | bottom: "conv4-3/expand/shift-div" 1244 | top: "conv4-3/expand/hswish" 1245 | eltwise_param { 1246 | operation: PROD 1247 | } 1248 | } 1249 | 1250 | layer { 1251 | name: "conv4-3/dwise" 1252 | #type: "Convolution" 1253 | type: "DepthwiseConvolution" 1254 | bottom: "conv4-3/expand/hswish" 1255 | top: "conv4-3/dwise" 1256 | param { 1257 | lr_mult: 1 1258 | decay_mult: 1 1259 | } 1260 | convolution_param { 1261 | num_output: 240 1262 | group: 240 1263 | pad: 1 1264 | bias_term: false 1265 | kernel_size: 3 1266 | stride: 2 1267 | weight_filler { 1268 | type: "msra" 1269 | } 1270 | engine: CAFFE 1271 | } 1272 | } 1273 | layer { 1274 | name: "conv4-3/dwise-bn" 1275 | type: "BatchNorm" 1276 | bottom: "conv4-3/dwise" 1277 | top: "conv4-3/dwise" 1278 | } 1279 | layer { 1280 | name: "conv4-3/dwise-bn-scale" 1281 | type: "Scale" 1282 | bottom: "conv4-3/dwise" 1283 | top: "conv4-3/dwise" 1284 | scale_param { 1285 | bias_term: true 1286 | } 1287 | } 1288 | # H-swish 1289 | layer { 1290 | name: "conv4-3/dwise/shift" 1291 | type: "Power" 1292 | bottom: "conv4-3/dwise" 1293 | top: "conv4-3/dwise/shift" 1294 | power_param { 1295 | power: 1 1296 | scale: 1 1297 | shift: 3 1298 | } 1299 | } 1300 | layer { 1301 | name: "conv4-3/dwise/shift-relu" 1302 | type: "ReLU6" 1303 | bottom: "conv4-3/dwise/shift" 1304 | top: "conv4-3/dwise/shift" 1305 | } 1306 | layer { 1307 | name: "conv4-3/dwise/shift-div" 1308 | type: "Power" 1309 | bottom: "conv4-3/dwise/shift" 1310 | top: "conv4-3/dwise/shift-div" 1311 | power_param { 1312 | power: 1 1313 | scale: 0.1666666667 1314 | shift: 0 1315 | } 1316 | } 1317 | layer { 1318 | name: "conv4-3/dwise/hswish" 1319 | type: "Eltwise" 1320 | bottom: "conv4-3/dwise" 1321 | bottom: "conv4-3/dwise/shift-div" 1322 | top: "conv4-3/dwise/hswish" 1323 | eltwise_param { 1324 | operation: PROD 1325 | } 1326 | } 1327 | 1328 | layer { 1329 | name: "conv4-3/linear" 1330 | type: "Convolution" 1331 | bottom: "conv4-3/dwise/hswish" 1332 | top: "conv4-3/linear" 1333 | param { 1334 | lr_mult: 1 1335 | decay_mult: 1 1336 | } 1337 | convolution_param { 1338 | num_output: 80 1339 | pad: 0 1340 | bias_term: false 1341 | kernel_size: 1 1342 | stride: 1 1343 | weight_filler { 1344 | type: "msra" 1345 | } 1346 | } 1347 | } 1348 | layer { 1349 | name: "conv4-3/linear-bn" 1350 | type: "BatchNorm" 1351 | bottom: "conv4-3/linear" 1352 | top: "conv4-3/linear" 1353 | } 1354 | layer { 1355 | name: "conv4-3/linear-bn-scale" 1356 | type: "Scale" 1357 | bottom: "conv4-3/linear" 1358 | top: "conv4-3/linear" 1359 | scale_param { 1360 | bias_term: true 1361 | } 1362 | } 1363 | 1364 | #################### stage 5-1 #################### 1365 | layer { 1366 | name: "conv5-1/expand" 1367 | type: "Convolution" 1368 | bottom: "conv4-3/linear" 1369 | top: "conv5-1/expand" 1370 | param { 1371 | lr_mult: 1 1372 | decay_mult: 1 1373 | } 1374 | convolution_param { 1375 | num_output: 200 1376 | pad: 0 1377 | bias_term: false 1378 | kernel_size: 1 1379 | stride: 1 1380 | weight_filler { 1381 | type: "msra" 1382 | } 1383 | } 1384 | } 1385 | layer { 1386 | name: "conv5-1/expand-bn" 1387 | type: "BatchNorm" 1388 | bottom: "conv5-1/expand" 1389 | top: "conv5-1/expand" 1390 | } 1391 | layer { 1392 | name: "conv5-1/expand-bn-scale" 1393 | type: "Scale" 1394 | bottom: "conv5-1/expand" 1395 | top: "conv5-1/expand" 1396 | scale_param { 1397 | bias_term: true 1398 | } 1399 | } 1400 | # H-swish 1401 | layer { 1402 | name: "conv5-1/expand/shift" 1403 | type: "Power" 1404 | bottom: "conv5-1/expand" 1405 | top: "conv5-1/expand/shift" 1406 | power_param { 1407 | power: 1 1408 | scale: 1 1409 | shift: 3 1410 | } 1411 | } 1412 | layer { 1413 | name: "conv5-1/expand/shift-relu" 1414 | type: "ReLU6" 1415 | bottom: "conv5-1/expand/shift" 1416 | top: "conv5-1/expand/shift" 1417 | } 1418 | layer { 1419 | name: "conv5-1/expand/shift-div" 1420 | type: "Power" 1421 | bottom: "conv5-1/expand/shift" 1422 | top: "conv5-1/expand/shift-div" 1423 | power_param { 1424 | power: 1 1425 | scale: 0.1666666667 1426 | shift: 0 1427 | } 1428 | } 1429 | layer { 1430 | name: "conv5-1/expand/hswish" 1431 | type: "Eltwise" 1432 | bottom: "conv5-1/expand" 1433 | bottom: "conv5-1/expand/shift-div" 1434 | top: "conv5-1/expand/hswish" 1435 | eltwise_param { 1436 | operation: PROD 1437 | } 1438 | } 1439 | 1440 | layer { 1441 | name: "conv5-1/dwise" 1442 | #type: "Convolution" 1443 | type: "DepthwiseConvolution" 1444 | bottom: "conv5-1/expand/hswish" 1445 | top: "conv5-1/dwise" 1446 | param { 1447 | lr_mult: 1 1448 | decay_mult: 1 1449 | } 1450 | convolution_param { 1451 | num_output: 200 1452 | group: 200 1453 | pad: 1 1454 | bias_term: false 1455 | kernel_size: 3 1456 | stride: 1 1457 | weight_filler { 1458 | type: "msra" 1459 | } 1460 | engine: CAFFE 1461 | } 1462 | } 1463 | layer { 1464 | name: "conv5-1/dwise-bn" 1465 | type: "BatchNorm" 1466 | bottom: "conv5-1/dwise" 1467 | top: "conv5-1/dwise" 1468 | } 1469 | layer { 1470 | name: "conv5-1/dwise-bn-scale" 1471 | type: "Scale" 1472 | bottom: "conv5-1/dwise" 1473 | top: "conv5-1/dwise" 1474 | scale_param { 1475 | bias_term: true 1476 | } 1477 | } 1478 | # H-swish 1479 | layer { 1480 | name: "conv5-1/dwise/shift" 1481 | type: "Power" 1482 | bottom: "conv5-1/dwise" 1483 | top: "conv5-1/dwise/shift" 1484 | power_param { 1485 | power: 1 1486 | scale: 1 1487 | shift: 3 1488 | } 1489 | } 1490 | layer { 1491 | name: "conv5-1/dwise/shift-relu" 1492 | type: "ReLU6" 1493 | bottom: "conv5-1/dwise/shift" 1494 | top: "conv5-1/dwise/shift" 1495 | } 1496 | layer { 1497 | name: "conv5-1/dwise/shift-div" 1498 | type: "Power" 1499 | bottom: "conv5-1/dwise/shift" 1500 | top: "conv5-1/dwise/shift-div" 1501 | power_param { 1502 | power: 1 1503 | scale: 0.1666666667 1504 | shift: 0 1505 | } 1506 | } 1507 | layer { 1508 | name: "conv5-1/dwise/hswish" 1509 | type: "Eltwise" 1510 | bottom: "conv5-1/dwise" 1511 | bottom: "conv5-1/dwise/shift-div" 1512 | top: "conv5-1/dwise/hswish" 1513 | eltwise_param { 1514 | operation: PROD 1515 | } 1516 | } 1517 | 1518 | layer { 1519 | name: "conv5-1/linear" 1520 | type: "Convolution" 1521 | bottom: "conv5-1/dwise/hswish" 1522 | top: "conv5-1/linear" 1523 | param { 1524 | lr_mult: 1 1525 | decay_mult: 1 1526 | } 1527 | convolution_param { 1528 | num_output: 80 1529 | pad: 0 1530 | bias_term: false 1531 | kernel_size: 1 1532 | stride: 1 1533 | weight_filler { 1534 | type: "msra" 1535 | } 1536 | } 1537 | } 1538 | layer { 1539 | name: "conv5-1/linear-bn" 1540 | type: "BatchNorm" 1541 | bottom: "conv5-1/linear" 1542 | top: "conv5-1/linear" 1543 | } 1544 | layer { 1545 | name: "conv5-1/linear-bn-scale" 1546 | type: "Scale" 1547 | bottom: "conv5-1/linear" 1548 | top: "conv5-1/linear" 1549 | scale_param { 1550 | bias_term: true 1551 | } 1552 | } 1553 | 1554 | layer { 1555 | name: "block5-1" 1556 | type: "Eltwise" 1557 | bottom: "conv4-3/linear" 1558 | bottom: "conv5-1/linear" 1559 | top: "block5-1" 1560 | } 1561 | 1562 | #################### stage 5-2 #################### 1563 | layer { 1564 | name: "conv5-2/expand" 1565 | type: "Convolution" 1566 | bottom: "block5-1" 1567 | top: "conv5-2/expand" 1568 | param { 1569 | lr_mult: 1 1570 | decay_mult: 1 1571 | } 1572 | convolution_param { 1573 | num_output: 184 1574 | pad: 0 1575 | bias_term: false 1576 | kernel_size: 1 1577 | stride: 1 1578 | weight_filler { 1579 | type: "msra" 1580 | } 1581 | } 1582 | } 1583 | layer { 1584 | name: "conv5-2/expand-bn" 1585 | type: "BatchNorm" 1586 | bottom: "conv5-2/expand" 1587 | top: "conv5-2/expand" 1588 | } 1589 | layer { 1590 | name: "conv5-2/expand-bn-scale" 1591 | type: "Scale" 1592 | bottom: "conv5-2/expand" 1593 | top: "conv5-2/expand" 1594 | scale_param { 1595 | bias_term: true 1596 | } 1597 | } 1598 | # H-swish 1599 | layer { 1600 | name: "conv5-2/expand/shift" 1601 | type: "Power" 1602 | bottom: "conv5-2/expand" 1603 | top: "conv5-2/expand/shift" 1604 | power_param { 1605 | power: 1 1606 | scale: 1 1607 | shift: 3 1608 | } 1609 | } 1610 | layer { 1611 | name: "conv5-2/expand/shift-relu" 1612 | type: "ReLU6" 1613 | bottom: "conv5-2/expand/shift" 1614 | top: "conv5-2/expand/shift" 1615 | } 1616 | layer { 1617 | name: "conv5-2/expand/shift-div" 1618 | type: "Power" 1619 | bottom: "conv5-2/expand/shift" 1620 | top: "conv5-2/expand/shift-div" 1621 | power_param { 1622 | power: 1 1623 | scale: 0.1666666667 1624 | shift: 0 1625 | } 1626 | } 1627 | layer { 1628 | name: "conv5-2/expand/hswish" 1629 | type: "Eltwise" 1630 | bottom: "conv5-2/expand" 1631 | bottom: "conv5-2/expand/shift-div" 1632 | top: "conv5-2/expand/hswish" 1633 | eltwise_param { 1634 | operation: PROD 1635 | } 1636 | } 1637 | 1638 | layer { 1639 | name: "conv5-2/dwise" 1640 | #type: "Convolution" 1641 | type: "DepthwiseConvolution" 1642 | bottom: "conv5-2/expand/hswish" 1643 | top: "conv5-2/dwise" 1644 | param { 1645 | lr_mult: 1 1646 | decay_mult: 1 1647 | } 1648 | convolution_param { 1649 | num_output: 184 1650 | group: 184 1651 | pad: 1 1652 | bias_term: false 1653 | kernel_size: 3 1654 | stride: 1 1655 | weight_filler { 1656 | type: "msra" 1657 | } 1658 | engine: CAFFE 1659 | } 1660 | } 1661 | layer { 1662 | name: "conv5-2/dwise-bn" 1663 | type: "BatchNorm" 1664 | bottom: "conv5-2/dwise" 1665 | top: "conv5-2/dwise" 1666 | } 1667 | layer { 1668 | name: "conv5-2/dwise-bn-scale" 1669 | type: "Scale" 1670 | bottom: "conv5-2/dwise" 1671 | top: "conv5-2/dwise" 1672 | scale_param { 1673 | bias_term: true 1674 | } 1675 | } 1676 | # H-swish 1677 | layer { 1678 | name: "conv5-2/dwise/shift" 1679 | type: "Power" 1680 | bottom: "conv5-2/dwise" 1681 | top: "conv5-2/dwise/shift" 1682 | power_param { 1683 | power: 1 1684 | scale: 1 1685 | shift: 3 1686 | } 1687 | } 1688 | layer { 1689 | name: "conv5-2/dwise/shift-relu" 1690 | type: "ReLU6" 1691 | bottom: "conv5-2/dwise/shift" 1692 | top: "conv5-2/dwise/shift" 1693 | } 1694 | layer { 1695 | name: "conv5-2/dwise/shift-div" 1696 | type: "Power" 1697 | bottom: "conv5-2/dwise/shift" 1698 | top: "conv5-2/dwise/shift-div" 1699 | power_param { 1700 | power: 1 1701 | scale: 0.1666666667 1702 | shift: 0 1703 | } 1704 | } 1705 | layer { 1706 | name: "conv5-2/dwise/hswish" 1707 | type: "Eltwise" 1708 | bottom: "conv5-2/dwise" 1709 | bottom: "conv5-2/dwise/shift-div" 1710 | top: "conv5-2/dwise/hswish" 1711 | eltwise_param { 1712 | operation: PROD 1713 | } 1714 | } 1715 | 1716 | layer { 1717 | name: "conv5-2/linear" 1718 | type: "Convolution" 1719 | bottom: "conv5-2/dwise/hswish" 1720 | top: "conv5-2/linear" 1721 | param { 1722 | lr_mult: 1 1723 | decay_mult: 1 1724 | } 1725 | convolution_param { 1726 | num_output: 80 1727 | pad: 0 1728 | bias_term: false 1729 | kernel_size: 1 1730 | stride: 1 1731 | weight_filler { 1732 | type: "msra" 1733 | } 1734 | } 1735 | } 1736 | layer { 1737 | name: "conv5-2/linear-bn" 1738 | type: "BatchNorm" 1739 | bottom: "conv5-2/linear" 1740 | top: "conv5-2/linear" 1741 | } 1742 | layer { 1743 | name: "conv5-2/linear-bn-scale" 1744 | type: "Scale" 1745 | bottom: "conv5-2/linear" 1746 | top: "conv5-2/linear" 1747 | scale_param { 1748 | bias_term: true 1749 | } 1750 | } 1751 | 1752 | layer { 1753 | name: "block5-2" 1754 | type: "Eltwise" 1755 | bottom: "block5-1" 1756 | bottom: "conv5-2/linear" 1757 | top: "block5-2" 1758 | } 1759 | 1760 | #################### stage 5-3 #################### 1761 | layer { 1762 | name: "conv5-3/expand" 1763 | type: "Convolution" 1764 | bottom: "block5-2" 1765 | top: "conv5-3/expand" 1766 | param { 1767 | lr_mult: 1 1768 | decay_mult: 1 1769 | } 1770 | convolution_param { 1771 | num_output: 184 1772 | pad: 0 1773 | bias_term: false 1774 | kernel_size: 1 1775 | stride: 1 1776 | weight_filler { 1777 | type: "msra" 1778 | } 1779 | } 1780 | } 1781 | layer { 1782 | name: "conv5-3/expand-bn" 1783 | type: "BatchNorm" 1784 | bottom: "conv5-3/expand" 1785 | top: "conv5-3/expand" 1786 | } 1787 | layer { 1788 | name: "conv5-3/expand-bn-scale" 1789 | type: "Scale" 1790 | bottom: "conv5-3/expand" 1791 | top: "conv5-3/expand" 1792 | scale_param { 1793 | bias_term: true 1794 | } 1795 | } 1796 | # H-swish 1797 | layer { 1798 | name: "conv5-3/expand/shift" 1799 | type: "Power" 1800 | bottom: "conv5-3/expand" 1801 | top: "conv5-3/expand/shift" 1802 | power_param { 1803 | power: 1 1804 | scale: 1 1805 | shift: 3 1806 | } 1807 | } 1808 | layer { 1809 | name: "conv5-3/expand/shift-relu" 1810 | type: "ReLU6" 1811 | bottom: "conv5-3/expand/shift" 1812 | top: "conv5-3/expand/shift" 1813 | } 1814 | layer { 1815 | name: "conv5-3/expand/shift-div" 1816 | type: "Power" 1817 | bottom: "conv5-3/expand/shift" 1818 | top: "conv5-3/expand/shift-div" 1819 | power_param { 1820 | power: 1 1821 | scale: 0.1666666667 1822 | shift: 0 1823 | } 1824 | } 1825 | layer { 1826 | name: "conv5-3/expand/hswish" 1827 | type: "Eltwise" 1828 | bottom: "conv5-3/expand" 1829 | bottom: "conv5-3/expand/shift-div" 1830 | top: "conv5-3/expand/hswish" 1831 | eltwise_param { 1832 | operation: PROD 1833 | } 1834 | } 1835 | 1836 | layer { 1837 | name: "conv5-3/dwise" 1838 | #type: "Convolution" 1839 | type: "DepthwiseConvolution" 1840 | bottom: "conv5-3/expand/hswish" 1841 | top: "conv5-3/dwise" 1842 | param { 1843 | lr_mult: 1 1844 | decay_mult: 1 1845 | } 1846 | convolution_param { 1847 | num_output: 184 1848 | group: 184 1849 | pad: 1 1850 | bias_term: false 1851 | kernel_size: 3 1852 | stride: 1 1853 | weight_filler { 1854 | type: "msra" 1855 | } 1856 | engine: CAFFE 1857 | } 1858 | } 1859 | layer { 1860 | name: "conv5-3/dwise-bn" 1861 | type: "BatchNorm" 1862 | bottom: "conv5-3/dwise" 1863 | top: "conv5-3/dwise" 1864 | } 1865 | layer { 1866 | name: "conv5-3/dwise-bn-scale" 1867 | type: "Scale" 1868 | bottom: "conv5-3/dwise" 1869 | top: "conv5-3/dwise" 1870 | scale_param { 1871 | bias_term: true 1872 | } 1873 | } 1874 | # H-swish 1875 | layer { 1876 | name: "conv5-3/dwise/shift" 1877 | type: "Power" 1878 | bottom: "conv5-3/dwise" 1879 | top: "conv5-3/dwise/shift" 1880 | power_param { 1881 | power: 1 1882 | scale: 1 1883 | shift: 3 1884 | } 1885 | } 1886 | layer { 1887 | name: "conv5-3/dwise/shift-relu" 1888 | type: "ReLU6" 1889 | bottom: "conv5-3/dwise/shift" 1890 | top: "conv5-3/dwise/shift" 1891 | } 1892 | layer { 1893 | name: "conv5-3/dwise/shift-div" 1894 | type: "Power" 1895 | bottom: "conv5-3/dwise/shift" 1896 | top: "conv5-3/dwise/shift-div" 1897 | power_param { 1898 | power: 1 1899 | scale: 0.1666666667 1900 | shift: 0 1901 | } 1902 | } 1903 | layer { 1904 | name: "conv5-3/dwise/hswish" 1905 | type: "Eltwise" 1906 | bottom: "conv5-3/dwise" 1907 | bottom: "conv5-3/dwise/shift-div" 1908 | top: "conv5-3/dwise/hswish" 1909 | eltwise_param { 1910 | operation: PROD 1911 | } 1912 | } 1913 | 1914 | layer { 1915 | name: "conv5-3/linear" 1916 | type: "Convolution" 1917 | bottom: "conv5-3/dwise/hswish" 1918 | top: "conv5-3/linear" 1919 | param { 1920 | lr_mult: 1 1921 | decay_mult: 1 1922 | } 1923 | convolution_param { 1924 | num_output: 80 1925 | pad: 0 1926 | bias_term: false 1927 | kernel_size: 1 1928 | stride: 1 1929 | weight_filler { 1930 | type: "msra" 1931 | } 1932 | } 1933 | } 1934 | layer { 1935 | name: "conv5-3/linear-bn" 1936 | type: "BatchNorm" 1937 | bottom: "conv5-3/linear" 1938 | top: "conv5-3/linear" 1939 | } 1940 | layer { 1941 | name: "conv5-3/linear-bn-scale" 1942 | type: "Scale" 1943 | bottom: "conv5-3/linear" 1944 | top: "conv5-3/linear" 1945 | scale_param { 1946 | bias_term: true 1947 | } 1948 | } 1949 | 1950 | layer { 1951 | name: "block5-3" 1952 | type: "Eltwise" 1953 | bottom: "block5-2" 1954 | bottom: "conv5-3/linear" 1955 | top: "block5-3" 1956 | } 1957 | 1958 | #################### stage 5-4 #################### 1959 | layer { 1960 | name: "conv5-4/expand" 1961 | type: "Convolution" 1962 | bottom: "block5-3" 1963 | top: "conv5-4/expand" 1964 | param { 1965 | lr_mult: 1 1966 | decay_mult: 1 1967 | } 1968 | convolution_param { 1969 | num_output: 480 1970 | pad: 0 1971 | bias_term: false 1972 | kernel_size: 1 1973 | stride: 1 1974 | weight_filler { 1975 | type: "msra" 1976 | } 1977 | } 1978 | } 1979 | layer { 1980 | name: "conv5-4/expand-bn" 1981 | type: "BatchNorm" 1982 | bottom: "conv5-4/expand" 1983 | top: "conv5-4/expand" 1984 | } 1985 | layer { 1986 | name: "conv5-4/expand-bn-scale" 1987 | type: "Scale" 1988 | bottom: "conv5-4/expand" 1989 | top: "conv5-4/expand" 1990 | scale_param { 1991 | bias_term: true 1992 | } 1993 | } 1994 | # H-swish 1995 | layer { 1996 | name: "conv5-4/expand/shift" 1997 | type: "Power" 1998 | bottom: "conv5-4/expand" 1999 | top: "conv5-4/expand/shift" 2000 | power_param { 2001 | power: 1 2002 | scale: 1 2003 | shift: 3 2004 | } 2005 | } 2006 | layer { 2007 | name: "conv5-4/expand/shift-relu" 2008 | type: "ReLU6" 2009 | bottom: "conv5-4/expand/shift" 2010 | top: "conv5-4/expand/shift" 2011 | } 2012 | layer { 2013 | name: "conv5-4/expand/shift-div" 2014 | type: "Power" 2015 | bottom: "conv5-4/expand/shift" 2016 | top: "conv5-4/expand/shift-div" 2017 | power_param { 2018 | power: 1 2019 | scale: 0.1666666667 2020 | shift: 0 2021 | } 2022 | } 2023 | layer { 2024 | name: "conv5-4/expand/hswish" 2025 | type: "Eltwise" 2026 | bottom: "conv5-4/expand" 2027 | bottom: "conv5-4/expand/shift-div" 2028 | top: "conv5-4/expand/hswish" 2029 | eltwise_param { 2030 | operation: PROD 2031 | } 2032 | } 2033 | 2034 | layer { 2035 | name: "conv5-4/dwise" 2036 | #type: "Convolution" 2037 | type: "DepthwiseConvolution" 2038 | bottom: "conv5-4/expand/hswish" 2039 | top: "conv5-4/dwise" 2040 | param { 2041 | lr_mult: 1 2042 | decay_mult: 1 2043 | } 2044 | convolution_param { 2045 | num_output: 480 2046 | group: 480 2047 | pad: 1 2048 | bias_term: false 2049 | kernel_size: 3 2050 | stride: 1 2051 | weight_filler { 2052 | type: "msra" 2053 | } 2054 | engine: CAFFE 2055 | } 2056 | } 2057 | layer { 2058 | name: "conv5-4/dwise-bn" 2059 | type: "BatchNorm" 2060 | bottom: "conv5-4/dwise" 2061 | top: "conv5-4/dwise" 2062 | } 2063 | layer { 2064 | name: "conv5-4/dwise-bn-scale" 2065 | type: "Scale" 2066 | bottom: "conv5-4/dwise" 2067 | top: "conv5-4/dwise" 2068 | scale_param { 2069 | bias_term: true 2070 | } 2071 | } 2072 | 2073 | # se 2074 | layer { 2075 | name: "conv5-4/dwise-se-pool" 2076 | type: "Pooling" 2077 | bottom: "conv5-4/dwise" 2078 | top: "conv5-4/dwise-se-pool" 2079 | pooling_param { 2080 | pool: AVE 2081 | global_pooling: true 2082 | } 2083 | } 2084 | layer { 2085 | name: "conv5-4/dwise-se-fc1" 2086 | type: "InnerProduct" 2087 | bottom: "conv5-4/dwise-se-pool" 2088 | top:"conv5-4/dwise-se-fc1" 2089 | param { 2090 | lr_mult: 1 2091 | decay_mult: 1 2092 | } 2093 | param { 2094 | lr_mult: 2 2095 | decay_mult: 0 2096 | } 2097 | inner_product_param { 2098 | num_output: 120 2099 | weight_filler { 2100 | type: "msra" 2101 | } 2102 | bias_filler { 2103 | type: "constant" 2104 | value: 0 2105 | } 2106 | } 2107 | } 2108 | layer { 2109 | name: "conv5-4/dwise-se-fc1-relu" 2110 | type: "ReLU6" 2111 | bottom: "conv5-4/dwise-se-fc1" 2112 | top: "conv5-4/dwise-se-fc1" 2113 | } 2114 | layer { 2115 | name: "conv5-4/dwise-se-fc2" 2116 | type: "InnerProduct" 2117 | bottom: "conv5-4/dwise-se-fc1" 2118 | top:"conv5-4/dwise-se-fc2" 2119 | param { 2120 | lr_mult: 1 2121 | decay_mult: 1 2122 | } 2123 | param { 2124 | lr_mult: 2 2125 | decay_mult: 0 2126 | } 2127 | inner_product_param { 2128 | num_output: 480 2129 | weight_filler { 2130 | type: "msra" 2131 | } 2132 | bias_filler { 2133 | type: "constant" 2134 | value: 0 2135 | } 2136 | } 2137 | } 2138 | # H-sigmoid 2139 | layer { 2140 | name: "conv5-4/dwise-se-fc2/shift" 2141 | type: "Power" 2142 | bottom: "conv5-4/dwise-se-fc2" 2143 | top: "conv5-4/dwise-se-fc2/shift" 2144 | power_param { 2145 | power: 1 2146 | scale: 1 2147 | shift: 3 2148 | } 2149 | } 2150 | layer { 2151 | name: "conv5-4/dwise-se-fc2/shift-relu" 2152 | type: "ReLU6" 2153 | bottom: "conv5-4/dwise-se-fc2/shift" 2154 | top: "conv5-4/dwise-se-fc2/shift" 2155 | } 2156 | layer { 2157 | name: "conv5-4/dwise-se-fc2/shift-div" 2158 | type: "Power" 2159 | bottom: "conv5-4/dwise-se-fc2/shift" 2160 | top: "conv5-4/dwise-se-fc2/shift-div" 2161 | power_param { 2162 | power: 1 2163 | scale: 0.1666666667 2164 | shift: 0 2165 | } 2166 | } 2167 | layer { 2168 | name: "conv5-4/dwise/scale" 2169 | type: "Scale" 2170 | bottom: "conv5-4/dwise" 2171 | bottom: "conv5-4/dwise-se-fc2/shift-div" 2172 | top: "conv5-4/dwise/scale" 2173 | scale_param{ 2174 | axis: 0 2175 | } 2176 | } 2177 | # H-swish 2178 | layer { 2179 | name: "conv5-4/dwise/shift" 2180 | type: "Power" 2181 | bottom: "conv5-4/dwise/scale" 2182 | top: "conv5-4/dwise/shift" 2183 | power_param { 2184 | power: 1 2185 | scale: 1 2186 | shift: 3 2187 | } 2188 | } 2189 | layer { 2190 | name: "conv5-4/dwise/shift-relu" 2191 | type: "ReLU6" 2192 | bottom: "conv5-4/dwise/shift" 2193 | top: "conv5-4/dwise/shift" 2194 | } 2195 | layer { 2196 | name: "conv5-4/dwise/shift-div" 2197 | type: "Power" 2198 | bottom: "conv5-4/dwise/shift" 2199 | top: "conv5-4/dwise/shift-div" 2200 | power_param { 2201 | power: 1 2202 | scale: 0.1666666667 2203 | shift: 0 2204 | } 2205 | } 2206 | layer { 2207 | name: "conv5-4/dwise/scale/hswish" 2208 | type: "Eltwise" 2209 | bottom: "conv5-4/dwise/scale" 2210 | bottom: "conv5-4/dwise/shift-div" 2211 | top: "conv5-4/dwise/scale/hswish" 2212 | eltwise_param { 2213 | operation: PROD 2214 | } 2215 | } 2216 | 2217 | layer { 2218 | name: "conv5-4/linear" 2219 | type: "Convolution" 2220 | bottom: "conv5-4/dwise/scale/hswish" 2221 | top: "conv5-4/linear" 2222 | param { 2223 | lr_mult: 1 2224 | decay_mult: 1 2225 | } 2226 | convolution_param { 2227 | num_output: 112 2228 | pad: 0 2229 | bias_term: false 2230 | kernel_size: 1 2231 | stride: 1 2232 | weight_filler { 2233 | type: "msra" 2234 | } 2235 | } 2236 | } 2237 | layer { 2238 | name: "conv5-4/linear-bn" 2239 | type: "BatchNorm" 2240 | bottom: "conv5-4/linear" 2241 | top: "conv5-4/linear" 2242 | } 2243 | layer { 2244 | name: "conv5-4/linear-bn-scale" 2245 | type: "Scale" 2246 | bottom: "conv5-4/linear" 2247 | top: "conv5-4/linear" 2248 | scale_param { 2249 | bias_term: true 2250 | } 2251 | } 2252 | 2253 | #################### stage 5-5 #################### 2254 | layer { 2255 | name: "conv5-5/expand" 2256 | type: "Convolution" 2257 | bottom: "conv5-4/linear" 2258 | top: "conv5-5/expand" 2259 | param { 2260 | lr_mult: 1 2261 | decay_mult: 1 2262 | } 2263 | convolution_param { 2264 | num_output: 672 2265 | pad: 0 2266 | bias_term: false 2267 | kernel_size: 1 2268 | stride: 1 2269 | weight_filler { 2270 | type: "msra" 2271 | } 2272 | } 2273 | } 2274 | layer { 2275 | name: "conv5-5/expand-bn" 2276 | type: "BatchNorm" 2277 | bottom: "conv5-5/expand" 2278 | top: "conv5-5/expand" 2279 | } 2280 | layer { 2281 | name: "conv5-5/expand-bn-scale" 2282 | type: "Scale" 2283 | bottom: "conv5-5/expand" 2284 | top: "conv5-5/expand" 2285 | scale_param { 2286 | bias_term: true 2287 | } 2288 | } 2289 | # H-swish 2290 | layer { 2291 | name: "conv5-5/expand/shift" 2292 | type: "Power" 2293 | bottom: "conv5-5/expand" 2294 | top: "conv5-5/expand/shift" 2295 | power_param { 2296 | power: 1 2297 | scale: 1 2298 | shift: 3 2299 | } 2300 | } 2301 | layer { 2302 | name: "conv5-5/expand/shift-relu" 2303 | type: "ReLU6" 2304 | bottom: "conv5-5/expand/shift" 2305 | top: "conv5-5/expand/shift" 2306 | } 2307 | layer { 2308 | name: "conv5-5/expand/shift-div" 2309 | type: "Power" 2310 | bottom: "conv5-5/expand/shift" 2311 | top: "conv5-5/expand/shift-div" 2312 | power_param { 2313 | power: 1 2314 | scale: 0.1666666667 2315 | shift: 0 2316 | } 2317 | } 2318 | layer { 2319 | name: "conv5-5/expand/hswish" 2320 | type: "Eltwise" 2321 | bottom: "conv5-5/expand" 2322 | bottom: "conv5-5/expand/shift-div" 2323 | top: "conv5-5/expand/hswish" 2324 | eltwise_param { 2325 | operation: PROD 2326 | } 2327 | } 2328 | 2329 | layer { 2330 | name: "conv5-5/dwise" 2331 | #type: "Convolution" 2332 | type: "DepthwiseConvolution" 2333 | bottom: "conv5-5/expand/hswish" 2334 | top: "conv5-5/dwise" 2335 | param { 2336 | lr_mult: 1 2337 | decay_mult: 1 2338 | } 2339 | convolution_param { 2340 | num_output: 672 2341 | group: 672 2342 | pad: 1 2343 | bias_term: false 2344 | kernel_size: 3 2345 | stride: 1 2346 | weight_filler { 2347 | type: "msra" 2348 | } 2349 | engine: CAFFE 2350 | } 2351 | } 2352 | layer { 2353 | name: "conv5-5/dwise-bn" 2354 | type: "BatchNorm" 2355 | bottom: "conv5-5/dwise" 2356 | top: "conv5-5/dwise" 2357 | } 2358 | layer { 2359 | name: "conv5-5/dwise-bn-scale" 2360 | type: "Scale" 2361 | bottom: "conv5-5/dwise" 2362 | top: "conv5-5/dwise" 2363 | scale_param { 2364 | bias_term: true 2365 | } 2366 | } 2367 | 2368 | # se 2369 | layer { 2370 | name: "conv5-5/dwise-se-pool" 2371 | type: "Pooling" 2372 | bottom: "conv5-5/dwise" 2373 | top: "conv5-5/dwise-se-pool" 2374 | pooling_param { 2375 | pool: AVE 2376 | global_pooling: true 2377 | } 2378 | } 2379 | layer { 2380 | name: "conv5-5/dwise-se-fc1" 2381 | type: "InnerProduct" 2382 | bottom: "conv5-5/dwise-se-pool" 2383 | top:"conv5-5/dwise-se-fc1" 2384 | param { 2385 | lr_mult: 1 2386 | decay_mult: 1 2387 | } 2388 | param { 2389 | lr_mult: 2 2390 | decay_mult: 0 2391 | } 2392 | inner_product_param { 2393 | num_output: 168 2394 | weight_filler { 2395 | type: "msra" 2396 | } 2397 | bias_filler { 2398 | type: "constant" 2399 | value: 0 2400 | } 2401 | } 2402 | } 2403 | layer { 2404 | name: "conv5-5/dwise-se-fc1-relu" 2405 | type: "ReLU6" 2406 | bottom: "conv5-5/dwise-se-fc1" 2407 | top: "conv5-5/dwise-se-fc1" 2408 | } 2409 | layer { 2410 | name: "conv5-5/dwise-se-fc2" 2411 | type: "InnerProduct" 2412 | bottom: "conv5-5/dwise-se-fc1" 2413 | top:"conv5-5/dwise-se-fc2" 2414 | param { 2415 | lr_mult: 1 2416 | decay_mult: 1 2417 | } 2418 | param { 2419 | lr_mult: 2 2420 | decay_mult: 0 2421 | } 2422 | inner_product_param { 2423 | num_output: 672 2424 | weight_filler { 2425 | type: "msra" 2426 | } 2427 | bias_filler { 2428 | type: "constant" 2429 | value: 0 2430 | } 2431 | } 2432 | } 2433 | # H-sigmoid 2434 | layer { 2435 | name: "conv5-5/dwise-se-fc2/shift" 2436 | type: "Power" 2437 | bottom: "conv5-5/dwise-se-fc2" 2438 | top: "conv5-5/dwise-se-fc2/shift" 2439 | power_param { 2440 | power: 1 2441 | scale: 1 2442 | shift: 3 2443 | } 2444 | } 2445 | layer { 2446 | name: "conv5-5/dwise-se-fc2/shift-relu" 2447 | type: "ReLU6" 2448 | bottom: "conv5-5/dwise-se-fc2/shift" 2449 | top: "conv5-5/dwise-se-fc2/shift" 2450 | } 2451 | layer { 2452 | name: "conv5-5/dwise-se-fc2/shift-div" 2453 | type: "Power" 2454 | bottom: "conv5-5/dwise-se-fc2/shift" 2455 | top: "conv5-5/dwise-se-fc2/shift-div" 2456 | power_param { 2457 | power: 1 2458 | scale: 0.1666666667 2459 | shift: 0 2460 | } 2461 | } 2462 | layer { 2463 | name: "conv5-5/dwise/scale" 2464 | type: "Scale" 2465 | bottom: "conv5-5/dwise" 2466 | bottom: "conv5-5/dwise-se-fc2/shift-div" 2467 | top: "conv5-5/dwise/scale" 2468 | scale_param{ 2469 | axis: 0 2470 | } 2471 | } 2472 | # H-swish 2473 | layer { 2474 | name: "conv5-5/dwise/shift" 2475 | type: "Power" 2476 | bottom: "conv5-5/dwise/scale" 2477 | top: "conv5-5/dwise/shift" 2478 | power_param { 2479 | power: 1 2480 | scale: 1 2481 | shift: 3 2482 | } 2483 | } 2484 | layer { 2485 | name: "conv5-5/dwise/shift-relu" 2486 | type: "ReLU6" 2487 | bottom: "conv5-5/dwise/shift" 2488 | top: "conv5-5/dwise/shift" 2489 | } 2490 | layer { 2491 | name: "conv5-5/dwise/shift-div" 2492 | type: "Power" 2493 | bottom: "conv5-5/dwise/shift" 2494 | top: "conv5-5/dwise/shift-div" 2495 | power_param { 2496 | power: 1 2497 | scale: 0.1666666667 2498 | shift: 0 2499 | } 2500 | } 2501 | layer { 2502 | name: "conv5-5/dwise/hswish" 2503 | type: "Eltwise" 2504 | bottom: "conv5-5/dwise/scale" 2505 | bottom: "conv5-5/dwise/shift-div" 2506 | top: "conv5-5/dwise/hswish" 2507 | eltwise_param { 2508 | operation: PROD 2509 | } 2510 | } 2511 | 2512 | layer { 2513 | name: "conv5-5/linear" 2514 | type: "Convolution" 2515 | bottom: "conv5-5/dwise/hswish" 2516 | top: "conv5-5/linear" 2517 | param { 2518 | lr_mult: 1 2519 | decay_mult: 1 2520 | } 2521 | convolution_param { 2522 | num_output: 112 2523 | pad: 0 2524 | bias_term: false 2525 | kernel_size: 1 2526 | stride: 1 2527 | weight_filler { 2528 | type: "msra" 2529 | } 2530 | } 2531 | } 2532 | layer { 2533 | name: "conv5-5/linear-bn" 2534 | type: "BatchNorm" 2535 | bottom: "conv5-5/linear" 2536 | top: "conv5-5/linear" 2537 | } 2538 | layer { 2539 | name: "conv5-5/linear-bn-scale" 2540 | type: "Scale" 2541 | bottom: "conv5-5/linear" 2542 | top: "conv5-5/linear" 2543 | scale_param { 2544 | bias_term: true 2545 | } 2546 | } 2547 | 2548 | layer { 2549 | name: "block5-5" 2550 | type: "Eltwise" 2551 | bottom: "conv5-4/linear" 2552 | bottom: "conv5-5/linear" 2553 | top: "block5-5" 2554 | } 2555 | 2556 | #################### stage 5-6 #################### 2557 | layer { 2558 | name: "conv5-6/expand" 2559 | type: "Convolution" 2560 | bottom: "block5-5" 2561 | top: "conv5-6/expand" 2562 | param { 2563 | lr_mult: 1 2564 | decay_mult: 1 2565 | } 2566 | convolution_param { 2567 | num_output: 672 2568 | pad: 0 2569 | bias_term: false 2570 | kernel_size: 1 2571 | stride: 1 2572 | weight_filler { 2573 | type: "msra" 2574 | } 2575 | } 2576 | } 2577 | layer { 2578 | name: "conv5-6/expand-bn" 2579 | type: "BatchNorm" 2580 | bottom: "conv5-6/expand" 2581 | top: "conv5-6/expand" 2582 | } 2583 | layer { 2584 | name: "conv5-6/expand-bn-scale" 2585 | type: "Scale" 2586 | bottom: "conv5-6/expand" 2587 | top: "conv5-6/expand" 2588 | scale_param { 2589 | bias_term: true 2590 | } 2591 | } 2592 | # H-swish 2593 | layer { 2594 | name: "conv5-6/expand/shift" 2595 | type: "Power" 2596 | bottom: "conv5-6/expand" 2597 | top: "conv5-6/expand/shift" 2598 | power_param { 2599 | power: 1 2600 | scale: 1 2601 | shift: 3 2602 | } 2603 | } 2604 | layer { 2605 | name: "conv5-6/expand/shift-relu" 2606 | type: "ReLU6" 2607 | bottom: "conv5-6/expand/shift" 2608 | top: "conv5-6/expand/shift" 2609 | } 2610 | layer { 2611 | name: "conv5-6/expand/shift-div" 2612 | type: "Power" 2613 | bottom: "conv5-6/expand/shift" 2614 | top: "conv5-6/expand/shift-div" 2615 | power_param { 2616 | power: 1 2617 | scale: 0.1666666667 2618 | shift: 0 2619 | } 2620 | } 2621 | layer { 2622 | name: "conv5-6/expand/hswish" 2623 | type: "Eltwise" 2624 | bottom: "conv5-6/expand" 2625 | bottom: "conv5-6/expand/shift-div" 2626 | top: "conv5-6/expand/hswish" 2627 | eltwise_param { 2628 | operation: PROD 2629 | } 2630 | } 2631 | 2632 | layer { 2633 | name: "conv5-6/dwise" 2634 | #type: "Convolution" 2635 | type: "DepthwiseConvolution" 2636 | bottom: "conv5-6/expand/hswish" 2637 | top: "conv5-6/dwise" 2638 | param { 2639 | lr_mult: 1 2640 | decay_mult: 1 2641 | } 2642 | convolution_param { 2643 | num_output: 672 2644 | group: 672 2645 | pad: 2 2646 | bias_term: false 2647 | kernel_size: 5 2648 | stride: 1 2649 | weight_filler { 2650 | type: "msra" 2651 | } 2652 | engine: CAFFE 2653 | } 2654 | } 2655 | layer { 2656 | name: "conv5-6/dwise-bn" 2657 | type: "BatchNorm" 2658 | bottom: "conv5-6/dwise" 2659 | top: "conv5-6/dwise" 2660 | } 2661 | layer { 2662 | name: "conv5-6/dwise-bn-scale" 2663 | type: "Scale" 2664 | bottom: "conv5-6/dwise" 2665 | top: "conv5-6/dwise" 2666 | scale_param { 2667 | bias_term: true 2668 | } 2669 | } 2670 | 2671 | # se 2672 | layer { 2673 | name: "conv5-6/dwise-se-pool" 2674 | type: "Pooling" 2675 | bottom: "conv5-6/dwise" 2676 | top: "conv5-6/dwise-se-pool" 2677 | pooling_param { 2678 | pool: AVE 2679 | global_pooling: true 2680 | } 2681 | } 2682 | layer { 2683 | name: "conv5-6/dwise-se-fc1" 2684 | type: "InnerProduct" 2685 | bottom: "conv5-6/dwise-se-pool" 2686 | top:"conv5-6/dwise-se-fc1" 2687 | param { 2688 | lr_mult: 1 2689 | decay_mult: 1 2690 | } 2691 | param { 2692 | lr_mult: 2 2693 | decay_mult: 0 2694 | } 2695 | inner_product_param { 2696 | num_output: 168 2697 | weight_filler { 2698 | type: "msra" 2699 | } 2700 | bias_filler { 2701 | type: "constant" 2702 | value: 0 2703 | } 2704 | } 2705 | } 2706 | layer { 2707 | name: "conv5-6/dwise-se-fc1-relu" 2708 | type: "ReLU6" 2709 | bottom: "conv5-6/dwise-se-fc1" 2710 | top: "conv5-6/dwise-se-fc1" 2711 | } 2712 | layer { 2713 | name: "conv5-6/dwise-se-fc2" 2714 | type: "InnerProduct" 2715 | bottom: "conv5-6/dwise-se-fc1" 2716 | top:"conv5-6/dwise-se-fc2" 2717 | param { 2718 | lr_mult: 1 2719 | decay_mult: 1 2720 | } 2721 | param { 2722 | lr_mult: 2 2723 | decay_mult: 0 2724 | } 2725 | inner_product_param { 2726 | num_output: 672 2727 | weight_filler { 2728 | type: "msra" 2729 | } 2730 | bias_filler { 2731 | type: "constant" 2732 | value: 0 2733 | } 2734 | } 2735 | } 2736 | # H-sigmoid 2737 | layer { 2738 | name: "conv5-6/dwise-se-fc2/shift" 2739 | type: "Power" 2740 | bottom: "conv5-6/dwise-se-fc2" 2741 | top: "conv5-6/dwise-se-fc2/shift" 2742 | power_param { 2743 | power: 1 2744 | scale: 1 2745 | shift: 3 2746 | } 2747 | } 2748 | layer { 2749 | name: "conv5-6/dwise-se-fc2/shift-relu" 2750 | type: "ReLU6" 2751 | bottom: "conv5-6/dwise-se-fc2/shift" 2752 | top: "conv5-6/dwise-se-fc2/shift" 2753 | } 2754 | layer { 2755 | name: "conv5-6/dwise-se-fc2/shift-div" 2756 | type: "Power" 2757 | bottom: "conv5-6/dwise-se-fc2/shift" 2758 | top: "conv5-6/dwise-se-fc2/shift-div" 2759 | power_param { 2760 | power: 1 2761 | scale: 0.1666666667 2762 | shift: 0 2763 | } 2764 | } 2765 | layer { 2766 | name: "conv5-6/dwise/scale" 2767 | type: "Scale" 2768 | bottom: "conv5-6/dwise" 2769 | bottom: "conv5-6/dwise-se-fc2/shift-div" 2770 | top: "conv5-6/dwise/scale" 2771 | scale_param{ 2772 | axis: 0 2773 | } 2774 | } 2775 | # H-swish 2776 | layer { 2777 | name: "conv5-6/dwise/shift" 2778 | type: "Power" 2779 | bottom: "conv5-6/dwise/scale" 2780 | top: "conv5-6/dwise/shift" 2781 | power_param { 2782 | power: 1 2783 | scale: 1 2784 | shift: 3 2785 | } 2786 | } 2787 | layer { 2788 | name: "conv5-6/dwise/shift-relu" 2789 | type: "ReLU6" 2790 | bottom: "conv5-6/dwise/shift" 2791 | top: "conv5-6/dwise/shift" 2792 | } 2793 | layer { 2794 | name: "conv5-6/dwise/shift-div" 2795 | type: "Power" 2796 | bottom: "conv5-6/dwise/shift" 2797 | top: "conv5-6/dwise/shift-div" 2798 | power_param { 2799 | power: 1 2800 | scale: 0.1666666667 2801 | shift: 0 2802 | } 2803 | } 2804 | layer { 2805 | name: "conv5-6/dwise/hswish" 2806 | type: "Eltwise" 2807 | bottom: "conv5-6/dwise/scale" 2808 | bottom: "conv5-6/dwise/shift-div" 2809 | top: "conv5-6/dwise/hswish" 2810 | eltwise_param { 2811 | operation: PROD 2812 | } 2813 | } 2814 | 2815 | layer { 2816 | name: "conv5-6/linear" 2817 | type: "Convolution" 2818 | bottom: "conv5-6/dwise/hswish" 2819 | top: "conv5-6/linear" 2820 | param { 2821 | lr_mult: 1 2822 | decay_mult: 1 2823 | } 2824 | convolution_param { 2825 | num_output: 112 2826 | pad: 0 2827 | bias_term: false 2828 | kernel_size: 1 2829 | stride: 1 2830 | weight_filler { 2831 | type: "msra" 2832 | } 2833 | } 2834 | } 2835 | layer { 2836 | name: "conv5-6/linear-bn" 2837 | type: "BatchNorm" 2838 | bottom: "conv5-6/linear" 2839 | top: "conv5-6/linear" 2840 | } 2841 | layer { 2842 | name: "conv5-6/linear-bn-scale" 2843 | type: "Scale" 2844 | bottom: "conv5-6/linear" 2845 | top: "conv5-6/linear" 2846 | scale_param { 2847 | bias_term: true 2848 | } 2849 | } 2850 | 2851 | layer { 2852 | name: "block5-6" 2853 | type: "Eltwise" 2854 | bottom: "block5-5" 2855 | bottom: "conv5-6/linear" 2856 | top: "block5-6" 2857 | } 2858 | 2859 | #################### stage 5-7 #################### 2860 | layer { 2861 | name: "conv5-7/expand" 2862 | type: "Convolution" 2863 | bottom: "block5-6" 2864 | top: "conv5-7/expand" 2865 | param { 2866 | lr_mult: 1 2867 | decay_mult: 1 2868 | } 2869 | convolution_param { 2870 | num_output: 672 2871 | pad: 0 2872 | bias_term: false 2873 | kernel_size: 1 2874 | stride: 1 2875 | weight_filler { 2876 | type: "msra" 2877 | } 2878 | } 2879 | } 2880 | layer { 2881 | name: "conv5-7/expand-bn" 2882 | type: "BatchNorm" 2883 | bottom: "conv5-7/expand" 2884 | top: "conv5-7/expand" 2885 | } 2886 | layer { 2887 | name: "conv5-7/expand-bn-scale" 2888 | type: "Scale" 2889 | bottom: "conv5-7/expand" 2890 | top: "conv5-7/expand" 2891 | scale_param { 2892 | bias_term: true 2893 | } 2894 | } 2895 | # H-swish 2896 | layer { 2897 | name: "conv5-7/expand/shift" 2898 | type: "Power" 2899 | bottom: "conv5-7/expand" 2900 | top: "conv5-7/expand/shift" 2901 | power_param { 2902 | power: 1 2903 | scale: 1 2904 | shift: 3 2905 | } 2906 | } 2907 | layer { 2908 | name: "conv5-7/expand/shift-relu" 2909 | type: "ReLU6" 2910 | bottom: "conv5-7/expand/shift" 2911 | top: "conv5-7/expand/shift" 2912 | } 2913 | layer { 2914 | name: "conv5-7/expand/shift-div" 2915 | type: "Power" 2916 | bottom: "conv5-7/expand/shift" 2917 | top: "conv5-7/expand/shift-div" 2918 | power_param { 2919 | power: 1 2920 | scale: 0.1666666667 2921 | shift: 0 2922 | } 2923 | } 2924 | layer { 2925 | name: "conv5-7/expand/hswish" 2926 | type: "Eltwise" 2927 | bottom: "conv5-7/expand" 2928 | bottom: "conv5-7/expand/shift-div" 2929 | top: "conv5-7/expand/hswish" 2930 | eltwise_param { 2931 | operation: PROD 2932 | } 2933 | } 2934 | 2935 | layer { 2936 | name: "conv5-7/dwise" 2937 | #type: "Convolution" 2938 | type: "DepthwiseConvolution" 2939 | bottom: "conv5-7/expand/hswish" 2940 | top: "conv5-7/dwise" 2941 | param { 2942 | lr_mult: 1 2943 | decay_mult: 1 2944 | } 2945 | convolution_param { 2946 | num_output: 672 2947 | group: 672 2948 | pad: 2 2949 | bias_term: false 2950 | kernel_size: 5 2951 | stride: 2 2952 | weight_filler { 2953 | type: "msra" 2954 | } 2955 | engine: CAFFE 2956 | } 2957 | } 2958 | layer { 2959 | name: "conv5-7/dwise-bn" 2960 | type: "BatchNorm" 2961 | bottom: "conv5-7/dwise" 2962 | top: "conv5-7/dwise" 2963 | } 2964 | layer { 2965 | name: "conv5-7/dwise-bn-scale" 2966 | type: "Scale" 2967 | bottom: "conv5-7/dwise" 2968 | top: "conv5-7/dwise" 2969 | scale_param { 2970 | bias_term: true 2971 | } 2972 | } 2973 | 2974 | # se 2975 | layer { 2976 | name: "conv5-7/dwise-se-pool" 2977 | type: "Pooling" 2978 | bottom: "conv5-7/dwise" 2979 | top: "conv5-7/dwise-se-pool" 2980 | pooling_param { 2981 | pool: AVE 2982 | global_pooling: true 2983 | } 2984 | } 2985 | layer { 2986 | name: "conv5-7/dwise-se-fc1" 2987 | type: "InnerProduct" 2988 | bottom: "conv5-7/dwise-se-pool" 2989 | top:"conv5-7/dwise-se-fc1" 2990 | param { 2991 | lr_mult: 1 2992 | decay_mult: 1 2993 | } 2994 | param { 2995 | lr_mult: 2 2996 | decay_mult: 0 2997 | } 2998 | inner_product_param { 2999 | num_output: 168 3000 | weight_filler { 3001 | type: "msra" 3002 | } 3003 | bias_filler { 3004 | type: "constant" 3005 | value: 0 3006 | } 3007 | } 3008 | } 3009 | layer { 3010 | name: "conv5-7/dwise-se-fc1-relu" 3011 | type: "ReLU6" 3012 | bottom: "conv5-7/dwise-se-fc1" 3013 | top: "conv5-7/dwise-se-fc1" 3014 | } 3015 | layer { 3016 | name: "conv5-7/dwise-se-fc2" 3017 | type: "InnerProduct" 3018 | bottom: "conv5-7/dwise-se-fc1" 3019 | top:"conv5-7/dwise-se-fc2" 3020 | param { 3021 | lr_mult: 1 3022 | decay_mult: 1 3023 | } 3024 | param { 3025 | lr_mult: 2 3026 | decay_mult: 0 3027 | } 3028 | inner_product_param { 3029 | num_output: 672 3030 | weight_filler { 3031 | type: "msra" 3032 | } 3033 | bias_filler { 3034 | type: "constant" 3035 | value: 0 3036 | } 3037 | } 3038 | } 3039 | # H-sigmoid 3040 | layer { 3041 | name: "conv5-7/dwise-se-fc2/shift" 3042 | type: "Power" 3043 | bottom: "conv5-7/dwise-se-fc2" 3044 | top: "conv5-7/dwise-se-fc2/shift" 3045 | power_param { 3046 | power: 1 3047 | scale: 1 3048 | shift: 3 3049 | } 3050 | } 3051 | layer { 3052 | name: "conv5-7/dwise-se-fc2/shift-relu" 3053 | type: "ReLU6" 3054 | bottom: "conv5-7/dwise-se-fc2/shift" 3055 | top: "conv5-7/dwise-se-fc2/shift" 3056 | } 3057 | layer { 3058 | name: "conv5-7/dwise-se-fc2/shift-div" 3059 | type: "Power" 3060 | bottom: "conv5-7/dwise-se-fc2/shift" 3061 | top: "conv5-7/dwise-se-fc2/shift-div" 3062 | power_param { 3063 | power: 1 3064 | scale: 0.1666666667 3065 | shift: 0 3066 | } 3067 | } 3068 | layer { 3069 | name: "conv5-7/dwise/scale" 3070 | type: "Scale" 3071 | bottom: "conv5-7/dwise" 3072 | bottom: "conv5-7/dwise-se-fc2/shift-div" 3073 | top: "conv5-7/dwise/scale" 3074 | scale_param{ 3075 | axis: 0 3076 | } 3077 | } 3078 | # H-swish 3079 | layer { 3080 | name: "conv5-7/dwise/shift" 3081 | type: "Power" 3082 | bottom: "conv5-7/dwise/scale" 3083 | top: "conv5-7/dwise/shift" 3084 | power_param { 3085 | power: 1 3086 | scale: 1 3087 | shift: 3 3088 | } 3089 | } 3090 | layer { 3091 | name: "conv5-7/dwise/shift-relu" 3092 | type: "ReLU6" 3093 | bottom: "conv5-7/dwise/shift" 3094 | top: "conv5-7/dwise/shift" 3095 | } 3096 | layer { 3097 | name: "conv5-7/dwise/shift-div" 3098 | type: "Power" 3099 | bottom: "conv5-7/dwise/shift" 3100 | top: "conv5-7/dwise/shift-div" 3101 | power_param { 3102 | power: 1 3103 | scale: 0.1666666667 3104 | shift: 0 3105 | } 3106 | } 3107 | layer { 3108 | name: "conv5-7/dwise/hswish" 3109 | type: "Eltwise" 3110 | bottom: "conv5-7/dwise/scale" 3111 | bottom: "conv5-7/dwise/shift-div" 3112 | top: "conv5-7/dwise/hswish" 3113 | eltwise_param { 3114 | operation: PROD 3115 | } 3116 | } 3117 | 3118 | layer { 3119 | name: "conv5-7/linear" 3120 | type: "Convolution" 3121 | bottom: "conv5-7/dwise/hswish" 3122 | top: "conv5-7/linear" 3123 | param { 3124 | lr_mult: 1 3125 | decay_mult: 1 3126 | } 3127 | convolution_param { 3128 | num_output: 160 3129 | pad: 0 3130 | bias_term: false 3131 | kernel_size: 1 3132 | stride: 1 3133 | weight_filler { 3134 | type: "msra" 3135 | } 3136 | } 3137 | } 3138 | layer { 3139 | name: "conv5-7/linear-bn" 3140 | type: "BatchNorm" 3141 | bottom: "conv5-7/linear" 3142 | top: "conv5-7/linear" 3143 | } 3144 | layer { 3145 | name: "conv5-7/linear-bn-scale" 3146 | type: "Scale" 3147 | bottom: "conv5-7/linear" 3148 | top: "conv5-7/linear" 3149 | scale_param { 3150 | bias_term: true 3151 | } 3152 | } 3153 | 3154 | #################### stage 6-1 #################### 3155 | layer { 3156 | name: "conv6-1/expand" 3157 | type: "Convolution" 3158 | bottom: "conv5-7/linear" 3159 | top: "conv6-1/expand" 3160 | param { 3161 | lr_mult: 1 3162 | decay_mult: 1 3163 | } 3164 | convolution_param { 3165 | num_output: 960 3166 | pad: 0 3167 | bias_term: false 3168 | kernel_size: 1 3169 | stride: 1 3170 | weight_filler { 3171 | type: "msra" 3172 | } 3173 | } 3174 | } 3175 | layer { 3176 | name: "conv6-1/expand-bn" 3177 | type: "BatchNorm" 3178 | bottom: "conv6-1/expand" 3179 | top: "conv6-1/expand" 3180 | } 3181 | layer { 3182 | name: "conv6-1/expand-bn-scale" 3183 | type: "Scale" 3184 | bottom: "conv6-1/expand" 3185 | top: "conv6-1/expand" 3186 | scale_param { 3187 | bias_term: true 3188 | } 3189 | } 3190 | # H-swish 3191 | layer { 3192 | name: "conv6-1/expand/shift" 3193 | type: "Power" 3194 | bottom: "conv6-1/expand" 3195 | top: "conv6-1/expand/shift" 3196 | power_param { 3197 | power: 1 3198 | scale: 1 3199 | shift: 3 3200 | } 3201 | } 3202 | layer { 3203 | name: "conv6-1/expand/shift-relu" 3204 | type: "ReLU6" 3205 | bottom: "conv6-1/expand/shift" 3206 | top: "conv6-1/expand/shift" 3207 | } 3208 | layer { 3209 | name: "conv6-1/expand/shift-div" 3210 | type: "Power" 3211 | bottom: "conv6-1/expand/shift" 3212 | top: "conv6-1/expand/shift-div" 3213 | power_param { 3214 | power: 1 3215 | scale: 0.1666666667 3216 | shift: 0 3217 | } 3218 | } 3219 | layer { 3220 | name: "conv6-1/expand/hswish" 3221 | type: "Eltwise" 3222 | bottom: "conv6-1/expand" 3223 | bottom: "conv6-1/expand/shift-div" 3224 | top: "conv6-1/expand/hswish" 3225 | eltwise_param { 3226 | operation: PROD 3227 | } 3228 | } 3229 | 3230 | layer { 3231 | name: "conv6-1/dwise" 3232 | #type: "Convolution" 3233 | type: "DepthwiseConvolution" 3234 | bottom: "conv6-1/expand/hswish" 3235 | top: "conv6-1/dwise" 3236 | param { 3237 | lr_mult: 1 3238 | decay_mult: 1 3239 | } 3240 | convolution_param { 3241 | num_output: 960 3242 | group: 960 3243 | pad: 2 3244 | bias_term: false 3245 | kernel_size: 5 3246 | stride: 1 3247 | weight_filler { 3248 | type: "msra" 3249 | } 3250 | engine: CAFFE 3251 | } 3252 | } 3253 | layer { 3254 | name: "conv6-1/dwise-bn" 3255 | type: "BatchNorm" 3256 | bottom: "conv6-1/dwise" 3257 | top: "conv6-1/dwise" 3258 | } 3259 | layer { 3260 | name: "conv6-1/dwise-bn-scale" 3261 | type: "Scale" 3262 | bottom: "conv6-1/dwise" 3263 | top: "conv6-1/dwise" 3264 | scale_param { 3265 | bias_term: true 3266 | } 3267 | } 3268 | 3269 | # se 3270 | layer { 3271 | name: "conv6-1/dwise-se-pool" 3272 | type: "Pooling" 3273 | bottom: "conv6-1/dwise" 3274 | top: "conv6-1/dwise-se-pool" 3275 | pooling_param { 3276 | pool: AVE 3277 | global_pooling: true 3278 | } 3279 | } 3280 | layer { 3281 | name: "conv6-1/dwise-se-fc1" 3282 | type: "InnerProduct" 3283 | bottom: "conv6-1/dwise-se-pool" 3284 | top:"conv6-1/dwise-se-fc1" 3285 | param { 3286 | lr_mult: 1 3287 | decay_mult: 1 3288 | } 3289 | param { 3290 | lr_mult: 2 3291 | decay_mult: 0 3292 | } 3293 | inner_product_param { 3294 | num_output: 240 3295 | weight_filler { 3296 | type: "msra" 3297 | } 3298 | bias_filler { 3299 | type: "constant" 3300 | value: 0 3301 | } 3302 | } 3303 | } 3304 | layer { 3305 | name: "conv6-1/dwise-se-fc1-relu" 3306 | type: "ReLU6" 3307 | bottom: "conv6-1/dwise-se-fc1" 3308 | top: "conv6-1/dwise-se-fc1" 3309 | } 3310 | layer { 3311 | name: "conv6-1/dwise-se-fc2" 3312 | type: "InnerProduct" 3313 | bottom: "conv6-1/dwise-se-fc1" 3314 | top:"conv6-1/dwise-se-fc2" 3315 | param { 3316 | lr_mult: 1 3317 | decay_mult: 1 3318 | } 3319 | param { 3320 | lr_mult: 2 3321 | decay_mult: 0 3322 | } 3323 | inner_product_param { 3324 | num_output: 960 3325 | weight_filler { 3326 | type: "msra" 3327 | } 3328 | bias_filler { 3329 | type: "constant" 3330 | value: 0 3331 | } 3332 | } 3333 | } 3334 | # H-sigmoid 3335 | layer { 3336 | name: "conv6-1/dwise-se-fc2/shift" 3337 | type: "Power" 3338 | bottom: "conv6-1/dwise-se-fc2" 3339 | top: "conv6-1/dwise-se-fc2/shift" 3340 | power_param { 3341 | power: 1 3342 | scale: 1 3343 | shift: 3 3344 | } 3345 | } 3346 | layer { 3347 | name: "conv6-1/dwise-se-fc2/shift-relu" 3348 | type: "ReLU6" 3349 | bottom: "conv6-1/dwise-se-fc2/shift" 3350 | top: "conv6-1/dwise-se-fc2/shift" 3351 | } 3352 | layer { 3353 | name: "conv6-1/dwise-se-fc2/shift-div" 3354 | type: "Power" 3355 | bottom: "conv6-1/dwise-se-fc2/shift" 3356 | top: "conv6-1/dwise-se-fc2/shift-div" 3357 | power_param { 3358 | power: 1 3359 | scale: 0.1666666667 3360 | shift: 0 3361 | } 3362 | } 3363 | layer { 3364 | name: "conv6-1/dwise/scale" 3365 | type: "Scale" 3366 | bottom: "conv6-1/dwise" 3367 | bottom: "conv6-1/dwise-se-fc2/shift-div" 3368 | top: "conv6-1/dwise/scale" 3369 | scale_param{ 3370 | axis: 0 3371 | } 3372 | } 3373 | # H-swish 3374 | layer { 3375 | name: "conv6-1/dwise/shift" 3376 | type: "Power" 3377 | bottom: "conv6-1/dwise/scale" 3378 | top: "conv6-1/dwise/shift" 3379 | power_param { 3380 | power: 1 3381 | scale: 1 3382 | shift: 3 3383 | } 3384 | } 3385 | layer { 3386 | name: "conv6-1/dwise/shift-relu" 3387 | type: "ReLU6" 3388 | bottom: "conv6-1/dwise/shift" 3389 | top: "conv6-1/dwise/shift" 3390 | } 3391 | layer { 3392 | name: "conv6-1/dwise/shift-div" 3393 | type: "Power" 3394 | bottom: "conv6-1/dwise/shift" 3395 | top: "conv6-1/dwise/shift-div" 3396 | power_param { 3397 | power: 1 3398 | scale: 0.1666666667 3399 | shift: 0 3400 | } 3401 | } 3402 | layer { 3403 | name: "conv6-1/dwise/hswish" 3404 | type: "Eltwise" 3405 | bottom: "conv6-1/dwise/scale" 3406 | bottom: "conv6-1/dwise/shift-div" 3407 | top: "conv6-1/dwise/hswish" 3408 | eltwise_param { 3409 | operation: PROD 3410 | } 3411 | } 3412 | 3413 | layer { 3414 | name: "conv6-1/linear" 3415 | type: "Convolution" 3416 | bottom: "conv6-1/dwise/hswish" 3417 | top: "conv6-1/linear" 3418 | param { 3419 | lr_mult: 1 3420 | decay_mult: 1 3421 | } 3422 | convolution_param { 3423 | num_output: 160 3424 | pad: 0 3425 | bias_term: false 3426 | kernel_size: 1 3427 | stride: 1 3428 | weight_filler { 3429 | type: "msra" 3430 | } 3431 | } 3432 | } 3433 | layer { 3434 | name: "conv6-1/linear-bn" 3435 | type: "BatchNorm" 3436 | bottom: "conv6-1/linear" 3437 | top: "conv6-1/linear" 3438 | } 3439 | layer { 3440 | name: "conv6-1/linear-bn-scale" 3441 | type: "Scale" 3442 | bottom: "conv6-1/linear" 3443 | top: "conv6-1/linear" 3444 | scale_param { 3445 | bias_term: true 3446 | } 3447 | } 3448 | 3449 | layer { 3450 | name: "block6-1" 3451 | type: "Eltwise" 3452 | bottom: "conv5-7/linear" 3453 | bottom: "conv6-1/linear" 3454 | top: "block6-1" 3455 | } 3456 | 3457 | #################### stage 6-2 #################### 3458 | layer { 3459 | name: "conv6-2" 3460 | type: "Convolution" 3461 | bottom: "block6-1" 3462 | top: "conv6-2" 3463 | param { 3464 | lr_mult: 1 3465 | decay_mult: 1 3466 | } 3467 | convolution_param { 3468 | num_output: 960 3469 | pad: 0 3470 | bias_term: false 3471 | kernel_size: 1 3472 | stride: 1 3473 | weight_filler { 3474 | type: "msra" 3475 | } 3476 | } 3477 | } 3478 | layer { 3479 | name: "conv6-2-bn" 3480 | type: "BatchNorm" 3481 | bottom: "conv6-2" 3482 | top: "conv6-2" 3483 | } 3484 | layer { 3485 | name: "conv6-2-bn-scale" 3486 | type: "Scale" 3487 | bottom: "conv6-2" 3488 | top: "conv6-2" 3489 | scale_param { 3490 | bias_term: true 3491 | } 3492 | } 3493 | # H-swish 3494 | layer { 3495 | name: "conv6-2/shift" 3496 | type: "Power" 3497 | bottom: "conv6-2" 3498 | top: "conv6-2/shift" 3499 | power_param { 3500 | power: 1 3501 | scale: 1 3502 | shift: 3 3503 | } 3504 | } 3505 | layer { 3506 | name: "conv6-2/shift-relu" 3507 | type: "ReLU6" 3508 | bottom: "conv6-2/shift" 3509 | top: "conv6-2/shift" 3510 | } 3511 | layer { 3512 | name: "conv6-2/shift-div" 3513 | type: "Power" 3514 | bottom: "conv6-2/shift" 3515 | top: "conv6-2/shift-div" 3516 | power_param { 3517 | power: 1 3518 | scale: 0.1666666667 3519 | shift: 0 3520 | } 3521 | } 3522 | layer { 3523 | name: "conv6-2/hswish" 3524 | type: "Eltwise" 3525 | bottom: "conv6-2" 3526 | bottom: "conv6-2/shift-div" 3527 | top: "conv6-2/hswish" 3528 | eltwise_param { 3529 | operation: PROD 3530 | } 3531 | } 3532 | 3533 | #################### stage 7-1 #################### 3534 | layer { 3535 | name: "pool7-1" 3536 | type: "Pooling" 3537 | bottom: "conv6-2/hswish" 3538 | top: "pool7-1" 3539 | pooling_param { 3540 | pool: AVE 3541 | global_pooling: true 3542 | } 3543 | } 3544 | # H-swish 3545 | layer { 3546 | name: "pool7-1/shift" 3547 | type: "Power" 3548 | bottom: "pool7-1" 3549 | top: "pool7-1/shift" 3550 | power_param { 3551 | power: 1 3552 | scale: 1 3553 | shift: 3 3554 | } 3555 | } 3556 | layer { 3557 | name: "pool7-1/shift-relu" 3558 | type: "ReLU6" 3559 | bottom: "pool7-1/shift" 3560 | top: "pool7-1/shift" 3561 | } 3562 | layer { 3563 | name: "pool7-1/shift-div" 3564 | type: "Power" 3565 | bottom: "pool7-1/shift" 3566 | top: "pool7-1/shift-div" 3567 | power_param { 3568 | power: 1 3569 | scale: 0.1666666667 3570 | shift: 0 3571 | } 3572 | } 3573 | layer { 3574 | name: "pool7-1/hswish" 3575 | type: "Eltwise" 3576 | bottom: "pool7-1" 3577 | bottom: "pool7-1/shift-div" 3578 | top: "pool7-1/hswish" 3579 | eltwise_param { 3580 | operation: PROD 3581 | } 3582 | } 3583 | 3584 | #################### stage 7-2 #################### 3585 | layer { 3586 | name: "conv7-2" 3587 | type: "Convolution" 3588 | bottom: "pool7-1/hswish" 3589 | top: "conv7-2" 3590 | param { 3591 | lr_mult: 1 3592 | decay_mult: 1 3593 | } 3594 | param { 3595 | lr_mult: 2 3596 | decay_mult: 0 3597 | } 3598 | convolution_param { 3599 | num_output: 1280 3600 | pad: 0 3601 | kernel_size: 1 3602 | stride: 1 3603 | weight_filler { 3604 | type: "msra" 3605 | } 3606 | bias_filler { 3607 | type: "constant" 3608 | value: 0 3609 | } 3610 | } 3611 | } 3612 | # H-swish 3613 | layer { 3614 | name: "conv7-2/shift" 3615 | type: "Power" 3616 | bottom: "conv7-2" 3617 | top: "conv7-2/shift" 3618 | power_param { 3619 | power: 1 3620 | scale: 1 3621 | shift: 3 3622 | } 3623 | } 3624 | layer { 3625 | name: "conv7-2/shift-relu" 3626 | type: "ReLU6" 3627 | bottom: "conv7-2/shift" 3628 | top: "conv7-2/shift" 3629 | } 3630 | layer { 3631 | name: "conv7-2/shift-div" 3632 | type: "Power" 3633 | bottom: "conv7-2/shift" 3634 | top: "conv7-2/shift-div" 3635 | power_param { 3636 | power: 1 3637 | scale: 0.1666666667 3638 | shift: 0 3639 | } 3640 | } 3641 | layer { 3642 | name: "conv7-2/hswish" 3643 | type: "Eltwise" 3644 | bottom: "conv7-2" 3645 | bottom: "conv7-2/shift-div" 3646 | top: "conv7-2/hswish" 3647 | eltwise_param { 3648 | operation: PROD 3649 | } 3650 | } 3651 | 3652 | #################### output #################### 3653 | layer { 3654 | name: "conv7-3" 3655 | type: "Convolution" 3656 | bottom: "conv7-2/hswish" 3657 | top: "conv7-3" 3658 | param { 3659 | lr_mult: 1 3660 | decay_mult: 1 3661 | } 3662 | param { 3663 | lr_mult: 2 3664 | decay_mult: 0 3665 | } 3666 | convolution_param { 3667 | num_output: 1000 3668 | pad: 0 3669 | kernel_size: 1 3670 | stride: 1 3671 | weight_filler { 3672 | type: "msra" 3673 | } 3674 | bias_filler { 3675 | type: "constant" 3676 | value: 0 3677 | } 3678 | } 3679 | } 3680 | 3681 | layer { 3682 | name: "prob" 3683 | type: "Softmax" 3684 | bottom: "conv7-3" 3685 | top: "prob" 3686 | } 3687 | -------------------------------------------------------------------------------- /mobilenet_v3_small_1.0.prototxt: -------------------------------------------------------------------------------- 1 | name: "mobilenet v3" 2 | input: "data" 3 | input_dim: 1 4 | input_dim: 3 5 | input_dim: 224 6 | input_dim: 224 7 | #################### stage 1 #################### 8 | layer { 9 | name: "conv1" 10 | type: "Convolution" 11 | bottom: "data" 12 | top: "conv1" 13 | param { 14 | lr_mult: 1 15 | decay_mult: 1 16 | } 17 | convolution_param { 18 | num_output: 16 19 | pad: 1 20 | bias_term: false 21 | kernel_size: 3 22 | stride: 2 23 | weight_filler { 24 | type: "msra" 25 | } 26 | } 27 | } 28 | layer { 29 | name: "conv1-bn" 30 | type: "BatchNorm" 31 | bottom: "conv1" 32 | top: "conv1" 33 | } 34 | layer { 35 | name: "conv1-bn-scale" 36 | type: "Scale" 37 | bottom: "conv1" 38 | top: "conv1" 39 | scale_param { 40 | bias_term: true 41 | } 42 | } 43 | # H-swish 44 | layer { 45 | name: "conv1/shift" 46 | type: "Power" 47 | bottom: "conv1" 48 | top: "conv1/shift" 49 | power_param { 50 | power: 1 51 | scale: 1 52 | shift: 3 53 | } 54 | } 55 | layer { 56 | name: "conv1/shift-relu" 57 | type: "ReLU6" 58 | bottom: "conv1/shift" 59 | top: "conv1/shift" 60 | } 61 | layer { 62 | name: "conv1/shift-div" 63 | type: "Power" 64 | bottom: "conv1/shift" 65 | top: "conv1/shift-div" 66 | power_param { 67 | power: 1 68 | scale: 0.1666666667 69 | shift: 0 70 | } 71 | } 72 | layer { 73 | name: "conv1/hswish" 74 | type: "Eltwise" 75 | bottom: "conv1" 76 | bottom: "conv1/shift-div" 77 | top: "conv1/hswish" 78 | eltwise_param { 79 | operation: PROD 80 | } 81 | } 82 | 83 | #################### stage 2-1 #################### 84 | layer { 85 | name: "conv2-1/expand" 86 | type: "Convolution" 87 | bottom: "conv1/hswish" 88 | top: "conv2-1/expand" 89 | param { 90 | lr_mult: 1 91 | decay_mult: 1 92 | } 93 | convolution_param { 94 | num_output: 16 95 | pad: 0 96 | bias_term: false 97 | kernel_size: 1 98 | stride: 1 99 | weight_filler { 100 | type: "msra" 101 | } 102 | } 103 | } 104 | layer { 105 | name: "conv2-1/expand-bn" 106 | type: "BatchNorm" 107 | bottom: "conv2-1/expand" 108 | top: "conv2-1/expand" 109 | } 110 | layer { 111 | name: "conv2-1/expand-bn-scale" 112 | type: "Scale" 113 | bottom: "conv2-1/expand" 114 | top: "conv2-1/expand" 115 | scale_param { 116 | bias_term: true 117 | } 118 | } 119 | layer { 120 | name: "conv2-1/expand-relu" 121 | type: "ReLU6" 122 | bottom: "conv2-1/expand" 123 | top: "conv2-1/expand" 124 | } 125 | 126 | layer { 127 | name: "conv2-1/dwise" 128 | #type: "Convolution" 129 | type: "DepthwiseConvolution" 130 | bottom: "conv2-1/expand" 131 | top: "conv2-1/dwise" 132 | param { 133 | lr_mult: 1 134 | decay_mult: 1 135 | } 136 | convolution_param { 137 | num_output: 16 138 | group: 16 139 | pad: 1 140 | bias_term: false 141 | kernel_size: 3 142 | stride: 2 143 | weight_filler { 144 | type: "msra" 145 | } 146 | engine: CAFFE 147 | } 148 | } 149 | layer { 150 | name: "conv2-1/dwise-bn" 151 | type: "BatchNorm" 152 | bottom: "conv2-1/dwise" 153 | top: "conv2-1/dwise" 154 | } 155 | layer { 156 | name: "conv2-1/dwise-bn-scale" 157 | type: "Scale" 158 | bottom: "conv2-1/dwise" 159 | top: "conv2-1/dwise" 160 | scale_param { 161 | bias_term: true 162 | } 163 | } 164 | 165 | # se 166 | layer { 167 | name: "conv2-1/dwise-se-pool" 168 | type: "Pooling" 169 | bottom: "conv2-1/dwise" 170 | top: "conv2-1/dwise-se-pool" 171 | pooling_param { 172 | pool: AVE 173 | global_pooling: true 174 | } 175 | } 176 | layer { 177 | name: "conv2-1/dwise-se-fc1" 178 | type: "InnerProduct" 179 | bottom: "conv2-1/dwise-se-pool" 180 | top:"conv2-1/dwise-se-fc1" 181 | param { 182 | lr_mult: 1 183 | decay_mult: 1 184 | } 185 | param { 186 | lr_mult: 2 187 | decay_mult: 0 188 | } 189 | inner_product_param { 190 | num_output: 4 191 | weight_filler { 192 | type: "msra" 193 | } 194 | bias_filler { 195 | type: "constant" 196 | value: 0 197 | } 198 | } 199 | } 200 | layer { 201 | name: "conv2-1/dwise-se-fc1-relu" 202 | type: "ReLU6" 203 | bottom: "conv2-1/dwise-se-fc1" 204 | top: "conv2-1/dwise-se-fc1" 205 | } 206 | layer { 207 | name: "conv2-1/dwise-se-fc2" 208 | type: "InnerProduct" 209 | bottom: "conv2-1/dwise-se-fc1" 210 | top:"conv2-1/dwise-se-fc2" 211 | param { 212 | lr_mult: 1 213 | decay_mult: 1 214 | } 215 | param { 216 | lr_mult: 2 217 | decay_mult: 0 218 | } 219 | inner_product_param { 220 | num_output: 16 221 | weight_filler { 222 | type: "msra" 223 | } 224 | bias_filler { 225 | type: "constant" 226 | value: 0 227 | } 228 | } 229 | } 230 | # H-sigmoid 231 | layer { 232 | name: "conv2-1/dwise-se-fc2/shift" 233 | type: "Power" 234 | bottom: "conv2-1/dwise-se-fc2" 235 | top: "conv2-1/dwise-se-fc2/shift" 236 | power_param { 237 | power: 1 238 | scale: 1 239 | shift: 3 240 | } 241 | } 242 | layer { 243 | name: "conv2-1/dwise-se-fc2/shift-relu" 244 | type: "ReLU6" 245 | bottom: "conv2-1/dwise-se-fc2/shift" 246 | top: "conv2-1/dwise-se-fc2/shift" 247 | } 248 | layer { 249 | name: "conv2-1/dwise-se-fc2/shift-div" 250 | type: "Power" 251 | bottom: "conv2-1/dwise-se-fc2/shift" 252 | top: "conv2-1/dwise-se-fc2/shift-div" 253 | power_param { 254 | power: 1 255 | scale: 0.1666666667 256 | shift: 0 257 | } 258 | } 259 | layer { 260 | name: "conv2-1/dwise/scale" 261 | type: "Scale" 262 | bottom: "conv2-1/dwise" 263 | bottom: "conv2-1/dwise-se-fc2/shift-div" 264 | top: "conv2-1/dwise/scale" 265 | scale_param{ 266 | axis: 0 267 | } 268 | } 269 | layer { 270 | name: "conv2-1/dwise/scale-relu" 271 | type: "ReLU6" 272 | bottom: "conv2-1/dwise/scale" 273 | top: "conv2-1/dwise/scale" 274 | } 275 | 276 | layer { 277 | name: "conv2-1/linear" 278 | type: "Convolution" 279 | bottom: "conv2-1/dwise/scale" 280 | top: "conv2-1/linear" 281 | param { 282 | lr_mult: 1 283 | decay_mult: 1 284 | } 285 | convolution_param { 286 | num_output: 16 287 | pad: 0 288 | bias_term: false 289 | kernel_size: 1 290 | stride: 1 291 | weight_filler { 292 | type: "msra" 293 | } 294 | } 295 | } 296 | layer { 297 | name: "conv2-1/linear-bn" 298 | type: "BatchNorm" 299 | bottom: "conv2-1/linear" 300 | top: "conv2-1/linear" 301 | } 302 | layer { 303 | name: "conv2-1/linear-bn-scale" 304 | type: "Scale" 305 | bottom: "conv2-1/linear" 306 | top: "conv2-1/linear" 307 | scale_param { 308 | bias_term: true 309 | } 310 | } 311 | 312 | #################### stage 3-1 #################### 313 | layer { 314 | name: "conv3-1/expand" 315 | type: "Convolution" 316 | bottom: "conv2-1/linear" 317 | top: "conv3-1/expand" 318 | param { 319 | lr_mult: 1 320 | decay_mult: 1 321 | } 322 | convolution_param { 323 | num_output: 72 324 | pad: 0 325 | bias_term: false 326 | kernel_size: 1 327 | stride: 1 328 | weight_filler { 329 | type: "msra" 330 | } 331 | } 332 | } 333 | layer { 334 | name: "conv3-1/expand-bn" 335 | type: "BatchNorm" 336 | bottom: "conv3-1/expand" 337 | top: "conv3-1/expand" 338 | } 339 | layer { 340 | name: "conv3-1/expand-bn-scale" 341 | type: "Scale" 342 | bottom: "conv3-1/expand" 343 | top: "conv3-1/expand" 344 | scale_param { 345 | bias_term: true 346 | } 347 | } 348 | layer { 349 | name: "conv3-1/expand-relu" 350 | type: "ReLU6" 351 | bottom: "conv3-1/expand" 352 | top: "conv3-1/expand" 353 | } 354 | 355 | layer { 356 | name: "conv3-1/dwise" 357 | #type: "Convolution" 358 | type: "DepthwiseConvolution" 359 | bottom: "conv3-1/expand" 360 | top: "conv3-1/dwise" 361 | param { 362 | lr_mult: 1 363 | decay_mult: 1 364 | } 365 | convolution_param { 366 | num_output: 72 367 | group: 72 368 | pad: 1 369 | bias_term: false 370 | kernel_size: 3 371 | stride: 2 372 | weight_filler { 373 | type: "msra" 374 | } 375 | engine: CAFFE 376 | } 377 | } 378 | layer { 379 | name: "conv3-1/dwise-bn" 380 | type: "BatchNorm" 381 | bottom: "conv3-1/dwise" 382 | top: "conv3-1/dwise" 383 | } 384 | layer { 385 | name: "conv3-1/dwise-bn-scale" 386 | type: "Scale" 387 | bottom: "conv3-1/dwise" 388 | top: "conv3-1/dwise" 389 | scale_param { 390 | bias_term: true 391 | } 392 | } 393 | layer { 394 | name: "conv3-1/dwise-relu" 395 | type: "ReLU6" 396 | bottom: "conv3-1/dwise" 397 | top: "conv3-1/dwise" 398 | } 399 | 400 | layer { 401 | name: "conv3-1/linear" 402 | type: "Convolution" 403 | bottom: "conv3-1/dwise" 404 | top: "conv3-1/linear" 405 | param { 406 | lr_mult: 1 407 | decay_mult: 1 408 | } 409 | convolution_param { 410 | num_output: 24 411 | pad: 0 412 | bias_term: false 413 | kernel_size: 1 414 | stride: 1 415 | weight_filler { 416 | type: "msra" 417 | } 418 | } 419 | } 420 | layer { 421 | name: "conv3-1/linear-bn" 422 | type: "BatchNorm" 423 | bottom: "conv3-1/linear" 424 | top: "conv3-1/linear" 425 | } 426 | layer { 427 | name: "conv3-1/linear-bn-scale" 428 | type: "Scale" 429 | bottom: "conv3-1/linear" 430 | top: "conv3-1/linear" 431 | scale_param { 432 | bias_term: true 433 | } 434 | } 435 | 436 | #################### stage 4-1 #################### 437 | layer { 438 | name: "conv4-1/expand" 439 | type: "Convolution" 440 | bottom: "conv3-1/linear" 441 | top: "conv4-1/expand" 442 | param { 443 | lr_mult: 1 444 | decay_mult: 1 445 | } 446 | convolution_param { 447 | num_output: 88 448 | pad: 0 449 | bias_term: false 450 | kernel_size: 1 451 | stride: 1 452 | weight_filler { 453 | type: "msra" 454 | } 455 | } 456 | } 457 | layer { 458 | name: "conv4-1/expand-bn" 459 | type: "BatchNorm" 460 | bottom: "conv4-1/expand" 461 | top: "conv4-1/expand" 462 | } 463 | layer { 464 | name: "conv4-1/expand-bn-scale" 465 | type: "Scale" 466 | bottom: "conv4-1/expand" 467 | top: "conv4-1/expand" 468 | scale_param { 469 | bias_term: true 470 | } 471 | } 472 | layer { 473 | name: "conv4-1/expand-relu" 474 | type: "ReLU6" 475 | bottom: "conv4-1/expand" 476 | top: "conv4-1/expand" 477 | } 478 | 479 | layer { 480 | name: "conv4-1/dwise" 481 | #type: "Convolution" 482 | type: "DepthwiseConvolution" 483 | bottom: "conv4-1/expand" 484 | top: "conv4-1/dwise" 485 | param { 486 | lr_mult: 1 487 | decay_mult: 1 488 | } 489 | convolution_param { 490 | num_output: 88 491 | group: 88 492 | pad: 1 493 | bias_term: false 494 | kernel_size: 3 495 | stride: 1 496 | weight_filler { 497 | type: "msra" 498 | } 499 | engine: CAFFE 500 | } 501 | } 502 | layer { 503 | name: "conv4-1/dwise-bn" 504 | type: "BatchNorm" 505 | bottom: "conv4-1/dwise" 506 | top: "conv4-1/dwise" 507 | } 508 | layer { 509 | name: "conv4-1/dwise-bn-scale" 510 | type: "Scale" 511 | bottom: "conv4-1/dwise" 512 | top: "conv4-1/dwise" 513 | scale_param { 514 | bias_term: true 515 | } 516 | } 517 | layer { 518 | name: "conv4-1/dwise-relu" 519 | type: "ReLU6" 520 | bottom: "conv4-1/dwise" 521 | top: "conv4-1/dwise" 522 | } 523 | 524 | layer { 525 | name: "conv4-1/linear" 526 | type: "Convolution" 527 | bottom: "conv4-1/dwise" 528 | top: "conv4-1/linear" 529 | param { 530 | lr_mult: 1 531 | decay_mult: 1 532 | } 533 | convolution_param { 534 | num_output: 24 535 | pad: 0 536 | bias_term: false 537 | kernel_size: 1 538 | stride: 1 539 | weight_filler { 540 | type: "msra" 541 | } 542 | } 543 | } 544 | layer { 545 | name: "conv4-1/linear-bn" 546 | type: "BatchNorm" 547 | bottom: "conv4-1/linear" 548 | top: "conv4-1/linear" 549 | } 550 | layer { 551 | name: "conv4-1/linear-bn-scale" 552 | type: "Scale" 553 | bottom: "conv4-1/linear" 554 | top: "conv4-1/linear" 555 | scale_param { 556 | bias_term: true 557 | } 558 | } 559 | 560 | layer { 561 | name: "block4-1" 562 | type: "Eltwise" 563 | bottom: "conv3-1/linear" 564 | bottom: "conv4-1/linear" 565 | top: "block4-1" 566 | } 567 | 568 | #################### stage 4-2 #################### 569 | layer { 570 | name: "conv4-2/expand" 571 | type: "Convolution" 572 | bottom: "block4-1" 573 | top: "conv4-2/expand" 574 | param { 575 | lr_mult: 1 576 | decay_mult: 1 577 | } 578 | convolution_param { 579 | num_output: 96 580 | pad: 0 581 | bias_term: false 582 | kernel_size: 1 583 | stride: 1 584 | weight_filler { 585 | type: "msra" 586 | } 587 | } 588 | } 589 | layer { 590 | name: "conv4-2/expand-bn" 591 | type: "BatchNorm" 592 | bottom: "conv4-2/expand" 593 | top: "conv4-2/expand" 594 | } 595 | layer { 596 | name: "conv4-2/expand-bn-scale" 597 | type: "Scale" 598 | bottom: "conv4-2/expand" 599 | top: "conv4-2/expand" 600 | scale_param { 601 | bias_term: true 602 | } 603 | } 604 | # H-swish 605 | layer { 606 | name: "conv4-2/expand/shift" 607 | type: "Power" 608 | bottom: "conv4-2/expand" 609 | top: "conv4-2/expand/shift" 610 | power_param { 611 | power: 1 612 | scale: 1 613 | shift: 3 614 | } 615 | } 616 | layer { 617 | name: "conv4-2/expand/shift-relu" 618 | type: "ReLU6" 619 | bottom: "conv4-2/expand/shift" 620 | top: "conv4-2/expand/shift" 621 | } 622 | layer { 623 | name: "conv4-2/expand/shift-div" 624 | type: "Power" 625 | bottom: "conv4-2/expand/shift" 626 | top: "conv4-2/expand/shift-div" 627 | power_param { 628 | power: 1 629 | scale: 0.1666666667 630 | shift: 0 631 | } 632 | } 633 | layer { 634 | name: "conv4-2/expand/hswish" 635 | type: "Eltwise" 636 | bottom: "conv4-2/expand" 637 | bottom: "conv4-2/expand/shift-div" 638 | top: "conv4-2/expand/hswish" 639 | eltwise_param { 640 | operation: PROD 641 | } 642 | } 643 | 644 | layer { 645 | name: "conv4-2/dwise" 646 | #type: "Convolution" 647 | type: "DepthwiseConvolution" 648 | bottom: "conv4-2/expand/hswish" 649 | top: "conv4-2/dwise" 650 | param { 651 | lr_mult: 1 652 | decay_mult: 1 653 | } 654 | convolution_param { 655 | num_output: 96 656 | group: 96 657 | pad: 2 658 | bias_term: false 659 | kernel_size: 5 660 | stride: 2 661 | weight_filler { 662 | type: "msra" 663 | } 664 | engine: CAFFE 665 | } 666 | } 667 | layer { 668 | name: "conv4-2/dwise-bn" 669 | type: "BatchNorm" 670 | bottom: "conv4-2/dwise" 671 | top: "conv4-2/dwise" 672 | } 673 | layer { 674 | name: "conv4-2/dwise-bn-scale" 675 | type: "Scale" 676 | bottom: "conv4-2/dwise" 677 | top: "conv4-2/dwise" 678 | scale_param { 679 | bias_term: true 680 | } 681 | } 682 | 683 | # se 684 | layer { 685 | name: "conv4-2/dwise-se-pool" 686 | type: "Pooling" 687 | bottom: "conv4-2/dwise" 688 | top: "conv4-2/dwise-se-pool" 689 | pooling_param { 690 | pool: AVE 691 | global_pooling: true 692 | } 693 | } 694 | layer { 695 | name: "conv4-2/dwise-se-fc1" 696 | type: "InnerProduct" 697 | bottom: "conv4-2/dwise-se-pool" 698 | top:"conv4-2/dwise-se-fc1" 699 | param { 700 | lr_mult: 1 701 | decay_mult: 1 702 | } 703 | param { 704 | lr_mult: 2 705 | decay_mult: 0 706 | } 707 | inner_product_param { 708 | num_output: 24 709 | weight_filler { 710 | type: "msra" 711 | } 712 | bias_filler { 713 | type: "constant" 714 | value: 0 715 | } 716 | } 717 | } 718 | layer { 719 | name: "conv4-2/dwise-se-fc1-relu" 720 | type: "ReLU6" 721 | bottom: "conv4-2/dwise-se-fc1" 722 | top: "conv4-2/dwise-se-fc1" 723 | } 724 | layer { 725 | name: "conv4-2/dwise-se-fc2" 726 | type: "InnerProduct" 727 | bottom: "conv4-2/dwise-se-fc1" 728 | top:"conv4-2/dwise-se-fc2" 729 | param { 730 | lr_mult: 1 731 | decay_mult: 1 732 | } 733 | param { 734 | lr_mult: 2 735 | decay_mult: 0 736 | } 737 | inner_product_param { 738 | num_output: 96 739 | weight_filler { 740 | type: "msra" 741 | } 742 | bias_filler { 743 | type: "constant" 744 | value: 0 745 | } 746 | } 747 | } 748 | # H-sigmoid 749 | layer { 750 | name: "conv4-2/dwise-se-fc2/shift" 751 | type: "Power" 752 | bottom: "conv4-2/dwise-se-fc2" 753 | top: "conv4-2/dwise-se-fc2/shift" 754 | power_param { 755 | power: 1 756 | scale: 1 757 | shift: 3 758 | } 759 | } 760 | layer { 761 | name: "conv4-2/dwise-se-fc2/shift-relu" 762 | type: "ReLU6" 763 | bottom: "conv4-2/dwise-se-fc2/shift" 764 | top: "conv4-2/dwise-se-fc2/shift" 765 | } 766 | layer { 767 | name: "conv4-2/dwise-se-fc2/shift-div" 768 | type: "Power" 769 | bottom: "conv4-2/dwise-se-fc2/shift" 770 | top: "conv4-2/dwise-se-fc2/shift-div" 771 | power_param { 772 | power: 1 773 | scale: 0.1666666667 774 | shift: 0 775 | } 776 | } 777 | layer { 778 | name: "conv4-2/dwise/scale" 779 | type: "Scale" 780 | bottom: "conv4-2/dwise" 781 | bottom: "conv4-2/dwise-se-fc2/shift-div" 782 | top: "conv4-2/dwise/scale" 783 | scale_param{ 784 | axis: 0 785 | } 786 | } 787 | # H-swish 788 | layer { 789 | name: "conv4-2/dwise/shift" 790 | type: "Power" 791 | bottom: "conv4-2/dwise/scale" 792 | top: "conv4-2/dwise/shift" 793 | power_param { 794 | power: 1 795 | scale: 1 796 | shift: 3 797 | } 798 | } 799 | layer { 800 | name: "conv4-2/dwise/shift-relu" 801 | type: "ReLU6" 802 | bottom: "conv4-2/dwise/shift" 803 | top: "conv4-2/dwise/shift" 804 | } 805 | layer { 806 | name: "conv4-2/dwise/shift-div" 807 | type: "Power" 808 | bottom: "conv4-2/dwise/shift" 809 | top: "conv4-2/dwise/shift-div" 810 | power_param { 811 | power: 1 812 | scale: 0.1666666667 813 | shift: 0 814 | } 815 | } 816 | layer { 817 | name: "conv4-2/dwise/hswish" 818 | type: "Eltwise" 819 | bottom: "conv4-2/dwise/scale" 820 | bottom: "conv4-2/dwise/shift-div" 821 | top: "conv4-2/dwise/hswish" 822 | eltwise_param { 823 | operation: PROD 824 | } 825 | } 826 | 827 | layer { 828 | name: "conv4-2/linear" 829 | type: "Convolution" 830 | bottom: "conv4-2/dwise/hswish" 831 | top: "conv4-2/linear" 832 | param { 833 | lr_mult: 1 834 | decay_mult: 1 835 | } 836 | convolution_param { 837 | num_output: 40 838 | pad: 0 839 | bias_term: false 840 | kernel_size: 1 841 | stride: 1 842 | weight_filler { 843 | type: "msra" 844 | } 845 | } 846 | } 847 | layer { 848 | name: "conv4-2/linear-bn" 849 | type: "BatchNorm" 850 | bottom: "conv4-2/linear" 851 | top: "conv4-2/linear" 852 | } 853 | layer { 854 | name: "conv4-2/linear-bn-scale" 855 | type: "Scale" 856 | bottom: "conv4-2/linear" 857 | top: "conv4-2/linear" 858 | scale_param { 859 | bias_term: true 860 | } 861 | } 862 | 863 | #################### stage 5-1 #################### 864 | layer { 865 | name: "conv5-1/expand" 866 | type: "Convolution" 867 | bottom: "conv4-2/linear" 868 | top: "conv5-1/expand" 869 | param { 870 | lr_mult: 1 871 | decay_mult: 1 872 | } 873 | convolution_param { 874 | num_output: 240 875 | pad: 0 876 | bias_term: false 877 | kernel_size: 1 878 | stride: 1 879 | weight_filler { 880 | type: "msra" 881 | } 882 | } 883 | } 884 | layer { 885 | name: "conv5-1/expand-bn" 886 | type: "BatchNorm" 887 | bottom: "conv5-1/expand" 888 | top: "conv5-1/expand" 889 | } 890 | layer { 891 | name: "conv5-1/expand-bn-scale" 892 | type: "Scale" 893 | bottom: "conv5-1/expand" 894 | top: "conv5-1/expand" 895 | scale_param { 896 | bias_term: true 897 | } 898 | } 899 | # H-swish 900 | layer { 901 | name: "conv5-1/expand/shift" 902 | type: "Power" 903 | bottom: "conv5-1/expand" 904 | top: "conv5-1/expand/shift" 905 | power_param { 906 | power: 1 907 | scale: 1 908 | shift: 3 909 | } 910 | } 911 | layer { 912 | name: "conv5-1/expand/shift-relu" 913 | type: "ReLU6" 914 | bottom: "conv5-1/expand/shift" 915 | top: "conv5-1/expand/shift" 916 | } 917 | layer { 918 | name: "conv5-1/expand/shift-div" 919 | type: "Power" 920 | bottom: "conv5-1/expand/shift" 921 | top: "conv5-1/expand/shift-div" 922 | power_param { 923 | power: 1 924 | scale: 0.1666666667 925 | shift: 0 926 | } 927 | } 928 | layer { 929 | name: "conv5-1/expand/hswish" 930 | type: "Eltwise" 931 | bottom: "conv5-1/expand" 932 | bottom: "conv5-1/expand/shift-div" 933 | top: "conv5-1/expand/hswish" 934 | eltwise_param { 935 | operation: PROD 936 | } 937 | } 938 | 939 | layer { 940 | name: "conv5-1/dwise" 941 | #type: "Convolution" 942 | type: "DepthwiseConvolution" 943 | bottom: "conv5-1/expand/hswish" 944 | top: "conv5-1/dwise" 945 | param { 946 | lr_mult: 1 947 | decay_mult: 1 948 | } 949 | convolution_param { 950 | num_output: 240 951 | group: 240 952 | pad: 2 953 | bias_term: false 954 | kernel_size: 5 955 | stride: 1 956 | weight_filler { 957 | type: "msra" 958 | } 959 | engine: CAFFE 960 | } 961 | } 962 | layer { 963 | name: "conv5-1/dwise-bn" 964 | type: "BatchNorm" 965 | bottom: "conv5-1/dwise" 966 | top: "conv5-1/dwise" 967 | } 968 | layer { 969 | name: "conv5-1/dwise-bn-scale" 970 | type: "Scale" 971 | bottom: "conv5-1/dwise" 972 | top: "conv5-1/dwise" 973 | scale_param { 974 | bias_term: true 975 | } 976 | } 977 | 978 | # se 979 | layer { 980 | name: "conv5-1/dwise-se-pool" 981 | type: "Pooling" 982 | bottom: "conv5-1/dwise" 983 | top: "conv5-1/dwise-se-pool" 984 | pooling_param { 985 | pool: AVE 986 | global_pooling: true 987 | } 988 | } 989 | layer { 990 | name: "conv5-1/dwise-se-fc1" 991 | type: "InnerProduct" 992 | bottom: "conv5-1/dwise-se-pool" 993 | top:"conv5-1/dwise-se-fc1" 994 | param { 995 | lr_mult: 1 996 | decay_mult: 1 997 | } 998 | param { 999 | lr_mult: 2 1000 | decay_mult: 0 1001 | } 1002 | inner_product_param { 1003 | num_output: 60 1004 | weight_filler { 1005 | type: "msra" 1006 | } 1007 | bias_filler { 1008 | type: "constant" 1009 | value: 0 1010 | } 1011 | } 1012 | } 1013 | layer { 1014 | name: "conv5-1/dwise-se-fc1-relu" 1015 | type: "ReLU6" 1016 | bottom: "conv5-1/dwise-se-fc1" 1017 | top: "conv5-1/dwise-se-fc1" 1018 | } 1019 | layer { 1020 | name: "conv5-1/dwise-se-fc2" 1021 | type: "InnerProduct" 1022 | bottom: "conv5-1/dwise-se-fc1" 1023 | top:"conv5-1/dwise-se-fc2" 1024 | param { 1025 | lr_mult: 1 1026 | decay_mult: 1 1027 | } 1028 | param { 1029 | lr_mult: 2 1030 | decay_mult: 0 1031 | } 1032 | inner_product_param { 1033 | num_output: 240 1034 | weight_filler { 1035 | type: "msra" 1036 | } 1037 | bias_filler { 1038 | type: "constant" 1039 | value: 0 1040 | } 1041 | } 1042 | } 1043 | # H-sigmoid 1044 | layer { 1045 | name: "conv5-1/dwise-se-fc2/shift" 1046 | type: "Power" 1047 | bottom: "conv5-1/dwise-se-fc2" 1048 | top: "conv5-1/dwise-se-fc2/shift" 1049 | power_param { 1050 | power: 1 1051 | scale: 1 1052 | shift: 3 1053 | } 1054 | } 1055 | layer { 1056 | name: "conv5-1/dwise-se-fc2/shift-relu" 1057 | type: "ReLU6" 1058 | bottom: "conv5-1/dwise-se-fc2/shift" 1059 | top: "conv5-1/dwise-se-fc2/shift" 1060 | } 1061 | layer { 1062 | name: "conv5-1/dwise-se-fc2/shift-div" 1063 | type: "Power" 1064 | bottom: "conv5-1/dwise-se-fc2/shift" 1065 | top: "conv5-1/dwise-se-fc2/shift-div" 1066 | power_param { 1067 | power: 1 1068 | scale: 0.1666666667 1069 | shift: 0 1070 | } 1071 | } 1072 | layer { 1073 | name: "conv5-1/dwise/scale" 1074 | type: "Scale" 1075 | bottom: "conv5-1/dwise" 1076 | bottom: "conv5-1/dwise-se-fc2/shift-div" 1077 | top: "conv5-1/dwise/scale" 1078 | scale_param{ 1079 | axis: 0 1080 | } 1081 | } 1082 | # H-swish 1083 | layer { 1084 | name: "conv5-1/dwise/shift" 1085 | type: "Power" 1086 | bottom: "conv5-1/dwise/scale" 1087 | top: "conv5-1/dwise/shift" 1088 | power_param { 1089 | power: 1 1090 | scale: 1 1091 | shift: 3 1092 | } 1093 | } 1094 | layer { 1095 | name: "conv5-1/dwise/shift-relu" 1096 | type: "ReLU6" 1097 | bottom: "conv5-1/dwise/shift" 1098 | top: "conv5-1/dwise/shift" 1099 | } 1100 | layer { 1101 | name: "conv5-1/dwise/shift-div" 1102 | type: "Power" 1103 | bottom: "conv5-1/dwise/shift" 1104 | top: "conv5-1/dwise/shift-div" 1105 | power_param { 1106 | power: 1 1107 | scale: 0.1666666667 1108 | shift: 0 1109 | } 1110 | } 1111 | layer { 1112 | name: "conv5-1/dwise/hswish" 1113 | type: "Eltwise" 1114 | bottom: "conv5-1/dwise/scale" 1115 | bottom: "conv5-1/dwise/shift-div" 1116 | top: "conv5-1/dwise/hswish" 1117 | eltwise_param { 1118 | operation: PROD 1119 | } 1120 | } 1121 | 1122 | layer { 1123 | name: "conv5-1/linear" 1124 | type: "Convolution" 1125 | bottom: "conv5-1/dwise/hswish" 1126 | top: "conv5-1/linear" 1127 | param { 1128 | lr_mult: 1 1129 | decay_mult: 1 1130 | } 1131 | convolution_param { 1132 | num_output: 40 1133 | pad: 0 1134 | bias_term: false 1135 | kernel_size: 1 1136 | stride: 1 1137 | weight_filler { 1138 | type: "msra" 1139 | } 1140 | } 1141 | } 1142 | layer { 1143 | name: "conv5-1/linear-bn" 1144 | type: "BatchNorm" 1145 | bottom: "conv5-1/linear" 1146 | top: "conv5-1/linear" 1147 | } 1148 | layer { 1149 | name: "conv5-1/linear-bn-scale" 1150 | type: "Scale" 1151 | bottom: "conv5-1/linear" 1152 | top: "conv5-1/linear" 1153 | scale_param { 1154 | bias_term: true 1155 | } 1156 | } 1157 | 1158 | layer { 1159 | name: "block5-1" 1160 | type: "Eltwise" 1161 | bottom: "conv4-2/linear" 1162 | bottom: "conv5-1/linear" 1163 | top: "block5-1" 1164 | } 1165 | 1166 | #################### stage 5-2 #################### 1167 | layer { 1168 | name: "conv5-2/expand" 1169 | type: "Convolution" 1170 | bottom: "block5-1" 1171 | top: "conv5-2/expand" 1172 | param { 1173 | lr_mult: 1 1174 | decay_mult: 1 1175 | } 1176 | convolution_param { 1177 | num_output: 240 1178 | pad: 0 1179 | bias_term: false 1180 | kernel_size: 1 1181 | stride: 1 1182 | weight_filler { 1183 | type: "msra" 1184 | } 1185 | } 1186 | } 1187 | layer { 1188 | name: "conv5-2/expand-bn" 1189 | type: "BatchNorm" 1190 | bottom: "conv5-2/expand" 1191 | top: "conv5-2/expand" 1192 | } 1193 | layer { 1194 | name: "conv5-2/expand-bn-scale" 1195 | type: "Scale" 1196 | bottom: "conv5-2/expand" 1197 | top: "conv5-2/expand" 1198 | scale_param { 1199 | bias_term: true 1200 | } 1201 | } 1202 | # H-swish 1203 | layer { 1204 | name: "conv5-2/expand/shift" 1205 | type: "Power" 1206 | bottom: "conv5-2/expand" 1207 | top: "conv5-2/expand/shift" 1208 | power_param { 1209 | power: 1 1210 | scale: 1 1211 | shift: 3 1212 | } 1213 | } 1214 | layer { 1215 | name: "conv5-2/expand/shift-relu" 1216 | type: "ReLU6" 1217 | bottom: "conv5-2/expand/shift" 1218 | top: "conv5-2/expand/shift" 1219 | } 1220 | layer { 1221 | name: "conv5-2/expand/shift-div" 1222 | type: "Power" 1223 | bottom: "conv5-2/expand/shift" 1224 | top: "conv5-2/expand/shift-div" 1225 | power_param { 1226 | power: 1 1227 | scale: 0.1666666667 1228 | shift: 0 1229 | } 1230 | } 1231 | layer { 1232 | name: "conv5-2/expand/hswish" 1233 | type: "Eltwise" 1234 | bottom: "conv5-2/expand" 1235 | bottom: "conv5-2/expand/shift-div" 1236 | top: "conv5-2/expand/hswish" 1237 | eltwise_param { 1238 | operation: PROD 1239 | } 1240 | } 1241 | 1242 | layer { 1243 | name: "conv5-2/dwise" 1244 | #type: "Convolution" 1245 | type: "DepthwiseConvolution" 1246 | bottom: "conv5-2/expand/hswish" 1247 | top: "conv5-2/dwise" 1248 | param { 1249 | lr_mult: 1 1250 | decay_mult: 1 1251 | } 1252 | convolution_param { 1253 | num_output: 240 1254 | group: 240 1255 | pad: 2 1256 | bias_term: false 1257 | kernel_size: 5 1258 | stride: 1 1259 | weight_filler { 1260 | type: "msra" 1261 | } 1262 | engine: CAFFE 1263 | } 1264 | } 1265 | layer { 1266 | name: "conv5-2/dwise-bn" 1267 | type: "BatchNorm" 1268 | bottom: "conv5-2/dwise" 1269 | top: "conv5-2/dwise" 1270 | } 1271 | layer { 1272 | name: "conv5-2/dwise-bn-scale" 1273 | type: "Scale" 1274 | bottom: "conv5-2/dwise" 1275 | top: "conv5-2/dwise" 1276 | scale_param { 1277 | bias_term: true 1278 | } 1279 | } 1280 | 1281 | # se 1282 | layer { 1283 | name: "conv5-2/dwise-se-pool" 1284 | type: "Pooling" 1285 | bottom: "conv5-2/dwise" 1286 | top: "conv5-2/dwise-se-pool" 1287 | pooling_param { 1288 | pool: AVE 1289 | global_pooling: true 1290 | } 1291 | } 1292 | layer { 1293 | name: "conv5-2/dwise-se-fc1" 1294 | type: "InnerProduct" 1295 | bottom: "conv5-2/dwise-se-pool" 1296 | top:"conv5-2/dwise-se-fc1" 1297 | param { 1298 | lr_mult: 1 1299 | decay_mult: 1 1300 | } 1301 | param { 1302 | lr_mult: 2 1303 | decay_mult: 0 1304 | } 1305 | inner_product_param { 1306 | num_output: 60 1307 | weight_filler { 1308 | type: "msra" 1309 | } 1310 | bias_filler { 1311 | type: "constant" 1312 | value: 0 1313 | } 1314 | } 1315 | } 1316 | layer { 1317 | name: "conv5-2/dwise-se-fc1-relu" 1318 | type: "ReLU6" 1319 | bottom: "conv5-2/dwise-se-fc1" 1320 | top: "conv5-2/dwise-se-fc1" 1321 | } 1322 | layer { 1323 | name: "conv5-2/dwise-se-fc2" 1324 | type: "InnerProduct" 1325 | bottom: "conv5-2/dwise-se-fc1" 1326 | top:"conv5-2/dwise-se-fc2" 1327 | param { 1328 | lr_mult: 1 1329 | decay_mult: 1 1330 | } 1331 | param { 1332 | lr_mult: 2 1333 | decay_mult: 0 1334 | } 1335 | inner_product_param { 1336 | num_output: 240 1337 | weight_filler { 1338 | type: "msra" 1339 | } 1340 | bias_filler { 1341 | type: "constant" 1342 | value: 0 1343 | } 1344 | } 1345 | } 1346 | # H-sigmoid 1347 | layer { 1348 | name: "conv5-2/dwise-se-fc2/shift" 1349 | type: "Power" 1350 | bottom: "conv5-2/dwise-se-fc2" 1351 | top: "conv5-2/dwise-se-fc2/shift" 1352 | power_param { 1353 | power: 1 1354 | scale: 1 1355 | shift: 3 1356 | } 1357 | } 1358 | layer { 1359 | name: "conv5-2/dwise-se-fc2/shift-relu" 1360 | type: "ReLU6" 1361 | bottom: "conv5-2/dwise-se-fc2/shift" 1362 | top: "conv5-2/dwise-se-fc2/shift" 1363 | } 1364 | layer { 1365 | name: "conv5-2/dwise-se-fc2/shift-div" 1366 | type: "Power" 1367 | bottom: "conv5-2/dwise-se-fc2/shift" 1368 | top: "conv5-2/dwise-se-fc2/shift-div" 1369 | power_param { 1370 | power: 1 1371 | scale: 0.1666666667 1372 | shift: 0 1373 | } 1374 | } 1375 | layer { 1376 | name: "conv5-2/dwise/scale" 1377 | type: "Scale" 1378 | bottom: "conv5-2/dwise" 1379 | bottom: "conv5-2/dwise-se-fc2/shift-div" 1380 | top: "conv5-2/dwise/scale" 1381 | scale_param{ 1382 | axis: 0 1383 | } 1384 | } 1385 | # H-swish 1386 | layer { 1387 | name: "conv5-2/dwise/shift" 1388 | type: "Power" 1389 | bottom: "conv5-2/dwise/scale" 1390 | top: "conv5-2/dwise/shift" 1391 | power_param { 1392 | power: 1 1393 | scale: 1 1394 | shift: 3 1395 | } 1396 | } 1397 | layer { 1398 | name: "conv5-2/dwise/shift-relu" 1399 | type: "ReLU6" 1400 | bottom: "conv5-2/dwise/shift" 1401 | top: "conv5-2/dwise/shift" 1402 | } 1403 | layer { 1404 | name: "conv5-2/dwise/shift-div" 1405 | type: "Power" 1406 | bottom: "conv5-2/dwise/shift" 1407 | top: "conv5-2/dwise/shift-div" 1408 | power_param { 1409 | power: 1 1410 | scale: 0.1666666667 1411 | shift: 0 1412 | } 1413 | } 1414 | layer { 1415 | name: "conv5-2/dwise/hswish" 1416 | type: "Eltwise" 1417 | bottom: "conv5-2/dwise/scale" 1418 | bottom: "conv5-2/dwise/shift-div" 1419 | top: "conv5-2/dwise/hswish" 1420 | eltwise_param { 1421 | operation: PROD 1422 | } 1423 | } 1424 | 1425 | layer { 1426 | name: "conv5-2/linear" 1427 | type: "Convolution" 1428 | bottom: "conv5-2/dwise/hswish" 1429 | top: "conv5-2/linear" 1430 | param { 1431 | lr_mult: 1 1432 | decay_mult: 1 1433 | } 1434 | convolution_param { 1435 | num_output: 40 1436 | pad: 0 1437 | bias_term: false 1438 | kernel_size: 1 1439 | stride: 1 1440 | weight_filler { 1441 | type: "msra" 1442 | } 1443 | } 1444 | } 1445 | layer { 1446 | name: "conv5-2/linear-bn" 1447 | type: "BatchNorm" 1448 | bottom: "conv5-2/linear" 1449 | top: "conv5-2/linear" 1450 | } 1451 | layer { 1452 | name: "conv5-2/linear-bn-scale" 1453 | type: "Scale" 1454 | bottom: "conv5-2/linear" 1455 | top: "conv5-2/linear" 1456 | scale_param { 1457 | bias_term: true 1458 | } 1459 | } 1460 | 1461 | layer { 1462 | name: "block5-2" 1463 | type: "Eltwise" 1464 | bottom: "block5-1" 1465 | bottom: "conv5-2/linear" 1466 | top: "block5-2" 1467 | } 1468 | 1469 | #################### stage 5-3 #################### 1470 | layer { 1471 | name: "conv5-3/expand" 1472 | type: "Convolution" 1473 | bottom: "block5-2" 1474 | top: "conv5-3/expand" 1475 | param { 1476 | lr_mult: 1 1477 | decay_mult: 1 1478 | } 1479 | convolution_param { 1480 | num_output: 120 1481 | pad: 0 1482 | bias_term: false 1483 | kernel_size: 1 1484 | stride: 1 1485 | weight_filler { 1486 | type: "msra" 1487 | } 1488 | } 1489 | } 1490 | layer { 1491 | name: "conv5-3/expand-bn" 1492 | type: "BatchNorm" 1493 | bottom: "conv5-3/expand" 1494 | top: "conv5-3/expand" 1495 | } 1496 | layer { 1497 | name: "conv5-3/expand-bn-scale" 1498 | type: "Scale" 1499 | bottom: "conv5-3/expand" 1500 | top: "conv5-3/expand" 1501 | scale_param { 1502 | bias_term: true 1503 | } 1504 | } 1505 | # H-swish 1506 | layer { 1507 | name: "conv5-3/expand/shift" 1508 | type: "Power" 1509 | bottom: "conv5-3/expand" 1510 | top: "conv5-3/expand/shift" 1511 | power_param { 1512 | power: 1 1513 | scale: 1 1514 | shift: 3 1515 | } 1516 | } 1517 | layer { 1518 | name: "conv5-3/expand/shift-relu" 1519 | type: "ReLU6" 1520 | bottom: "conv5-3/expand/shift" 1521 | top: "conv5-3/expand/shift" 1522 | } 1523 | layer { 1524 | name: "conv5-3/expand/shift-div" 1525 | type: "Power" 1526 | bottom: "conv5-3/expand/shift" 1527 | top: "conv5-3/expand/shift-div" 1528 | power_param { 1529 | power: 1 1530 | scale: 0.1666666667 1531 | shift: 0 1532 | } 1533 | } 1534 | layer { 1535 | name: "conv5-3/expand/hswish" 1536 | type: "Eltwise" 1537 | bottom: "conv5-3/expand" 1538 | bottom: "conv5-3/expand/shift-div" 1539 | top: "conv5-3/expand/hswish" 1540 | eltwise_param { 1541 | operation: PROD 1542 | } 1543 | } 1544 | 1545 | layer { 1546 | name: "conv5-3/dwise" 1547 | #type: "Convolution" 1548 | type: "DepthwiseConvolution" 1549 | bottom: "conv5-3/expand/hswish" 1550 | top: "conv5-3/dwise" 1551 | param { 1552 | lr_mult: 1 1553 | decay_mult: 1 1554 | } 1555 | convolution_param { 1556 | num_output: 120 1557 | group: 120 1558 | pad: 2 1559 | bias_term: false 1560 | kernel_size: 5 1561 | stride: 1 1562 | weight_filler { 1563 | type: "msra" 1564 | } 1565 | engine: CAFFE 1566 | } 1567 | } 1568 | layer { 1569 | name: "conv5-3/dwise-bn" 1570 | type: "BatchNorm" 1571 | bottom: "conv5-3/dwise" 1572 | top: "conv5-3/dwise" 1573 | } 1574 | layer { 1575 | name: "conv5-3/dwise-bn-scale" 1576 | type: "Scale" 1577 | bottom: "conv5-3/dwise" 1578 | top: "conv5-3/dwise" 1579 | scale_param { 1580 | bias_term: true 1581 | } 1582 | } 1583 | 1584 | # se 1585 | layer { 1586 | name: "conv5-3/dwise-se-pool" 1587 | type: "Pooling" 1588 | bottom: "conv5-3/dwise" 1589 | top: "conv5-3/dwise-se-pool" 1590 | pooling_param { 1591 | pool: AVE 1592 | global_pooling: true 1593 | } 1594 | } 1595 | layer { 1596 | name: "conv5-3/dwise-se-fc1" 1597 | type: "InnerProduct" 1598 | bottom: "conv5-3/dwise-se-pool" 1599 | top:"conv5-3/dwise-se-fc1" 1600 | param { 1601 | lr_mult: 1 1602 | decay_mult: 1 1603 | } 1604 | param { 1605 | lr_mult: 2 1606 | decay_mult: 0 1607 | } 1608 | inner_product_param { 1609 | num_output: 30 1610 | weight_filler { 1611 | type: "msra" 1612 | } 1613 | bias_filler { 1614 | type: "constant" 1615 | value: 0 1616 | } 1617 | } 1618 | } 1619 | layer { 1620 | name: "conv5-3/dwise-se-fc1-relu" 1621 | type: "ReLU6" 1622 | bottom: "conv5-3/dwise-se-fc1" 1623 | top: "conv5-3/dwise-se-fc1" 1624 | } 1625 | layer { 1626 | name: "conv5-3/dwise-se-fc2" 1627 | type: "InnerProduct" 1628 | bottom: "conv5-3/dwise-se-fc1" 1629 | top:"conv5-3/dwise-se-fc2" 1630 | param { 1631 | lr_mult: 1 1632 | decay_mult: 1 1633 | } 1634 | param { 1635 | lr_mult: 2 1636 | decay_mult: 0 1637 | } 1638 | inner_product_param { 1639 | num_output: 120 1640 | weight_filler { 1641 | type: "msra" 1642 | } 1643 | bias_filler { 1644 | type: "constant" 1645 | value: 0 1646 | } 1647 | } 1648 | } 1649 | # H-sigmoid 1650 | layer { 1651 | name: "conv5-3/dwise-se-fc2/shift" 1652 | type: "Power" 1653 | bottom: "conv5-3/dwise-se-fc2" 1654 | top: "conv5-3/dwise-se-fc2/shift" 1655 | power_param { 1656 | power: 1 1657 | scale: 1 1658 | shift: 3 1659 | } 1660 | } 1661 | layer { 1662 | name: "conv5-3/dwise-se-fc2/shift-relu" 1663 | type: "ReLU6" 1664 | bottom: "conv5-3/dwise-se-fc2/shift" 1665 | top: "conv5-3/dwise-se-fc2/shift" 1666 | } 1667 | layer { 1668 | name: "conv5-3/dwise-se-fc2/shift-div" 1669 | type: "Power" 1670 | bottom: "conv5-3/dwise-se-fc2/shift" 1671 | top: "conv5-3/dwise-se-fc2/shift-div" 1672 | power_param { 1673 | power: 1 1674 | scale: 0.1666666667 1675 | shift: 0 1676 | } 1677 | } 1678 | layer { 1679 | name: "conv5-3/dwise/scale" 1680 | type: "Scale" 1681 | bottom: "conv5-3/dwise" 1682 | bottom: "conv5-3/dwise-se-fc2/shift-div" 1683 | top: "conv5-3/dwise/scale" 1684 | scale_param{ 1685 | axis: 0 1686 | } 1687 | } 1688 | # H-swish 1689 | layer { 1690 | name: "conv5-3/dwise/shift" 1691 | type: "Power" 1692 | bottom: "conv5-3/dwise/scale" 1693 | top: "conv5-3/dwise/shift" 1694 | power_param { 1695 | power: 1 1696 | scale: 1 1697 | shift: 3 1698 | } 1699 | } 1700 | layer { 1701 | name: "conv5-3/dwise/shift-relu" 1702 | type: "ReLU6" 1703 | bottom: "conv5-3/dwise/shift" 1704 | top: "conv5-3/dwise/shift" 1705 | } 1706 | layer { 1707 | name: "conv5-3/dwise/shift-div" 1708 | type: "Power" 1709 | bottom: "conv5-3/dwise/shift" 1710 | top: "conv5-3/dwise/shift-div" 1711 | power_param { 1712 | power: 1 1713 | scale: 0.1666666667 1714 | shift: 0 1715 | } 1716 | } 1717 | layer { 1718 | name: "conv5-3/dwise/hswish" 1719 | type: "Eltwise" 1720 | bottom: "conv5-3/dwise/scale" 1721 | bottom: "conv5-3/dwise/shift-div" 1722 | top: "conv5-3/dwise/hswish" 1723 | eltwise_param { 1724 | operation: PROD 1725 | } 1726 | } 1727 | 1728 | layer { 1729 | name: "conv5-3/linear" 1730 | type: "Convolution" 1731 | bottom: "conv5-3/dwise/hswish" 1732 | top: "conv5-3/linear" 1733 | param { 1734 | lr_mult: 1 1735 | decay_mult: 1 1736 | } 1737 | convolution_param { 1738 | num_output: 48 1739 | pad: 0 1740 | bias_term: false 1741 | kernel_size: 1 1742 | stride: 1 1743 | weight_filler { 1744 | type: "msra" 1745 | } 1746 | } 1747 | } 1748 | layer { 1749 | name: "conv5-3/linear-bn" 1750 | type: "BatchNorm" 1751 | bottom: "conv5-3/linear" 1752 | top: "conv5-3/linear" 1753 | } 1754 | layer { 1755 | name: "conv5-3/linear-bn-scale" 1756 | type: "Scale" 1757 | bottom: "conv5-3/linear" 1758 | top: "conv5-3/linear" 1759 | scale_param { 1760 | bias_term: true 1761 | } 1762 | } 1763 | 1764 | #################### stage 5-4 #################### 1765 | layer { 1766 | name: "conv5-4/expand" 1767 | type: "Convolution" 1768 | bottom: "conv5-3/linear" 1769 | top: "conv5-4/expand" 1770 | param { 1771 | lr_mult: 1 1772 | decay_mult: 1 1773 | } 1774 | convolution_param { 1775 | num_output: 144 1776 | pad: 0 1777 | bias_term: false 1778 | kernel_size: 1 1779 | stride: 1 1780 | weight_filler { 1781 | type: "msra" 1782 | } 1783 | } 1784 | } 1785 | layer { 1786 | name: "conv5-4/expand-bn" 1787 | type: "BatchNorm" 1788 | bottom: "conv5-4/expand" 1789 | top: "conv5-4/expand" 1790 | } 1791 | layer { 1792 | name: "conv5-4/expand-bn-scale" 1793 | type: "Scale" 1794 | bottom: "conv5-4/expand" 1795 | top: "conv5-4/expand" 1796 | scale_param { 1797 | bias_term: true 1798 | } 1799 | } 1800 | # H-swish 1801 | layer { 1802 | name: "conv5-4/expand/shift" 1803 | type: "Power" 1804 | bottom: "conv5-4/expand" 1805 | top: "conv5-4/expand/shift" 1806 | power_param { 1807 | power: 1 1808 | scale: 1 1809 | shift: 3 1810 | } 1811 | } 1812 | layer { 1813 | name: "conv5-4/expand/shift-relu" 1814 | type: "ReLU6" 1815 | bottom: "conv5-4/expand/shift" 1816 | top: "conv5-4/expand/shift" 1817 | } 1818 | layer { 1819 | name: "conv5-4/expand/shift-div" 1820 | type: "Power" 1821 | bottom: "conv5-4/expand/shift" 1822 | top: "conv5-4/expand/shift-div" 1823 | power_param { 1824 | power: 1 1825 | scale: 0.1666666667 1826 | shift: 0 1827 | } 1828 | } 1829 | layer { 1830 | name: "conv5-4/expand/hswish" 1831 | type: "Eltwise" 1832 | bottom: "conv5-4/expand" 1833 | bottom: "conv5-4/expand/shift-div" 1834 | top: "conv5-4/expand/hswish" 1835 | eltwise_param { 1836 | operation: PROD 1837 | } 1838 | } 1839 | 1840 | layer { 1841 | name: "conv5-4/dwise" 1842 | #type: "Convolution" 1843 | type: "DepthwiseConvolution" 1844 | bottom: "conv5-4/expand/hswish" 1845 | top: "conv5-4/dwise" 1846 | param { 1847 | lr_mult: 1 1848 | decay_mult: 1 1849 | } 1850 | convolution_param { 1851 | num_output: 144 1852 | group: 144 1853 | pad: 2 1854 | bias_term: false 1855 | kernel_size: 5 1856 | stride: 1 1857 | weight_filler { 1858 | type: "msra" 1859 | } 1860 | engine: CAFFE 1861 | } 1862 | } 1863 | layer { 1864 | name: "conv5-4/dwise-bn" 1865 | type: "BatchNorm" 1866 | bottom: "conv5-4/dwise" 1867 | top: "conv5-4/dwise" 1868 | } 1869 | layer { 1870 | name: "conv5-4/dwise-bn-scale" 1871 | type: "Scale" 1872 | bottom: "conv5-4/dwise" 1873 | top: "conv5-4/dwise" 1874 | scale_param { 1875 | bias_term: true 1876 | } 1877 | } 1878 | 1879 | # se 1880 | layer { 1881 | name: "conv5-4/dwise-se-pool" 1882 | type: "Pooling" 1883 | bottom: "conv5-4/dwise" 1884 | top: "conv5-4/dwise-se-pool" 1885 | pooling_param { 1886 | pool: AVE 1887 | global_pooling: true 1888 | } 1889 | } 1890 | layer { 1891 | name: "conv5-4/dwise-se-fc1" 1892 | type: "InnerProduct" 1893 | bottom: "conv5-4/dwise-se-pool" 1894 | top:"conv5-4/dwise-se-fc1" 1895 | param { 1896 | lr_mult: 1 1897 | decay_mult: 1 1898 | } 1899 | param { 1900 | lr_mult: 2 1901 | decay_mult: 0 1902 | } 1903 | inner_product_param { 1904 | num_output: 36 1905 | weight_filler { 1906 | type: "msra" 1907 | } 1908 | bias_filler { 1909 | type: "constant" 1910 | value: 0 1911 | } 1912 | } 1913 | } 1914 | layer { 1915 | name: "conv5-4/dwise-se-fc1-relu" 1916 | type: "ReLU6" 1917 | bottom: "conv5-4/dwise-se-fc1" 1918 | top: "conv5-4/dwise-se-fc1" 1919 | } 1920 | layer { 1921 | name: "conv5-4/dwise-se-fc2" 1922 | type: "InnerProduct" 1923 | bottom: "conv5-4/dwise-se-fc1" 1924 | top:"conv5-4/dwise-se-fc2" 1925 | param { 1926 | lr_mult: 1 1927 | decay_mult: 1 1928 | } 1929 | param { 1930 | lr_mult: 2 1931 | decay_mult: 0 1932 | } 1933 | inner_product_param { 1934 | num_output: 144 1935 | weight_filler { 1936 | type: "msra" 1937 | } 1938 | bias_filler { 1939 | type: "constant" 1940 | value: 0 1941 | } 1942 | } 1943 | } 1944 | # H-sigmoid 1945 | layer { 1946 | name: "conv5-4/dwise-se-fc2/shift" 1947 | type: "Power" 1948 | bottom: "conv5-4/dwise-se-fc2" 1949 | top: "conv5-4/dwise-se-fc2/shift" 1950 | power_param { 1951 | power: 1 1952 | scale: 1 1953 | shift: 3 1954 | } 1955 | } 1956 | layer { 1957 | name: "conv5-4/dwise-se-fc2/shift-relu" 1958 | type: "ReLU6" 1959 | bottom: "conv5-4/dwise-se-fc2/shift" 1960 | top: "conv5-4/dwise-se-fc2/shift" 1961 | } 1962 | layer { 1963 | name: "conv5-4/dwise-se-fc2/shift-div" 1964 | type: "Power" 1965 | bottom: "conv5-4/dwise-se-fc2/shift" 1966 | top: "conv5-4/dwise-se-fc2/shift-div" 1967 | power_param { 1968 | power: 1 1969 | scale: 0.1666666667 1970 | shift: 0 1971 | } 1972 | } 1973 | layer { 1974 | name: "conv5-4/dwise/scale" 1975 | type: "Scale" 1976 | bottom: "conv5-4/dwise" 1977 | bottom: "conv5-4/dwise-se-fc2/shift-div" 1978 | top: "conv5-4/dwise/scale" 1979 | scale_param{ 1980 | axis: 0 1981 | } 1982 | } 1983 | # H-swish 1984 | layer { 1985 | name: "conv5-4/dwise/shift" 1986 | type: "Power" 1987 | bottom: "conv5-4/dwise/scale" 1988 | top: "conv5-4/dwise/shift" 1989 | power_param { 1990 | power: 1 1991 | scale: 1 1992 | shift: 3 1993 | } 1994 | } 1995 | layer { 1996 | name: "conv5-4/dwise/shift-relu" 1997 | type: "ReLU6" 1998 | bottom: "conv5-4/dwise/shift" 1999 | top: "conv5-4/dwise/shift" 2000 | } 2001 | layer { 2002 | name: "conv5-4/dwise/shift-div" 2003 | type: "Power" 2004 | bottom: "conv5-4/dwise/shift" 2005 | top: "conv5-4/dwise/shift-div" 2006 | power_param { 2007 | power: 1 2008 | scale: 0.1666666667 2009 | shift: 0 2010 | } 2011 | } 2012 | layer { 2013 | name: "conv5-4/dwise/hswish" 2014 | type: "Eltwise" 2015 | bottom: "conv5-4/dwise/scale" 2016 | bottom: "conv5-4/dwise/shift-div" 2017 | top: "conv5-4/dwise/hswish" 2018 | eltwise_param { 2019 | operation: PROD 2020 | } 2021 | } 2022 | 2023 | layer { 2024 | name: "conv5-4/linear" 2025 | type: "Convolution" 2026 | bottom: "conv5-4/dwise/hswish" 2027 | top: "conv5-4/linear" 2028 | param { 2029 | lr_mult: 1 2030 | decay_mult: 1 2031 | } 2032 | convolution_param { 2033 | num_output: 48 2034 | pad: 0 2035 | bias_term: false 2036 | kernel_size: 1 2037 | stride: 1 2038 | weight_filler { 2039 | type: "msra" 2040 | } 2041 | } 2042 | } 2043 | layer { 2044 | name: "conv5-4/linear-bn" 2045 | type: "BatchNorm" 2046 | bottom: "conv5-4/linear" 2047 | top: "conv5-4/linear" 2048 | } 2049 | layer { 2050 | name: "conv5-4/linear-bn-scale" 2051 | type: "Scale" 2052 | bottom: "conv5-4/linear" 2053 | top: "conv5-4/linear" 2054 | scale_param { 2055 | bias_term: true 2056 | } 2057 | } 2058 | 2059 | layer { 2060 | name: "block5-4" 2061 | type: "Eltwise" 2062 | bottom: "conv5-3/linear" 2063 | bottom: "conv5-4/linear" 2064 | top: "block5-4" 2065 | } 2066 | 2067 | #################### stage 5-5 #################### 2068 | layer { 2069 | name: "conv5-5/expand" 2070 | type: "Convolution" 2071 | bottom: "block5-4" 2072 | top: "conv5-5/expand" 2073 | param { 2074 | lr_mult: 1 2075 | decay_mult: 1 2076 | } 2077 | convolution_param { 2078 | num_output: 288 2079 | pad: 0 2080 | bias_term: false 2081 | kernel_size: 1 2082 | stride: 1 2083 | weight_filler { 2084 | type: "msra" 2085 | } 2086 | } 2087 | } 2088 | layer { 2089 | name: "conv5-5/expand-bn" 2090 | type: "BatchNorm" 2091 | bottom: "conv5-5/expand" 2092 | top: "conv5-5/expand" 2093 | } 2094 | layer { 2095 | name: "conv5-5/expand-bn-scale" 2096 | type: "Scale" 2097 | bottom: "conv5-5/expand" 2098 | top: "conv5-5/expand" 2099 | scale_param { 2100 | bias_term: true 2101 | } 2102 | } 2103 | # H-swish 2104 | layer { 2105 | name: "conv5-5/expand/shift" 2106 | type: "Power" 2107 | bottom: "conv5-5/expand" 2108 | top: "conv5-5/expand/shift" 2109 | power_param { 2110 | power: 1 2111 | scale: 1 2112 | shift: 3 2113 | } 2114 | } 2115 | layer { 2116 | name: "conv5-5/expand/shift-relu" 2117 | type: "ReLU6" 2118 | bottom: "conv5-5/expand/shift" 2119 | top: "conv5-5/expand/shift" 2120 | } 2121 | layer { 2122 | name: "conv5-5/expand/shift-div" 2123 | type: "Power" 2124 | bottom: "conv5-5/expand/shift" 2125 | top: "conv5-5/expand/shift-div" 2126 | power_param { 2127 | power: 1 2128 | scale: 0.1666666667 2129 | shift: 0 2130 | } 2131 | } 2132 | layer { 2133 | name: "conv5-5/expand/hswish" 2134 | type: "Eltwise" 2135 | bottom: "conv5-5/expand" 2136 | bottom: "conv5-5/expand/shift-div" 2137 | top: "conv5-5/expand/hswish" 2138 | eltwise_param { 2139 | operation: PROD 2140 | } 2141 | } 2142 | 2143 | layer { 2144 | name: "conv5-5/dwise" 2145 | #type: "Convolution" 2146 | type: "DepthwiseConvolution" 2147 | bottom: "conv5-5/expand/hswish" 2148 | top: "conv5-5/dwise" 2149 | param { 2150 | lr_mult: 1 2151 | decay_mult: 1 2152 | } 2153 | convolution_param { 2154 | num_output: 288 2155 | group: 288 2156 | pad: 2 2157 | bias_term: false 2158 | kernel_size: 5 2159 | stride: 2 2160 | weight_filler { 2161 | type: "msra" 2162 | } 2163 | engine: CAFFE 2164 | } 2165 | } 2166 | layer { 2167 | name: "conv5-5/dwise-bn" 2168 | type: "BatchNorm" 2169 | bottom: "conv5-5/dwise" 2170 | top: "conv5-5/dwise" 2171 | } 2172 | layer { 2173 | name: "conv5-5/dwise-bn-scale" 2174 | type: "Scale" 2175 | bottom: "conv5-5/dwise" 2176 | top: "conv5-5/dwise" 2177 | scale_param { 2178 | bias_term: true 2179 | } 2180 | } 2181 | 2182 | # se 2183 | layer { 2184 | name: "conv5-5/dwise-se-pool" 2185 | type: "Pooling" 2186 | bottom: "conv5-5/dwise" 2187 | top: "conv5-5/dwise-se-pool" 2188 | pooling_param { 2189 | pool: AVE 2190 | global_pooling: true 2191 | } 2192 | } 2193 | layer { 2194 | name: "conv5-5/dwise-se-fc1" 2195 | type: "InnerProduct" 2196 | bottom: "conv5-5/dwise-se-pool" 2197 | top:"conv5-5/dwise-se-fc1" 2198 | param { 2199 | lr_mult: 1 2200 | decay_mult: 1 2201 | } 2202 | param { 2203 | lr_mult: 2 2204 | decay_mult: 0 2205 | } 2206 | inner_product_param { 2207 | num_output: 72 2208 | weight_filler { 2209 | type: "msra" 2210 | } 2211 | bias_filler { 2212 | type: "constant" 2213 | value: 0 2214 | } 2215 | } 2216 | } 2217 | layer { 2218 | name: "conv5-5/dwise-se-fc1-relu" 2219 | type: "ReLU6" 2220 | bottom: "conv5-5/dwise-se-fc1" 2221 | top: "conv5-5/dwise-se-fc1" 2222 | } 2223 | layer { 2224 | name: "conv5-5/dwise-se-fc2" 2225 | type: "InnerProduct" 2226 | bottom: "conv5-5/dwise-se-fc1" 2227 | top:"conv5-5/dwise-se-fc2" 2228 | param { 2229 | lr_mult: 1 2230 | decay_mult: 1 2231 | } 2232 | param { 2233 | lr_mult: 2 2234 | decay_mult: 0 2235 | } 2236 | inner_product_param { 2237 | num_output: 288 2238 | weight_filler { 2239 | type: "msra" 2240 | } 2241 | bias_filler { 2242 | type: "constant" 2243 | value: 0 2244 | } 2245 | } 2246 | } 2247 | # H-sigmoid 2248 | layer { 2249 | name: "conv5-5/dwise-se-fc2/shift" 2250 | type: "Power" 2251 | bottom: "conv5-5/dwise-se-fc2" 2252 | top: "conv5-5/dwise-se-fc2/shift" 2253 | power_param { 2254 | power: 1 2255 | scale: 1 2256 | shift: 3 2257 | } 2258 | } 2259 | layer { 2260 | name: "conv5-5/dwise-se-fc2/shift-relu" 2261 | type: "ReLU6" 2262 | bottom: "conv5-5/dwise-se-fc2/shift" 2263 | top: "conv5-5/dwise-se-fc2/shift" 2264 | } 2265 | layer { 2266 | name: "conv5-5/dwise-se-fc2/shift-div" 2267 | type: "Power" 2268 | bottom: "conv5-5/dwise-se-fc2/shift" 2269 | top: "conv5-5/dwise-se-fc2/shift-div" 2270 | power_param { 2271 | power: 1 2272 | scale: 0.1666666667 2273 | shift: 0 2274 | } 2275 | } 2276 | layer { 2277 | name: "conv5-5/dwise/scale" 2278 | type: "Scale" 2279 | bottom: "conv5-5/dwise" 2280 | bottom: "conv5-5/dwise-se-fc2/shift-div" 2281 | top: "conv5-5/dwise/scale" 2282 | scale_param{ 2283 | axis: 0 2284 | } 2285 | } 2286 | # H-swish 2287 | layer { 2288 | name: "conv5-5/dwise/shift" 2289 | type: "Power" 2290 | bottom: "conv5-5/dwise/scale" 2291 | top: "conv5-5/dwise/shift" 2292 | power_param { 2293 | power: 1 2294 | scale: 1 2295 | shift: 3 2296 | } 2297 | } 2298 | layer { 2299 | name: "conv5-5/dwise/shift-relu" 2300 | type: "ReLU6" 2301 | bottom: "conv5-5/dwise/shift" 2302 | top: "conv5-5/dwise/shift" 2303 | } 2304 | layer { 2305 | name: "conv5-5/dwise/shift-div" 2306 | type: "Power" 2307 | bottom: "conv5-5/dwise/shift" 2308 | top: "conv5-5/dwise/shift-div" 2309 | power_param { 2310 | power: 1 2311 | scale: 0.1666666667 2312 | shift: 0 2313 | } 2314 | } 2315 | layer { 2316 | name: "conv5-5/dwise/hswish" 2317 | type: "Eltwise" 2318 | bottom: "conv5-5/dwise/scale" 2319 | bottom: "conv5-5/dwise/shift-div" 2320 | top: "conv5-5/dwise/hswish" 2321 | eltwise_param { 2322 | operation: PROD 2323 | } 2324 | } 2325 | 2326 | layer { 2327 | name: "conv5-5/linear" 2328 | type: "Convolution" 2329 | bottom: "conv5-5/dwise/hswish" 2330 | top: "conv5-5/linear" 2331 | param { 2332 | lr_mult: 1 2333 | decay_mult: 1 2334 | } 2335 | convolution_param { 2336 | num_output: 96 2337 | pad: 0 2338 | bias_term: false 2339 | kernel_size: 1 2340 | stride: 1 2341 | weight_filler { 2342 | type: "msra" 2343 | } 2344 | } 2345 | } 2346 | layer { 2347 | name: "conv5-5/linear-bn" 2348 | type: "BatchNorm" 2349 | bottom: "conv5-5/linear" 2350 | top: "conv5-5/linear" 2351 | } 2352 | layer { 2353 | name: "conv5-5/linear-bn-scale" 2354 | type: "Scale" 2355 | bottom: "conv5-5/linear" 2356 | top: "conv5-5/linear" 2357 | scale_param { 2358 | bias_term: true 2359 | } 2360 | } 2361 | 2362 | #################### stage 6-1 #################### 2363 | layer { 2364 | name: "conv6-1/expand" 2365 | type: "Convolution" 2366 | bottom: "conv5-5/linear" 2367 | top: "conv6-1/expand" 2368 | param { 2369 | lr_mult: 1 2370 | decay_mult: 1 2371 | } 2372 | convolution_param { 2373 | num_output: 576 2374 | pad: 0 2375 | bias_term: false 2376 | kernel_size: 1 2377 | stride: 1 2378 | weight_filler { 2379 | type: "msra" 2380 | } 2381 | } 2382 | } 2383 | layer { 2384 | name: "conv6-1/expand-bn" 2385 | type: "BatchNorm" 2386 | bottom: "conv6-1/expand" 2387 | top: "conv6-1/expand" 2388 | } 2389 | layer { 2390 | name: "conv6-1/expand-bn-scale" 2391 | type: "Scale" 2392 | bottom: "conv6-1/expand" 2393 | top: "conv6-1/expand" 2394 | scale_param { 2395 | bias_term: true 2396 | } 2397 | } 2398 | # H-swish 2399 | layer { 2400 | name: "conv6-1/expand/shift" 2401 | type: "Power" 2402 | bottom: "conv6-1/expand" 2403 | top: "conv6-1/expand/shift" 2404 | power_param { 2405 | power: 1 2406 | scale: 1 2407 | shift: 3 2408 | } 2409 | } 2410 | layer { 2411 | name: "conv6-1/expand/shift-relu" 2412 | type: "ReLU6" 2413 | bottom: "conv6-1/expand/shift" 2414 | top: "conv6-1/expand/shift" 2415 | } 2416 | layer { 2417 | name: "conv6-1/expand/shift-div" 2418 | type: "Power" 2419 | bottom: "conv6-1/expand/shift" 2420 | top: "conv6-1/expand/shift-div" 2421 | power_param { 2422 | power: 1 2423 | scale: 0.1666666667 2424 | shift: 0 2425 | } 2426 | } 2427 | layer { 2428 | name: "conv6-1/expand/hswish" 2429 | type: "Eltwise" 2430 | bottom: "conv6-1/expand" 2431 | bottom: "conv6-1/expand/shift-div" 2432 | top: "conv6-1/expand/hswish" 2433 | eltwise_param { 2434 | operation: PROD 2435 | } 2436 | } 2437 | 2438 | layer { 2439 | name: "conv6-1/dwise" 2440 | #type: "Convolution" 2441 | type: "DepthwiseConvolution" 2442 | bottom: "conv6-1/expand/hswish" 2443 | top: "conv6-1/dwise" 2444 | param { 2445 | lr_mult: 1 2446 | decay_mult: 1 2447 | } 2448 | convolution_param { 2449 | num_output: 576 2450 | group: 576 2451 | pad: 2 2452 | bias_term: false 2453 | kernel_size: 5 2454 | stride: 1 2455 | weight_filler { 2456 | type: "msra" 2457 | } 2458 | engine: CAFFE 2459 | } 2460 | } 2461 | layer { 2462 | name: "conv6-1/dwise-bn" 2463 | type: "BatchNorm" 2464 | bottom: "conv6-1/dwise" 2465 | top: "conv6-1/dwise" 2466 | } 2467 | layer { 2468 | name: "conv6-1/dwise-bn-scale" 2469 | type: "Scale" 2470 | bottom: "conv6-1/dwise" 2471 | top: "conv6-1/dwise" 2472 | scale_param { 2473 | bias_term: true 2474 | } 2475 | } 2476 | 2477 | # se 2478 | layer { 2479 | name: "conv6-1/dwise-se-pool" 2480 | type: "Pooling" 2481 | bottom: "conv6-1/dwise" 2482 | top: "conv6-1/dwise-se-pool" 2483 | pooling_param { 2484 | pool: AVE 2485 | global_pooling: true 2486 | } 2487 | } 2488 | layer { 2489 | name: "conv6-1/dwise-se-fc1" 2490 | type: "InnerProduct" 2491 | bottom: "conv6-1/dwise-se-pool" 2492 | top:"conv6-1/dwise-se-fc1" 2493 | param { 2494 | lr_mult: 1 2495 | decay_mult: 1 2496 | } 2497 | param { 2498 | lr_mult: 2 2499 | decay_mult: 0 2500 | } 2501 | inner_product_param { 2502 | num_output: 144 2503 | weight_filler { 2504 | type: "msra" 2505 | } 2506 | bias_filler { 2507 | type: "constant" 2508 | value: 0 2509 | } 2510 | } 2511 | } 2512 | layer { 2513 | name: "conv6-1/dwise-se-fc1-relu" 2514 | type: "ReLU6" 2515 | bottom: "conv6-1/dwise-se-fc1" 2516 | top: "conv6-1/dwise-se-fc1" 2517 | } 2518 | layer { 2519 | name: "conv6-1/dwise-se-fc2" 2520 | type: "InnerProduct" 2521 | bottom: "conv6-1/dwise-se-fc1" 2522 | top:"conv6-1/dwise-se-fc2" 2523 | param { 2524 | lr_mult: 1 2525 | decay_mult: 1 2526 | } 2527 | param { 2528 | lr_mult: 2 2529 | decay_mult: 0 2530 | } 2531 | inner_product_param { 2532 | num_output: 576 2533 | weight_filler { 2534 | type: "msra" 2535 | } 2536 | bias_filler { 2537 | type: "constant" 2538 | value: 0 2539 | } 2540 | } 2541 | } 2542 | # H-sigmoid 2543 | layer { 2544 | name: "conv6-1/dwise-se-fc2/shift" 2545 | type: "Power" 2546 | bottom: "conv6-1/dwise-se-fc2" 2547 | top: "conv6-1/dwise-se-fc2/shift" 2548 | power_param { 2549 | power: 1 2550 | scale: 1 2551 | shift: 3 2552 | } 2553 | } 2554 | layer { 2555 | name: "conv6-1/dwise-se-fc2/shift-relu" 2556 | type: "ReLU6" 2557 | bottom: "conv6-1/dwise-se-fc2/shift" 2558 | top: "conv6-1/dwise-se-fc2/shift" 2559 | } 2560 | layer { 2561 | name: "conv6-1/dwise-se-fc2/shift-div" 2562 | type: "Power" 2563 | bottom: "conv6-1/dwise-se-fc2/shift" 2564 | top: "conv6-1/dwise-se-fc2/shift-div" 2565 | power_param { 2566 | power: 1 2567 | scale: 0.1666666667 2568 | shift: 0 2569 | } 2570 | } 2571 | layer { 2572 | name: "conv6-1/dwise/scale" 2573 | type: "Scale" 2574 | bottom: "conv6-1/dwise" 2575 | bottom: "conv6-1/dwise-se-fc2/shift-div" 2576 | top: "conv6-1/dwise/scale" 2577 | scale_param{ 2578 | axis: 0 2579 | } 2580 | } 2581 | # H-swish 2582 | layer { 2583 | name: "conv6-1/dwise/shift" 2584 | type: "Power" 2585 | bottom: "conv6-1/dwise/scale" 2586 | top: "conv6-1/dwise/shift" 2587 | power_param { 2588 | power: 1 2589 | scale: 1 2590 | shift: 3 2591 | } 2592 | } 2593 | layer { 2594 | name: "conv6-1/dwise/shift-relu" 2595 | type: "ReLU6" 2596 | bottom: "conv6-1/dwise/shift" 2597 | top: "conv6-1/dwise/shift" 2598 | } 2599 | layer { 2600 | name: "conv6-1/dwise/shift-div" 2601 | type: "Power" 2602 | bottom: "conv6-1/dwise/shift" 2603 | top: "conv6-1/dwise/shift-div" 2604 | power_param { 2605 | power: 1 2606 | scale: 0.1666666667 2607 | shift: 0 2608 | } 2609 | } 2610 | layer { 2611 | name: "conv6-1/dwise/hswish" 2612 | type: "Eltwise" 2613 | bottom: "conv6-1/dwise/scale" 2614 | bottom: "conv6-1/dwise/shift-div" 2615 | top: "conv6-1/dwise/hswish" 2616 | eltwise_param { 2617 | operation: PROD 2618 | } 2619 | } 2620 | 2621 | layer { 2622 | name: "conv6-1/linear" 2623 | type: "Convolution" 2624 | bottom: "conv6-1/dwise/hswish" 2625 | top: "conv6-1/linear" 2626 | param { 2627 | lr_mult: 1 2628 | decay_mult: 1 2629 | } 2630 | convolution_param { 2631 | num_output: 96 2632 | pad: 0 2633 | bias_term: false 2634 | kernel_size: 1 2635 | stride: 1 2636 | weight_filler { 2637 | type: "msra" 2638 | } 2639 | } 2640 | } 2641 | layer { 2642 | name: "conv6-1/linear-bn" 2643 | type: "BatchNorm" 2644 | bottom: "conv6-1/linear" 2645 | top: "conv6-1/linear" 2646 | } 2647 | layer { 2648 | name: "conv6-1/linear-bn-scale" 2649 | type: "Scale" 2650 | bottom: "conv6-1/linear" 2651 | top: "conv6-1/linear" 2652 | scale_param { 2653 | bias_term: true 2654 | } 2655 | } 2656 | 2657 | layer { 2658 | name: "block6-1" 2659 | type: "Eltwise" 2660 | bottom: "conv5-5/linear" 2661 | bottom: "conv6-1/linear" 2662 | top: "block6-1" 2663 | } 2664 | 2665 | #################### stage 6-2 #################### 2666 | layer { 2667 | name: "conv6-2/expand" 2668 | type: "Convolution" 2669 | bottom: "block6-1" 2670 | top: "conv6-2/expand" 2671 | param { 2672 | lr_mult: 1 2673 | decay_mult: 1 2674 | } 2675 | convolution_param { 2676 | num_output: 576 2677 | pad: 0 2678 | bias_term: false 2679 | kernel_size: 1 2680 | stride: 1 2681 | weight_filler { 2682 | type: "msra" 2683 | } 2684 | } 2685 | } 2686 | layer { 2687 | name: "conv6-2/expand-bn" 2688 | type: "BatchNorm" 2689 | bottom: "conv6-2/expand" 2690 | top: "conv6-2/expand" 2691 | } 2692 | layer { 2693 | name: "conv6-2/expand-bn-scale" 2694 | type: "Scale" 2695 | bottom: "conv6-2/expand" 2696 | top: "conv6-2/expand" 2697 | scale_param { 2698 | bias_term: true 2699 | } 2700 | } 2701 | # H-swish 2702 | layer { 2703 | name: "conv6-2/expand/shift" 2704 | type: "Power" 2705 | bottom: "conv6-2/expand" 2706 | top: "conv6-2/expand/shift" 2707 | power_param { 2708 | power: 1 2709 | scale: 1 2710 | shift: 3 2711 | } 2712 | } 2713 | layer { 2714 | name: "conv6-2/expand/shift-relu" 2715 | type: "ReLU6" 2716 | bottom: "conv6-2/expand/shift" 2717 | top: "conv6-2/expand/shift" 2718 | } 2719 | layer { 2720 | name: "conv6-2/expand/shift-div" 2721 | type: "Power" 2722 | bottom: "conv6-2/expand/shift" 2723 | top: "conv6-2/expand/shift-div" 2724 | power_param { 2725 | power: 1 2726 | scale: 0.1666666667 2727 | shift: 0 2728 | } 2729 | } 2730 | layer { 2731 | name: "conv6-2/expand/hswish" 2732 | type: "Eltwise" 2733 | bottom: "conv6-2/expand" 2734 | bottom: "conv6-2/expand/shift-div" 2735 | top: "conv6-2/expand/hswish" 2736 | eltwise_param { 2737 | operation: PROD 2738 | } 2739 | } 2740 | 2741 | layer { 2742 | name: "conv6-2/dwise" 2743 | #type: "Convolution" 2744 | type: "DepthwiseConvolution" 2745 | bottom: "conv6-2/expand/hswish" 2746 | top: "conv6-2/dwise" 2747 | param { 2748 | lr_mult: 1 2749 | decay_mult: 1 2750 | } 2751 | convolution_param { 2752 | num_output: 576 2753 | group: 576 2754 | pad: 2 2755 | bias_term: false 2756 | kernel_size: 5 2757 | stride: 1 2758 | weight_filler { 2759 | type: "msra" 2760 | } 2761 | engine: CAFFE 2762 | } 2763 | } 2764 | layer { 2765 | name: "conv6-2/dwise-bn" 2766 | type: "BatchNorm" 2767 | bottom: "conv6-2/dwise" 2768 | top: "conv6-2/dwise" 2769 | } 2770 | layer { 2771 | name: "conv6-2/dwise-bn-scale" 2772 | type: "Scale" 2773 | bottom: "conv6-2/dwise" 2774 | top: "conv6-2/dwise" 2775 | scale_param { 2776 | bias_term: true 2777 | } 2778 | } 2779 | 2780 | # se 2781 | layer { 2782 | name: "conv6-2/dwise-se-pool" 2783 | type: "Pooling" 2784 | bottom: "conv6-2/dwise" 2785 | top: "conv6-2/dwise-se-pool" 2786 | pooling_param { 2787 | pool: AVE 2788 | global_pooling: true 2789 | } 2790 | } 2791 | layer { 2792 | name: "conv6-2/dwise-se-fc1" 2793 | type: "InnerProduct" 2794 | bottom: "conv6-2/dwise-se-pool" 2795 | top:"conv6-2/dwise-se-fc1" 2796 | param { 2797 | lr_mult: 1 2798 | decay_mult: 1 2799 | } 2800 | param { 2801 | lr_mult: 2 2802 | decay_mult: 0 2803 | } 2804 | inner_product_param { 2805 | num_output: 144 2806 | weight_filler { 2807 | type: "msra" 2808 | } 2809 | bias_filler { 2810 | type: "constant" 2811 | value: 0 2812 | } 2813 | } 2814 | } 2815 | layer { 2816 | name: "conv6-2/dwise-se-fc1-relu" 2817 | type: "ReLU6" 2818 | bottom: "conv6-2/dwise-se-fc1" 2819 | top: "conv6-2/dwise-se-fc1" 2820 | } 2821 | layer { 2822 | name: "conv6-2/dwise-se-fc2" 2823 | type: "InnerProduct" 2824 | bottom: "conv6-2/dwise-se-fc1" 2825 | top:"conv6-2/dwise-se-fc2" 2826 | param { 2827 | lr_mult: 1 2828 | decay_mult: 1 2829 | } 2830 | param { 2831 | lr_mult: 2 2832 | decay_mult: 0 2833 | } 2834 | inner_product_param { 2835 | num_output: 576 2836 | weight_filler { 2837 | type: "msra" 2838 | } 2839 | bias_filler { 2840 | type: "constant" 2841 | value: 0 2842 | } 2843 | } 2844 | } 2845 | # H-sigmoid 2846 | layer { 2847 | name: "conv6-2/dwise-se-fc2/shift" 2848 | type: "Power" 2849 | bottom: "conv6-2/dwise-se-fc2" 2850 | top: "conv6-2/dwise-se-fc2/shift" 2851 | power_param { 2852 | power: 1 2853 | scale: 1 2854 | shift: 3 2855 | } 2856 | } 2857 | layer { 2858 | name: "conv6-2/dwise-se-fc2/shift-relu" 2859 | type: "ReLU6" 2860 | bottom: "conv6-2/dwise-se-fc2/shift" 2861 | top: "conv6-2/dwise-se-fc2/shift" 2862 | } 2863 | layer { 2864 | name: "conv6-2/dwise-se-fc2/shift-div" 2865 | type: "Power" 2866 | bottom: "conv6-2/dwise-se-fc2/shift" 2867 | top: "conv6-2/dwise-se-fc2/shift-div" 2868 | power_param { 2869 | power: 1 2870 | scale: 0.1666666667 2871 | shift: 0 2872 | } 2873 | } 2874 | layer { 2875 | name: "conv6-2/dwise/scale" 2876 | type: "Scale" 2877 | bottom: "conv6-2/dwise" 2878 | bottom: "conv6-2/dwise-se-fc2/shift-div" 2879 | top: "conv6-2/dwise/scale" 2880 | scale_param{ 2881 | axis: 0 2882 | } 2883 | } 2884 | # H-swish 2885 | layer { 2886 | name: "conv6-2/dwise/shift" 2887 | type: "Power" 2888 | bottom: "conv6-2/dwise/scale" 2889 | top: "conv6-2/dwise/shift" 2890 | power_param { 2891 | power: 1 2892 | scale: 1 2893 | shift: 3 2894 | } 2895 | } 2896 | layer { 2897 | name: "conv6-2/dwise/shift-relu" 2898 | type: "ReLU6" 2899 | bottom: "conv6-2/dwise/shift" 2900 | top: "conv6-2/dwise/shift" 2901 | } 2902 | layer { 2903 | name: "conv6-2/dwise/shift-div" 2904 | type: "Power" 2905 | bottom: "conv6-2/dwise/shift" 2906 | top: "conv6-2/dwise/shift-div" 2907 | power_param { 2908 | power: 1 2909 | scale: 0.1666666667 2910 | shift: 0 2911 | } 2912 | } 2913 | layer { 2914 | name: "conv6-2/dwise/hswish" 2915 | type: "Eltwise" 2916 | bottom: "conv6-2/dwise/scale" 2917 | bottom: "conv6-2/dwise/shift-div" 2918 | top: "conv6-2/dwise/hswish" 2919 | eltwise_param { 2920 | operation: PROD 2921 | } 2922 | } 2923 | 2924 | layer { 2925 | name: "conv6-2/linear" 2926 | type: "Convolution" 2927 | bottom: "conv6-2/dwise/hswish" 2928 | top: "conv6-2/linear" 2929 | param { 2930 | lr_mult: 1 2931 | decay_mult: 1 2932 | } 2933 | convolution_param { 2934 | num_output: 96 2935 | pad: 0 2936 | bias_term: false 2937 | kernel_size: 1 2938 | stride: 1 2939 | weight_filler { 2940 | type: "msra" 2941 | } 2942 | } 2943 | } 2944 | layer { 2945 | name: "conv6-2/linear-bn" 2946 | type: "BatchNorm" 2947 | bottom: "conv6-2/linear" 2948 | top: "conv6-2/linear" 2949 | } 2950 | layer { 2951 | name: "conv6-2/linear-bn-scale" 2952 | type: "Scale" 2953 | bottom: "conv6-2/linear" 2954 | top: "conv6-2/linear" 2955 | scale_param { 2956 | bias_term: true 2957 | } 2958 | } 2959 | 2960 | layer { 2961 | name: "block6-2" 2962 | type: "Eltwise" 2963 | bottom: "block6-1" 2964 | bottom: "conv6-2/linear" 2965 | top: "block6-2" 2966 | } 2967 | 2968 | #################### stage 6-3 #################### 2969 | layer { 2970 | name: "conv6-3" 2971 | type: "Convolution" 2972 | bottom: "block6-2" 2973 | top: "conv6-3" 2974 | param { 2975 | lr_mult: 1 2976 | decay_mult: 1 2977 | } 2978 | convolution_param { 2979 | num_output: 576 2980 | pad: 0 2981 | bias_term: false 2982 | kernel_size: 1 2983 | stride: 1 2984 | weight_filler { 2985 | type: "msra" 2986 | } 2987 | } 2988 | } 2989 | layer { 2990 | name: "conv6-3-bn" 2991 | type: "BatchNorm" 2992 | bottom: "conv6-3" 2993 | top: "conv6-3" 2994 | } 2995 | layer { 2996 | name: "conv6-3-bn-scale" 2997 | type: "Scale" 2998 | bottom: "conv6-3" 2999 | top: "conv6-3" 3000 | scale_param { 3001 | bias_term: true 3002 | } 3003 | } 3004 | 3005 | # se 3006 | layer { 3007 | name: "conv6-3-se-pool" 3008 | type: "Pooling" 3009 | bottom: "conv6-3" 3010 | top: "conv6-3-se-pool" 3011 | pooling_param { 3012 | pool: AVE 3013 | global_pooling: true 3014 | } 3015 | } 3016 | layer { 3017 | name: "conv6-3-se-fc1" 3018 | type: "InnerProduct" 3019 | bottom: "conv6-3-se-pool" 3020 | top:"conv6-3-se-fc1" 3021 | param { 3022 | lr_mult: 1 3023 | decay_mult: 1 3024 | } 3025 | param { 3026 | lr_mult: 2 3027 | decay_mult: 0 3028 | } 3029 | inner_product_param { 3030 | num_output: 144 3031 | weight_filler { 3032 | type: "msra" 3033 | } 3034 | bias_filler { 3035 | type: "constant" 3036 | value: 0 3037 | } 3038 | } 3039 | } 3040 | layer { 3041 | name: "conv6-3-se-fc1-relu" 3042 | type: "ReLU6" 3043 | bottom: "conv6-3-se-fc1" 3044 | top: "conv6-3-se-fc1" 3045 | } 3046 | layer { 3047 | name: "conv6-3-se-fc2" 3048 | type: "InnerProduct" 3049 | bottom: "conv6-3-se-fc1" 3050 | top:"conv6-3-se-fc2" 3051 | param { 3052 | lr_mult: 1 3053 | decay_mult: 1 3054 | } 3055 | param { 3056 | lr_mult: 2 3057 | decay_mult: 0 3058 | } 3059 | inner_product_param { 3060 | num_output: 576 3061 | weight_filler { 3062 | type: "msra" 3063 | } 3064 | bias_filler { 3065 | type: "constant" 3066 | value: 0 3067 | } 3068 | } 3069 | } 3070 | # H-sigmoid 3071 | layer { 3072 | name: "conv6-3-se-fc2/shift" 3073 | type: "Power" 3074 | bottom: "conv6-3-se-fc2" 3075 | top: "conv6-3-se-fc2/shift" 3076 | power_param { 3077 | power: 1 3078 | scale: 1 3079 | shift: 3 3080 | } 3081 | } 3082 | layer { 3083 | name: "conv6-3-se-fc2/shift-relu" 3084 | type: "ReLU6" 3085 | bottom: "conv6-3-se-fc2/shift" 3086 | top: "conv6-3-se-fc2/shift" 3087 | } 3088 | layer { 3089 | name: "conv6-3-se-fc2/shift-div" 3090 | type: "Power" 3091 | bottom: "conv6-3-se-fc2/shift" 3092 | top: "conv6-3-se-fc2/shift-div" 3093 | power_param { 3094 | power: 1 3095 | scale: 0.1666666667 3096 | shift: 0 3097 | } 3098 | } 3099 | layer { 3100 | name: "conv6-3/scale" 3101 | type: "Scale" 3102 | bottom: "conv6-3" 3103 | bottom: "conv6-3-se-fc2/shift-div" 3104 | top: "conv6-3/scale" 3105 | scale_param{ 3106 | axis: 0 3107 | } 3108 | } 3109 | # H-swish 3110 | layer { 3111 | name: "conv6-3/shift" 3112 | type: "Power" 3113 | bottom: "conv6-3/scale" 3114 | top: "conv6-3/shift" 3115 | power_param { 3116 | power: 1 3117 | scale: 1 3118 | shift: 3 3119 | } 3120 | } 3121 | layer { 3122 | name: "conv6-3/shift-relu" 3123 | type: "ReLU6" 3124 | bottom: "conv6-3/shift" 3125 | top: "conv6-3/shift" 3126 | } 3127 | layer { 3128 | name: "conv6-3/shift-div" 3129 | type: "Power" 3130 | bottom: "conv6-3/shift" 3131 | top: "conv6-3/shift-div" 3132 | power_param { 3133 | power: 1 3134 | scale: 0.1666666667 3135 | shift: 0 3136 | } 3137 | } 3138 | layer { 3139 | name: "conv6-3/hswish" 3140 | type: "Eltwise" 3141 | bottom: "conv6-3/scale" 3142 | bottom: "conv6-3/shift-div" 3143 | top: "conv6-3/hswish" 3144 | eltwise_param { 3145 | operation: PROD 3146 | } 3147 | } 3148 | 3149 | #################### stage 7-1 #################### 3150 | layer { 3151 | name: "pool7-1" 3152 | type: "Pooling" 3153 | bottom: "conv6-3/hswish" 3154 | top: "pool7-1" 3155 | pooling_param { 3156 | pool: AVE 3157 | global_pooling: true 3158 | } 3159 | } 3160 | # H-swish 3161 | layer { 3162 | name: "pool7-1/shift" 3163 | type: "Power" 3164 | bottom: "pool7-1" 3165 | top: "pool7-1/shift" 3166 | power_param { 3167 | power: 1 3168 | scale: 1 3169 | shift: 3 3170 | } 3171 | } 3172 | layer { 3173 | name: "pool7-1/shift-relu" 3174 | type: "ReLU6" 3175 | bottom: "pool7-1/shift" 3176 | top: "pool7-1/shift" 3177 | } 3178 | layer { 3179 | name: "pool7-1/shift-div" 3180 | type: "Power" 3181 | bottom: "pool7-1/shift" 3182 | top: "pool7-1/shift-div" 3183 | power_param { 3184 | power: 1 3185 | scale: 0.1666666667 3186 | shift: 0 3187 | } 3188 | } 3189 | layer { 3190 | name: "pool7-1/hswish" 3191 | type: "Eltwise" 3192 | bottom: "pool7-1" 3193 | bottom: "pool7-1/shift-div" 3194 | top: "pool7-1/hswish" 3195 | eltwise_param { 3196 | operation: PROD 3197 | } 3198 | } 3199 | 3200 | #################### stage 7-2 #################### 3201 | layer { 3202 | name: "conv7-2" 3203 | type: "Convolution" 3204 | bottom: "pool7-1/hswish" 3205 | top: "conv7-2" 3206 | param { 3207 | lr_mult: 1 3208 | decay_mult: 1 3209 | } 3210 | convolution_param { 3211 | num_output: 1280 3212 | pad: 0 3213 | bias_term: false 3214 | kernel_size: 1 3215 | stride: 1 3216 | weight_filler { 3217 | type: "msra" 3218 | } 3219 | } 3220 | } 3221 | layer { 3222 | name: "conv7-2-bn" 3223 | type: "BatchNorm" 3224 | bottom: "conv7-2" 3225 | top: "conv7-2" 3226 | } 3227 | layer { 3228 | name: "conv7-2-bn-scale" 3229 | type: "Scale" 3230 | bottom: "conv7-2" 3231 | top: "conv7-2" 3232 | scale_param { 3233 | bias_term: true 3234 | } 3235 | } 3236 | # H-swish 3237 | layer { 3238 | name: "conv7-2/shift" 3239 | type: "Power" 3240 | bottom: "conv7-2" 3241 | top: "conv7-2/shift" 3242 | power_param { 3243 | power: 1 3244 | scale: 1 3245 | shift: 3 3246 | } 3247 | } 3248 | layer { 3249 | name: "conv7-2/shift-relu" 3250 | type: "ReLU6" 3251 | bottom: "conv7-2/shift" 3252 | top: "conv7-2/shift" 3253 | } 3254 | layer { 3255 | name: "conv7-2/shift-div" 3256 | type: "Power" 3257 | bottom: "conv7-2/shift" 3258 | top: "conv7-2/shift-div" 3259 | power_param { 3260 | power: 1 3261 | scale: 0.1666666667 3262 | shift: 0 3263 | } 3264 | } 3265 | layer { 3266 | name: "conv7-2/hswish" 3267 | type: "Eltwise" 3268 | bottom: "conv7-2" 3269 | bottom: "conv7-2/shift-div" 3270 | top: "conv7-2/hswish" 3271 | eltwise_param { 3272 | operation: PROD 3273 | } 3274 | } 3275 | 3276 | #################### output #################### 3277 | layer { 3278 | name: "conv7-3" 3279 | type: "Convolution" 3280 | bottom: "conv7-2/hswish" 3281 | top: "conv7-3" 3282 | param { 3283 | lr_mult: 1 3284 | decay_mult: 1 3285 | } 3286 | convolution_param { 3287 | num_output: 1000 3288 | pad: 0 3289 | bias_term: false 3290 | kernel_size: 1 3291 | stride: 1 3292 | weight_filler { 3293 | type: "msra" 3294 | } 3295 | } 3296 | } 3297 | layer { 3298 | name: "conv7-3-bn" 3299 | type: "BatchNorm" 3300 | bottom: "conv7-3" 3301 | top: "conv7-3" 3302 | } 3303 | layer { 3304 | name: "conv7-3-bn-scale" 3305 | type: "Scale" 3306 | bottom: "conv7-3" 3307 | top: "conv7-3" 3308 | scale_param { 3309 | bias_term: true 3310 | } 3311 | } 3312 | # H-swish 3313 | layer { 3314 | name: "conv7-3/shift" 3315 | type: "Power" 3316 | bottom: "conv7-3" 3317 | top: "conv7-3/shift" 3318 | power_param { 3319 | power: 1 3320 | scale: 1 3321 | shift: 3 3322 | } 3323 | } 3324 | layer { 3325 | name: "conv7-3/shift-relu" 3326 | type: "ReLU6" 3327 | bottom: "conv7-3/shift" 3328 | top: "conv7-3/shift" 3329 | } 3330 | layer { 3331 | name: "conv7-3/shift-div" 3332 | type: "Power" 3333 | bottom: "conv7-3/shift" 3334 | top: "conv7-3/shift-div" 3335 | power_param { 3336 | power: 1 3337 | scale: 0.1666666667 3338 | shift: 0 3339 | } 3340 | } 3341 | layer { 3342 | name: "conv7-3/hswish" 3343 | type: "Eltwise" 3344 | bottom: "conv7-3" 3345 | bottom: "conv7-3/shift-div" 3346 | top: "conv7-3/hswish" 3347 | eltwise_param { 3348 | operation: PROD 3349 | } 3350 | } 3351 | 3352 | layer { 3353 | name: "prob" 3354 | type: "Softmax" 3355 | bottom: "conv7-3/hswish" 3356 | top: "prob" 3357 | } 3358 | --------------------------------------------------------------------------------