Skip to content

Instantly share code, notes, and snippets.

@walkoncross
Last active November 11, 2017 00:16
Show Gist options
  • Save walkoncross/192f1fa12657205b0a7e54fbc3fa3c4d to your computer and use it in GitHub Desktop.
Save walkoncross/192f1fa12657205b0a7e54fbc3fa3c4d to your computer and use it in GitHub Desktop.
name: "BN-SpherefaceNet-20"
layer {
name: "data"
type: "ImageData"
top: "data"
top: "label"
transform_param {
mean_value: 127.5
mean_value: 127.5
mean_value: 127.5
scale: 0.0078125
mirror: true
}
image_data_param {
source: "data/CASIA-WebFace-112X96.txt"
batch_size: 256
shuffle: true
}
}
############## CNN Architecture ###############
layer {
name: "conv1_1"
type: "Convolution"
bottom: "data"
top: "conv1_1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 64
kernel_size: 3
stride: 2
pad: 1
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv1_1"
top: "conv1_1"
name: "conv1_1_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv1_1"
top: "conv1_1"
name: "conv1_1_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu1_1"
type: "PReLU"
bottom: "conv1_1"
top: "conv1_1"
}
layer {
name: "conv1_2"
type: "Convolution"
bottom: "conv1_1"
top: "conv1_2"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 64
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv1_2"
top: "conv1_2"
name: "conv1_2_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv1_2"
top: "conv1_2"
name: "conv1_2_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu1_2"
type: "PReLU"
bottom: "conv1_2"
top: "conv1_2"
}
layer {
name: "conv1_3"
type: "Convolution"
bottom: "conv1_2"
top: "conv1_3"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 64
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv1_3"
top: "conv1_3"
name: "conv1_3_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv1_3"
top: "conv1_3"
name: "conv1_3_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu1_3"
type: "PReLU"
bottom: "conv1_3"
top: "conv1_3"
}
layer {
name: "res1_3"
type: "Eltwise"
bottom: "conv1_1"
bottom: "conv1_3"
top: "res1_3"
eltwise_param {
operation: 1
}
}
layer {
bottom: "res1_3"
top: "res1_3"
name: "res1_3_relu"
type: "PReLU"
}
layer {
name: "conv2_1"
type: "Convolution"
bottom: "res1_3"
top: "conv2_1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 128
kernel_size: 3
stride: 2
pad: 1
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv2_1"
top: "conv2_1"
name: "conv2_1_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv2_1"
top: "conv2_1"
name: "conv2_1_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu2_1"
type: "PReLU"
bottom: "conv2_1"
top: "conv2_1"
}
layer {
name: "conv2_2"
type: "Convolution"
bottom: "conv2_1"
top: "conv2_2"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 128
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv2_2"
top: "conv2_2"
name: "conv2_2_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv2_2"
top: "conv2_2"
name: "conv2_2_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu2_2"
type: "PReLU"
bottom: "conv2_2"
top: "conv2_2"
}
layer {
name: "conv2_3"
type: "Convolution"
bottom: "conv2_2"
top: "conv2_3"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 128
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv2_3"
top: "conv2_3"
name: "conv2_3_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv2_3"
top: "conv2_3"
name: "conv2_3_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu2_3"
type: "PReLU"
bottom: "conv2_3"
top: "conv2_3"
}
layer {
name: "res2_3"
type: "Eltwise"
bottom: "conv2_1"
bottom: "conv2_3"
top: "res2_3"
eltwise_param {
operation: 1
}
}
layer {
bottom: "res2_3"
top: "res2_3"
name: "res2_3_relu"
type: "PReLU"
}
layer {
name: "conv2_4"
type: "Convolution"
bottom: "res2_3"
top: "conv2_4"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 128
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv2_4"
top: "conv2_4"
name: "conv2_4_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv2_4"
top: "conv2_4"
name: "conv2_4_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu2_4"
type: "PReLU"
bottom: "conv2_4"
top: "conv2_4"
}
layer {
name: "conv2_5"
type: "Convolution"
bottom: "conv2_4"
top: "conv2_5"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 128
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv2_5"
top: "conv2_5"
name: "conv2_5_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv2_5"
top: "conv2_5"
name: "conv2_5_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu2_5"
type: "PReLU"
bottom: "conv2_5"
top: "conv2_5"
}
layer {
name: "res2_5"
type: "Eltwise"
bottom: "res2_3"
bottom: "conv2_5"
top: "res2_5"
eltwise_param {
operation: 1
}
}
layer {
bottom: "res2_5"
top: "res2_5"
name: "res2_5_relu"
type: "PReLU"
}
layer {
name: "conv3_1"
type: "Convolution"
bottom: "res2_5"
top: "conv3_1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 256
kernel_size: 3
stride: 2
pad: 1
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv3_1"
top: "conv3_1"
name: "conv3_1_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv3_1"
top: "conv3_1"
name: "conv3_1_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu3_1"
type: "PReLU"
bottom: "conv3_1"
top: "conv3_1"
}
layer {
name: "conv3_2"
type: "Convolution"
bottom: "conv3_1"
top: "conv3_2"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 256
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv3_2"
top: "conv3_2"
name: "conv3_2_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv3_2"
top: "conv3_2"
name: "conv3_2_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu3_2"
type: "PReLU"
bottom: "conv3_2"
top: "conv3_2"
}
layer {
name: "conv3_3"
type: "Convolution"
bottom: "conv3_2"
top: "conv3_3"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 256
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv3_3"
top: "conv3_3"
name: "conv3_3_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv3_3"
top: "conv3_3"
name: "conv3_3_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu3_3"
type: "PReLU"
bottom: "conv3_3"
top: "conv3_3"
}
layer {
name: "res3_3"
type: "Eltwise"
bottom: "conv3_1"
bottom: "conv3_3"
top: "res3_3"
eltwise_param {
operation: 1
}
}
layer {
bottom: "res3_3"
top: "res3_3"
name: "res3_3_relu"
type: "PReLU"
}
layer {
name: "conv3_4"
type: "Convolution"
bottom: "res3_3"
top: "conv3_4"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 256
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv3_4"
top: "conv3_4"
name: "conv3_4_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv3_4"
top: "conv3_4"
name: "conv3_4_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu3_4"
type: "PReLU"
bottom: "conv3_4"
top: "conv3_4"
}
layer {
name: "conv3_5"
type: "Convolution"
bottom: "conv3_4"
top: "conv3_5"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 256
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv3_5"
top: "conv3_5"
name: "conv3_5_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv3_5"
top: "conv3_5"
name: "conv3_5_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu3_5"
type: "PReLU"
bottom: "conv3_5"
top: "conv3_5"
}
layer {
name: "res3_5"
type: "Eltwise"
bottom: "res3_3"
bottom: "conv3_5"
top: "res3_5"
eltwise_param {
operation: 1
}
}
layer {
bottom: "res3_5"
top: "res3_5"
name: "res3_5_relu"
type: "PReLU"
}
layer {
name: "conv3_6"
type: "Convolution"
bottom: "res3_5"
top: "conv3_6"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 256
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv3_6"
top: "conv3_6"
name: "conv3_6_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv3_6"
top: "conv3_6"
name: "conv3_6_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu3_6"
type: "PReLU"
bottom: "conv3_6"
top: "conv3_6"
}
layer {
name: "conv3_7"
type: "Convolution"
bottom: "conv3_6"
top: "conv3_7"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 256
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv3_7"
top: "conv3_7"
name: "conv3_7_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv3_7"
top: "conv3_7"
name: "conv3_7_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu3_7"
type: "PReLU"
bottom: "conv3_7"
top: "conv3_7"
}
layer {
name: "res3_7"
type: "Eltwise"
bottom: "res3_5"
bottom: "conv3_7"
top: "res3_7"
eltwise_param {
operation: 1
}
}
layer {
bottom: "res3_7"
top: "res3_7"
name: "res3_7_relu"
type: "PReLU"
}
layer {
name: "conv3_8"
type: "Convolution"
bottom: "res3_7"
top: "conv3_8"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 256
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv3_8"
top: "conv3_8"
name: "conv3_8_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv3_8"
top: "conv3_8"
name: "conv3_8_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu3_8"
type: "PReLU"
bottom: "conv3_8"
top: "conv3_8"
}
layer {
name: "conv3_9"
type: "Convolution"
bottom: "conv3_8"
top: "conv3_9"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 256
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv3_9"
top: "conv3_9"
name: "conv3_9_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv3_9"
top: "conv3_9"
name: "conv3_9_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu3_9"
type: "PReLU"
bottom: "conv3_9"
top: "conv3_9"
}
layer {
name: "res3_9"
type: "Eltwise"
bottom: "res3_7"
bottom: "conv3_9"
top: "res3_9"
eltwise_param {
operation: 1
}
}
layer {
bottom: "res3_9"
top: "res3_9"
name: "res3_9_relu"
type: "PReLU"
}
layer {
name: "conv4_1"
type: "Convolution"
bottom: "res3_9"
top: "conv4_1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 512
kernel_size: 3
stride: 2
pad: 1
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv4_1"
top: "conv4_1"
name: "conv4_1_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv4_1"
top: "conv4_1"
name: "conv4_1_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu4_1"
type: "PReLU"
bottom: "conv4_1"
top: "conv4_1"
}
layer {
name: "conv4_2"
type: "Convolution"
bottom: "conv4_1"
top: "conv4_2"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 512
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv4_2"
top: "conv4_2"
name: "conv4_2_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv4_2"
top: "conv4_2"
name: "conv4_2_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu4_2"
type: "PReLU"
bottom: "conv4_2"
top: "conv4_2"
}
layer {
name: "conv4_3"
type: "Convolution"
bottom: "conv4_2"
top: "conv4_3"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 0
decay_mult: 0
}
convolution_param {
num_output: 512
kernel_size: 3
stride: 1
pad: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv4_3"
top: "conv4_3"
name: "conv4_3_bn"
type: "BatchNorm"
batch_norm_param {
use_global_stats: false
}
}
layer {
bottom: "conv4_3"
top: "conv4_3"
name: "conv4_3_bn_scale"
type: "Scale"
scale_param {
bias_term: true
}
}
layer {
name: "relu4_3"
type: "PReLU"
bottom: "conv4_3"
top: "conv4_3"
}
layer {
name: "res4_3"
type: "Eltwise"
bottom: "conv4_1"
bottom: "conv4_3"
top: "res4_3"
eltwise_param {
operation: 1
}
}
layer {
bottom: "res4_3"
top: "res4_3"
name: "res4_3_relu"
type: "PReLU"
}
layer {
name: "fc5"
type: "InnerProduct"
bottom: "res4_3"
top: "fc5"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
inner_product_param {
num_output: 512
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
value: 0
}
}
}
############### A-Softmax Loss ##############
layer {
name: "fc6"
type: "MarginInnerProduct"
bottom: "fc5"
bottom: "label"
top: "fc6"
top: "lambda"
param {
lr_mult: 1
decay_mult: 1
}
margin_inner_product_param {
num_output: 10572
type: QUADRUPLE
weight_filler {
type: "xavier"
}
base: 1000
gamma: 0.12
power: 1
lambda_min: 5
iteration: 0
}
}
layer {
name: "softmax_loss"
type: "SoftmaxWithLoss"
bottom: "fc6"
bottom: "label"
top: "softmax_loss"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment