-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Multi label Data and MultiLabel Accuracy #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Nice, thanks Sergio! Could you rebase to squash the fixes, linting, and the like to make this easier to read? |
I will, do you use a nice tool to squash commits and make it nicer? Sergio 2014-06-19 21:42 GMT-07:00 Evan Shelhamer notifications@github.com:
|
I just do an interactive rebase. For any commits you want to squash you http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html I'm not sure if that qualifies as a nice tool but I like it haha. Thanks On Sat, Jun 21, 2014 at 4:47 AM, Sergio Guadarrama <notifications@github.com
|
@shelhamer I have cleaned a bit the commits, could try that it works for you? |
Yes, but only after Tuesday. On Monday, June 23, 2014, Sergio Guadarrama notifications@github.com
|
@sguada Could I use this feature for face points alignment? As you know, with face point alignment problem, the input is a face image and label output is face points coordinates. Does this feature support that? Or does caffe support that model type? |
@thuanvh I wouldn't use multi-label for that problem, multi-label assumes a discrete set of labels, rather than a vector of coordinates. So this PR is useful for image tagging or image classification (when one image can be classified with two or more labels), but not for regression. Look at #512 and #147 on how to do regression. You probably want to minimize the distance between the predicted positions and the ground truth. So using a euclidian loss seems a good first attempt. You can use it directly if all the images have the same number of points, but you would need to adapt the code if that is not the case. |
Should this be split into a multilabel accurac 8000 y and a multilabel loss as in #522 ? |
@sguada I would like to use this PR because in my net I would like to make multi-class prediction. In my case I have a groundtruth like this: (3 classes) How should I format my labels? For example if the groundtruth is [True 23] I think it should be something like this: [1], [-1, -1, 1, -1], [-1, -1, -1, 1]. (I added brackets to make my example clearer) Is it correct? |
I am trying this PR ^^ But not sure what layer type should I use for the last layer for training / validation?
Thanks in advance! |
You should use |
@onauparc I'm a bit confuse about your multi-label problem, since it seems a mix of multi-class and and regression. But if you think that the encoding your proposed makes sense then this PR should be able to handle it. |
@sguada I mean something like the schema at page 13 in this pubblication: http://arxiv.org/abs/1312.6082v4 |
It's a long post. I had tried for several days, still can not get a working sample Q_Q I have done follow works modify
|
@yocox What happens is that the multi-label format should be a vector of {-1,0,1} one per label. So your train file should look like
What means that file1.jpg is have label 0 and 1 but no 2, and file2.jpg have label 2 but not 0 or 1. I think your modification of conver_imageset looks good, just try to change your input file. |
@bhack It is totally possible handle multiple softmax layers and then concat them. The only thing that need to be address is how the labels are going to be encoded. One solution using this PR would be to encode the multiple labels as a vector of binary labels. For example, let's assume we want to code length 0, 1, 2, >2 and then two digits 0..9 that could be done by:
|
@shelhamer I don't know how to clean this PR more, should I close it and start a new one with fewer and better grouped commits? |
Seems that not merge anymore |
@sguada We have already experimented this encoding also on other frameworks and works fine. |
I think for that you just need multiple accuracy layers, each one with one Sergio 2014-06-30 7:33 GMT-07:00 bhack notifications@github.com:
|
@sguade Yes off course but this doesn't work if we want our accurancy incremented on the global goal of having all the multiple accurancy layer (target) correct. |
@bhack yeah, that's correct if you want a global loss then you need to combine them. Are you interested in writing an example? I will either rebase again or start a cleaner PR |
@sguada Yes. One example is in Street View House Number (pag. 13 http://arxiv.org/pdf/1312.6082v4.pdf). The accuracy need to handle all softmax layers because the goal is to have the correct House Number sequence (5 digit max) with the right length (1 softmax). So we have six softmax layer with a global loss. |
@bhack, I know the paper and that example, I meant if you are willing to On Monday, June 30, 2014, bhack notifications@github.com wrote:
Sergio |
Is #1414 really intended to replace this PR or is it IndirectionLayer just one part of it? (Trying to get my bearings in these two very heavily commented PRs.) |
@bgreen-litl There is also #1380 |
Has there been any progress on this PR? @sguada Have you been working lately on this? |
@sguada I am trying to learn a model that outputs a word(more than 10 characters) so how to write the code length as a binary vector? should it be [0,..9,>9] or could you let me kknow the current trend for multi-label |
I am also interested in data and accuracy layers that support multi-label classification. Can someone clarify the states of the PRs? |
@gavinmh @danielhauagge See last commenta in #1380 |
fatal error: cublas_v2.h: No such file or directory Same problem happened when I complied the example released by @yocox , did you deal with it? @misaghkord @yocox I have set CPU_ONLY:=1 but it still happened. |
Wow! Tomorrow is exactly a year since this PR was created. If I need to solve a multi label classification problem, what is the approach I should follow with caffe? ps: I'm still digging through all the references posted here. |
Is this only a documentation problem now? See #1698 |
Closing this PR since it is against the defunct dev branch and we concluded that losses and layers are capable of handling multilabel problems so this is a documentation / example issue and not a technical problem that needs further layers. |
The dev branch has been deprecated and deleted. Why didn't this feature merged into the master branch? |
@bhack In this multi-task setting, it's ok for training by using the multi-dimensional labels with But how about the accuracy? How to compute the total accuracy of a sample during test? Have you customized the accuracy layer? |
I've done something cited in comments at #2935 but was never reviewed and now closed because against dev branch. |
Where is the document/example explaining how to handle multilabel problems with current system? |
Many thanks to @sguada , I am using your code now. |
Is this finalized? |
Hi there, siddharth here, i am working on a project to recognize products and have used 200 pics each to train the 11 classes. but when i am testing it is showing only one class at a time. For labeling i have used LabelImg. |
This PR allows to use multi-label data {-1,0,1} with 0 means ignore, -1 negative and 1 positive.
@sergeyk review