how to use HDF5 layer for multiclass images as ground truth

75 views
Skip to first unread message

Majid Azimi

unread,
Mar 8, 2016, 10:05:43 AM3/8/16
to Caffe Users

Hi!

I would like to ask if our ground truth are images e.g. flow maps... how to put call this labels in our prototxt files. in this case I am solving a regression problem which I have an image of flow magnitude as label and want to train my net with these kinds of labels. previously I did classification with caffe using imagedata layer and declaring GT was easy, but in this case, I didn't get it how to put this ground truth into hdf5 file and basically the txt file it refers to. I've so far come to know I should use hdf5 layers for multiclass labeling but in my case I have this multi class labels as images  which I don't know to make it work.

my flow magnitude ground truth is: WxHx1 (here only the magnitude and we don't use the 3 channel color coded flow magnitude)

my flow vector ground truth is: WxHx2  (as for x direction and y direction)


########## I didn't get it how to use this layer and how to make those training data into list.txt
layer {
name: "data"
type: "HDF5_DATA"
top: "data"
top: "magnitude_labels"
top: "vector_labels"
include {
phase: TRAIN
}
hdf5_data_param {
source: "../list.txt"
batch_size: 128
}

layer {
name: "data"
type: "HDF5_DATA"
top: "data"
top: "magnitude_labels"
top: "vector_labels"
include {
phase: TEST
}
hdf5_data_param {
source: "../list.txt"
batch_size: 128
}
########################################train_val.prototxt  which I used for classification.
name: "FCN-ClassificationCaffeNet"
layer {
name: "data"
type: "ImageData"
top: "data"
top: "magnitude_labels"
top: "vector_labels"
include {
phase: TRAIN
}
transform_param {
mirror: true
crop_size: 227
mean_file: "data/ilsvrc12/imagenet_mean.binaryproto"
}
image_data_param {
source: "data//train.txt"
batch_size: 50
new_height: 256
new_width: 256
}
}
layer {
name: "data"
type: "ImageData"
top: "data"
top: "label"
include {
phase: TEST
}
transform_param {
mirror: false
crop_size: 227
mean_file: "data/ilsvrc12/imagenet_mean.binaryproto"
}
image_data_param {
source: "data/test.txt"
batch_size: 50
new_height: 256
new_width: 256
}
}

Thanks a lot already for your help.

Reply all
Reply to author
Forward
0 new messages