pytorch-image-models
pytorch-image-models copied to clipboard
[FEATURE] Multi-Label Classification
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 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....
That's Awesome. Looking Forward to your update!
thanks for this great job which keep us in touch with SOTA things.
looking forward to this.
Thank you.
@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
@yang-ruixin , seems you're not using BCE losses. have you test your code with multi-label classification task ?
@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
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.
@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
- 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
- is bce loss better than MultiLabelSoft loss?
- can we apply Spatial transformers insider transformers for localization of attributes detected
Thanks in advance