Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ashutoshsatapathy1990/6b49609d6861beeb56064f545ee13306 to your computer and use it in GitHub Desktop.
Save ashutoshsatapathy1990/6b49609d6861beeb56064f545ee13306 to your computer and use it in GitHub Desktop.
ResNet 18 Caffe prototxt file for DIGITS
# ResNet18
name: "ResNet18"
layer {
name: "train-data"
type: "Data"
top: "data"
top: "label"
transform_param {
mirror: true
crop_size: 224
}
data_param {
batch_size: 32
}
include { stage: "train" }
}
layer {
name: "val-data"
type: "Data"
top: "data"
top: "label"
transform_param {
mirror: false
crop_size: 224
}
data_param {
batch_size: 16
}
include { stage: "val" }
}
layer {
name: "conv1"
type: "Convolution"
bottom: "data"
top: "conv1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 64
pad: 3
kernel_size: 7
stride: 2
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn_conv1"
type: "BatchNorm"
bottom: "conv1"
top: "conv1_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "conv1_relu"
type: "ReLU"
bottom: "conv1_bn"
top: "conv1_bn"
}
layer {
name: "pool1"
type: "Pooling"
bottom: "conv1_bn"
top: "pool1"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layer {
name: "res2a_branch1"
type: "Convolution"
bottom: "pool1"
top: "res2a_branch1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 256
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2a_branch1"
type: "BatchNorm"
bottom: "res2a_branch1"
top: "res2a_branch1_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2a_branch2a"
type: "Convolution"
bottom: "pool1"
top: "res2a_branch2a"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 64
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2a_branch2a"
type: "BatchNorm"
bottom: "res2a_branch2a"
top: "res2a_branch2a_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2a_branch2a_relu"
type: "ReLU"
bottom: "res2a_branch2a_bn"
top: "res2a_branch2a_bn"
}
layer {
name: "res2a_branch2b"
type: "Convolution"
bottom: "res2a_branch2a_bn"
top: "res2a_branch2b"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 64
pad: 1
kernel_size: 3
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2a_branch2b"
type: "BatchNorm"
bottom: "res2a_branch2b"
top: "res2a_branch2b_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2a_branch2b_relu"
type: "ReLU"
bottom: "res2a_branch2b_bn"
top: "res2a_branch2b_bn"
}
layer {
name: "res2a_branch2c"
type: "Convolution"
bottom: "res2a_branch2b_bn"
top: "res2a_branch2c"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 256
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2a_branch2c"
type: "BatchNorm"
bottom: "res2a_branch2c"
top: "res2a_branch2c_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2a"
type: "Eltwise"
bottom: "res2a_branch1_bn"
bottom: "res2a_branch2c_bn"
top: "res2a"
}
layer {
name: "res2a_relu"
type: "ReLU"
bottom: "res2a"
top: "res2a"
}
layer {
name: "res2b_branch2a"
type: "Convolution"
bottom: "res2a"
top: "res2b_branch2a"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 64
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2b_branch2a"
type: "BatchNorm"
bottom: "res2b_branch2a"
top: "res2b_branch2a_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2b_branch2a_relu"
type: "ReLU"
bottom: "res2b_branch2a_bn"
top: "res2b_branch2a_bn"
}
layer {
name: "res2b_branch2b"
type: "Convolution"
bottom: "res2b_branch2a_bn"
top: "res2b_branch2b"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 64
pad: 1
kernel_size: 3
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2b_branch2b"
type: "BatchNorm"
bottom: "res2b_branch2b"
top: "res2b_branch2b_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2b_branch2b_relu"
type: "ReLU"
bottom: "res2b_branch2b_bn"
top: "res2b_branch2b_bn"
}
layer {
name: "res2b_branch2c"
type: "Convolution"
bottom: "res2b_branch2b_bn"
top: "res2b_branch2c"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 256
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2b_branch2c"
type: "BatchNorm"
bottom: "res2b_branch2c"
top: "res2b_branch2c_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2b"
type: "Eltwise"
bottom: "res2a"
bottom: "res2b_branch2c_bn"
top: "res2b"
}
layer {
name: "res2b_relu"
type: "ReLU"
bottom: "res2b"
top: "res2b"
}
layer {
name: "res2c_branch2a"
type: "Convolution"
bottom: "res2b"
top: "res2c_branch2a"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 64
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2c_branch2a"
type: "BatchNorm"
bottom: "res2c_branch2a"
top: "res2c_branch2a_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2c_branch2a_relu"
type: "ReLU"
bottom: "res2c_branch2a_bn"
top: "res2c_branch2a_bn"
}
layer {
name: "res2c_branch2b"
type: "Convolution"
bottom: "res2c_branch2a_bn"
top: "res2c_branch2b"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 64
pad: 1
kernel_size: 3
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2c_branch2b"
type: "BatchNorm"
bottom: "res2c_branch2b"
top: "res2c_branch2b_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2c_branch2b_relu"
type: "ReLU"
bottom: "res2c_branch2b_bn"
top: "res2c_branch2b_bn"
}
layer {
name: "res2c_branch2c"
type: "Convolution"
bottom: "res2c_branch2b_bn"
top: "res2c_branch2c"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 256
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn2c_branch2c"
type: "BatchNorm"
bottom: "res2c_branch2c"
top: "res2c_branch2c_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res2c"
type: "Eltwise"
bottom: "res2b"
bottom: "res2c_branch2c_bn"
top: "res2c"
}
layer {
name: "res2c_relu"
type: "ReLU"
bottom: "res2c"
top: "res2c"
}
layer {
name: "res3a_branch1"
type: "Convolution"
bottom: "res2c"
top: "res3a_branch1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 512
pad: 0
kernel_size: 1
stride: 2
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn3a_branch1"
type: "BatchNorm"
bottom: "res3a_branch1"
top: "res3a_branch1_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res3a_branch2a"
type: "Convolution"
bottom: "res2c"
top: "res3a_branch2a"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 128
pad: 0
kernel_size: 1
stride: 2
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn3a_branch2a"
type: "BatchNorm"
bottom: "res3a_branch2a"
top: "res3a_branch2a_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res3a_branch2a_relu"
type: "ReLU"
bottom: "res3a_branch2a_bn"
top: "res3a_branch2a_bn"
}
layer {
name: "res3a_branch2b"
type: "Convolution"
bottom: "res3a_branch2a_bn"
top: "res3a_branch2b"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 128
pad: 1
kernel_size: 3
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn3a_branch2b"
type: "BatchNorm"
bottom: "res3a_branch2b"
top: "res3a_branch2b_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res3a_branch2b_relu"
type: "ReLU"
bottom: "res3a_branch2b_bn"
top: "res3a_branch2b_bn"
}
layer {
name: "res3a_branch2c"
type: "Convolution"
bottom: "res3a_branch2b_bn"
top: "res3a_branch2c"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 512
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn3a_branch2c"
type: "BatchNorm"
bottom: "res3a_branch2c"
top: "res3a_branch2c_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res3a"
type: "Eltwise"
bottom: "res3a_branch1_bn"
bottom: "res3a_branch2c_bn"
top: "res3a"
}
layer {
name: "res3a_relu"
type: "ReLU"
bottom: "res3a"
top: "res3a"
}
layer {
name: "res3b_branch2a"
type: "Convolution"
bottom: "res3a"
top: "res3b_branch2a"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 128
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn3b_branch2a"
type: "BatchNorm"
bottom: "res3b_branch2a"
top: "res3b_branch2a_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res3b_branch2a_relu"
type: "ReLU"
bottom: "res3b_branch2a_bn"
top: "res3b_branch2a_bn"
}
layer {
name: "res3b_branch2b"
type: "Convolution"
bottom: "res3b_branch2a_bn"
top: "res3b_branch2b"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 128
pad: 1
kernel_size: 3
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn3b_branch2b"
type: "BatchNorm"
bottom: "res3b_branch2b"
top: "res3b_branch2b_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res3b_branch2b_relu"
type: "ReLU"
bottom: "res3b_branch2b_bn"
top: "res3b_branch2b_bn"
}
layer {
name: "res3b_branch2c"
type: "Convolution"
bottom: "res3b_branch2b_bn"
top: "res3b_branch2c"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 512
pad: 0
kernel_size: 1
stride: 1
weight_filler {
type: "msra"
std: 0.0005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "bn3b_branch2c"
type: "BatchNorm"
bottom: "res3b_branch2c"
top: "res3b_branch2c_bn"
param {
lr_mult: 1
decay_mult: 0
}
param {
lr_mult: 1
decay_mult: 0
}
batch_norm_param {
scale_filler {
type: "constant"
value: 1
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "res3b"
type: "Eltwise"
bottom: "res3a"
bottom: "res3b_branch2c_bn"
top: "res3b"
}
layer {
name: "res3b_relu"
type: "ReLU"
bottom: "res3b"
top: "res3b"
}
layer {
name: "pool2"
type: "Pooling"
bottom: "res3b"
top: "pool2"
pooling_param {
pool: AVE
kernel_size: 7
stride: 1
}
}
layer {
name: "fclayer"
type: "InnerProduct"
bottom: "pool2"
top: "fclayer"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
inner_product_param {
weight_filler {
type: "msra"
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "accuracy"
type: "Accuracy"
bottom: "fclayer"
bottom: "label"
top: "accuracy"
include { stage: "val" }
}
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "fclayer"
bottom: "label"
top: "loss"
exclude { stage: "deploy" }
}
layer {
name: "softmax"
type: "Softmax"
bottom: "fclayer"
top: "softmax"
include { stage: "deploy" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment