我用中科院李子青的数据库训练,模型用的是DeepID。为何accuracy在迭代了近40个epcohs还是很低,一直没有变,loss也没有下降

我用的数据库(10575个对象,近50万张图像,val集和test集都是2万张左右,剩下的用来做train集)
net: "/home/hrw/caffe/examples/VIPLFaceNet/DeepID_train_test.prototxt"
# conver the whole test set. 330 * 64 = 21150 images.
test_iter: 330
 
# Each 7064 is one epoch, test after each epoch
test_interval: 7064 
base_lr: 0.01
momentum: 0.9
weight_decay: 0.005

lr_policy: "step"
# every 30 epochs, decrease the learning rate by factor 10.
stepsize: 211920
gamma: 0.1
# power: 0.75
display: 200

max_iter: 847680 # 120 epochs.

# every 30 epochs
snapshot: 211920
snapshot_prefix: "/home/hrw/caffe/examples/VIPLFaceNet/"
solver_mode: GPU


name: "deepID_network"
layer {
  name: "input_data"
  top: "data"
  top: "label"
  type: "Data"
  data_param {
    source: "/home/hrw/caffe/examples/VIPLFaceNet/train_lmdb"
    backend: LMDB
    batch_size: 64
  }
  transform_param {
    mean_file: "/home/hrw/caffe/examples/VIPLFaceNet/mean.binaryproto"
  }
  include {
    phase: TRAIN
  }
}
layer {
  name: "input_data"
  top: "data"
  top: "label"
  type: "Data"
  data_param {
    source: "/home/hrw/caffe/examples/VIPLFaceNet/val_lmdb"
    backend: LMDB
    batch_size: 64 
  }
  transform_param {
    mean_file: "/home/hrw/caffe/examples/VIPLFaceNet/mean.binaryproto"
  }
  include {
    phase: TEST
  }
}
layer {
  name: "conv1"
  type: "Convolution"
  bottom: "data"
  top: "conv1"
  param {
    name: "conv1_w"
    lr_mult: 1
    decay_mult: 0
  }
  param {
    name: "conv1_b"
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 20
    kernel_size: 4
    stride: 1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}

layer {
  name: "relu1"
  type: "ReLU"
  bottom: "conv1"
  top: "conv1"
}
layer {
  name: "pool1"
  type: "Pooling"
  bottom: "conv1"
  top: "pool1"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 2
  }
}
layer {
  name: "conv2"
  type: "Convolution"
  bottom: "pool1"
  top: "conv2"
  param {
    name: "conv2_w"
    lr_mult: 1
    decay_mult: 0
  }
  param {
    name: "conv2_b"
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 40
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}

layer {
  name: "relu2"
  type: "ReLU"
  bottom: "conv2"
  top: "conv2"
}
layer {
  name: "pool2"
  type: "Pooling"
  bottom: "conv2"
  top: "pool2"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 1
  }
}
layer {
  name: "conv3"
  type: "Convolution"
  bottom: "pool2"
  top: "conv3"
  param {
    name: "conv3_w"
    lr_mult: 1
    decay_mult: 0
  }
  param {
    name: "conv3_b"
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 60
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}

layer {
  name: "relu3"
  type: "ReLU"
  bottom: "conv3"
  top: "conv3"
}
layer {
  name: "pool3"
  type: "Pooling"
  bottom: "conv3"
  top: "pool3"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 2
  }
}
layer {
  name: "conv4"
  type: "Convolution"
  bottom: "pool3"
  top: "conv4"
  param {
    name: "conv4_w"
    lr_mult: 1
    decay_mult: 0
  }
  param {
    name: "conv4_b"
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 80
    kernel_size: 2
    stride: 1
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}
layer {
  name: "relu4"
  type: "ReLU"
  bottom: "conv4"
  top: "conv4"
}
layer {
  name: "fc160_1"
  type: "InnerProduct"
  bottom: "pool3"
  top: "fc160_1"
  param {
    name: "fc160_1_w"
    lr_mult: 1
    decay_mult: 1
  }
  param {
    name: "fc160_1_b"
    lr_mult: 2
    decay_mult: 1
  }
  inner_product_param {
    num_output: 160
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}

layer {
  name: "fc160_2"
  type: "InnerProduct"
  bottom: "conv4"
  top: "fc160_2"
  param {
    name: "fc160_2_w"
    lr_mult: 1
    decay_mult: 1
  }
  param {
    name: "fc160_2_b"
    lr_mult: 2
    decay_mult: 1
  }
  inner_product_param {
    num_output: 160
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}

layer {
  name: "fc160"
  type: "Eltwise"
  bottom: "fc160_1"
  bottom: "fc160_2"
  top: "fc160"
  eltwise_param {
    operation: SUM
  }
}
layer {
  name: "dropout"
  type: "Dropout"
  bottom: "fc160"
  top: "fc160"
  dropout_param {
    dropout_ratio: 0.4
  }
}

layer {
  name: "fc_class"
  type: "InnerProduct"
  bottom: "fc160"
  top: "fc_class"
  param {
    name: "fc_class_w"
    lr_mult: 1
    decay_mult: 1
  }
  param {
    name: "fc_class_b"
    lr_mult: 2
    decay_mult: 1
  }
  inner_product_param {
    num_output: 10575
    weight_filler {
      type: "gaussian"
      std: 0.01
    }
    bias_filler {
      type: "constant"
    }
  }
}
layer {
  name: "loss"
  type: "SoftmaxWithLoss"
  bottom: "fc_class"
  bottom: "label"
  top: "loss"
}
layer {
  name: "accuracy"
  type: "Accuracy"
  bottom: "fc_class"
  bottom: "label"
  top: "accuracy"
  include {
    phase: TEST
  }
}
 
已邀请:

爱在路上 - 想成为菜鸟中的战斗机

赞同来自:

我的也是,效果不好,你试过用VGG什么做finetune吗??

要回复问题请先登录注册