Giter Site home page Giter Site logo

few-shot-ctm's Introduction

Category Traversal Module for Few-shot Learning

A PyTorch implementation of our paper "Finding Task-Relevant Features for Few-Shot Learning by Category Traversal", published at CVPR 2019, an ORAL presentation.

By Hongyang Li, David Eigen, Samuel Dodge, Matthew Zeiler, and Xiaogang Wang.

[arXiv Paper] [Poster]

[End-of-internship Presentation Slides] (40 mins)

[Short Slides] (5 mins at CVPR)

(a) describes the conventional metric-based methods and (b) depicts the proposed CTM where features are traversed across categories for acquiring better representations.

The following figure shows a detailed configuration of our proposed CTM module.

Overview

  • PyTorch 0.4 or above, tested in Linux/cluster/multi/single-gpu(s).
  • Datasets: tieredImagenet and miniImagenet
  • A metric-based few-shot learning algorithm
  • The proposed Category Traversal Module (CTM) serves as a plug-and-play unit to most existing methods, with ~2% improvement in accuracy.

Install

There are some dependencies; be sure to install the newer version to be compatible with the latest pytorch. For example:

conda install pytorch torchvision cudatoolkit=10.0 -c pytorch
conda install -c anaconda pillow pyyaml opencv requests
conda install -c conda-forge visdom

Prepare the dataset (miniImageNet for example):

sh dataset/get_tier_and_mini.sh

How to run

python main.py --yaml_file configs/demo/mini/20way_1shot.yaml

Datasets

We conduct all the experiments on tieredImagenet and miniImagenet benchmarks; to download them, please refer to DATASET.md.

Adapting CTM module to your own task

Please refer to forward_CTM method in the core/model.py file for details.

The current version contains some legacy variable names in early trial experiments; we would remove them later and make the repo cleaner.

Citation

Please cite in the following manner if you find it useful in your research:

@inproceedings{li2019ctm,
  title = {{Finding Task-Relevant Features for Few-Shot Learning by Category Traversal}},
  author = {Hongyang Li and David Eigen and Samuel Dodge and Matthew Zeiler and Xiaogang Wang},
  booktitle = {CVPR},
  year = {2019}
}

few-shot-ctm's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.