Learning to Compare: Relation Network for Few-Shot Learning
Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip H. S. Torr, Timothy M. Hospedales
Code Available — Be the first to reproduce this paper.
ReproduceCode
- github.com/sicara/easy-few-shot-learningpytorch★ 1,301
- github.com/jiakangyuan/helixformerpytorch★ 16
- github.com/Atharva-Phatak/One-Shot-Artpytorch★ 0
- github.com/prolearner/LearningToCompareTFtf★ 0
- github.com/knnaraghi/fewshottf★ 0
- github.com/code-implementation1/Code7/tree/main/relationnetmindspore★ 0
- github.com/Mind23-2/MindCode-66mindspore★ 0
- github.com/flexibility2/Pytorch-Implementation-for-RelationNetpytorch★ 0
- github.com/khoiucd/LearningToCompare-Tensorflowtf★ 0
- github.com/floodsung/LearningToCompare_FSLpytorch★ 0
Abstract
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.
Tasks
Benchmark Results
| Dataset | Model | Metric | Claimed | Verified | Status |
|---|---|---|---|---|---|
| CIFAR-FS 5-way (5-shot) | Relation Networks* | Accuracy | 69.3 | — | Unverified |
| CUB 200 5-way 1-shot | Relation Net | Accuracy | 50.44 | — | Unverified |
| CUB 200 5-way 5-shot | Relation Net | Accuracy | 65.32 | — | Unverified |
| Meta-Dataset | Relation Networks | Accuracy | 53.32 | — | Unverified |
| Meta-Dataset Rank | Relation Networks | Mean Rank | 11.8 | — | Unverified |
| Mini-Imagenet 10-way (1-shot) | Relation Networks | Accuracy | 34.9 | — | Unverified |
| Mini-Imagenet 10-way (5-shot) | Relation Networks | Accuracy | 47.9 | — | Unverified |
| Mini-Imagenet 5-way (1-shot) | Relation Net (Sung et al., 2018) | Accuracy | 50.4 | — | Unverified |
| Mini-ImageNet-CUB 5-way (1-shot) | RelationNet (Sung et al., 2018) | Accuracy | 42.91 | — | Unverified |
| OMNIGLOT - 1-Shot, 20-way | Relation Net | Accuracy | 97.6 | — | Unverified |
| OMNIGLOT - 1-Shot, 5-way | Relation Net | Accuracy | 99.6 | — | Unverified |
| OMNIGLOT - 5-Shot, 20-way | Relation Net | Accuracy | 99.1 | — | Unverified |
| OMNIGLOT - 5-Shot, 5-way | Relation Net | Accuracy | 99.8 | — | Unverified |
| Tiered ImageNet 10-way (1-shot) | Relation Networks | Accuracy | 36.3 | — | Unverified |
| Tiered ImageNet 10-way (5-shot) | Relation Networks | Accuracy | 58 | — | Unverified |