├── LICENSE ├── README.md ├── SqueezeNet_v1.0 ├── deploy.prototxt ├── solver.prototxt ├── squeezenet_v1.0.caffemodel └── train_val.prototxt └── SqueezeNet_v1.1 ├── README.md ├── deploy.prototxt ├── solver.prototxt ├── squeezenet_v1.1.caffemodel └── train_val.prototxt /LICENSE: -------------------------------------------------------------------------------- 1 | BSD LICENSE. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted 4 | provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions 7 | and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions 10 | and the following disclaimer in the documentation and/or other materials provided with the 11 | distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 15 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 16 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 17 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 18 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 19 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 20 | THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | The Caffe-compatible files that you are probably looking for: 3 | 4 | SqueezeNet_v1.0/train_val.prototxt #model architecture 5 | SqueezeNet_v1.0/solver.prototxt #additional training details (learning rate schedule, etc.) 6 | SqueezeNet_v1.0/squeezenet_v1.0.caffemodel #pretrained model parameters 7 | 8 | If you find SqueezeNet useful in your research, please consider citing the [SqueezeNet paper](http://arxiv.org/abs/1602.07360): 9 | 10 | @article{SqueezeNet, 11 | Author = {Forrest N. Iandola and Song Han and Matthew W. Moskewicz and Khalid Ashraf and William J. Dally and Kurt Keutzer}, 12 | Title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and $<$0.5MB model size}, 13 | Journal = {arXiv:1602.07360}, 14 | Year = {2016} 15 | } 16 | 17 | 18 | Helpful hints: 19 | 20 | 1. **Getting the SqueezeNet model:** `git clone `. 21 | In this repository, we include Caffe-compatible files for the model architecture, the solver configuration, and the pretrained model (4.8MB uncompressed). 22 | 23 | 2. **Batch size.** We have experimented with batch sizes ranging from 32 to 1024. In this repo, our default batch size is 512. If implemented naively on a single GPU, a batch size this large may result in running out of memory. An effective workaround is to use hierarchical batching (sometimes called "delayed batching"). Caffe supports hierarchical batching by doing `train_val.prototxt>batch_size` training samples concurrently in memory. After `solver.prototxt>iter_size` iterations, the gradients are summed and the model is updated. Mathematically, the batch size is `batch_size * iter_size`. In the included prototxt files, we have set `(batch_size=32, iter_size=16)`, but any combination of batch_size and iter_size that multiply to 512 will produce eqivalent results. In fact, with the same random number generator seed, the model will be fully reproducable if trained multiple times. Finally, note that in Caffe `iter_size` is applied while training on the training set but not while testing on the test set. 24 | 25 | 3. **Implementing Fire modules.** In the paper, we describe the `expand` portion of the Fire layer as a collection of 1x1 and 3x3 filters. Caffe does not natively support a convolution layer that has multiple filter sizes. To work around this, we implement `expand1x1` and `expand3x3` layers and concatenate the results together in the channel dimension. 26 | 27 | 4. **The SqueezeNet team has released a few variants of SqueezeNet**. Each of these include pretrained models, and the non-compressed versions include training protocols, too. 28 | 29 | SqueezeNet v1.0 (in this repo), the base model described in our SqueezeNet paper. 30 | 31 | [Compressed SqueezeNet v1.0](https://github.com/songhan/SqueezeNet_compressed), as described in the SqueezeNet paper. 32 | 33 | [SqueezeNet v1.0 with Residual Connections](https://github.com/songhan/SqueezeNet-Residual), which delivers higher accuracy without increasing the model size. 34 | 35 | [SqueezeNet v1.0 with Dense→Sparse→Dense (DSD) Training](https://github.com/songhan/SqueezeNet-DSD-Training), which delivers higher accuracy without increasing the model size. 36 | 37 | SqueezeNet v1.1 (in this repo), which requires 2.4x less computation than SqueezeNet v1.0 without diminshing accuracy. 38 | 39 | 5. **Community adoption of SqueezeNet**: 40 | 41 | [SqueezeNet in the *MXNet* framework](https://github.com/haria/SqueezeNet), by Guo Haria 42 | 43 | [SqueezeNet in the *Chainer* framework](https://github.com/ejlb/squeezenet-chainer), by Eddie Bell 44 | 45 | [SqueezeNet in the *Keras* framework](https://github.com/DT42/squeezenet_demo), by [dt42.io](https://dt42.io/) 46 | 47 | [SqueezeNet in the *Tensorflow* framework](https://github.com/vonclites/squeezenet), by Domenick Poster 48 | 49 | [SqueezeNet in the *PyTorch* framework](https://github.com/pytorch/vision/blob/master/torchvision/models/squeezenet.py), by Marat Dukhan 50 | 51 | [SqueezeNet in the *CoreML* framework](https://github.com/mdering/CoreMLZoo) 52 | 53 | [Neural Art using SqueezeNet](https://github.com/pavelgonchar/neural-art-mini), by Pavel Gonchar 54 | 55 | [SqueezeNet compression in Ristretto](https://arxiv.org/abs/1605.06402), by Philipp Gysel 56 | 57 | **If you like SqueezeNet, you might also like SqueezeNext! ([SqueezeNext paper](https://arxiv.org/abs/1803.10615), [SqueezeNext code](https://github.com/amirgholami/SqueezeNext))** 58 | -------------------------------------------------------------------------------- /SqueezeNet_v1.0/deploy.prototxt: -------------------------------------------------------------------------------- 1 | # please cite: 2 | # @article{SqueezeNet, 3 | # Author = {Forrest N. Iandola and Matthew W. Moskewicz and Khalid Ashraf and Song Han and William J. Dally and Kurt Keutzer}, 4 | # Title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and $<$1MB model size}, 5 | # Journal = {arXiv:1602.07360}, 6 | # Year = {2016} 7 | #} 8 | 9 | input: "data" 10 | input_shape { 11 | dim: 10 12 | dim: 3 13 | dim: 227 14 | dim: 227 15 | } 16 | layer { 17 | name: "conv1" 18 | type: "Convolution" 19 | bottom: "data" 20 | top: "conv1" 21 | convolution_param { 22 | num_output: 96 23 | kernel_size: 7 24 | stride: 2 25 | } 26 | } 27 | layer { 28 | name: "relu_conv1" 29 | type: "ReLU" 30 | bottom: "conv1" 31 | top: "conv1" 32 | } 33 | layer { 34 | name: "pool1" 35 | type: "Pooling" 36 | bottom: "conv1" 37 | top: "pool1" 38 | pooling_param { 39 | pool: MAX 40 | kernel_size: 3 41 | stride: 2 42 | } 43 | } 44 | layer { 45 | name: "fire2/squeeze1x1" 46 | type: "Convolution" 47 | bottom: "pool1" 48 | top: "fire2/squeeze1x1" 49 | convolution_param { 50 | num_output: 16 51 | kernel_size: 1 52 | } 53 | } 54 | layer { 55 | name: "fire2/relu_squeeze1x1" 56 | type: "ReLU" 57 | bottom: "fire2/squeeze1x1" 58 | top: "fire2/squeeze1x1" 59 | } 60 | layer { 61 | name: "fire2/expand1x1" 62 | type: "Convolution" 63 | bottom: "fire2/squeeze1x1" 64 | top: "fire2/expand1x1" 65 | convolution_param { 66 | num_output: 64 67 | kernel_size: 1 68 | } 69 | } 70 | layer { 71 | name: "fire2/relu_expand1x1" 72 | type: "ReLU" 73 | bottom: "fire2/expand1x1" 74 | top: "fire2/expand1x1" 75 | } 76 | layer { 77 | name: "fire2/expand3x3" 78 | type: "Convolution" 79 | bottom: "fire2/squeeze1x1" 80 | top: "fire2/expand3x3" 81 | convolution_param { 82 | num_output: 64 83 | pad: 1 84 | kernel_size: 3 85 | } 86 | } 87 | layer { 88 | name: "fire2/relu_expand3x3" 89 | type: "ReLU" 90 | bottom: "fire2/expand3x3" 91 | top: "fire2/expand3x3" 92 | } 93 | layer { 94 | name: "fire2/concat" 95 | type: "Concat" 96 | bottom: "fire2/expand1x1" 97 | bottom: "fire2/expand3x3" 98 | top: "fire2/concat" 99 | } 100 | layer { 101 | name: "fire3/squeeze1x1" 102 | type: "Convolution" 103 | bottom: "fire2/concat" 104 | top: "fire3/squeeze1x1" 105 | convolution_param { 106 | num_output: 16 107 | kernel_size: 1 108 | } 109 | } 110 | layer { 111 | name: "fire3/relu_squeeze1x1" 112 | type: "ReLU" 113 | bottom: "fire3/squeeze1x1" 114 | top: "fire3/squeeze1x1" 115 | } 116 | layer { 117 | name: "fire3/expand1x1" 118 | type: "Convolution" 119 | bottom: "fire3/squeeze1x1" 120 | top: "fire3/expand1x1" 121 | convolution_param { 122 | num_output: 64 123 | kernel_size: 1 124 | } 125 | } 126 | layer { 127 | name: "fire3/relu_expand1x1" 128 | type: "ReLU" 129 | bottom: "fire3/expand1x1" 130 | top: "fire3/expand1x1" 131 | } 132 | layer { 133 | name: "fire3/expand3x3" 134 | type: "Convolution" 135 | bottom: "fire3/squeeze1x1" 136 | top: "fire3/expand3x3" 137 | convolution_param { 138 | num_output: 64 139 | pad: 1 140 | kernel_size: 3 141 | } 142 | } 143 | layer { 144 | name: "fire3/relu_expand3x3" 145 | type: "ReLU" 146 | bottom: "fire3/expand3x3" 147 | top: "fire3/expand3x3" 148 | } 149 | layer { 150 | name: "fire3/concat" 151 | type: "Concat" 152 | bottom: "fire3/expand1x1" 153 | bottom: "fire3/expand3x3" 154 | top: "fire3/concat" 155 | } 156 | layer { 157 | name: "fire4/squeeze1x1" 158 | type: "Convolution" 159 | bottom: "fire3/concat" 160 | top: "fire4/squeeze1x1" 161 | convolution_param { 162 | num_output: 32 163 | kernel_size: 1 164 | } 165 | } 166 | layer { 167 | name: "fire4/relu_squeeze1x1" 168 | type: "ReLU" 169 | bottom: "fire4/squeeze1x1" 170 | top: "fire4/squeeze1x1" 171 | } 172 | layer { 173 | name: "fire4/expand1x1" 174 | type: "Convolution" 175 | bottom: "fire4/squeeze1x1" 176 | top: "fire4/expand1x1" 177 | convolution_param { 178 | num_output: 128 179 | kernel_size: 1 180 | } 181 | } 182 | layer { 183 | name: "fire4/relu_expand1x1" 184 | type: "ReLU" 185 | bottom: "fire4/expand1x1" 186 | top: "fire4/expand1x1" 187 | } 188 | layer { 189 | name: "fire4/expand3x3" 190 | type: "Convolution" 191 | bottom: "fire4/squeeze1x1" 192 | top: "fire4/expand3x3" 193 | convolution_param { 194 | num_output: 128 195 | pad: 1 196 | kernel_size: 3 197 | } 198 | } 199 | layer { 200 | name: "fire4/relu_expand3x3" 201 | type: "ReLU" 202 | bottom: "fire4/expand3x3" 203 | top: "fire4/expand3x3" 204 | } 205 | layer { 206 | name: "fire4/concat" 207 | type: "Concat" 208 | bottom: "fire4/expand1x1" 209 | bottom: "fire4/expand3x3" 210 | top: "fire4/concat" 211 | } 212 | layer { 213 | name: "pool4" 214 | type: "Pooling" 215 | bottom: "fire4/concat" 216 | top: "pool4" 217 | pooling_param { 218 | pool: MAX 219 | kernel_size: 3 220 | stride: 2 221 | } 222 | } 223 | layer { 224 | name: "fire5/squeeze1x1" 225 | type: "Convolution" 226 | bottom: "pool4" 227 | top: "fire5/squeeze1x1" 228 | convolution_param { 229 | num_output: 32 230 | kernel_size: 1 231 | } 232 | } 233 | layer { 234 | name: "fire5/relu_squeeze1x1" 235 | type: "ReLU" 236 | bottom: "fire5/squeeze1x1" 237 | top: "fire5/squeeze1x1" 238 | } 239 | layer { 240 | name: "fire5/expand1x1" 241 | type: "Convolution" 242 | bottom: "fire5/squeeze1x1" 243 | top: "fire5/expand1x1" 244 | convolution_param { 245 | num_output: 128 246 | kernel_size: 1 247 | } 248 | } 249 | layer { 250 | name: "fire5/relu_expand1x1" 251 | type: "ReLU" 252 | bottom: "fire5/expand1x1" 253 | top: "fire5/expand1x1" 254 | } 255 | layer { 256 | name: "fire5/expand3x3" 257 | type: "Convolution" 258 | bottom: "fire5/squeeze1x1" 259 | top: "fire5/expand3x3" 260 | convolution_param { 261 | num_output: 128 262 | pad: 1 263 | kernel_size: 3 264 | } 265 | } 266 | layer { 267 | name: "fire5/relu_expand3x3" 268 | type: "ReLU" 269 | bottom: "fire5/expand3x3" 270 | top: "fire5/expand3x3" 271 | } 272 | layer { 273 | name: "fire5/concat" 274 | type: "Concat" 275 | bottom: "fire5/expand1x1" 276 | bottom: "fire5/expand3x3" 277 | top: "fire5/concat" 278 | } 279 | layer { 280 | name: "fire6/squeeze1x1" 281 | type: "Convolution" 282 | bottom: "fire5/concat" 283 | top: "fire6/squeeze1x1" 284 | convolution_param { 285 | num_output: 48 286 | kernel_size: 1 287 | } 288 | } 289 | layer { 290 | name: "fire6/relu_squeeze1x1" 291 | type: "ReLU" 292 | bottom: "fire6/squeeze1x1" 293 | top: "fire6/squeeze1x1" 294 | } 295 | layer { 296 | name: "fire6/expand1x1" 297 | type: "Convolution" 298 | bottom: "fire6/squeeze1x1" 299 | top: "fire6/expand1x1" 300 | convolution_param { 301 | num_output: 192 302 | kernel_size: 1 303 | } 304 | } 305 | layer { 306 | name: "fire6/relu_expand1x1" 307 | type: "ReLU" 308 | bottom: "fire6/expand1x1" 309 | top: "fire6/expand1x1" 310 | } 311 | layer { 312 | name: "fire6/expand3x3" 313 | type: "Convolution" 314 | bottom: "fire6/squeeze1x1" 315 | top: "fire6/expand3x3" 316 | convolution_param { 317 | num_output: 192 318 | pad: 1 319 | kernel_size: 3 320 | } 321 | } 322 | layer { 323 | name: "fire6/relu_expand3x3" 324 | type: "ReLU" 325 | bottom: "fire6/expand3x3" 326 | top: "fire6/expand3x3" 327 | } 328 | layer { 329 | name: "fire6/concat" 330 | type: "Concat" 331 | bottom: "fire6/expand1x1" 332 | bottom: "fire6/expand3x3" 333 | top: "fire6/concat" 334 | } 335 | layer { 336 | name: "fire7/squeeze1x1" 337 | type: "Convolution" 338 | bottom: "fire6/concat" 339 | top: "fire7/squeeze1x1" 340 | convolution_param { 341 | num_output: 48 342 | kernel_size: 1 343 | } 344 | } 345 | layer { 346 | name: "fire7/relu_squeeze1x1" 347 | type: "ReLU" 348 | bottom: "fire7/squeeze1x1" 349 | top: "fire7/squeeze1x1" 350 | } 351 | layer { 352 | name: "fire7/expand1x1" 353 | type: "Convolution" 354 | bottom: "fire7/squeeze1x1" 355 | top: "fire7/expand1x1" 356 | convolution_param { 357 | num_output: 192 358 | kernel_size: 1 359 | } 360 | } 361 | layer { 362 | name: "fire7/relu_expand1x1" 363 | type: "ReLU" 364 | bottom: "fire7/expand1x1" 365 | top: "fire7/expand1x1" 366 | } 367 | layer { 368 | name: "fire7/expand3x3" 369 | type: "Convolution" 370 | bottom: "fire7/squeeze1x1" 371 | top: "fire7/expand3x3" 372 | convolution_param { 373 | num_output: 192 374 | pad: 1 375 | kernel_size: 3 376 | } 377 | } 378 | layer { 379 | name: "fire7/relu_expand3x3" 380 | type: "ReLU" 381 | bottom: "fire7/expand3x3" 382 | top: "fire7/expand3x3" 383 | } 384 | layer { 385 | name: "fire7/concat" 386 | type: "Concat" 387 | bottom: "fire7/expand1x1" 388 | bottom: "fire7/expand3x3" 389 | top: "fire7/concat" 390 | } 391 | layer { 392 | name: "fire8/squeeze1x1" 393 | type: "Convolution" 394 | bottom: "fire7/concat" 395 | top: "fire8/squeeze1x1" 396 | convolution_param { 397 | num_output: 64 398 | kernel_size: 1 399 | } 400 | } 401 | layer { 402 | name: "fire8/relu_squeeze1x1" 403 | type: "ReLU" 404 | bottom: "fire8/squeeze1x1" 405 | top: "fire8/squeeze1x1" 406 | } 407 | layer { 408 | name: "fire8/expand1x1" 409 | type: "Convolution" 410 | bottom: "fire8/squeeze1x1" 411 | top: "fire8/expand1x1" 412 | convolution_param { 413 | num_output: 256 414 | kernel_size: 1 415 | } 416 | } 417 | layer { 418 | name: "fire8/relu_expand1x1" 419 | type: "ReLU" 420 | bottom: "fire8/expand1x1" 421 | top: "fire8/expand1x1" 422 | } 423 | layer { 424 | name: "fire8/expand3x3" 425 | type: "Convolution" 426 | bottom: "fire8/squeeze1x1" 427 | top: "fire8/expand3x3" 428 | convolution_param { 429 | num_output: 256 430 | pad: 1 431 | kernel_size: 3 432 | } 433 | } 434 | layer { 435 | name: "fire8/relu_expand3x3" 436 | type: "ReLU" 437 | bottom: "fire8/expand3x3" 438 | top: "fire8/expand3x3" 439 | } 440 | layer { 441 | name: "fire8/concat" 442 | type: "Concat" 443 | bottom: "fire8/expand1x1" 444 | bottom: "fire8/expand3x3" 445 | top: "fire8/concat" 446 | } 447 | layer { 448 | name: "pool8" 449 | type: "Pooling" 450 | bottom: "fire8/concat" 451 | top: "pool8" 452 | pooling_param { 453 | pool: MAX 454 | kernel_size: 3 455 | stride: 2 456 | } 457 | } 458 | layer { 459 | name: "fire9/squeeze1x1" 460 | type: "Convolution" 461 | bottom: "pool8" 462 | top: "fire9/squeeze1x1" 463 | convolution_param { 464 | num_output: 64 465 | kernel_size: 1 466 | } 467 | } 468 | layer { 469 | name: "fire9/relu_squeeze1x1" 470 | type: "ReLU" 471 | bottom: "fire9/squeeze1x1" 472 | top: "fire9/squeeze1x1" 473 | } 474 | layer { 475 | name: "fire9/expand1x1" 476 | type: "Convolution" 477 | bottom: "fire9/squeeze1x1" 478 | top: "fire9/expand1x1" 479 | convolution_param { 480 | num_output: 256 481 | kernel_size: 1 482 | } 483 | } 484 | layer { 485 | name: "fire9/relu_expand1x1" 486 | type: "ReLU" 487 | bottom: "fire9/expand1x1" 488 | top: "fire9/expand1x1" 489 | } 490 | layer { 491 | name: "fire9/expand3x3" 492 | type: "Convolution" 493 | bottom: "fire9/squeeze1x1" 494 | top: "fire9/expand3x3" 495 | convolution_param { 496 | num_output: 256 497 | pad: 1 498 | kernel_size: 3 499 | } 500 | } 501 | layer { 502 | name: "fire9/relu_expand3x3" 503 | type: "ReLU" 504 | bottom: "fire9/expand3x3" 505 | top: "fire9/expand3x3" 506 | } 507 | layer { 508 | name: "fire9/concat" 509 | type: "Concat" 510 | bottom: "fire9/expand1x1" 511 | bottom: "fire9/expand3x3" 512 | top: "fire9/concat" 513 | } 514 | layer { 515 | name: "drop9" 516 | type: "Dropout" 517 | bottom: "fire9/concat" 518 | top: "fire9/concat" 519 | dropout_param { 520 | dropout_ratio: 0.5 521 | } 522 | } 523 | layer { 524 | name: "conv10" 525 | type: "Convolution" 526 | bottom: "fire9/concat" 527 | top: "conv10" 528 | convolution_param { 529 | num_output: 1000 530 | pad: 1 531 | kernel_size: 1 532 | } 533 | } 534 | layer { 535 | name: "relu_conv10" 536 | type: "ReLU" 537 | bottom: "conv10" 538 | top: "conv10" 539 | } 540 | layer { 541 | name: "pool10" 542 | type: "Pooling" 543 | bottom: "conv10" 544 | top: "pool10" 545 | pooling_param { 546 | pool: AVE 547 | global_pooling: true 548 | } 549 | } 550 | layer { 551 | name: "prob" 552 | type: "Softmax" 553 | bottom: "pool10" 554 | top: "prob" 555 | } 556 | -------------------------------------------------------------------------------- /SqueezeNet_v1.0/solver.prototxt: -------------------------------------------------------------------------------- 1 | # please cite: 2 | # @article{SqueezeNet, 3 | # Author = {Forrest N. Iandola and Matthew W. Moskewicz and Khalid Ashraf and Song Han and William J. Dally and Kurt Keutzer}, 4 | # Title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and $<$1MB model size}, 5 | # Journal = {arXiv:1602.07360}, 6 | # Year = {2016} 7 | # } 8 | 9 | test_iter: 2000 #not subject to iter_size 10 | test_interval: 1000 11 | base_lr: 0.04 12 | display: 40 13 | max_iter: 170000 14 | iter_size: 16 #global batch size = batch_size * iter_size 15 | lr_policy: "poly" 16 | power: 1.0 #linearly decrease LR 17 | momentum: 0.9 18 | weight_decay: 0.0002 19 | snapshot: 1000 20 | snapshot_prefix: "train" 21 | solver_mode: GPU 22 | random_seed: 42 23 | net: "train_val.prototxt" #we typically do `cd SqueezeNet_v1.0; caffe train ` 24 | test_initialization: false 25 | average_loss: 40 26 | -------------------------------------------------------------------------------- /SqueezeNet_v1.0/squeezenet_v1.0.caffemodel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forresti/SqueezeNet/51147dc0681638c28aad593b9e923f3500117125/SqueezeNet_v1.0/squeezenet_v1.0.caffemodel -------------------------------------------------------------------------------- /SqueezeNet_v1.0/train_val.prototxt: -------------------------------------------------------------------------------- 1 | # please cite: 2 | # @article{SqueezeNet, 3 | # Author = {Forrest N. Iandola and Matthew W. Moskewicz and Khalid Ashraf and Song Han and William J. Dally and Kurt Keutzer}, 4 | # Title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and $<$1MB model size}, 5 | # Journal = {arXiv:1602.07360}, 6 | # Year = {2016} 7 | # } 8 | layer { 9 | name: "data" 10 | type: "Data" 11 | top: "data" 12 | top: "label" 13 | include { 14 | phase: TRAIN 15 | } 16 | transform_param { 17 | crop_size: 227 18 | mean_value: 104 19 | mean_value: 117 20 | mean_value: 123 21 | } 22 | data_param { 23 | source: "examples/imagenet/ilsvrc12_train_lmdb" 24 | batch_size: 32 #*iter_size 25 | backend: LMDB 26 | } 27 | } 28 | layer { 29 | name: "data" 30 | type: "Data" 31 | top: "data" 32 | top: "label" 33 | include { 34 | phase: TEST 35 | } 36 | transform_param { 37 | crop_size: 227 38 | mean_value: 104 39 | mean_value: 117 40 | mean_value: 123 41 | } 42 | data_param { 43 | source: "examples/imagenet/ilsvrc12_val_lmdb" 44 | batch_size: 25 #not *iter_size 45 | backend: LMDB 46 | } 47 | } 48 | layer { 49 | name: "conv1" 50 | type: "Convolution" 51 | bottom: "data" 52 | top: "conv1" 53 | convolution_param { 54 | num_output: 96 55 | kernel_size: 7 56 | stride: 2 57 | weight_filler { 58 | type: "xavier" 59 | } 60 | } 61 | } 62 | layer { 63 | name: "relu_conv1" 64 | type: "ReLU" 65 | bottom: "conv1" 66 | top: "conv1" 67 | } 68 | layer { 69 | name: "pool1" 70 | type: "Pooling" 71 | bottom: "conv1" 72 | top: "pool1" 73 | pooling_param { 74 | pool: MAX 75 | kernel_size: 3 76 | stride: 2 77 | } 78 | } 79 | layer { 80 | name: "fire2/squeeze1x1" 81 | type: "Convolution" 82 | bottom: "pool1" 83 | top: "fire2/squeeze1x1" 84 | convolution_param { 85 | num_output: 16 86 | kernel_size: 1 87 | weight_filler { 88 | type: "xavier" 89 | } 90 | } 91 | } 92 | layer { 93 | name: "fire2/relu_squeeze1x1" 94 | type: "ReLU" 95 | bottom: "fire2/squeeze1x1" 96 | top: "fire2/squeeze1x1" 97 | } 98 | layer { 99 | name: "fire2/expand1x1" 100 | type: "Convolution" 101 | bottom: "fire2/squeeze1x1" 102 | top: "fire2/expand1x1" 103 | convolution_param { 104 | num_output: 64 105 | kernel_size: 1 106 | weight_filler { 107 | type: "xavier" 108 | } 109 | } 110 | } 111 | layer { 112 | name: "fire2/relu_expand1x1" 113 | type: "ReLU" 114 | bottom: "fire2/expand1x1" 115 | top: "fire2/expand1x1" 116 | } 117 | layer { 118 | name: "fire2/expand3x3" 119 | type: "Convolution" 120 | bottom: "fire2/squeeze1x1" 121 | top: "fire2/expand3x3" 122 | convolution_param { 123 | num_output: 64 124 | pad: 1 125 | kernel_size: 3 126 | weight_filler { 127 | type: "xavier" 128 | } 129 | } 130 | } 131 | layer { 132 | name: "fire2/relu_expand3x3" 133 | type: "ReLU" 134 | bottom: "fire2/expand3x3" 135 | top: "fire2/expand3x3" 136 | } 137 | layer { 138 | name: "fire2/concat" 139 | type: "Concat" 140 | bottom: "fire2/expand1x1" 141 | bottom: "fire2/expand3x3" 142 | top: "fire2/concat" 143 | } 144 | layer { 145 | name: "fire3/squeeze1x1" 146 | type: "Convolution" 147 | bottom: "fire2/concat" 148 | top: "fire3/squeeze1x1" 149 | convolution_param { 150 | num_output: 16 151 | kernel_size: 1 152 | weight_filler { 153 | type: "xavier" 154 | } 155 | } 156 | } 157 | layer { 158 | name: "fire3/relu_squeeze1x1" 159 | type: "ReLU" 160 | bottom: "fire3/squeeze1x1" 161 | top: "fire3/squeeze1x1" 162 | } 163 | layer { 164 | name: "fire3/expand1x1" 165 | type: "Convolution" 166 | bottom: "fire3/squeeze1x1" 167 | top: "fire3/expand1x1" 168 | convolution_param { 169 | num_output: 64 170 | kernel_size: 1 171 | weight_filler { 172 | type: "xavier" 173 | } 174 | } 175 | } 176 | layer { 177 | name: "fire3/relu_expand1x1" 178 | type: "ReLU" 179 | bottom: "fire3/expand1x1" 180 | top: "fire3/expand1x1" 181 | } 182 | layer { 183 | name: "fire3/expand3x3" 184 | type: "Convolution" 185 | bottom: "fire3/squeeze1x1" 186 | top: "fire3/expand3x3" 187 | convolution_param { 188 | num_output: 64 189 | pad: 1 190 | kernel_size: 3 191 | weight_filler { 192 | type: "xavier" 193 | } 194 | } 195 | } 196 | layer { 197 | name: "fire3/relu_expand3x3" 198 | type: "ReLU" 199 | bottom: "fire3/expand3x3" 200 | top: "fire3/expand3x3" 201 | } 202 | layer { 203 | name: "fire3/concat" 204 | type: "Concat" 205 | bottom: "fire3/expand1x1" 206 | bottom: "fire3/expand3x3" 207 | top: "fire3/concat" 208 | } 209 | layer { 210 | name: "fire4/squeeze1x1" 211 | type: "Convolution" 212 | bottom: "fire3/concat" 213 | top: "fire4/squeeze1x1" 214 | convolution_param { 215 | num_output: 32 216 | kernel_size: 1 217 | weight_filler { 218 | type: "xavier" 219 | } 220 | } 221 | } 222 | layer { 223 | name: "fire4/relu_squeeze1x1" 224 | type: "ReLU" 225 | bottom: "fire4/squeeze1x1" 226 | top: "fire4/squeeze1x1" 227 | } 228 | layer { 229 | name: "fire4/expand1x1" 230 | type: "Convolution" 231 | bottom: "fire4/squeeze1x1" 232 | top: "fire4/expand1x1" 233 | convolution_param { 234 | num_output: 128 235 | kernel_size: 1 236 | weight_filler { 237 | type: "xavier" 238 | } 239 | } 240 | } 241 | layer { 242 | name: "fire4/relu_expand1x1" 243 | type: "ReLU" 244 | bottom: "fire4/expand1x1" 245 | top: "fire4/expand1x1" 246 | } 247 | layer { 248 | name: "fire4/expand3x3" 249 | type: "Convolution" 250 | bottom: "fire4/squeeze1x1" 251 | top: "fire4/expand3x3" 252 | convolution_param { 253 | num_output: 128 254 | pad: 1 255 | kernel_size: 3 256 | weight_filler { 257 | type: "xavier" 258 | } 259 | } 260 | } 261 | layer { 262 | name: "fire4/relu_expand3x3" 263 | type: "ReLU" 264 | bottom: "fire4/expand3x3" 265 | top: "fire4/expand3x3" 266 | } 267 | layer { 268 | name: "fire4/concat" 269 | type: "Concat" 270 | bottom: "fire4/expand1x1" 271 | bottom: "fire4/expand3x3" 272 | top: "fire4/concat" 273 | } 274 | layer { 275 | name: "pool4" 276 | type: "Pooling" 277 | bottom: "fire4/concat" 278 | top: "pool4" 279 | pooling_param { 280 | pool: MAX 281 | kernel_size: 3 282 | stride: 2 283 | } 284 | } 285 | layer { 286 | name: "fire5/squeeze1x1" 287 | type: "Convolution" 288 | bottom: "pool4" 289 | top: "fire5/squeeze1x1" 290 | convolution_param { 291 | num_output: 32 292 | kernel_size: 1 293 | weight_filler { 294 | type: "xavier" 295 | } 296 | } 297 | } 298 | layer { 299 | name: "fire5/relu_squeeze1x1" 300 | type: "ReLU" 301 | bottom: "fire5/squeeze1x1" 302 | top: "fire5/squeeze1x1" 303 | } 304 | layer { 305 | name: "fire5/expand1x1" 306 | type: "Convolution" 307 | bottom: "fire5/squeeze1x1" 308 | top: "fire5/expand1x1" 309 | convolution_param { 310 | num_output: 128 311 | kernel_size: 1 312 | weight_filler { 313 | type: "xavier" 314 | } 315 | } 316 | } 317 | layer { 318 | name: "fire5/relu_expand1x1" 319 | type: "ReLU" 320 | bottom: "fire5/expand1x1" 321 | top: "fire5/expand1x1" 322 | } 323 | layer { 324 | name: "fire5/expand3x3" 325 | type: "Convolution" 326 | bottom: "fire5/squeeze1x1" 327 | top: "fire5/expand3x3" 328 | convolution_param { 329 | num_output: 128 330 | pad: 1 331 | kernel_size: 3 332 | weight_filler { 333 | type: "xavier" 334 | } 335 | } 336 | } 337 | layer { 338 | name: "fire5/relu_expand3x3" 339 | type: "ReLU" 340 | bottom: "fire5/expand3x3" 341 | top: "fire5/expand3x3" 342 | } 343 | layer { 344 | name: "fire5/concat" 345 | type: "Concat" 346 | bottom: "fire5/expand1x1" 347 | bottom: "fire5/expand3x3" 348 | top: "fire5/concat" 349 | } 350 | layer { 351 | name: "fire6/squeeze1x1" 352 | type: "Convolution" 353 | bottom: "fire5/concat" 354 | top: "fire6/squeeze1x1" 355 | convolution_param { 356 | num_output: 48 357 | kernel_size: 1 358 | weight_filler { 359 | type: "xavier" 360 | } 361 | } 362 | } 363 | layer { 364 | name: "fire6/relu_squeeze1x1" 365 | type: "ReLU" 366 | bottom: "fire6/squeeze1x1" 367 | top: "fire6/squeeze1x1" 368 | } 369 | layer { 370 | name: "fire6/expand1x1" 371 | type: "Convolution" 372 | bottom: "fire6/squeeze1x1" 373 | top: "fire6/expand1x1" 374 | convolution_param { 375 | num_output: 192 376 | kernel_size: 1 377 | weight_filler { 378 | type: "xavier" 379 | } 380 | } 381 | } 382 | layer { 383 | name: "fire6/relu_expand1x1" 384 | type: "ReLU" 385 | bottom: "fire6/expand1x1" 386 | top: "fire6/expand1x1" 387 | } 388 | layer { 389 | name: "fire6/expand3x3" 390 | type: "Convolution" 391 | bottom: "fire6/squeeze1x1" 392 | top: "fire6/expand3x3" 393 | convolution_param { 394 | num_output: 192 395 | pad: 1 396 | kernel_size: 3 397 | weight_filler { 398 | type: "xavier" 399 | } 400 | } 401 | } 402 | layer { 403 | name: "fire6/relu_expand3x3" 404 | type: "ReLU" 405 | bottom: "fire6/expand3x3" 406 | top: "fire6/expand3x3" 407 | } 408 | layer { 409 | name: "fire6/concat" 410 | type: "Concat" 411 | bottom: "fire6/expand1x1" 412 | bottom: "fire6/expand3x3" 413 | top: "fire6/concat" 414 | } 415 | layer { 416 | name: "fire7/squeeze1x1" 417 | type: "Convolution" 418 | bottom: "fire6/concat" 419 | top: "fire7/squeeze1x1" 420 | convolution_param { 421 | num_output: 48 422 | kernel_size: 1 423 | weight_filler { 424 | type: "xavier" 425 | } 426 | } 427 | } 428 | layer { 429 | name: "fire7/relu_squeeze1x1" 430 | type: "ReLU" 431 | bottom: "fire7/squeeze1x1" 432 | top: "fire7/squeeze1x1" 433 | } 434 | layer { 435 | name: "fire7/expand1x1" 436 | type: "Convolution" 437 | bottom: "fire7/squeeze1x1" 438 | top: "fire7/expand1x1" 439 | convolution_param { 440 | num_output: 192 441 | kernel_size: 1 442 | weight_filler { 443 | type: "xavier" 444 | } 445 | } 446 | } 447 | layer { 448 | name: "fire7/relu_expand1x1" 449 | type: "ReLU" 450 | bottom: "fire7/expand1x1" 451 | top: "fire7/expand1x1" 452 | } 453 | layer { 454 | name: "fire7/expand3x3" 455 | type: "Convolution" 456 | bottom: "fire7/squeeze1x1" 457 | top: "fire7/expand3x3" 458 | convolution_param { 459 | num_output: 192 460 | pad: 1 461 | kernel_size: 3 462 | weight_filler { 463 | type: "xavier" 464 | } 465 | } 466 | } 467 | layer { 468 | name: "fire7/relu_expand3x3" 469 | type: "ReLU" 470 | bottom: "fire7/expand3x3" 471 | top: "fire7/expand3x3" 472 | } 473 | layer { 474 | name: "fire7/concat" 475 | type: "Concat" 476 | bottom: "fire7/expand1x1" 477 | bottom: "fire7/expand3x3" 478 | top: "fire7/concat" 479 | } 480 | layer { 481 | name: "fire8/squeeze1x1" 482 | type: "Convolution" 483 | bottom: "fire7/concat" 484 | top: "fire8/squeeze1x1" 485 | convolution_param { 486 | num_output: 64 487 | kernel_size: 1 488 | weight_filler { 489 | type: "xavier" 490 | } 491 | } 492 | } 493 | layer { 494 | name: "fire8/relu_squeeze1x1" 495 | type: "ReLU" 496 | bottom: "fire8/squeeze1x1" 497 | top: "fire8/squeeze1x1" 498 | } 499 | layer { 500 | name: "fire8/expand1x1" 501 | type: "Convolution" 502 | bottom: "fire8/squeeze1x1" 503 | top: "fire8/expand1x1" 504 | convolution_param { 505 | num_output: 256 506 | kernel_size: 1 507 | weight_filler { 508 | type: "xavier" 509 | } 510 | } 511 | } 512 | layer { 513 | name: "fire8/relu_expand1x1" 514 | type: "ReLU" 515 | bottom: "fire8/expand1x1" 516 | top: "fire8/expand1x1" 517 | } 518 | layer { 519 | name: "fire8/expand3x3" 520 | type: "Convolution" 521 | bottom: "fire8/squeeze1x1" 522 | top: "fire8/expand3x3" 523 | convolution_param { 524 | num_output: 256 525 | pad: 1 526 | kernel_size: 3 527 | weight_filler { 528 | type: "xavier" 529 | } 530 | } 531 | } 532 | layer { 533 | name: "fire8/relu_expand3x3" 534 | type: "ReLU" 535 | bottom: "fire8/expand3x3" 536 | top: "fire8/expand3x3" 537 | } 538 | layer { 539 | name: "fire8/concat" 540 | type: "Concat" 541 | bottom: "fire8/expand1x1" 542 | bottom: "fire8/expand3x3" 543 | top: "fire8/concat" 544 | } 545 | layer { 546 | name: "pool8" 547 | type: "Pooling" 548 | bottom: "fire8/concat" 549 | top: "pool8" 550 | pooling_param { 551 | pool: MAX 552 | kernel_size: 3 553 | stride: 2 554 | } 555 | } 556 | layer { 557 | name: "fire9/squeeze1x1" 558 | type: "Convolution" 559 | bottom: "pool8" 560 | top: "fire9/squeeze1x1" 561 | convolution_param { 562 | num_output: 64 563 | kernel_size: 1 564 | weight_filler { 565 | type: "xavier" 566 | } 567 | } 568 | } 569 | layer { 570 | name: "fire9/relu_squeeze1x1" 571 | type: "ReLU" 572 | bottom: "fire9/squeeze1x1" 573 | top: "fire9/squeeze1x1" 574 | } 575 | layer { 576 | name: "fire9/expand1x1" 577 | type: "Convolution" 578 | bottom: "fire9/squeeze1x1" 579 | top: "fire9/expand1x1" 580 | convolution_param { 581 | num_output: 256 582 | kernel_size: 1 583 | weight_filler { 584 | type: "xavier" 585 | } 586 | } 587 | } 588 | layer { 589 | name: "fire9/relu_expand1x1" 590 | type: "ReLU" 591 | bottom: "fire9/expand1x1" 592 | top: "fire9/expand1x1" 593 | } 594 | layer { 595 | name: "fire9/expand3x3" 596 | type: "Convolution" 597 | bottom: "fire9/squeeze1x1" 598 | top: "fire9/expand3x3" 599 | convolution_param { 600 | num_output: 256 601 | pad: 1 602 | kernel_size: 3 603 | weight_filler { 604 | type: "xavier" 605 | } 606 | } 607 | } 608 | layer { 609 | name: "fire9/relu_expand3x3" 610 | type: "ReLU" 611 | bottom: "fire9/expand3x3" 612 | top: "fire9/expand3x3" 613 | } 614 | layer { 615 | name: "fire9/concat" 616 | type: "Concat" 617 | bottom: "fire9/expand1x1" 618 | bottom: "fire9/expand3x3" 619 | top: "fire9/concat" 620 | } 621 | layer { 622 | name: "drop9" 623 | type: "Dropout" 624 | bottom: "fire9/concat" 625 | top: "fire9/concat" 626 | dropout_param { 627 | dropout_ratio: 0.5 628 | } 629 | } 630 | layer { 631 | name: "conv10" 632 | type: "Convolution" 633 | bottom: "fire9/concat" 634 | top: "conv10" 635 | convolution_param { 636 | num_output: 1000 637 | pad: 1 638 | kernel_size: 1 639 | weight_filler { 640 | type: "gaussian" 641 | mean: 0.0 642 | std: 0.01 643 | } 644 | } 645 | } 646 | layer { 647 | name: "relu_conv10" 648 | type: "ReLU" 649 | bottom: "conv10" 650 | top: "conv10" 651 | } 652 | layer { 653 | name: "pool10" 654 | type: "Pooling" 655 | bottom: "conv10" 656 | top: "pool10" 657 | pooling_param { 658 | pool: AVE 659 | global_pooling: true 660 | } 661 | } 662 | layer { 663 | name: "loss" 664 | type: "SoftmaxWithLoss" 665 | bottom: "pool10" 666 | bottom: "label" 667 | top: "loss" 668 | include { 669 | phase: TRAIN 670 | } 671 | } 672 | layer { 673 | name: "accuracy" 674 | type: "Accuracy" 675 | bottom: "pool10" 676 | bottom: "label" 677 | top: "accuracy" 678 | include { 679 | phase: TEST 680 | } 681 | } 682 | layer { 683 | name: "accuracy_top5" 684 | type: "Accuracy" 685 | bottom: "pool10" 686 | bottom: "label" 687 | top: "accuracy_top5" 688 | include { 689 | phase: TEST 690 | } 691 | accuracy_param { 692 | top_k: 5 693 | } 694 | } 695 | -------------------------------------------------------------------------------- /SqueezeNet_v1.1/README.md: -------------------------------------------------------------------------------- 1 | 2 | **What's new in SqueezeNet v1.1?** 3 | 4 | | | SqueezeNet v1.0 | SqueezeNet v1.1 | 5 | | :------------- |:-------------:| :-----:| 6 | | conv1: | 96 filters of resolution 7x7 | 64 filters of resolution 3x3 | 7 | | pooling layers: | pool_{1,4,8} | pool_{1,3,5} | 8 | | computation | 1.72 GFLOPS/image | 0.72 GFLOPS/image: *2.4x less computation* | 9 | | ImageNet accuracy | >= 80.3% top-5 | >= 80.3% top-5 | 10 | 11 | 12 | SqueezeNet v1.1 has 2.4x less computation than v1.0, without sacrificing accuracy. 13 | -------------------------------------------------------------------------------- /SqueezeNet_v1.1/deploy.prototxt: -------------------------------------------------------------------------------- 1 | # please cite: 2 | # @article{SqueezeNet, 3 | # Author = {Forrest N. Iandola and Matthew W. Moskewicz and Khalid Ashraf and Song Han and William J. Dally and Kurt Keutzer}, 4 | # Title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and $<$1MB model size}, 5 | # Journal = {arXiv:1602.07360}, 6 | # Year = {2016} 7 | # } 8 | 9 | layer { 10 | name: "data" 11 | type: "Input" 12 | top: "data" 13 | input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } } 14 | } 15 | layer { 16 | name: "conv1" 17 | type: "Convolution" 18 | bottom: "data" 19 | top: "conv1" 20 | convolution_param { 21 | num_output: 64 22 | kernel_size: 3 23 | stride: 2 24 | } 25 | } 26 | layer { 27 | name: "relu_conv1" 28 | type: "ReLU" 29 | bottom: "conv1" 30 | top: "conv1" 31 | } 32 | layer { 33 | name: "pool1" 34 | type: "Pooling" 35 | bottom: "conv1" 36 | top: "pool1" 37 | pooling_param { 38 | pool: MAX 39 | kernel_size: 3 40 | stride: 2 41 | } 42 | } 43 | layer { 44 | name: "fire2/squeeze1x1" 45 | type: "Convolution" 46 | bottom: "pool1" 47 | top: "fire2/squeeze1x1" 48 | convolution_param { 49 | num_output: 16 50 | kernel_size: 1 51 | } 52 | } 53 | layer { 54 | name: "fire2/relu_squeeze1x1" 55 | type: "ReLU" 56 | bottom: "fire2/squeeze1x1" 57 | top: "fire2/squeeze1x1" 58 | } 59 | layer { 60 | name: "fire2/expand1x1" 61 | type: "Convolution" 62 | bottom: "fire2/squeeze1x1" 63 | top: "fire2/expand1x1" 64 | convolution_param { 65 | num_output: 64 66 | kernel_size: 1 67 | } 68 | } 69 | layer { 70 | name: "fire2/relu_expand1x1" 71 | type: "ReLU" 72 | bottom: "fire2/expand1x1" 73 | top: "fire2/expand1x1" 74 | } 75 | layer { 76 | name: "fire2/expand3x3" 77 | type: "Convolution" 78 | bottom: "fire2/squeeze1x1" 79 | top: "fire2/expand3x3" 80 | convolution_param { 81 | num_output: 64 82 | pad: 1 83 | kernel_size: 3 84 | } 85 | } 86 | layer { 87 | name: "fire2/relu_expand3x3" 88 | type: "ReLU" 89 | bottom: "fire2/expand3x3" 90 | top: "fire2/expand3x3" 91 | } 92 | layer { 93 | name: "fire2/concat" 94 | type: "Concat" 95 | bottom: "fire2/expand1x1" 96 | bottom: "fire2/expand3x3" 97 | top: "fire2/concat" 98 | } 99 | layer { 100 | name: "fire3/squeeze1x1" 101 | type: "Convolution" 102 | bottom: "fire2/concat" 103 | top: "fire3/squeeze1x1" 104 | convolution_param { 105 | num_output: 16 106 | kernel_size: 1 107 | } 108 | } 109 | layer { 110 | name: "fire3/relu_squeeze1x1" 111 | type: "ReLU" 112 | bottom: "fire3/squeeze1x1" 113 | top: "fire3/squeeze1x1" 114 | } 115 | layer { 116 | name: "fire3/expand1x1" 117 | type: "Convolution" 118 | bottom: "fire3/squeeze1x1" 119 | top: "fire3/expand1x1" 120 | convolution_param { 121 | num_output: 64 122 | kernel_size: 1 123 | } 124 | } 125 | layer { 126 | name: "fire3/relu_expand1x1" 127 | type: "ReLU" 128 | bottom: "fire3/expand1x1" 129 | top: "fire3/expand1x1" 130 | } 131 | layer { 132 | name: "fire3/expand3x3" 133 | type: "Convolution" 134 | bottom: "fire3/squeeze1x1" 135 | top: "fire3/expand3x3" 136 | convolution_param { 137 | num_output: 64 138 | pad: 1 139 | kernel_size: 3 140 | } 141 | } 142 | layer { 143 | name: "fire3/relu_expand3x3" 144 | type: "ReLU" 145 | bottom: "fire3/expand3x3" 146 | top: "fire3/expand3x3" 147 | } 148 | layer { 149 | name: "fire3/concat" 150 | type: "Concat" 151 | bottom: "fire3/expand1x1" 152 | bottom: "fire3/expand3x3" 153 | top: "fire3/concat" 154 | } 155 | layer { 156 | name: "pool3" 157 | type: "Pooling" 158 | bottom: "fire3/concat" 159 | top: "pool3" 160 | pooling_param { 161 | pool: MAX 162 | kernel_size: 3 163 | stride: 2 164 | } 165 | } 166 | layer { 167 | name: "fire4/squeeze1x1" 168 | type: "Convolution" 169 | bottom: "pool3" 170 | top: "fire4/squeeze1x1" 171 | convolution_param { 172 | num_output: 32 173 | kernel_size: 1 174 | } 175 | } 176 | layer { 177 | name: "fire4/relu_squeeze1x1" 178 | type: "ReLU" 179 | bottom: "fire4/squeeze1x1" 180 | top: "fire4/squeeze1x1" 181 | } 182 | layer { 183 | name: "fire4/expand1x1" 184 | type: "Convolution" 185 | bottom: "fire4/squeeze1x1" 186 | top: "fire4/expand1x1" 187 | convolution_param { 188 | num_output: 128 189 | kernel_size: 1 190 | } 191 | } 192 | layer { 193 | name: "fire4/relu_expand1x1" 194 | type: "ReLU" 195 | bottom: "fire4/expand1x1" 196 | top: "fire4/expand1x1" 197 | } 198 | layer { 199 | name: "fire4/expand3x3" 200 | type: "Convolution" 201 | bottom: "fire4/squeeze1x1" 202 | top: "fire4/expand3x3" 203 | convolution_param { 204 | num_output: 128 205 | pad: 1 206 | kernel_size: 3 207 | } 208 | } 209 | layer { 210 | name: "fire4/relu_expand3x3" 211 | type: "ReLU" 212 | bottom: "fire4/expand3x3" 213 | top: "fire4/expand3x3" 214 | } 215 | layer { 216 | name: "fire4/concat" 217 | type: "Concat" 218 | bottom: "fire4/expand1x1" 219 | bottom: "fire4/expand3x3" 220 | top: "fire4/concat" 221 | } 222 | layer { 223 | name: "fire5/squeeze1x1" 224 | type: "Convolution" 225 | bottom: "fire4/concat" 226 | top: "fire5/squeeze1x1" 227 | convolution_param { 228 | num_output: 32 229 | kernel_size: 1 230 | } 231 | } 232 | layer { 233 | name: "fire5/relu_squeeze1x1" 234 | type: "ReLU" 235 | bottom: "fire5/squeeze1x1" 236 | top: "fire5/squeeze1x1" 237 | } 238 | layer { 239 | name: "fire5/expand1x1" 240 | type: "Convolution" 241 | bottom: "fire5/squeeze1x1" 242 | top: "fire5/expand1x1" 243 | convolution_param { 244 | num_output: 128 245 | kernel_size: 1 246 | } 247 | } 248 | layer { 249 | name: "fire5/relu_expand1x1" 250 | type: "ReLU" 251 | bottom: "fire5/expand1x1" 252 | top: "fire5/expand1x1" 253 | } 254 | layer { 255 | name: "fire5/expand3x3" 256 | type: "Convolution" 257 | bottom: "fire5/squeeze1x1" 258 | top: "fire5/expand3x3" 259 | convolution_param { 260 | num_output: 128 261 | pad: 1 262 | kernel_size: 3 263 | } 264 | } 265 | layer { 266 | name: "fire5/relu_expand3x3" 267 | type: "ReLU" 268 | bottom: "fire5/expand3x3" 269 | top: "fire5/expand3x3" 270 | } 271 | layer { 272 | name: "fire5/concat" 273 | type: "Concat" 274 | bottom: "fire5/expand1x1" 275 | bottom: "fire5/expand3x3" 276 | top: "fire5/concat" 277 | } 278 | layer { 279 | name: "pool5" 280 | type: "Pooling" 281 | bottom: "fire5/concat" 282 | top: "pool5" 283 | pooling_param { 284 | pool: MAX 285 | kernel_size: 3 286 | stride: 2 287 | } 288 | } 289 | layer { 290 | name: "fire6/squeeze1x1" 291 | type: "Convolution" 292 | bottom: "pool5" 293 | top: "fire6/squeeze1x1" 294 | convolution_param { 295 | num_output: 48 296 | kernel_size: 1 297 | } 298 | } 299 | layer { 300 | name: "fire6/relu_squeeze1x1" 301 | type: "ReLU" 302 | bottom: "fire6/squeeze1x1" 303 | top: "fire6/squeeze1x1" 304 | } 305 | layer { 306 | name: "fire6/expand1x1" 307 | type: "Convolution" 308 | bottom: "fire6/squeeze1x1" 309 | top: "fire6/expand1x1" 310 | convolution_param { 311 | num_output: 192 312 | kernel_size: 1 313 | } 314 | } 315 | layer { 316 | name: "fire6/relu_expand1x1" 317 | type: "ReLU" 318 | bottom: "fire6/expand1x1" 319 | top: "fire6/expand1x1" 320 | } 321 | layer { 322 | name: "fire6/expand3x3" 323 | type: "Convolution" 324 | bottom: "fire6/squeeze1x1" 325 | top: "fire6/expand3x3" 326 | convolution_param { 327 | num_output: 192 328 | pad: 1 329 | kernel_size: 3 330 | } 331 | } 332 | layer { 333 | name: "fire6/relu_expand3x3" 334 | type: "ReLU" 335 | bottom: "fire6/expand3x3" 336 | top: "fire6/expand3x3" 337 | } 338 | layer { 339 | name: "fire6/concat" 340 | type: "Concat" 341 | bottom: "fire6/expand1x1" 342 | bottom: "fire6/expand3x3" 343 | top: "fire6/concat" 344 | } 345 | layer { 346 | name: "fire7/squeeze1x1" 347 | type: "Convolution" 348 | bottom: "fire6/concat" 349 | top: "fire7/squeeze1x1" 350 | convolution_param { 351 | num_output: 48 352 | kernel_size: 1 353 | } 354 | } 355 | layer { 356 | name: "fire7/relu_squeeze1x1" 357 | type: "ReLU" 358 | bottom: "fire7/squeeze1x1" 359 | top: "fire7/squeeze1x1" 360 | } 361 | layer { 362 | name: "fire7/expand1x1" 363 | type: "Convolution" 364 | bottom: "fire7/squeeze1x1" 365 | top: "fire7/expand1x1" 366 | convolution_param { 367 | num_output: 192 368 | kernel_size: 1 369 | } 370 | } 371 | layer { 372 | name: "fire7/relu_expand1x1" 373 | type: "ReLU" 374 | bottom: "fire7/expand1x1" 375 | top: "fire7/expand1x1" 376 | } 377 | layer { 378 | name: "fire7/expand3x3" 379 | type: "Convolution" 380 | bottom: "fire7/squeeze1x1" 381 | top: "fire7/expand3x3" 382 | convolution_param { 383 | num_output: 192 384 | pad: 1 385 | kernel_size: 3 386 | } 387 | } 388 | layer { 389 | name: "fire7/relu_expand3x3" 390 | type: "ReLU" 391 | bottom: "fire7/expand3x3" 392 | top: "fire7/expand3x3" 393 | } 394 | layer { 395 | name: "fire7/concat" 396 | type: "Concat" 397 | bottom: "fire7/expand1x1" 398 | bottom: "fire7/expand3x3" 399 | top: "fire7/concat" 400 | } 401 | layer { 402 | name: "fire8/squeeze1x1" 403 | type: "Convolution" 404 | bottom: "fire7/concat" 405 | top: "fire8/squeeze1x1" 406 | convolution_param { 407 | num_output: 64 408 | kernel_size: 1 409 | } 410 | } 411 | layer { 412 | name: "fire8/relu_squeeze1x1" 413 | type: "ReLU" 414 | bottom: "fire8/squeeze1x1" 415 | top: "fire8/squeeze1x1" 416 | } 417 | layer { 418 | name: "fire8/expand1x1" 419 | type: "Convolution" 420 | bottom: "fire8/squeeze1x1" 421 | top: "fire8/expand1x1" 422 | convolution_param { 423 | num_output: 256 424 | kernel_size: 1 425 | } 426 | } 427 | layer { 428 | name: "fire8/relu_expand1x1" 429 | type: "ReLU" 430 | bottom: "fire8/expand1x1" 431 | top: "fire8/expand1x1" 432 | } 433 | layer { 434 | name: "fire8/expand3x3" 435 | type: "Convolution" 436 | bottom: "fire8/squeeze1x1" 437 | top: "fire8/expand3x3" 438 | convolution_param { 439 | num_output: 256 440 | pad: 1 441 | kernel_size: 3 442 | } 443 | } 444 | layer { 445 | name: "fire8/relu_expand3x3" 446 | type: "ReLU" 447 | bottom: "fire8/expand3x3" 448 | top: "fire8/expand3x3" 449 | } 450 | layer { 451 | name: "fire8/concat" 452 | type: "Concat" 453 | bottom: "fire8/expand1x1" 454 | bottom: "fire8/expand3x3" 455 | top: "fire8/concat" 456 | } 457 | layer { 458 | name: "fire9/squeeze1x1" 459 | type: "Convolution" 460 | bottom: "fire8/concat" 461 | top: "fire9/squeeze1x1" 462 | convolution_param { 463 | num_output: 64 464 | kernel_size: 1 465 | } 466 | } 467 | layer { 468 | name: "fire9/relu_squeeze1x1" 469 | type: "ReLU" 470 | bottom: "fire9/squeeze1x1" 471 | top: "fire9/squeeze1x1" 472 | } 473 | layer { 474 | name: "fire9/expand1x1" 475 | type: "Convolution" 476 | bottom: "fire9/squeeze1x1" 477 | top: "fire9/expand1x1" 478 | convolution_param { 479 | num_output: 256 480 | kernel_size: 1 481 | } 482 | } 483 | layer { 484 | name: "fire9/relu_expand1x1" 485 | type: "ReLU" 486 | bottom: "fire9/expand1x1" 487 | top: "fire9/expand1x1" 488 | } 489 | layer { 490 | name: "fire9/expand3x3" 491 | type: "Convolution" 492 | bottom: "fire9/squeeze1x1" 493 | top: "fire9/expand3x3" 494 | convolution_param { 495 | num_output: 256 496 | pad: 1 497 | kernel_size: 3 498 | } 499 | } 500 | layer { 501 | name: "fire9/relu_expand3x3" 502 | type: "ReLU" 503 | bottom: "fire9/expand3x3" 504 | top: "fire9/expand3x3" 505 | } 506 | layer { 507 | name: "fire9/concat" 508 | type: "Concat" 509 | bottom: "fire9/expand1x1" 510 | bottom: "fire9/expand3x3" 511 | top: "fire9/concat" 512 | } 513 | layer { 514 | name: "drop9" 515 | type: "Dropout" 516 | bottom: "fire9/concat" 517 | top: "fire9/concat" 518 | dropout_param { 519 | dropout_ratio: 0.5 520 | } 521 | } 522 | layer { 523 | name: "conv10" 524 | type: "Convolution" 525 | bottom: "fire9/concat" 526 | top: "conv10" 527 | convolution_param { 528 | num_output: 1000 529 | kernel_size: 1 530 | } 531 | } 532 | layer { 533 | name: "relu_conv10" 534 | type: "ReLU" 535 | bottom: "conv10" 536 | top: "conv10" 537 | } 538 | layer { 539 | name: "pool10" 540 | type: "Pooling" 541 | bottom: "conv10" 542 | top: "pool10" 543 | pooling_param { 544 | pool: AVE 545 | global_pooling: true 546 | } 547 | } 548 | layer { 549 | name: "prob" 550 | type: "Softmax" 551 | bottom: "pool10" 552 | top: "prob" 553 | } 554 | -------------------------------------------------------------------------------- /SqueezeNet_v1.1/solver.prototxt: -------------------------------------------------------------------------------- 1 | # please cite: 2 | # @article{SqueezeNet, 3 | # Author = {Forrest N. Iandola and Matthew W. Moskewicz and Khalid Ashraf and Song Han and William J. Dally and Kurt Keutzer}, 4 | # Title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and $<$1MB model size}, 5 | # Journal = {arXiv:1602.07360}, 6 | # Year = {2016} 7 | # } 8 | 9 | test_iter: 2000 #not subject to iter_size 10 | test_interval: 1000 11 | base_lr: 0.04 12 | display: 40 13 | max_iter: 170000 14 | iter_size: 16 #global batch size = batch_size * iter_size 15 | lr_policy: "poly" 16 | power: 1.0 #linearly decrease LR 17 | momentum: 0.9 18 | weight_decay: 0.0002 19 | snapshot: 1000 20 | snapshot_prefix: "train" 21 | solver_mode: GPU 22 | random_seed: 42 23 | net: "train_val.prototxt" #we typically do `cd SqueezeNet_v1.0; caffe train ` 24 | test_initialization: false 25 | average_loss: 40 26 | -------------------------------------------------------------------------------- /SqueezeNet_v1.1/squeezenet_v1.1.caffemodel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forresti/SqueezeNet/51147dc0681638c28aad593b9e923f3500117125/SqueezeNet_v1.1/squeezenet_v1.1.caffemodel -------------------------------------------------------------------------------- /SqueezeNet_v1.1/train_val.prototxt: -------------------------------------------------------------------------------- 1 | # please cite: 2 | # @article{SqueezeNet, 3 | # Author = {Forrest N. Iandola and Matthew W. Moskewicz and Khalid Ashraf and Song Han and William J. Dally and Kurt Keutzer}, 4 | # Title = {SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and $<$1MB model size}, 5 | # Journal = {arXiv:1602.07360}, 6 | # Year = {2016} 7 | # } 8 | layer { 9 | name: "data" 10 | type: "Data" 11 | top: "data" 12 | top: "label" 13 | include { 14 | phase: TRAIN 15 | } 16 | transform_param { 17 | crop_size: 227 18 | mean_value: 104 19 | mean_value: 117 20 | mean_value: 123 21 | } 22 | data_param { 23 | source: "examples/imagenet/ilsvrc12_train_lmdb" 24 | batch_size: 32 25 | backend: LMDB 26 | } 27 | } 28 | layer { 29 | name: "data" 30 | type: "Data" 31 | top: "data" 32 | top: "label" 33 | include { 34 | phase: TEST 35 | } 36 | transform_param { 37 | crop_size: 227 38 | mean_value: 104 39 | mean_value: 117 40 | mean_value: 123 41 | } 42 | data_param { 43 | source: "examples/imagenet/ilsvrc12_val_lmdb" 44 | batch_size: 25 #not *iter_size 45 | backend: LMDB 46 | } 47 | } 48 | layer { 49 | name: "conv1" 50 | type: "Convolution" 51 | bottom: "data" 52 | top: "conv1" 53 | convolution_param { 54 | num_output: 64 55 | kernel_size: 3 56 | stride: 2 57 | weight_filler { 58 | type: "xavier" 59 | } 60 | } 61 | } 62 | layer { 63 | name: "relu_conv1" 64 | type: "ReLU" 65 | bottom: "conv1" 66 | top: "conv1" 67 | } 68 | layer { 69 | name: "pool1" 70 | type: "Pooling" 71 | bottom: "conv1" 72 | top: "pool1" 73 | pooling_param { 74 | pool: MAX 75 | kernel_size: 3 76 | stride: 2 77 | } 78 | } 79 | layer { 80 | name: "fire2/squeeze1x1" 81 | type: "Convolution" 82 | bottom: "pool1" 83 | top: "fire2/squeeze1x1" 84 | convolution_param { 85 | num_output: 16 86 | kernel_size: 1 87 | weight_filler { 88 | type: "xavier" 89 | } 90 | } 91 | } 92 | layer { 93 | name: "fire2/relu_squeeze1x1" 94 | type: "ReLU" 95 | bottom: "fire2/squeeze1x1" 96 | top: "fire2/squeeze1x1" 97 | } 98 | layer { 99 | name: "fire2/expand1x1" 100 | type: "Convolution" 101 | bottom: "fire2/squeeze1x1" 102 | top: "fire2/expand1x1" 103 | convolution_param { 104 | num_output: 64 105 | kernel_size: 1 106 | weight_filler { 107 | type: "xavier" 108 | } 109 | } 110 | } 111 | layer { 112 | name: "fire2/relu_expand1x1" 113 | type: "ReLU" 114 | bottom: "fire2/expand1x1" 115 | top: "fire2/expand1x1" 116 | } 117 | layer { 118 | name: "fire2/expand3x3" 119 | type: "Convolution" 120 | bottom: "fire2/squeeze1x1" 121 | top: "fire2/expand3x3" 122 | convolution_param { 123 | num_output: 64 124 | pad: 1 125 | kernel_size: 3 126 | weight_filler { 127 | type: "xavier" 128 | } 129 | } 130 | } 131 | layer { 132 | name: "fire2/relu_expand3x3" 133 | type: "ReLU" 134 | bottom: "fire2/expand3x3" 135 | top: "fire2/expand3x3" 136 | } 137 | layer { 138 | name: "fire2/concat" 139 | type: "Concat" 140 | bottom: "fire2/expand1x1" 141 | bottom: "fire2/expand3x3" 142 | top: "fire2/concat" 143 | } 144 | layer { 145 | name: "fire3/squeeze1x1" 146 | type: "Convolution" 147 | bottom: "fire2/concat" 148 | top: "fire3/squeeze1x1" 149 | convolution_param { 150 | num_output: 16 151 | kernel_size: 1 152 | weight_filler { 153 | type: "xavier" 154 | } 155 | } 156 | } 157 | layer { 158 | name: "fire3/relu_squeeze1x1" 159 | type: "ReLU" 160 | bottom: "fire3/squeeze1x1" 161 | top: "fire3/squeeze1x1" 162 | } 163 | layer { 164 | name: "fire3/expand1x1" 165 | type: "Convolution" 166 | bottom: "fire3/squeeze1x1" 167 | top: "fire3/expand1x1" 168 | convolution_param { 169 | num_output: 64 170 | kernel_size: 1 171 | weight_filler { 172 | type: "xavier" 173 | } 174 | } 175 | } 176 | layer { 177 | name: "fire3/relu_expand1x1" 178 | type: "ReLU" 179 | bottom: "fire3/expand1x1" 180 | top: "fire3/expand1x1" 181 | } 182 | layer { 183 | name: "fire3/expand3x3" 184 | type: "Convolution" 185 | bottom: "fire3/squeeze1x1" 186 | top: "fire3/expand3x3" 187 | convolution_param { 188 | num_output: 64 189 | pad: 1 190 | kernel_size: 3 191 | weight_filler { 192 | type: "xavier" 193 | } 194 | } 195 | } 196 | layer { 197 | name: "fire3/relu_expand3x3" 198 | type: "ReLU" 199 | bottom: "fire3/expand3x3" 200 | top: "fire3/expand3x3" 201 | } 202 | layer { 203 | name: "fire3/concat" 204 | type: "Concat" 205 | bottom: "fire3/expand1x1" 206 | bottom: "fire3/expand3x3" 207 | top: "fire3/concat" 208 | } 209 | layer { 210 | name: "pool3" 211 | type: "Pooling" 212 | bottom: "fire3/concat" 213 | top: "pool3" 214 | pooling_param { 215 | pool: MAX 216 | kernel_size: 3 217 | stride: 2 218 | } 219 | } 220 | layer { 221 | name: "fire4/squeeze1x1" 222 | type: "Convolution" 223 | bottom: "pool3" 224 | top: "fire4/squeeze1x1" 225 | convolution_param { 226 | num_output: 32 227 | kernel_size: 1 228 | weight_filler { 229 | type: "xavier" 230 | } 231 | } 232 | } 233 | layer { 234 | name: "fire4/relu_squeeze1x1" 235 | type: "ReLU" 236 | bottom: "fire4/squeeze1x1" 237 | top: "fire4/squeeze1x1" 238 | } 239 | layer { 240 | name: "fire4/expand1x1" 241 | type: "Convolution" 242 | bottom: "fire4/squeeze1x1" 243 | top: "fire4/expand1x1" 244 | convolution_param { 245 | num_output: 128 246 | kernel_size: 1 247 | weight_filler { 248 | type: "xavier" 249 | } 250 | } 251 | } 252 | layer { 253 | name: "fire4/relu_expand1x1" 254 | type: "ReLU" 255 | bottom: "fire4/expand1x1" 256 | top: "fire4/expand1x1" 257 | } 258 | layer { 259 | name: "fire4/expand3x3" 260 | type: "Convolution" 261 | bottom: "fire4/squeeze1x1" 262 | top: "fire4/expand3x3" 263 | convolution_param { 264 | num_output: 128 265 | pad: 1 266 | kernel_size: 3 267 | weight_filler { 268 | type: "xavier" 269 | } 270 | } 271 | } 272 | layer { 273 | name: "fire4/relu_expand3x3" 274 | type: "ReLU" 275 | bottom: "fire4/expand3x3" 276 | top: "fire4/expand3x3" 277 | } 278 | layer { 279 | name: "fire4/concat" 280 | type: "Concat" 281 | bottom: "fire4/expand1x1" 282 | bottom: "fire4/expand3x3" 283 | top: "fire4/concat" 284 | } 285 | layer { 286 | name: "fire5/squeeze1x1" 287 | type: "Convolution" 288 | bottom: "fire4/concat" 289 | top: "fire5/squeeze1x1" 290 | convolution_param { 291 | num_output: 32 292 | kernel_size: 1 293 | weight_filler { 294 | type: "xavier" 295 | } 296 | } 297 | } 298 | layer { 299 | name: "fire5/relu_squeeze1x1" 300 | type: "ReLU" 301 | bottom: "fire5/squeeze1x1" 302 | top: "fire5/squeeze1x1" 303 | } 304 | layer { 305 | name: "fire5/expand1x1" 306 | type: "Convolution" 307 | bottom: "fire5/squeeze1x1" 308 | top: "fire5/expand1x1" 309 | convolution_param { 310 | num_output: 128 311 | kernel_size: 1 312 | weight_filler { 313 | type: "xavier" 314 | } 315 | } 316 | } 317 | layer { 318 | name: "fire5/relu_expand1x1" 319 | type: "ReLU" 320 | bottom: "fire5/expand1x1" 321 | top: "fire5/expand1x1" 322 | } 323 | layer { 324 | name: "fire5/expand3x3" 325 | type: "Convolution" 326 | bottom: "fire5/squeeze1x1" 327 | top: "fire5/expand3x3" 328 | convolution_param { 329 | num_output: 128 330 | pad: 1 331 | kernel_size: 3 332 | weight_filler { 333 | type: "xavier" 334 | } 335 | } 336 | } 337 | layer { 338 | name: "fire5/relu_expand3x3" 339 | type: "ReLU" 340 | bottom: "fire5/expand3x3" 341 | top: "fire5/expand3x3" 342 | } 343 | layer { 344 | name: "fire5/concat" 345 | type: "Concat" 346 | bottom: "fire5/expand1x1" 347 | bottom: "fire5/expand3x3" 348 | top: "fire5/concat" 349 | } 350 | layer { 351 | name: "pool5" 352 | type: "Pooling" 353 | bottom: "fire5/concat" 354 | top: "pool5" 355 | pooling_param { 356 | pool: MAX 357 | kernel_size: 3 358 | stride: 2 359 | } 360 | } 361 | layer { 362 | name: "fire6/squeeze1x1" 363 | type: "Convolution" 364 | bottom: "pool5" 365 | top: "fire6/squeeze1x1" 366 | convolution_param { 367 | num_output: 48 368 | kernel_size: 1 369 | weight_filler { 370 | type: "xavier" 371 | } 372 | } 373 | } 374 | layer { 375 | name: "fire6/relu_squeeze1x1" 376 | type: "ReLU" 377 | bottom: "fire6/squeeze1x1" 378 | top: "fire6/squeeze1x1" 379 | } 380 | layer { 381 | name: "fire6/expand1x1" 382 | type: "Convolution" 383 | bottom: "fire6/squeeze1x1" 384 | top: "fire6/expand1x1" 385 | convolution_param { 386 | num_output: 192 387 | kernel_size: 1 388 | weight_filler { 389 | type: "xavier" 390 | } 391 | } 392 | } 393 | layer { 394 | name: "fire6/relu_expand1x1" 395 | type: "ReLU" 396 | bottom: "fire6/expand1x1" 397 | top: "fire6/expand1x1" 398 | } 399 | layer { 400 | name: "fire6/expand3x3" 401 | type: "Convolution" 402 | bottom: "fire6/squeeze1x1" 403 | top: "fire6/expand3x3" 404 | convolution_param { 405 | num_output: 192 406 | pad: 1 407 | kernel_size: 3 408 | weight_filler { 409 | type: "xavier" 410 | } 411 | } 412 | } 413 | layer { 414 | name: "fire6/relu_expand3x3" 415 | type: "ReLU" 416 | bottom: "fire6/expand3x3" 417 | top: "fire6/expand3x3" 418 | } 419 | layer { 420 | name: "fire6/concat" 421 | type: "Concat" 422 | bottom: "fire6/expand1x1" 423 | bottom: "fire6/expand3x3" 424 | top: "fire6/concat" 425 | } 426 | layer { 427 | name: "fire7/squeeze1x1" 428 | type: "Convolution" 429 | bottom: "fire6/concat" 430 | top: "fire7/squeeze1x1" 431 | convolution_param { 432 | num_output: 48 433 | kernel_size: 1 434 | weight_filler { 435 | type: "xavier" 436 | } 437 | } 438 | } 439 | layer { 440 | name: "fire7/relu_squeeze1x1" 441 | type: "ReLU" 442 | bottom: "fire7/squeeze1x1" 443 | top: "fire7/squeeze1x1" 444 | } 445 | layer { 446 | name: "fire7/expand1x1" 447 | type: "Convolution" 448 | bottom: "fire7/squeeze1x1" 449 | top: "fire7/expand1x1" 450 | convolution_param { 451 | num_output: 192 452 | kernel_size: 1 453 | weight_filler { 454 | type: "xavier" 455 | } 456 | } 457 | } 458 | layer { 459 | name: "fire7/relu_expand1x1" 460 | type: "ReLU" 461 | bottom: "fire7/expand1x1" 462 | top: "fire7/expand1x1" 463 | } 464 | layer { 465 | name: "fire7/expand3x3" 466 | type: "Convolution" 467 | bottom: "fire7/squeeze1x1" 468 | top: "fire7/expand3x3" 469 | convolution_param { 470 | num_output: 192 471 | pad: 1 472 | kernel_size: 3 473 | weight_filler { 474 | type: "xavier" 475 | } 476 | } 477 | } 478 | layer { 479 | name: "fire7/relu_expand3x3" 480 | type: "ReLU" 481 | bottom: "fire7/expand3x3" 482 | top: "fire7/expand3x3" 483 | } 484 | layer { 485 | name: "fire7/concat" 486 | type: "Concat" 487 | bottom: "fire7/expand1x1" 488 | bottom: "fire7/expand3x3" 489 | top: "fire7/concat" 490 | } 491 | layer { 492 | name: "fire8/squeeze1x1" 493 | type: "Convolution" 494 | bottom: "fire7/concat" 495 | top: "fire8/squeeze1x1" 496 | convolution_param { 497 | num_output: 64 498 | kernel_size: 1 499 | weight_filler { 500 | type: "xavier" 501 | } 502 | } 503 | } 504 | layer { 505 | name: "fire8/relu_squeeze1x1" 506 | type: "ReLU" 507 | bottom: "fire8/squeeze1x1" 508 | top: "fire8/squeeze1x1" 509 | } 510 | layer { 511 | name: "fire8/expand1x1" 512 | type: "Convolution" 513 | bottom: "fire8/squeeze1x1" 514 | top: "fire8/expand1x1" 515 | convolution_param { 516 | num_output: 256 517 | kernel_size: 1 518 | weight_filler { 519 | type: "xavier" 520 | } 521 | } 522 | } 523 | layer { 524 | name: "fire8/relu_expand1x1" 525 | type: "ReLU" 526 | bottom: "fire8/expand1x1" 527 | top: "fire8/expand1x1" 528 | } 529 | layer { 530 | name: "fire8/expand3x3" 531 | type: "Convolution" 532 | bottom: "fire8/squeeze1x1" 533 | top: "fire8/expand3x3" 534 | convolution_param { 535 | num_output: 256 536 | pad: 1 537 | kernel_size: 3 538 | weight_filler { 539 | type: "xavier" 540 | } 541 | } 542 | } 543 | layer { 544 | name: "fire8/relu_expand3x3" 545 | type: "ReLU" 546 | bottom: "fire8/expand3x3" 547 | top: "fire8/expand3x3" 548 | } 549 | layer { 550 | name: "fire8/concat" 551 | type: "Concat" 552 | bottom: "fire8/expand1x1" 553 | bottom: "fire8/expand3x3" 554 | top: "fire8/concat" 555 | } 556 | layer { 557 | name: "fire9/squeeze1x1" 558 | type: "Convolution" 559 | bottom: "fire8/concat" 560 | top: "fire9/squeeze1x1" 561 | convolution_param { 562 | num_output: 64 563 | kernel_size: 1 564 | weight_filler { 565 | type: "xavier" 566 | } 567 | } 568 | } 569 | layer { 570 | name: "fire9/relu_squeeze1x1" 571 | type: "ReLU" 572 | bottom: "fire9/squeeze1x1" 573 | top: "fire9/squeeze1x1" 574 | } 575 | layer { 576 | name: "fire9/expand1x1" 577 | type: "Convolution" 578 | bottom: "fire9/squeeze1x1" 579 | top: "fire9/expand1x1" 580 | convolution_param { 581 | num_output: 256 582 | kernel_size: 1 583 | weight_filler { 584 | type: "xavier" 585 | } 586 | } 587 | } 588 | layer { 589 | name: "fire9/relu_expand1x1" 590 | type: "ReLU" 591 | bottom: "fire9/expand1x1" 592 | top: "fire9/expand1x1" 593 | } 594 | layer { 595 | name: "fire9/expand3x3" 596 | type: "Convolution" 597 | bottom: "fire9/squeeze1x1" 598 | top: "fire9/expand3x3" 599 | convolution_param { 600 | num_output: 256 601 | pad: 1 602 | kernel_size: 3 603 | weight_filler { 604 | type: "xavier" 605 | } 606 | } 607 | } 608 | layer { 609 | name: "fire9/relu_expand3x3" 610 | type: "ReLU" 611 | bottom: "fire9/expand3x3" 612 | top: "fire9/expand3x3" 613 | } 614 | layer { 615 | name: "fire9/concat" 616 | type: "Concat" 617 | bottom: "fire9/expand1x1" 618 | bottom: "fire9/expand3x3" 619 | top: "fire9/concat" 620 | } 621 | layer { 622 | name: "drop9" 623 | type: "Dropout" 624 | bottom: "fire9/concat" 625 | top: "fire9/concat" 626 | dropout_param { 627 | dropout_ratio: 0.5 628 | } 629 | } 630 | layer { 631 | name: "conv10" 632 | type: "Convolution" 633 | bottom: "fire9/concat" 634 | top: "conv10" 635 | convolution_param { 636 | num_output: 1000 637 | kernel_size: 1 638 | weight_filler { 639 | type: "gaussian" 640 | mean: 0.0 641 | std: 0.01 642 | } 643 | } 644 | } 645 | layer { 646 | name: "relu_conv10" 647 | type: "ReLU" 648 | bottom: "conv10" 649 | top: "conv10" 650 | } 651 | layer { 652 | name: "pool10" 653 | type: "Pooling" 654 | bottom: "conv10" 655 | top: "pool10" 656 | pooling_param { 657 | pool: AVE 658 | global_pooling: true 659 | } 660 | } 661 | layer { 662 | name: "loss" 663 | type: "SoftmaxWithLoss" 664 | bottom: "pool10" 665 | bottom: "label" 666 | top: "loss" 667 | #include { 668 | # phase: TRAIN 669 | #} 670 | } 671 | layer { 672 | name: "accuracy" 673 | type: "Accuracy" 674 | bottom: "pool10" 675 | bottom: "label" 676 | top: "accuracy" 677 | #include { 678 | # phase: TEST 679 | #} 680 | } 681 | layer { 682 | name: "accuracy_top5" 683 | type: "Accuracy" 684 | bottom: "pool10" 685 | bottom: "label" 686 | top: "accuracy_top5" 687 | #include { 688 | # phase: TEST 689 | #} 690 | accuracy_param { 691 | top_k: 5 692 | } 693 | } 694 | --------------------------------------------------------------------------------