All Projects → hytseng0509 → Crossdomainfewshot

hytseng0509 / Crossdomainfewshot

Cross-Domain Few-Shot Classification via Learned Feature-Wise Transformation (ICLR 2020 spotlight)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Crossdomainfewshot

What I Have Read
Paper Lists, Notes and Slides, Focus on NLP. For summarization, please refer to https://github.com/xcfcode/Summarization-Papers
Stars: ✭ 110 (-46.08%)
Mutual labels:  meta-learning
Mfr
Learning Meta Face Recognition in Unseen Domains, CVPR, Oral, 2020
Stars: ✭ 127 (-37.75%)
Mutual labels:  meta-learning
Mzsr
Meta-Transfer Learning for Zero-Shot Super-Resolution (CVPR, 2020)
Stars: ✭ 181 (-11.27%)
Mutual labels:  meta-learning
Fewshotnlp
The source codes of the paper "Improving Few-shot Text Classification via Pretrained Language Representations" and "When Low Resource NLP Meets Unsupervised Language Model: Meta-pretraining Then Meta-learning for Few-shot Text Classification".
Stars: ✭ 115 (-43.63%)
Mutual labels:  meta-learning
Meta Learning Lstm Pytorch
pytorch implementation of Optimization as a Model for Few-shot Learning
Stars: ✭ 121 (-40.69%)
Mutual labels:  meta-learning
Savn
Learning to Learn how to Learn: Self-Adaptive Visual Navigation using Meta-Learning (https://arxiv.org/abs/1812.00971)
Stars: ✭ 135 (-33.82%)
Mutual labels:  meta-learning
Gnn Meta Attack
Implementation of the paper "Adversarial Attacks on Graph Neural Networks via Meta Learning".
Stars: ✭ 99 (-51.47%)
Mutual labels:  meta-learning
Meta Learning Papers
A classified list of meta learning papers based on realm.
Stars: ✭ 193 (-5.39%)
Mutual labels:  meta-learning
Keita
My personal toolkit for PyTorch development.
Stars: ✭ 124 (-39.22%)
Mutual labels:  meta-learning
Metalearning4nlp Papers
A list of recent papers about Meta / few-shot learning methods applied in NLP areas.
Stars: ✭ 163 (-20.1%)
Mutual labels:  meta-learning
Boml
Bilevel Optimization Library in Python for Multi-Task and Meta Learning
Stars: ✭ 120 (-41.18%)
Mutual labels:  meta-learning
Metar Cnn
Meta R-CNN : Towards General Solver for Instance-level Low-shot Learning
Stars: ✭ 120 (-41.18%)
Mutual labels:  meta-learning
Awesome Federated Learning
All materials you need for Federated Learning: blogs, videos, papers, and softwares, etc.
Stars: ✭ 149 (-26.96%)
Mutual labels:  meta-learning
Meta Blocks
A modular toolbox for meta-learning research with a focus on speed and reproducibility.
Stars: ✭ 110 (-46.08%)
Mutual labels:  meta-learning
Promp
ProMP: Proximal Meta-Policy Search
Stars: ✭ 181 (-11.27%)
Mutual labels:  meta-learning
Maxl
The implementation of "Self-Supervised Generalisation with Meta Auxiliary Learning" [NeurIPS 2019].
Stars: ✭ 101 (-50.49%)
Mutual labels:  meta-learning
Canet
The code for paper "CANet: Class-Agnostic Segmentation Networks with Iterative Refinement and Attentive Few-Shot Learning"
Stars: ✭ 135 (-33.82%)
Mutual labels:  meta-learning
Openml Python
Python module to interface with OpenML
Stars: ✭ 202 (-0.98%)
Mutual labels:  meta-learning
Hyperactive
A hyperparameter optimization and data collection toolbox for convenient and fast prototyping of machine-learning models.
Stars: ✭ 182 (-10.78%)
Mutual labels:  meta-learning
Meta Weight Net
NeurIPS'19: Meta-Weight-Net: Learning an Explicit Mapping For Sample Weighting (Pytorch implementation for noisy labels).
Stars: ✭ 158 (-22.55%)
Mutual labels:  meta-learning

Cross-Domain Few-Shot Classification via Learned Feature-Wise Transformation

[Project Page][Paper]

Pytorch implementation for our cross-domain few-shot classification method. With the proposed learned feature-wise transformation layers, we are able to:

  1. improve the performance of exisiting few-shot classification methods under cross-domain setting
  2. achieve stat-of-the-art performance under single-domain setting.

Contact: Hung-Yu Tseng ([email protected])

Paper

Please cite our paper if you find the code or dataset useful for your research.

Cross-Domain Few-Shot Classification via Learned Feature-Wise Transformation
Hung-Yu Tseng, Hsin-Ying Lee, Jia-Bin Huang, Ming-Hsuan Yang
International Conference on Learning Representations (ICLR), 2020 (spotlight)

@inproceedings{crossdomainfewshot,
  author = {Tseng, Hung-Yu and Lee, Hsin-Ying and Huang, Jia-Bin and Yang, Ming-Hsuan},
  booktitle = {International Conference on Learning Representations},
  title = {Cross-Domain Few-Shot Classification via Learned Feature-Wise Transformation},
  year = {2020}
}

Usage

Prerequisites

  • Python >= 3.5
  • Pytorch >= 1.3 and torchvision (https://pytorch.org/)
  • You can use the requirements.txt file we provide to setup the environment via Anaconda.
conda create --name py36 python=3.6
conda install pytorch torchvision -c pytorch
pip3 install -r requirements.txt

Install

Clone this repository:

git clone https://github.com/hytseng0509/CrossDomainFewShot.git
cd CrossDomainFewShot

Datasets

Download 5 datasets seperately with the following commands.

  • Set DATASET_NAME to: cars, cub, miniImagenet, places, or plantae.
cd filelists
python3 process.py DATASET_NAME
cd ..
  • Refer to the instruction here for constructing your own dataset.

Feature encoder pre-training

We adopt baseline++ for MatchingNet, and baseline from CloserLookFewShot for other metric-based frameworks.

  • Download the pre-trained feature encoders.
cd output/checkpoints
python3 download_encoder.py
cd ../..
  • Or train your own pre-trained feature encoder (specify PRETRAIN to baseline++ or baseline).
python3 train_baseline.py --method PRETRAIN --dataset miniImagenet --name PRETRAIN --train_aug

Training with multiple seen domains

Baseline training w/o feature-wise transformations.

  • METHOD : metric-based framework matchingnet, relationnet_softmax, or gnnnet.
  • TESTSET: unseen domain cars, cub, places, or plantae.
python3 train_baseline.py --method METHOD --dataset multi --testset TESTSET --name multi_TESTSET_ori_METHOD --warmup PRETRAIN --train_aug

Training w/ learning-to-learned feature-wise transformations.

python3 train.py --method METHOD --dataset multi --testset TESTSET --name multi_TESTSET_lft_METHOD --warmup PRETRAIN --train_aug

Evaluation

Test the metric-based framework METHOD on the unseen domain TESTSET.

  • Specify the saved model you want to evaluate with --name (e.g., --name multi_TESTSET_lft_METHOD from the above example).
python3 test.py --method METHOD --name NAME --dataset TESTSET

Note

  • This code is built upon the implementation from CloserLookFewShot.
  • The dataset, model, and code are for non-commercial research purposes only.
  • You can change the number of shot (i.e. 1/5 shots) using the argument --n_shot.
  • You need a GPU with 16G memory for training the gnnnet approach w/ learning-to-learned feature-wise transformations.
  • 04/2020: We've corrected the code for training with multiple domains. Please find the link here for the model trained with the current implementation on Pytorch 1.4.
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].