We present a conceptually simple, flexible, and general framework for few-shot learning, where a classifier must learn to recognise new classes given only few examples from each. Our method, called the Relation Network (RN), is trained end-to-end from scratch. During meta-learning, it learns to learn a deep distance metric to compare a small number of images within episodes, each of which is designed to simulate the few-shot setting. Once trained, a RN is able to classify images of new classes by computing relation scores between query images and the few examples of each new class without further updating the network. Besides providing improved performance on few-shot learning, our framework is easily extended to zero-shot learning. Extensive experiments on five benchmarks demonstrate that our simple approach provides a unified and effective approach for both of these two tasks.
@inproceedings{sung2018learning,
title={Learning to compare: Relation network for few-shot learning},
author={Sung, Flood and Yang, Yongxin and Zhang, Li and Xiang, Tao and Torr, Philip HS and Hospedales, Timothy M},
booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
pages={1199--1208},
year={2018}
}
It consists of two steps:
Step1: Base training
Step2: Meta Testing:
${WORK_DIR}/${CONFIG}/best_accuracy_mean.pth
in default.# base training
python ./tools/classification/train.py \
configs/classification/relation_net/cub/relation-net_conv4_1xb105_cub_5way-1shot.py
# meta testing
python ./tools/classification/test.py \
configs/classification/relation_net/cub/relation-net_conv4_1xb105_cub_5way-1shot.py \
work_dir/relation-net_conv4_1xb105_cub_5way-1shot/best_accuracy_mean.pth
Note:
num_support_way
* (num_support_shots
+ num_query_shots
)Arch | Input Size | Batch Size | way | shot | mean Acc | std | ckpt | log |
---|---|---|---|---|---|---|---|---|
conv4 | 84x84 | 105 | 5 | 1 | 65.53 | 0.51 | ckpt | log |
conv4 | 84x84 | 105 | 5 | 5 | 82.05 | 0.34 | ⇑ | ⇑ |
resnet12 | 84x84 | 105 | 5 | 1 | 73.22 | 0.48 | ckpt | log |
resnet12 | 84x84 | 105 | 5 | 5 | 86.94 | 0.28 | ⇑ | ⇑ |
Arch | Input Size | Batch Size | way | shot | mean Acc | std | ckpt | log |
---|---|---|---|---|---|---|---|---|
conv4 | 84x84 | 105 | 5 | 1 | 49.69 | 0.43 | ckpt | log |
conv4 | 84x84 | 105 | 5 | 5 | 68.14 | 0.37 | ⇑ | ⇑ |
resnet12 | 84x84 | 105 | 5 | 1 | 54.12 | 0.46 | ckpt | log |
resnet12 | 84x84 | 105 | 5 | 5 | 71.31 | 0.37 | ⇑ | ⇑ |
Arch | Input Size | Batch Size | way | shot | mean Acc | std | ckpt | log |
---|---|---|---|---|---|---|---|---|
conv4 | 84x84 | 105 | 5 | 1 | 47.6 | 0.48 | ckpt | log |
conv4 | 84x84 | 105 | 5 | 5 | 64.09 | 0.43 | ⇑ | ⇑ |
resnet12 | 84x84 | 105 | 5 | 1 | 57.46 | 0.52 | ckpt | log |
resnet12 | 84x84 | 105 | 5 | 5 | 72.84 | 0.43 | ⇑ | ⇑ |
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )