Caffe中的多标签回归 [英] Multi label regression in Caffe

查看:133
本文介绍了Caffe中的多标签回归的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我根据kaggle面部关键点竞争从输入图像中提取30个面部关键点(x,y).

i am extracting 30 facial keypoints (x,y) from an input image as per kaggle facialkeypoints competition.

我如何设置caffe以运行回归并产生30维输出?

How do i setup caffe to run a regression and produce 30 dimensional output??.

Input: 96x96 image
Output: 30 - (30 dimensions).

我如何相应地设置咖啡?我正在使用EUCLIDEAN_LOSS(平方和)来获取回归输出.这是一个使用caffe的简单Logistic回归模型,但无法正常工作.外观精度图层无法处理多标签输出.

How do i setup caffe accordingly?. I am using EUCLIDEAN_LOSS (sum of squares) to get the regressed output. Here is a simple logistic regressor model using caffe but it is not working. Looks accuracy layer cannot handle multi-label output.

I0120 17:51:27.039113  4113 net.cpp:394] accuracy <- label_fkp_1_split_1
I0120 17:51:27.039135  4113 net.cpp:356] accuracy -> accuracy
I0120 17:51:27.039158  4113 net.cpp:96] Setting up accuracy
F0120 17:51:27.039201  4113 accuracy_layer.cpp:26] Check failed: bottom[1]->channels() == 1 (30 vs. 1) 
*** Check failure stack trace: ***
    @     0x7f7c2711bdaa  (unknown)
    @     0x7f7c2711bce4  (unknown)
    @     0x7f7c2711b6e6  (unknown)

这是图层文件:

name: "LogReg"
layers {
  name: "fkp"
  top: "data"
  top: "label"
  type: HDF5_DATA
  hdf5_data_param {
   source: "train.txt"
   batch_size: 100
  }
    include: { phase: TRAIN }

}

layers {
  name: "fkp"
  type: HDF5_DATA
  top: "data"
  top: "label"
  hdf5_data_param {
    source: "test.txt"
    batch_size: 100
  }

  include: { phase: TEST }
}

layers {
  name: "ip"
  type: INNER_PRODUCT
  bottom: "data"
  top: "ip"
  inner_product_param {
    num_output: 30
  }
}
layers {
  name: "loss"
  type: EUCLIDEAN_LOSS
  bottom: "ip"
  bottom: "label"
  top: "loss"
}

layers {
  name: "accuracy"
  type: ACCURACY
  bottom: "ip"
  bottom: "label"
  top: "accuracy"
  include: { phase: TEST }
}

推荐答案

我找到了:)

我将SOFTLAYER替换为EUCLIDEAN_LOSS函数,并更改了输出数量.奏效了.

I replaced the SOFTLAYER to EUCLIDEAN_LOSS function and changed the number of outputs. It worked.

layers {
  name: "loss"
  type: EUCLIDEAN_LOSS
  bottom: "ip1"
  bottom: "label"
  top: "loss"
}

HINGE_LOSS也是另一种选择.

HINGE_LOSS is also another option.

这篇关于Caffe中的多标签回归的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