Multi labels ImageData layer ?

764 vues
Accéder directement au premier message non lu

Julien

non lue,
22 janv. 2016, 09:50:0922/01/2016
à Caffe Users
Hi there !

Is it possible to use ImageData layer with several label per images ?
(or a way to split a single label ?)

Thanks

Julien

Julien

non lue,
22 janv. 2016, 10:21:2922/01/2016
à Caffe Users
I have just figured out than I can add several ImageData Layer :

One with :
img1 label1-X
img2 label1-Y
...

Another one with : 
img1 label2-X
img2 label2-Y
...

However if I correctly understand... my images are read two times.. I am right ? is there a solution ?
Le message a été supprimé

Jan C Peters

non lue,
25 janv. 2016, 08:35:3625/01/2016
à Caffe Users
Well, use a different means of data input. My favorite is HDF5, since you are completely free in the shape of your data _and_ labels. The ImageData layer is a quite restrictive and less efficient means of input and should only be used in the most simple scenarios, not for any serious training.

Jan

Julien

non lue,
25 janv. 2016, 11:26:0225/01/2016
à Caffe Users
That's what I have used previously and I was hoping there was (now) a simpler solution using ImageData :(
Ok I'll try with my hdf5 or lmdb scripts ^^

Thanks !

Julien

zzz

non lue,
25 janv. 2016, 20:31:2825/01/2016
à Caffe Users

Hi
Julien

I am trying figure it out also. Do you simple configure multiple ImageData Layer for input?
I tried this way. It seems that Caffe treats each data ImageData Layer as a independent net.
Even I just configure an extra ImageData Layer without connect it to any other layers. Caffe automatically trains use it as input

For example, I configure a ImageData layer called distlabel

When I train it. I will output like this

Jan C Peters

non lue,
26 janv. 2016, 05:23:3626/01/2016
à Caffe Users
Well, creating a text file with a long list of filenames is not much faster than creating a corresponding HDF5 file, at least from a scripting standpoint....

@zzz: I have a hard time understanding what you want to say. But I can tell you this: Caffe treats blobs that are not used as "bottom" in any layer as output blobs. What happens in your example is that The separate ImageData layer reads in images/labels that are immediately interpreted as the output of the network, without ever being used for anything. I really do not see why this would be useful. What Julien did is adding a separate ImageData layer, like you, but connecting its top blob(s) to other layers (probably some loss layer). If this is used for multilabel classification, where you have more than one label for every single image, this harms performance a bit, since the image is actually loaded twice, once by each imagedata layer.

Jan

zzz

non lue,
26 janv. 2016, 09:41:3526/01/2016
à Caffe Users
Sorry for my bad description. I see this time. So your suggestion of using one image and two mask label as inputs is HDF5 Layer, which would be more efficiently, right?
I will have a try. Thanks 
Thanks for your answers in the two posts, Jan. It's very helpful to me.

Julien

non lue,
26 janv. 2016, 10:00:3726/01/2016
à Caffe Users
Jan you perfectly understood my problem ;)
And yes Unfortunately the image is loaded twice ! It would be a nice feature to provide two files when working with ImageData : One with a list of images and another one with a list of labels ( using the same order of course )

As I already have some scripts which use hdf5 / lmdb, I'll continue with them 

Thanks again

Jan C Peters

non lue,
26 janv. 2016, 10:10:2626/01/2016
à Caffe Users
You always have the option of writing up a new layer type that does exactly what you want ;-). For example you could use the ImageData layer as a basis and then add on that to support two labels per image. Should not be all too difficult, since the layer does at least _almost_ what you want to do, apparently.

Jan

Julien

non lue,
26 janv. 2016, 10:14:3626/01/2016
à Caffe Users
It's on my todolist... If I have some time !
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message