Detecting rare objects from a few examples is an emerging problem. Prior works show meta-learning is a promising approach. But, fine-tuning techniques have drawn scant attention. We find that fine-tuning only the last layer of existing detectors on rare classes is crucial to the few-shot object detection task. Such a simple approach outperforms the meta-learning methods by roughly 2~20 points on current benchmarks and sometimes even doubles the accuracy of the prior methods. However, the high variance in the few samples often leads to the unreliability of existing benchmarks. We revise the evaluation protocols by sampling multiple groups of training examples to obtain stable comparisons and build new benchmarks based on three datasets: PASCAL VOC, COCO and LVIS. Again, our fine-tuning approach establishes a new state of the art on the revised benchmarks. The code as well as the pretrained models are available at https://github.com/ucbdrive/few-shot-object-detection.
@inproceedings{wang2020few,
title={Frustratingly Simple Few-Shot Object Detection},
author={Wang, Xin and Huang, Thomas E. and Darrell, Trevor and Gonzalez, Joseph E and Yu, Fisher}
booktitle={International Conference on Machine Learning (ICML)},
year={2020}
}
Note: ALL the reported results use the data split released from TFA official repo. Currently, each setting is only evaluated with one fixed few shot dataset. Please refer to DATA Preparation to get more details about the dataset and data preparation.
Following the original implementation, it consists of 3 steps:
Step1: Base training
Step2: Reshape the bbox head of base model:
Step3: Few shot fine-tuning:
# step1: base training for voc split1
bash ./tools/detection/dist_train.sh \
configs/detection/tfa/voc/split1/tfa_r101_fpn_voc-split1_base-training.py 8
# step2: reshape the bbox head of base model for few shot fine-tuning
python -m tools.detection.misc.initialize_bbox_head \
--src1 work_dirs/tfa_r101_fpn_voc-split1_base-training/latest.pth \
--method randinit \
--save-dir work_dirs/tfa_r101_fpn_voc-split1_base-training
# step3: few shot fine-tuning
bash ./tools/detection/dist_train.sh \
configs/detection/tfa/voc/split1/tfa_r101_fpn_voc-split1_1shot-fine-tuning.py 8
Note:
work_dirs/{BASE TRAINING CONFIG}/base_model_random_init_bbox_head.pth
.
When the model is saved to different path, please update the argument load_from
in step3 few shot fine-tune configs instead
of using resume_from
.load_from
to the downloaded checkpoint path.Arch | Split | Base AP50 | ckpt(step1) | ckpt(step2) | log |
---|---|---|---|---|---|
r101_fpn | 1 | 80.9 | ckpt | ckpt | log |
r101_fpn | 2 | 82.0 | ckpt | ckpt | log |
r101_fpn | 3 | 82.1 | ckpt | ckpt | log |
Note:
Arch | Split | Shot | Base AP50 | Novel AP50 | ckpt | log |
---|---|---|---|---|---|---|
r101_fpn | 1 | 1 | 79.2 | 41.9 | ckpt | log |
r101_fpn | 1 | 2 | 79.2 | 49.0 | ckpt | log |
r101_fpn | 1 | 3 | 79.6 | 49.9 | ckpt | log |
r101_fpn | 1 | 5 | 79.6 | 58.0 | ckpt | log |
r101_fpn | 1 | 10 | 79.7 | 58.4 | ckpt | log |
r101_fpn | 2 | 1 | 80.3 | 26.6 | ckpt | log |
r101_fpn | 2 | 2 | 78.1 | 30.7 | ckpt | log |
r101_fpn | 2 | 3 | 79.4 | 39.0 | ckpt | log |
r101_fpn | 2 | 5 | 79.4 | 35.7 | ckpt | log |
r101_fpn | 2 | 10 | 79.7 | 40.5 | ckpt | log |
r101_fpn | 3 | 1 | 80.5 | 34.0 | ckpt | log |
r101_fpn | 3 | 2 | 80.6 | 39.3 | ckpt | log |
r101_fpn | 3 | 3 | 81.1 | 42.8 | ckpt | log |
r101_fpn | 3 | 5 | 80.8 | 51.4 | ckpt | log |
r101_fpn | 3 | 10 | 80.7 | 50.6 | ckpt | log |
Arch | Base mAP | ckpt(step1) | ckpt(step2) | log |
---|---|---|---|---|
r101_fpn | 39.5 | ckpt | ckpt | log |
Arch | Shot | Base mAP | Novel mAP | ckpt | log |
---|---|---|---|---|---|
r101_fpn | 10 | 35.2 | 10.4 | ckpt | log |
r101_fpn | 30 | 36.7 | 14.7 | ckpt | log |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。