All Projects → Alibaba-MIIL → ZS_SDL

Alibaba-MIIL / ZS_SDL

Licence: MIT License
Official Pytorch Implementation of: "Semantic Diversity Learning for Zero-Shot Multi-label Classification"(ICCV, 2021) paper

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ZS SDL

synse-zsl
Official PyTorch code for the ICIP 2021 paper 'Syntactically Guided Generative Embeddings For Zero Shot Skeleton Action Recognition'
Stars: ✭ 14 (-36.36%)
Mutual labels:  zero-shot-learning
kaggle-human-protein-atlas-image-classification
Kaggle 2018 @ Human Protein Atlas Image Classification
Stars: ✭ 34 (+54.55%)
Mutual labels:  multi-label-classification
multi-label-classification
machine-learning tensorflow multi-label-classification
Stars: ✭ 27 (+22.73%)
Mutual labels:  multi-label-classification
Zero-shot-Fact-Verification
Codes for ACL-IJCNLP 2021 Paper "Zero-shot Fact Verification by Claim Generation"
Stars: ✭ 39 (+77.27%)
Mutual labels:  zero-shot-learning
deep-eos
General-Purpose Neural Networks for Sentence Boundary Detection
Stars: ✭ 66 (+200%)
Mutual labels:  zero-shot-learning
FREE
Codes for the ICCV'21 paper "FREE: Feature Refinement for Generalized Zero-Shot Learning"
Stars: ✭ 28 (+27.27%)
Mutual labels:  zero-shot-learning
Natural-language-understanding-papers
NLU: domain-intent-slot; text2SQL
Stars: ✭ 77 (+250%)
Mutual labels:  zero-shot-learning
C-Tran
General Multi-label Image Classification with Transformers
Stars: ✭ 106 (+381.82%)
Mutual labels:  multi-label-classification
Awesome-Weak-Shot-Learning
A curated list of papers, code and resources pertaining to weak-shot classification, detection, and segmentation.
Stars: ✭ 142 (+545.45%)
Mutual labels:  zero-shot-learning
Caver
Caver: a toolkit for multilabel text classification.
Stars: ✭ 38 (+72.73%)
Mutual labels:  multi-label-classification
omikuji
An efficient implementation of Partitioned Label Trees & its variations for extreme multi-label classification
Stars: ✭ 69 (+213.64%)
Mutual labels:  multi-label-classification
GoEmotions-pytorch
Pytorch Implementation of GoEmotions 😍😢😱
Stars: ✭ 95 (+331.82%)
Mutual labels:  multi-label-classification
extremeText
Library for fast text representation and extreme classification.
Stars: ✭ 141 (+540.91%)
Mutual labels:  multi-label-classification
Feature-Generating-Networks
Zero Shot Learning with Feature Generating Networks
Stars: ✭ 31 (+40.91%)
Mutual labels:  zero-shot-learning
Awesome-Zero-Shot-Object-Detection
No description or website provided.
Stars: ✭ 89 (+304.55%)
Mutual labels:  zero-shot-learning
Zero-Shot-Learning
零样本学习
Stars: ✭ 20 (-9.09%)
Mutual labels:  zero-shot-learning
napkinXC
Extremely simple and fast extreme multi-class and multi-label classifiers.
Stars: ✭ 38 (+72.73%)
Mutual labels:  multi-label-classification
hierse
Zero-shot image tagging by hierarchical semantic embedding
Stars: ✭ 77 (+250%)
Mutual labels:  zero-shot-learning
domain-adaptation-capls
Unsupervised Domain Adaptation via Structured Prediction Based Selective Pseudo-Labeling
Stars: ✭ 43 (+95.45%)
Mutual labels:  zero-shot-learning
neuron-importance-zsl
[ECCV 2018] code for Choose Your Neuron: Incorporating Domain Knowledge Through Neuron Importance
Stars: ✭ 56 (+154.55%)
Mutual labels:  zero-shot-learning

PWC

Semantic Diversity Learning for Zero-Shot Multi-label Classification

Paper

Official PyTorch Implementation

Avi Ben-Cohen, Nadav Zamir, Emanuel Ben Baruch, Itamar Friedman, Lihi Zelnik-Manor
DAMO Academy, Alibaba Group Abstract Training a neural network model for recognizing multiple labels associated with an image, including identifying unseen labels, is challenging, especially for images that portray numerous semantically diverse labels. As challenging as this task is, it is an essential task to tackle since it represents many real-world cases, such as image retrieval of natural images. We argue that using a single embedding vector to represent an image, as commonly practiced, is not sufficient to rank both relevant seen and unseen labels accurately. This study introduces an end-to-end model training for multi-label zero-shot learning that supports semantic diversity of the images and labels. We propose to use an embedding matrix having principal embedding vectors trained using a tailored loss function. In addition, during training, we suggest up-weighting in the loss function image samples presenting higher semantic diversity to encourage the diversity of the embedding matrix. Extensive experiments show that our proposed method improves the zero-shot model’s quality in tag-based image retrieval achieving SoTA results on several common datasets (NUS-Wide, COCO, Open Images).

Semantic Diversity Learning (SDL) Implementation

In this PyTorch file, we provide an implementation of our semantic diversity learning (SDL) loss for zero shot multi-label classification.

Pretrained Models

We provide a pre-trained model on NUS-WIDE dataset, which can be found here

Inference Code

We provide an inference code, that demonstrates how to load our model, pre-process an image and do actuall inference. Example run:

python infer.py  \
--model_path=./models_local/NUS_mtresnet_224.pth \
--model_name=tresnet_m \
--pic_path=./pics/140016_215548610_422b79b4d7_m.jpg \
--top_k=10 \

which will result in: Note that predicted "unseen" tags are indicated by * tag-name *.

Training Code

We provide a training code, that can be used to train our model.

  • The implementation in the provided training script is based on the ASL repository.
  • The annotations should be provided in COCO format.
  • To reproduce similar results to our paper results on COCO use the split provided in: Zero-Shot Object Detection.
  • The annotation files are expected to be in the metadata path under "zs_split" folder.
  • wordvec_array.pickle and cls_ids.pickle include coco word-vectors and seen-uneen class ids respectively, and should be located in the metadata path.
  • The pretrained imagenet based backbone can be downloaded here
  • Run the following training args:
python train.py  \
--data=./data/COCO/ \
--model-path=./models/tresnet_m.pth \
--image-size=608 \
--pretrain-backbone=1 \

Note: the resolution is higher as we compared to object detection based methods that use similar or larger input size.

Citation

@misc{bencohen2021semantic,
      title={Semantic Diversity Learning for Zero-Shot Multi-label Classification}, 
      author={Avi Ben-Cohen and Nadav Zamir and Emanuel Ben Baruch and Itamar Friedman and Lihi Zelnik-Manor},
      year={2021},
      eprint={2105.05926},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Acknowledgements

Several images from NUS-WIDE dataset are used in this project. Some components of this code implementation are adapted from the repository https://github.com/Alibaba-MIIL/ASL. We would like to thank Tal Ridnik for his valuable comments and suggestions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].