We propose prototypical networks for the problem of few-shot classification, where a classifier must generalize to new classes not seen in the training set, given only a small number of examples of each new class. Prototypical networks learn a metric space in which classification can be performed by computing distances to prototype representations of each class. Compared to recent approaches for few-shot learning, they reflect a simpler inductive bias that is beneficial in this limited-data regime, and achieve excellent results. We provide an analysis showing that some simple design decisions can yield substantial improvements over recent approaches involving complicated architectural choices and meta-learning. We further extend prototypical networks to zero-shot learning and achieve state-of-the-art results on the CU-Birds dataset.
@inproceedings{snell2017prototypical,
title={Prototypical networks for few-shot learning},
author={Snell, Jake and Swersky, Kevin and Zemel, Richard},
booktitle={Proceedings of the 31st International Conference on Neural Information Processing Systems},
pages={4080--4090},
year={2017}
}
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/proto_net/cub/proto-net_conv4_1xb105_cub_5way-1shot.py
# meta testing
python ./tools/classification/test.py \
configs/classification/proto_net/cub/proto-net_conv4_1xb105_cub_5way-1shot.py \
work_dir/proto-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 | 58.86 | 0.52 | ckpt | log |
conv4 | 84x84 | 105 | 5 | 5 | 80.77 | 0.34 | ⇑ | ⇑ |
resnet12 | 84x84 | 105 | 5 | 1 | 74.35 | 0.48 | ckpt | log |
resnet12 | 84x84 | 105 | 5 | 5 | 88.5 | 0.25 | ⇑ | ⇑ |
Arch | Input Size | Batch Size | way | shot | mean Acc | std | ckpt | log |
---|---|---|---|---|---|---|---|---|
conv4 | 84x84 | 105 | 5 | 1 | 48.11 | 0.43 | ckpt | log |
conv4 | 84x84 | 105 | 5 | 5 | 68.51 | 0.37 | ⇑ | ⇑ |
resnet12 | 84x84 | 105 | 5 | 1 | 56.13 | 0.45 | ckpt | log |
resnet12 | 84x84 | 105 | 5 | 5 | 75.7 | 0.33 | ⇑ | ⇑ |
Arch | Input Size | Batch Size | way | shot | mean Acc | std | ckpt | log |
---|---|---|---|---|---|---|---|---|
conv4 | 84x84 | 105 | 5 | 1 | 45.5 | 0.46 | ckpt | log |
conv4 | 84x84 | 105 | 5 | 5 | 62.89 | 0.43 | ⇑ | ⇑ |
resnet12 | 84x84 | 105 | 5 | 1 | 59.11 | 0.52 | ckpt | log |
resnet12 | 84x84 | 105 | 5 | 5 | 75.3 | 0.42 | ⇑ | ⇑ |
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )