《Shallow Bayesian Meta Learning for Real World Few-shot Recognition》
ICCV 2021 Version: https://openaccess.thecvf.com/content/ICCV2021/papers/Zhang_Shallow_Bayesian_Meta_Learning_for_Real-World_Few-Shot_Recognition_ICCV_2021_paper.pdf
- download data
- download encoders
- extract features
- (sd fsl) Single-Domain Few Shot Learning
- (cd fsl) Cross-Domain Few Shot Testing
- (md fsl) Multi-Domain Few Shot Learning: Meta-dataset
- (fscil) Few Shot Class Incremental Learning
- Compute Calibration Error
- code references
e.g., as for mini-Imagenet, please download mini-Imagenet and put it at ./data/mini
and run proc_image.py
to preprocess generate train/val/test datasets. (This process method is based on maml).
For CUB_200_2011, please reference the instruction at ${Project_dir}/data/cub/source/readme.md
For Cars, please reference the instruction at ${Project_dir}/data/cars/source/readme.md
name format: $net_domain-$net_arch.pkl
. e.g. mini-conv4.pkl
.
network backbones: conv4, resnet18, wrn_28_20
download link. passport: 5kxg
save models at $project_dir/encoder/model_parameters
python extract_features.py --encoder 'conv4/resnet18/wrn' --dataset_train 'mini/tiered/cifarfs' --dataset_inference 'mini/tiered/cifarfs/cub/cars'
--lr
: initial learning rate--feature_or_logits
: using features or logits from the encoder. 0 is features; 1 is logits
the following "log name"
is created after the training process
e.g.: 5Way-5Shot, using encoder conv4
on miniImagenet
dataset, using MetaQDA_MAP
version
python train.py --n_way 5 --k_spt 5 --net_arch conv4 --net_domain mini --strategy map
python test.py -l_n "log name"
e.g.: testing trained models "log name"
on cub
dataset
python test.py -l_n "log name" -x_d cub
-
Installation Meta-Dataset Follow the the "User instructions" in the Meta-Dataset repository for "Installation" and "Downloading and converting datasets".
-
Download features download all the extracted features from HERE and put it in the ${Project_dir}/data/meta-dataset/
python train_urt_mqda.py
python test_urt_mqda.py -l_n "log name"
python train_mqda_incremental.py
python test_mqda_map_incremental.py -l_n "log name"
python compute_ece.py -l_n "log name"
- dataloader reference: RelationNet
- cub, cars dataset reference: CrossDomainFewShot
- metadataset train.py reference: urt