This is the code for our paper,
- Jaekyeom Kim, Hyoungseok Kim, and Gunhee Kim. Model-Agnostic Boundary-Adversarial Sampling for Test-Time Generalization in Few-Shot Learning. In ECCV, 2020. [paper] [appx] [talk] [slides]
This is the application of our method to Dynamic Few-Shot Visual Learning without Forgetting.
If you find our work or this code useful in your research, please cite
@inproceedings{kim2020_mabas,
title={Model-Agnostic Boundary-Adversarial Sampling For Test-Time Generalization in Few-Shot Learning},
author={Kim, Jaekyeom and Kim, Hyoungseok and Kim, Gunhee},
booktitle={Computer Vision--ECCV 2020: 16th European Conference, Glasgow, UK, August 23--28, 2020, Proceedings, Part I 16},
pages={599--617},
year={2020},
organization={Springer}
}
You can create a conda environment by
conda env create -f environment.yml
and activate it with
conda activate mabas-fswf
- Create a subdirectory named
datasets
. - Download and decompress miniImageNet (from FSwF and MetaOptNet) into
datasets/MiniImagenet/
. - Download and decompress CIFAR-FS (from MetaOptNet) into
datasets/CIFAR_FS/
. - Download and decompress FC100 (from MetaOptNet) into
datasets/FC100/
.
Command | Dataset | Type |
---|---|---|
python train.py --config miniImageNet_ResNetLikeCosineClassifier |
miniImageNet | Base |
python train.py --config miniImageNet_ResNetLikeCosineClassifierGenWeightAttN5 --parent_exp "miniImageNet_ResNetLikeCosineClassifier" |
miniImageNet | 5-shot |
python train.py --config miniImageNet_ResNetLikeCosineClassifierGenWeightAttN1 --parent_exp "miniImageNet_ResNetLikeCosineClassifier" |
miniImageNet | 1-shot |
python train.py --config CIFARFS_ResNetLikeCosineClassifier |
CIFAR-FS | Base |
python train.py --config CIFARFS_ResNetLikeCosineClassifierGenWeightAttN5 --parent_exp "CIFARFS_ResNetLikeCosineClassifier" |
CIFAR-FS | 5-shot |
python train.py --config CIFARFS_ResNetLikeCosineClassifierGenWeightAttN1 --parent_exp "CIFARFS_ResNetLikeCosineClassifier" |
CIFAR-FS | 1-shot |
python train.py --config FC100_ResNetLikeCosineClassifier |
FC100 | Base |
python train.py --config FC100_ResNetLikeCosineClassifierGenWeightAttN5 --parent_exp "FC100_ResNetLikeCosineClassifier" |
FC100 | 5-shot |
python train.py --config FC100_ResNetLikeCosineClassifierGenWeightAttN1 --parent_exp "FC100_ResNetLikeCosineClassifier" |
FC100 | 1-shot |
Command | Dataset | Type |
---|---|---|
python evaluate_finetune.py --config miniImageNet_ResNetLikeCosineClassifierGenWeightAttN5 --parent_exp "miniImageNet_ResNetLikeCosineClassifier/miniImageNet_ResNetLikeCosineClassifierGenWeightAttN5" |
miniImageNet | 5-shot |
python evaluate_finetune.py --config miniImageNet_ResNetLikeCosineClassifierGenWeightAttN1 --parent_exp "miniImageNet_ResNetLikeCosineClassifier/miniImageNet_ResNetLikeCosineClassifierGenWeightAttN1" |
miniImageNet | 1-shot |
python evaluate_finetune.py --config CIFARFS_ResNetLikeCosineClassifierGenWeightAttN5 --parent_exp "CIFARFS_ResNetLikeCosineClassifier/CIFARFS_ResNetLikeCosineClassifierGenWeightAttN5" |
CIFAR-FS | 5-shot |
python evaluate_finetune.py --config CIFARFS_ResNetLikeCosineClassifierGenWeightAttN1 --parent_exp "CIFARFS_ResNetLikeCosineClassifier/CIFARFS_ResNetLikeCosineClassifierGenWeightAttN1" |
CIFAR-FS | 1-shot |
python evaluate_finetune.py --config FC100_ResNetLikeCosineClassifierGenWeightAttN5 --parent_exp "FC100_ResNetLikeCosineClassifier/FC100_ResNetLikeCosineClassifierGenWeightAttN5" |
FC100 | 5-shot |
python evaluate_finetune.py --config FC100_ResNetLikeCosineClassifierGenWeightAttN1 --parent_exp "FC100_ResNetLikeCosineClassifier/FC100_ResNetLikeCosineClassifierGenWeightAttN1" |
FC100 | 1-shot |
This source code is based on the implementations for Dynamic Few-Shot Visual Learning without Forgetting and Meta-learning with differentiable convex optimization.