py-faster-rcnn/models/pascal_voc/ZF/faster_rcnn_alt_opt/stage1_fast_rcnn_train.pt

来源:互联网 发布:html5单页面静态源码 编辑:程序博客网 时间:2024/05/21 10:43

py-faster-rcnn/models/pascal_voc/ZF/faster_rcnn_alt_opt/stage1_fast_rcnn_train.pt

 

name: "ZF"

#三个模型文件,小型网络ZF,大型网络VGG16,中型网络#VGG_CNN_M_1024

layer {

  name: 'data'

  type: 'Python'

  top: 'data'

  top: 'rois'

  top: 'labels'

  top: 'bbox_targets'

  top: 'bbox_inside_weights'

  top: 'bbox_outside_weights'

  python_param {

    module: 'roi_data_layer.layer'

    layer: 'RoIDataLayer'

    param_str:"'num_classes': 21" #训练集类别,类别数+1  

  }

}

 

#========= conv1-conv5 ============

 

layer {

       name: "conv1"

       type: "Convolution"

       bottom: "data"

       top: "conv1"

       param { lr_mult: 1.0 }

       param { lr_mult: 2.0 }

       convolution_param {

              num_output: 96

              kernel_size: 7

              pad: 3

              stride: 2

       }

}

layer {

       name: "relu1"

       type: "ReLU"

       bottom: "conv1"

       top: "conv1"

}

layer {

       name: "norm1"

       type: "LRN"

       bottom: "conv1"

       top: "norm1"

       lrn_param {

              local_size: 3

              alpha: 0.00005

              beta: 0.75

              norm_region:WITHIN_CHANNEL

    engine: CAFFE

       }

}

layer {

       name: "pool1"

       type: "Pooling"

       bottom: "norm1"

       top: "pool1"

       pooling_param {

              kernel_size: 3

              stride: 2

              pad: 1

              pool: MAX

       }

}

layer {

       name: "conv2"

       type: "Convolution"

       bottom: "pool1"

       top: "conv2"

       param { lr_mult: 1.0 }

       param { lr_mult: 2.0 }

       convolution_param {

              num_output: 256

              kernel_size: 5

              pad: 2

              stride: 2

       }

}

layer {

       name: "relu2"

       type: "ReLU"

       bottom: "conv2"

       top: "conv2"

}

layer {

       name: "norm2"

       type: "LRN"

       bottom: "conv2"

       top: "norm2"

       lrn_param {

              local_size: 3

              alpha: 0.00005

              beta: 0.75

              norm_region:WITHIN_CHANNEL

    engine: CAFFE

       }

}

layer {

       name: "pool2"

       type: "Pooling"

       bottom: "norm2"

       top: "pool2"

       pooling_param {

              kernel_size: 3

              stride: 2

              pad: 1

              pool: MAX

       }

}

layer {

       name: "conv3"

       type: "Convolution"

       bottom: "pool2"

       top: "conv3"

       param { lr_mult: 1.0 }

       param { lr_mult: 2.0 }

       convolution_param {

              num_output: 384

              kernel_size: 3

              pad: 1

              stride: 1

       }

}

layer {

       name: "relu3"

       type: "ReLU"

       bottom: "conv3"

       top: "conv3"

}

layer {

       name: "conv4"

       type: "Convolution"

       bottom: "conv3"

       top: "conv4"

       param { lr_mult: 1.0 }

       param { lr_mult: 2.0 }

       convolution_param {

              num_output: 384

              kernel_size: 3

              pad: 1

              stride: 1

       }

}

layer {

       name: "relu4"

       type: "ReLU"

       bottom: "conv4"

       top: "conv4"

}

layer {

       name: "conv5"

       type: "Convolution"

       bottom: "conv4"

       top: "conv5"

       param { lr_mult: 1.0 }

       param { lr_mult: 2.0 }

       convolution_param {

              num_output: 256

              kernel_size: 3

              pad: 1

              stride: 1

       }

}

layer {

       name: "relu5"

       type: "ReLU"

       bottom: "conv5"

       top: "conv5"

}

 

#========= RCNN ============

 

layer {

  name: "roi_pool_conv5"

  type: "ROIPooling"

  bottom: "conv5"

  bottom: "rois"

  top: "roi_pool_conv5"

  roi_pooling_param {

    pooled_w: 6

    pooled_h: 6

    spatial_scale: 0.0625 # 1/16

  }

}

