Home

Awesome

Associative Alignment for Few-shot Image Classification

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

Datasets

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

</code><pre> @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} } </code></pre>