Skip to content

Code for "Associative alignment for few-shot image classification"- ECCV'2020.

Notifications You must be signed in to change notification settings

ArmanAfrasiyabi/associative-alignment-fs

Repository files navigation

This repository contains the pytorch implementation of Associative Alignment for Few-shot Image Classification paper presentation. This paper proposes associative alignment with two strategies: 1) a metric-learning loss for minimizing the distance between related base samples and the centroid of novel instances in the feature space, and 2) a conditional adversarial alignment loss based on the Wasserstein distance.

Train

  1. Hyper-parameters and training details are specified in args_parser.py, where you can switch between methods such as softMax, cosMax or arcMax. We tested associative alignment using arcMax.
  2. Run meta-learning from transferLearning.py to capture and test the best model in ./results/models.
  3. Run transfer learning from transferLearning.py to save and test the best model in ./results/models. This is required to move on to the next associative alignment stage.
  4. Run associative_alignment.py to perform our associative alignment using the best model found in (2) and the pre-defined setup in (1).

Datasets

  • To speed up the detecting related base, we saved the base classes in 84x84 format. Therefore, we recommend to download the dataset here, and copy the dataset in the fs_benchmarks directory.
  • Otherwise, if you have the dataset, specify the directory of your training set in args_parser.py.

Dependencies

  1. numpy
  2. Pytorch 1.0.1+
  3. torchvision 0.2.1+
  4. PIL

The project webpage

Please visit the project webpage for more information.

Citation

@inproceedings{afrasiyabi2020associative,
title={Associative Alignment for Few-shot Image Classification},
author={Afrasiyabi, Arman and Lalonde, Jean-Fran{\c{c}}ois and Gagn{'e}, Christian},
booktitle={European Conference on Computer Vision},
pages={18--35},
year={2020},
organization={Springer}
}

About

Code for "Associative alignment for few-shot image classification"- ECCV'2020.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages