All Projects → peymanbateni → simple-cnaps

peymanbateni / simple-cnaps

Licence: MIT license
Source codes for "Improved Few-Shot Visual Classification" (CVPR 2020), "Enhancing Few-Shot Image Classification with Unlabelled Examples" (WACV 2022), and "Beyond Simple Meta-Learning: Multi-Purpose Models for Multi-Domain, Active and Continual Few-Shot Learning" (Neural Networks 2022 - in submission)

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects
shell
77523 projects

Projects that are alternatives of or similar to simple-cnaps

Awesome-Few-shot
Awesome Few-shot learning
Stars: ✭ 50 (-43.18%)
Mutual labels:  metric-learning, meta-learning, few-shot-learning, few-shot-recognition
sib meta learn
Code of Empirical Bayes Transductive Meta-Learning with Synthetic Gradients
Stars: ✭ 56 (-36.36%)
Mutual labels:  meta-learning, few-shot-learning, mini-imagenet
awesome-few-shot-meta-learning
awesome few shot / meta learning papers
Stars: ✭ 44 (-50%)
Mutual labels:  metric-learning, meta-learning, few-shot-learning
pytorch-meta-dataset
A non-official 100% PyTorch implementation of META-DATASET benchmark for few-shot classification
Stars: ✭ 39 (-55.68%)
Mutual labels:  few-shot-learning, meta-dataset, few-shot-classifcation
LearningToCompare-Tensorflow
Tensorflow implementation for paper: Learning to Compare: Relation Network for Few-Shot Learning.
Stars: ✭ 17 (-80.68%)
Mutual labels:  metric-learning, meta-learning, few-shot-learning
Learning-To-Compare-For-Text
Learning To Compare For Text , Few shot learning in text classification
Stars: ✭ 38 (-56.82%)
Mutual labels:  meta-learning, few-shot-learning
renet
[ICCV'21] Official PyTorch implementation of Relational Embedding for Few-Shot Classification
Stars: ✭ 72 (-18.18%)
Mutual labels:  few-shot-learning, few-shot-classifcation
FUSION
PyTorch code for NeurIPSW 2020 paper (4th Workshop on Meta-Learning) "Few-Shot Unsupervised Continual Learning through Meta-Examples"
Stars: ✭ 18 (-79.55%)
Mutual labels:  meta-learning, few-shot-learning
LibFewShot
LibFewShot: A Comprehensive Library for Few-shot Learning.
Stars: ✭ 629 (+614.77%)
Mutual labels:  meta-learning, few-shot-learning
Meta-TTS
Official repository of https://arxiv.org/abs/2111.04040v1
Stars: ✭ 69 (-21.59%)
Mutual labels:  meta-learning, few-shot-learning
Transferlearning
Transfer learning / domain adaptation / domain generalization / multi-task learning etc. Papers, codes, datasets, applications, tutorials.-迁移学习
Stars: ✭ 8,481 (+9537.5%)
Mutual labels:  meta-learning, few-shot-learning
CDFSL-ATA
[IJCAI 2021] Cross-Domain Few-Shot Classification via Adversarial Task Augmentation
Stars: ✭ 21 (-76.14%)
Mutual labels:  meta-learning, few-shot-learning
Meta Learning Papers
Meta Learning / Learning to Learn / One Shot Learning / Few Shot Learning
Stars: ✭ 2,420 (+2650%)
Mutual labels:  meta-learning, few-shot-learning
FSL-Mate
FSL-Mate: A collection of resources for few-shot learning (FSL).
Stars: ✭ 1,346 (+1429.55%)
Mutual labels:  meta-learning, few-shot-learning
MeTAL
Official PyTorch implementation of "Meta-Learning with Task-Adaptive Loss Function for Few-Shot Learning" (ICCV2021 Oral)
Stars: ✭ 24 (-72.73%)
Mutual labels:  meta-learning, few-shot-learning
finetuner
Finetuning any DNN for better embedding on neural search tasks
Stars: ✭ 442 (+402.27%)
Mutual labels:  metric-learning, few-shot-learning
Hcn Prototypeloss Pytorch
Hierarchical Co-occurrence Network with Prototype Loss for Few-shot Learning (PyTorch)
Stars: ✭ 17 (-80.68%)
Mutual labels:  metric-learning, meta-learning
MetaD2A
Official PyTorch implementation of "Rapid Neural Architecture Search by Learning to Generate Graphs from Datasets" (ICLR 2021)
Stars: ✭ 49 (-44.32%)
Mutual labels:  meta-learning
attMPTI
[CVPR 2021] Few-shot 3D Point Cloud Semantic Segmentation
Stars: ✭ 118 (+34.09%)
Mutual labels:  few-shot-learning
pykale
Knowledge-Aware machine LEarning (KALE): accessible machine learning from multiple sources for interdisciplinary research, part of the 🔥PyTorch ecosystem
Stars: ✭ 381 (+332.95%)
Mutual labels:  meta-learning

Improved Few-Shot Visual Classification

**This code base is an implicit fork of https://github.com/plai-group/simple-cnaps. Please refer to that repository for the most up-to-date code. We will try to sync that repository with the one here as much as possible, but there will be latencies as the PLAI-Group repository is directly maintained, and my personal copy here is not. Also, if you would like to ask any questions or reach out regarding any of the papers, please email me directly at [email protected] (my cs.ubc.ca may have expired by the time you are emailing as I have graduated!).

This repository contains source codes for the following papers and thesis:

The code base has been authored by Peyman Bateni, Jarred Barber, Raghav Goyal, Vaden Masrani, Dr. Jan-Willemn van de Meent, Dr. Leonid Sigal and Dr. Frank Wood. The source codes build on the original code base for CNAPS authored by Dr. John Bronskill, Jonathan Gordon, James Reqeima, Dr. Sebastian Nowozin, and Dr. Richard E. Turner. We would like to thank them for their help, support and early sharing of their work. To see the original CNAPS repository, visit https://github.com/cambridge-mlg/cnaps.

Simple CNAPS

Simple CNAPS proposes the use of hierarchically regularized cluster means and covariance estimates within a Mahalanobis-distance based classifer for improved few-shot classification accuracy. This method incorporates said classifier within the same neural adaptive feature extractor as CNAPS. For more details, please refer to our paper on Simple CNAPS: Improved Few-Shot Visual Classification. The source code for this paper has been provided in the simple-cnaps-src directory. To reproduce our results, please refer to the README.md file within that folder.

Global Meta-Dataset Rank (Simple CNAPS): https://github.com/google-research/meta-dataset#training-on-all-datasets

Global Mini-ImageNet Rank (Simple CNAPS):

PWC PWC PWC PWC

Global Tiered-ImageNet Rank (Simple CNAPS):

PWC PWC PWC PWC

Transductive CNAPS

Transductive CNAPS extends the Simple CNAPS framework to the transductive few-shot learning setting where all query examples are provided at once. This method uses a two-step transductive task-encoder for adapting the feature extractor as well as a soft k-means cluster refinement procedure, resulting in better test-time accuracy. For additional details, please refer to our paper on Transductive CNAPS: Enhancing Few-Shot Image Classification with Unlabelled Examples. The source code for this work is provided under the transductive-cnaps-src directory. To reproduce our results, please refer to the README.md file within this folder.

Global Meta-Dataset Rank (Transductive CNAPS): https://github.com/google-research/meta-dataset#training-on-all-datasets

Global Mini-ImageNet Rank (Transductive CNAPS):

PWC PWC PWC PWC

Global Tiered-ImageNet Rank (Transductive CNAPS):

PWC PWC PWC PWC

Active and Continual Learning

We additionally evaluate both methods within the paradigms of "out of the box" active and continual learning. These settings were first proposed by Requeima et al., and studies how well few-shot classifiers, trained for few-shot learning, can be deployed for active and continual learning without any problem-specific finetuning or training. For additional details on our active and continual learning experiments and algorithms, please refer to our latest paper: Beyond Simple Meta-Learning: Multi-Purpose Models for Multi-Domain, Active and Continual Few-Shot Learning. For code and instructions to reproduce the experiments reported, please refer to the active-learning and continual-learning folders.

Meta-Dataset Results

Dataset Simple CNAPS Simple CNAPS Transductive CNAPS Transductive CNAPS
--shuffle_dataset False True False True
In-Domain Datasets --- --- --- ---
ILSVRC 58.6±1.1 56.5±1.1 58.8±1.1 57.9±1.1
Omniglot 91.7±0.6 91.9±0.6 93.9±0.4 94.3±0.4
Aircraft 82.4±0.7 83.8±0.6 84.1±0.6 84.7±0.5
Birds 74.9±0.8 76.1±0.9 76.8±0.8 78.8±0.7
Textures 67.8±0.8 70.0±0.8 69.0±0.8 66.2±0.8
Quick Draw 77.7±0.7 78.3±0.7 78.6±0.7 77.9±0.6
Fungi 46.9±1.0 49.1±1.2 48.8±1.1 48.9±1.2
VGG Flower 90.7±0.5 91.3±0.6 91.6±0.4 92.3±0.4
Out-of-Domain Datasets --- --- --- ---
Traffic Signs 73.5±0.7 59.2±1.0 76.1±0.7 59.7±1.1
MSCOCO 46.2±1.1 42.4±1.1 48.7±1.0 42.5±1.1
MNIST 93.9±0.4 94.3±0.4 95.7±0.3 94.7±0.3
CIFAR10 74.3±0.7 72.0±0.8 75.7±0.7 73.6±0.7
CIFAR100 60.5±1.0 60.9±1.1 62.9±1.0 61.8±1.0
--- --- --- --- ---
In-Domain Average Accuracy 73.8±0.8 74.6±0.8 75.2±0.8 75.1±0.8
Out-of-Domain Average Accuracy 69.7±0.8 65.8±0.8 71.8±0.8 66.5±0.8
Overall Average Accuracy 72.2±0.8 71.2±0.8 73.9±0.8 71.8±0.8

Mini-ImageNet Results

Setup 5-way 1-shot 5-way 5-shot 10-way 1-shot 10-way 5-shot
Simple CNAPS 53.2±0.9 70.8±0.7 37.1±0.5 56.7±0.5
Transductive CNAPS 55.6±0.9 73.1±0.7 42.8±0.7 59.6±0.5
--- --- --- --- ---
Simple CNAPS + FETI 77.4±0.8 90.3±0.4 63.5±0.6 83.1±0.4
Transductive CNAPS + FETI 79.9±0.8 91.5±0.4 68.5±0.6 85.9±0.3

Tiered-ImageNet Results

Setup 5-way 1-shot 5-way 5-shot 10-way 1-shot 10-way 5-shot
Simple CNAPS 63.0±1.0 80.0±0.8 48.1±0.7 70.2±0.6
Transductive CNAPS 65.9±1.0 81.8±0.7 54.6±0.8 72.5±0.6
--- --- --- --- ---
Simple CNAPS + FETI 71.4±1.0 86.0±0.6 57.1±0.7 78.5±0.5
Transductive CNAPS + FETI 73.8±1.0 87.7±0.6 65.1±0.8 80.6±0.5

Citation

We hope you have found our code base helpful! If you use this repository, please cite our papers:

@InProceedings{Bateni2020_SimpleCNAPS,
    author = {Bateni, Peyman and Goyal, Raghav and Masrani, Vaden and Wood, Frank and Sigal, Leonid},
    title = {Improved Few-Shot Visual Classification},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month = {June},
    year = {2020}
}

@InProceedings{Bateni2022_TransductiveCNAPS,
    author    = {Bateni, Peyman and Barber, Jarred and van de Meent, Jan-Willem and Wood, Frank},
    title     = {Enhancing Few-Shot Image Classification With Unlabelled Examples},
    booktitle = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
    month     = {January},
    year      = {2022},
    pages     = {2796-2805}
}

@misc{Bateni2022_BeyondSimpleMetaLearning,
    title={Beyond Simple Meta-Learning: Multi-Purpose Models for Multi-Domain, Active and Continual Few-Shot Learning}, 
    author={Peyman Bateni and Jarred Barber and Raghav Goyal and Vaden Masrani and Jan-Willem van de Meent and Leonid Sigal and Frank Wood},
    year={2022},
    eprint={2201.05151},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

@phdthesis{Bateni2021_Thesis, 
    series      = {Electronic Theses and Dissertations (ETDs) 2008+}, 
    title       = {On label-efficient computer vision : building fast and effective few-shot image classifiers}, 
    url         = {https://open.library.ubc.ca/collections/ubctheses/24/items/1.0402554}, 
    DOI         = {http://dx.doi.org/10.14288/1.0402554}, 
    school      = {University of British Columbia}, 
    author      = {Bateni, Peyman}, 
    year        = {2021}, 
    collection  = {Electronic Theses and Dissertations (ETDs) 2008+}
}

**If you would like to ask any questions or reach out regarding any of the papers, please email me directly at [email protected] (my cs.ubc.ca email may have expired by the time you are emailing as I have graduated!).

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].