layer {

  name: "fc6"

  type: "InnerProduct"

  bottom: "roi_pool_conv5"

  top: "fc6"

  param { lr_mult: 1.0 }

  param { lr_mult: 2.0 }

  inner_product_param {

    num_output: 4096

  }

}

layer {

  name: "relu6"

  type: "ReLU"

  bottom: "fc6"

  top: "fc6"

}

layer {

  name: "drop6"

  type: "Dropout"

  bottom: "fc6"

  top: "fc6"

  dropout_param {

    dropout_ratio: 0.5

    scale_train: false

  }

}

layer {

  name: "fc7"

  type: "InnerProduct"

  bottom: "fc6"

  top: "fc7"

  param { lr_mult: 1.0 }

  param { lr_mult: 2.0 }

  inner_product_param {

    num_output: 4096

  }

}

layer {

  name: "relu7"

  type: "ReLU"

  bottom: "fc7"

  top: "fc7"

}

layer {

  name: "drop7"

  type: "Dropout"

  bottom: "fc7"

  top: "fc7"

  dropout_param {

    dropout_ratio: 0.5

    scale_train: false

  }

}

layer {

  name: "cls_score"

  type: "InnerProduct"

  bottom: "fc7"

  top: "cls_score"

  param { lr_mult: 1.0 }

  param { lr_mult: 2.0 }

  inner_product_param {

    num_output: 21#训练集类别,类别数+1  

    weight_filler {

      type: "gaussian"

      std: 0.01

    }

    bias_filler {

      type: "constant"

      value: 0

    }

  }

}

layer {

  name: "bbox_pred"

  type: "InnerProduct"

  bottom: "fc7"

  top: "bbox_pred"

  param { lr_mult: 1.0 }

  param { lr_mult: 2.0 }

  inner_product_param {

    num_output: 84#训练集类别,(类别数+1*4  

    weight_filler {

      type: "gaussian"

      std: 0.001

    }

    bias_filler {

      type: "constant"

      value: 0

    }

  }

}

layer {

  name: "loss_cls"

  type: "SoftmaxWithLoss"

  bottom: "cls_score"

  bottom: "labels"

  propagate_down: 1

  propagate_down: 0

  top: "cls_loss"

  loss_weight: 1

  loss_param {

    ignore_label: -1

    normalize: true

  }

}

layer {

  name: "loss_bbox"

  type: "SmoothL1Loss"

  bottom: "bbox_pred"

  bottom: "bbox_targets"

  bottom:"bbox_inside_weights"

  bottom:"bbox_outside_weights"

  top: "bbox_loss"

  loss_weight: 1

}

 

#========= RPN ============

# Dummy layers so that initial parameters are saved into the output net

 

layer {

  name: "rpn_conv1"

  type: "Convolution"

  bottom: "conv5"

  top: "rpn_conv1"

  param { lr_mult: 0 decay_mult: 0 }

  param { lr_mult: 0 decay_mult: 0 }

  convolution_param {

    num_output: 256

    kernel_size: 3 pad: 1 stride: 1

    weight_filler { type:"gaussian" std: 0.01 }

    bias_filler { type:"constant" value: 0 }

  }

}

layer {

  name: "rpn_relu1"

  type: "ReLU"

  bottom: "rpn_conv1"

  top: "rpn_conv1"

}

layer {

  name: "rpn_cls_score"

  type: "Convolution"

  bottom: "rpn_conv1"

  top: "rpn_cls_score"

  param { lr_mult: 0 decay_mult: 0 }

  param { lr_mult: 0 decay_mult: 0 }

  convolution_param {

    num_output: 18   # 2(bg/fg) * 9(anchors)

    kernel_size: 1 pad: 0 stride: 1

    weight_filler { type:"gaussian" std: 0.01 }

    bias_filler { type:"constant" value: 0 }

  }

}

layer {

  name: "rpn_bbox_pred"

  type: "Convolution"

  bottom: "rpn_conv1"

  top: "rpn_bbox_pred"

  param { lr_mult: 0 decay_mult: 0 }

  param { lr_mult: 0 decay_mult: 0 }

  convolution_param {

    num_output: 36   # 4 * 9(anchors)

    kernel_size: 1 pad: 0 stride: 1

    weight_filler { type:"gaussian" std: 0.01 }

    bias_filler { type:"constant" value: 0 }

  }

}

layer {

  name:"silence_rpn_cls_score"

  type: "Silence"

  bottom: "rpn_cls_score"

}

layer {

  name:"silence_rpn_bbox_pred"

  type: "Silence"

  bottom: "rpn_bbox_pred"

}