Skip to content

[FEATURE] Multi-Label Classification #452

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

Open
liangshi036 opened this issue Feb 24, 2021 · 8 comments
Open

[FEATURE] Multi-Label Classification #452

liangshi036 opened this issue Feb 24, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@liangshi036
Copy link

liangshi036 commented Feb 24, 2021

How do I apply this nice repo to Multi-Label Classification task ?
That is , a image has multi labels,I'd like to get the each label's confidence.

sound like add some features in dataset.py? or more than this file?

Thanks.

@liangshi036 liangshi036 added the enhancement New feature or request label Feb 24, 2021
@liangshi036 liangshi036 changed the title multi task learning Apply to Multi-Label Classification Feb 25, 2021
@rwightman rwightman changed the title Apply to Multi-Label Classification Support Multi-Label Classification Feb 25, 2021
@rwightman
Copy link
Collaborator

rwightman commented Feb 25, 2021

@liangshi036 I do have an (eventual) plan to add support for BCE and/or MultiLabelSoft margin losses for use in multi-label tasks and include support for a suitable dataset. Have a number of other significant refactorings of the train code to support TPU ahead of that in the queue though....

@rwightman rwightman changed the title Support Multi-Label Classification [FEATURE] Multi-Label Classification Feb 25, 2021
@liangshi036
Copy link
Author

That's Awesome. Looking Forward to your update!

thanks for this great job which keep us in touch with SOTA things.

@ravich3373
Copy link

looking forward to this.

Thank you.

@yang-ruixin
Copy link

yang-ruixin commented Mar 19, 2021

@rwightman
Thank Ross for his great work.
I've implemented multi-label classification based on his code.
Here is the link:
https://github.com/yang-ruixin/PyTorch-Image-Models-Multi-Label-Classification

Cheers,
Ruixin

@liangshi036
Copy link
Author

@yang-ruixin , seems you're not using BCE losses. have you test your code with multi-label classification task ?

@yang-ruixin
Copy link

@yang-ruixin , seems you're not using BCE losses. have you test your code with multi-label classification task ?

Hi there,

Sure I've tested my code, with fashion-product-images dataset and another private dataset.
BCE loss, B stands for binary, but in our case, each label has more than two classes, hence you cannot use BCE loss.
The loss I used is the same as Ross' loss.
In MultiLabelModel class, get_loss method, the input argument loss_fn is defined in lines 567~578 in ./train.py.

Ruixin

@liangshi036
Copy link
Author

BCE (nn.BCEWithLogitsLoss) is a elegant way to treats output independently (as logit loss) in multi-label classification task .
maybe the same as you do in your repo.

you can post your test result by the way.

@abhigoku10
Copy link

@yang-ruixin @liangshi036 @rwightman thanks for sharing your source code, i am trying to do attribute recognition for the person using transformers which is a multilabel classification problem statement, can you please share your thought on the following points

  1. I am using coat,pit architectures can remove the classifier head and add my classifier? can you share some references on how to do it
  2. is bce loss better than MultiLabelSoft loss?
  3. can we apply Spatial transformers insider transformers for localization of attributes detected

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants