Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save muhakbaryasin/3233fc3dcbb76bdfccb03ef87f9c03ef to your computer and use it in GitHub Desktop.
Save muhakbaryasin/3233fc3dcbb76bdfccb03ef87f9c03ef to your computer and use it in GitHub Desktop.
cnn captcha
name: "Captcha Recognition"
layers {
name: "labeled captcha image"
type: DATA
top: "data"
top: "label"
data_param {
source: "temp/train.db"
backend: LEVELDB
batch_size: 64
}
transform_param {
scale: 0.00390625
}
include: { phase: TRAIN }
}
layers {
name: "conv1"
type: CONVOLUTION
bottom: "data"
top: "conv1"
blobs_lr: 1
blobs_lr: 2
convolution_param {
num_output: 48
kernel_size: 5
stride: 2
pad: 2
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
}
layers {
name: "pool1"
type: POOLING
bottom: "conv1"
top: "pool1"
pooling_param {
pool: MAX
kernel_size: 2
stride: 2
}
}
layers {
name: "relu1"
type: RELU
bottom: "pool1"
top: "pool1"
}
layers {
name: "drop1"
type: DROPOUT
bottom: "pool1"
top: "pool1"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
name: "conv2"
type: CONVOLUTION
bottom: "pool1"
top: "conv2"
blobs_lr: 1
blobs_lr: 2
convolution_param {
num_output: 64
kernel_size: 5
stride: 1
pad: 2
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
}
layers {
name: "pool2"
type: POOLING
bottom: "conv2"
top: "pool2"
pooling_param {
pool: MAX
kernel_size: 2
stride: 1
}
}
layers {
name: "relu2"
type: RELU
bottom: "pool2"
top: "pool2"
}
layers {
name: "drop2"
type: DROPOUT
bottom: "pool2"
top: "pool2"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
name: "conv3"
type: CONVOLUTION
bottom: "pool2"
top: "conv3"
blobs_lr: 1
blobs_lr: 2
convolution_param {
num_output: 128
kernel_size: 5
stride: 1
pad: 2
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
}
layers {
name: "pool3"
type: POOLING
bottom: "conv3"
top: "pool3"
pooling_param {
pool: MAX
kernel_size: 2
stride: 2
}
}
layers {
name: "relu3"
type: RELU
bottom: "pool3"
top: "pool3"
}
layers {
name: "drop3"
type: DROPOUT
bottom: "pool3"
top: "pool3"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
bottom: "pool3"
top: "ip1"
name: "ip1"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
inner_product_param {
num_output: 3072
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
}
layers {
name: "relu4"
type: RELU
bottom: "ip1"
top: "ip1"
}
layers {
name: "drop4"
type: DROPOUT
bottom: "ip1"
top: "ip1"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
name: "ip2"
type: INNER_PRODUCT
bottom: "ip1"
top: "ip2"
blobs_lr: 1
blobs_lr: 2
inner_product_param {
num_output: 378
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
}
}
}
layers {
name: "loss"
type: SOFTMAX_LOSS
bottom: "ip2"
bottom: "label"
top: "loss"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment