带有多标签图像的咖啡 [英] caffe with multi-label images

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

问题描述

我有一个带有多个标签的图像数据集;数据集中有100个类别,每个图像都有1至5个与之关联的标签.

I have a dataset of images that have multiple labels; There are 100 classes in the dataset, and each image has 1 to 5 labels associated with them.

我正在按照以下网址中的说明进行操作:

I'm following the instruction in the following URL:

https://github.com/BVLC/caffe/issues/550

它说我需要生成一个文本文件,其中列出了图像及其标签,如

It says that I need to generate a text file listing the images and its labels as in

/home/my_test_dir/picture-foo.jpg 0
/home/my_test_dir/picture-foo1.jpg 1

就我而言,由于我具有多标签图像,因此按如下所示简单地添加标签是否可行?

In my case, since I have multi-label images, does it work to simply add labels as in following?

/home/my_test_dir/picture-foo.jpg 0 2 5
/home/my_test_dir/picture-foo1.jpg 1 4

我感觉可能不会那么简单,如果我是对的,那么在设置Caffe的过程中,我应该在哪一步以及如何整合数据集的多标签性?

I have a feeling that it's probably not going to be that simple, and if I'm right, in what step and how should I integrate the multi-label-ness of the dataset in the process of setting up Caffe?

推荐答案

我相信Shai的答案不再是最新的. Caffe支持HDF5和LMDB格式的多标签/矩阵基础真理 . github注释中的python代码段演示了如何构造多标签LMDB基本事实(有关HDF5格式,请参见 Shai的答案). 与单标签图像数据集的构造不同,为图像构造lmdb,而为多标签地面真相数据构造第二个单独的lmdb.该代码段处理了空间多标签地面真实情况,可用于对图像进行像素级标记.

I believe Shai's answer is no longer up-to-date. Caffe supports multi-label/matrix ground truth for HDF5 and LMDB formats. The python snippet in this github comment demonstrates how to construct multi-label LMDB ground truth (see Shai's answer for HDF5 format). Different from the construction of single-label image datasets, an lmdb is constructed for the images while a second separate lmdb is constructed for the multi-label ground truth data. The snippet deals with spatial multi-label ground truth useful for pixel-wise labeling of images.

将数据写入lmdb的顺序至关重要.基本事实的顺序必须与图像的顺序匹配.

The order in which data is written to the lmdb is crucial. The order of the ground truth must match the order of the images.

诸如SOFTMAX_LOSS,EUCLIDEAN_LOSS,SIGMOID_CROSS_ENTROPY_LOSS之类的亏损层也支持多标签数据. 但是,精度层仍然仅限于单标签数据.您可能需要关注此github问题,以跟踪何时将此功能添加到咖啡.

Loss layers such as SOFTMAX_LOSS, EUCLIDEAN_LOSS, SIGMOID_CROSS_ENTROPY_LOSS also support multi-label data. However, the Accuracy layer is still limited to single-label data. You might want to follow this github issue to keep track of when this feature is added to Caffe.

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

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