Authors: Zican Zha, Hao Tang, Yunlian Sun, and Jinhui Tang.
This repository provides code for "Boosting Few-shot Fine-grained Recognition with Background Suppression and Foreground Alignment" IEEE TCSVT 2023.
Python 3.6
Pytorch
>= 1.7.0 Torchvision
= 0.10scikit-image
= 0.18.1Download Datasets from Baidu Drive (extraction code: ZZC3)
Download Datasets from Google Drive
python train.py --dataset [type of dataset] --model [backbone] --num_classes [num-classes] --nExemplars [num-shots]
python test.py --dataset CUB-200-2011 --model R --num_classes 100 --nExemplars 5
# Example: run on CUB dataset, ResNet-12 backbone, 5-way 1-shot
python train.py --dataset CUB-200-2011 --model R --num_classes 100 --nExemplars 1
python test.py --dataset CUB-200-2011 --model R --num_classes 100 --nExemplars 1
Please cite our paper if you find the work useful, thanks!
@article{zha2023boosting,
title={Boosting Few-shot Fine-grained Recognition with Background Suppression and Foreground Alignment},
author={Zha, Zican and Tang, Hao and Sun, Yunlian and Tang, Jinhui},
journal={IEEE Transactions on Circuits and Systems for Video Technology},
year={2023},
publisher={IEEE},
doi={10.1109/TCSVT.2023.3236636}
}
@article{TangYLT22,
author = {Hao Tang and Chengcheng Yuan and Zechao Li and Jinhui Tang},
title = {Learning attention-guided pyramidal features for few-shot fine-grained recognition},
journal = {Pattern Recognit.},
volume = {130},
pages = {108792},
year = {2022}
}
This code is based on the implementations of fewshot-CAN.