如何训练CNN获取图像的特定补丁?

时间:2018-06-10 09:32:39

标签: deep-learning caffe image-segmentation pycaffe matcaffe

我需要训练CNN来分割对象周围的特定补丁。我有补丁的坐标,我想为图像的每个补丁训练一个CNN。但是,我不知道如何将图像区域作为输入层?

我看到RCNN的主要思想是WINDOW_DATA Layer

layers {
  name: "data"
  type: WINDOW_DATA
  top: "data"
  top: "label"
  window_data_param {
    source: "examples/finetune_pascal_detection/window_file_2007_trainval.txt"
    batch_size: 128
    fg_threshold: 0.5
    bg_threshold: 0.5
    fg_fraction: 0.25
    context_pad: 16
    crop_mode: "warp"
  }
  transform_param {
    mirror: true
    crop_size: 227
    mean_file: "data/ilsvrc12/imagenet_mean.binaryproto"
  }
  include: { phase: TRAIN }

其中window_file_2007_trainval.txt是这样的文件:

# 0 #id of image
/home/0.3089.jpg #path to image
3 # nb of channel
360 #height
480 #width
13 #number of box
1 1.00 136 73 304 241 #class-overlaping between current box and ground-truth box-x1-y1-x2-y2
1 0.25 179 177 299 267
0 0.00 310 88 430 178
0 0.00 349 178 469 268
1 0.00 85 36 145 81
1 0.03 225 43 285 88
0 0.00 364 87 424 132
1 0.01 229 237 259 259
0 0.00 140 319 170 341
0 0.00 36 63 66 85
0 0.00 367 296 382 307
0 0.00 252 269 267 280
0 0.00 318 236 333 247

我的问题是,如何在指定的补丁中提供图像并训练CNN,其中我的图像是.mat的医学图像,我担心的格式是改变为png值正在改变?

或者你有什么建议吗?

0 个答案:

没有答案