Source codes for Improved Few-Shot Visual Classification (CVPR 2020), Enhancing Few-Shot Image Classification with Unlabelled Examples

Overview

Improved Few-Shot Visual Classification

This repository contains source codes for the following papers:

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 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}
}

**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!).

Owner
PLAI Group at UBC
PLAI Group at UBC
Exploring Relational Context for Multi-Task Dense Prediction [ICCV 2021]

Adaptive Task-Relational Context (ATRC) This repository provides source code for the ICCV 2021 paper Exploring Relational Context for Multi-Task Dense

David Brüggemann 35 Dec 05, 2022
A modular application for performing anomaly detection in networks

Deep-Learning-Models-for-Network-Annomaly-Detection The modular app consists for mainly three annomaly detection algorithms. The system supports model

Shivam Patel 1 Dec 09, 2021
Supplementary materials to "Spin-optomechanical quantum interface enabled by an ultrasmall mechanical and optical mode volume cavity" by H. Raniwala, S. Krastanov, M. Eichenfield, and D. R. Englund, 2022

Supplementary materials to "Spin-optomechanical quantum interface enabled by an ultrasmall mechanical and optical mode volume cavity" by H. Raniwala,

Stefan Krastanov 1 Jan 17, 2022
Lipstick ain't enough: Beyond Color-Matching for In-the-Wild Makeup Transfer (CVPR 2021)

Table of Content Introduction Datasets Getting Started Requirements Usage Example Training & Evaluation CPM: Color-Pattern Makeup Transfer CPM is a ho

VinAI Research 248 Dec 13, 2022
Portfolio analytics for quants, written in Python

QuantStats: Portfolio analytics for quants QuantStats Python library that performs portfolio profiling, allowing quants and portfolio managers to unde

Ran Aroussi 2.7k Jan 08, 2023
Specificity-preserving RGB-D Saliency Detection

Specificity-preserving RGB-D Saliency Detection Authors: Tao Zhou, Huazhu Fu, Geng Chen, Yi Zhou, Deng-Ping Fan, and Ling Shao. 1. Preface This reposi

Tao Zhou 35 Jan 08, 2023
As-ViT: Auto-scaling Vision Transformers without Training

As-ViT: Auto-scaling Vision Transformers without Training [PDF] Wuyang Chen, Wei Huang, Xianzhi Du, Xiaodan Song, Zhangyang Wang, Denny Zhou In ICLR 2

VITA 68 Sep 05, 2022
Simple image captioning model - CLIP prefix captioning.

CLIP prefix captioning. Inference Notebook: 🥳 New: 🥳 Our technical papar is finally out! Official implementation for the paper "ClipCap: CLIP Prefix

688 Jan 04, 2023
Oscar and VinVL

Oscar: Object-Semantics Aligned Pre-training for Vision-and-Language Tasks VinVL: Revisiting Visual Representations in Vision-Language Models Updates

Microsoft 938 Dec 26, 2022
ML course - EPFL Machine Learning Course, Fall 2021

EPFL Machine Learning Course CS-433 Machine Learning Course, Fall 2021 Repository for all lecture notes, labs and projects - resources, code templates

EPFL Machine Learning and Optimization Laboratory 1k Jan 04, 2023
A simple command line tool for text to image generation, using OpenAI's CLIP and a BigGAN.

Ryan Murdock has done it again, combining OpenAI's CLIP and the generator from a BigGAN! This repository wraps up his work so it is easily accessible to anyone who owns a GPU.

Phil Wang 2.3k Jan 09, 2023
load .txt to train YOLOX, same as Yolo others

YOLOX train your data you need generate data.txt like follow format (per line- one image). prepare one data.txt like this: img_path1 x1,y1,x2,y2,clas

LiMingf 18 Aug 18, 2022
Official code for our ICCV paper: "From Continuity to Editability: Inverting GANs with Consecutive Images"

GANInversion_with_ConsecutiveImgs Official code for our ICCV paper: "From Continuity to Editability: Inverting GANs with Consecutive Images" https://a

QingyangXu 38 Dec 07, 2022
Code for BMVC2021 paper "Boundary Guided Context Aggregation for Semantic Segmentation"

Boundary-Guided-Context-Aggregation Boundary Guided Context Aggregation for Semantic Segmentation Haoxiang Ma, Hongyu Yang, Di Huang In BMVC'2021 Pape

Haoxiang Ma 31 Jan 08, 2023
Evaluating Cross-lingual Sentence Representations

XNLI: The Cross-Lingual NLI Corpus XNLI is an evaluation corpus for language transfer and cross-lingual sentence classification in 15 languages. New:

Meta Research 395 Dec 19, 2022
TF2 implementation of knowledge distillation using the "function matching" hypothesis from the paper Knowledge distillation: A good teacher is patient and consistent by Beyer et al.

FunMatch-Distillation TF2 implementation of knowledge distillation using the "function matching" hypothesis from the paper Knowledge distillation: A g

Sayak Paul 67 Dec 20, 2022
ilpyt: imitation learning library with modular, baseline implementations in Pytorch

ilpyt The imitation learning toolbox (ilpyt) contains modular implementations of common deep imitation learning algorithms in PyTorch, with unified in

The MITRE Corporation 11 Nov 17, 2022
MPViT:Multi-Path Vision Transformer for Dense Prediction

MPViT : Multi-Path Vision Transformer for Dense Prediction This repository inlcu

Youngwan Lee 272 Dec 20, 2022
A unified framework for machine learning with time series

Welcome to sktime A unified framework for machine learning with time series We provide specialized time series algorithms and scikit-learn compatible

The Alan Turing Institute 6k Jan 08, 2023
LBK 35 Dec 26, 2022