Papers › Prototypical Networks for Few-shot Learning

Prototypical Networks for Few-shot Learning

15 Mar 2017NeurIPS 2017 12arXiv:1703.05175archive 2025-07-28

Jake Snell, Kevin Swersky, Richard S. Zemel

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.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1703.05175")

Code

Syntology Ran 49 of 64 code samples harvested from 29 repositories linked to this paper; 15 have no recorded run. Of those that ran: 5 ran · honoured contract; 11 ran · our draft was wrong; 9 ran · fixture could not drive it; 24 ran with no contract checked.

By repository: official repository: 1 sample from 1 repository, 1 ran; community (archive-listed): 61 samples from 28 repositories, 46 ran; 2 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

43 repositories listed; official and paper-mentioned ones first.

COAOX/Cifar-Prototypical mentioned on GitHubpytorch report
DrMMZ/ProtoNet mentioned on GitHubtf report
HenryCWoo/LTLProject mentioned on GitHubpytorch report
Hsankesara/DeepResearch mentioned on GitHubpytorch report
KamalM8/Few-Shot-learning-Fashion mentioned on GitHubpytorch report
Michedev/Prototypical-Networks mentioned on GitHubpytorch report
RongKaiWeskerMA/INSTA mentioned on GitHubpytorch report
Sha-Lab/FEAT mentioned on GitHubpytorch report
WangTianduo/Prototypical-Networks mentioned on GitHubpytorch report
ajfisch/few-shot-cp mentioned on GitHubpytorch report
akshatgarg99/FewShotLearning mentioned on GitHubpytorch report
amazon-research/dse mentioned on GitHubpytorch report
andrewbo29/mtm-meta-learning-sa mentioned on GitHubpytorch report
ash3n/Latent-Similarity mentioned on GitHubtf report
ash3n/Prototypical-Network-TF mentioned on GitHubtf report
cnielly/prototypical-networks-omniglot mentioned on GitHubpytorch report
cyvius96/prototypical-network-pytorch mentioned on GitHubpytorch report
ebadrian/metadl mentioned on GitHubtfApache-2.0 report
goldblum/AdversarialQuerying mentioned on GitHubpytorch report
joshfp/fellowship.ai mentioned on GitHubpytorch report
joshfp/one-shot-learning mentioned on GitHubpytorch report
jsalbert/prototypical-networks mentioned on GitHubpytorchMIT report
lif31up/prototypical-network mentioned on GitHubpytorch report
mariehane/prototypical-networks mentioned on GitHubpytorch report
maxstrobel/HCN-PrototypeLoss-PyTorch mentioned on GitHubpytorch report
minseop-aitrics/FewshotLearning mentioned on GitHubtf report
msfuxian/DualAttentionNet mentioned on GitHubmindsporeApache-2.0 report
oscarknagg/few-shot mentioned on GitHubpytorch report
yredwood/fewshot_blogpost mentioned on GitHubtf report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

64 samples harvested; 49 ran; 5 honoured the contract we drafted; 15 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

5ran · honoured contract
11ran · our draft was wrong
9ran · fixture could not drive it
24ran
15unverified

Licence: 18 of the 64 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 29 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Protonet jakesnell/prototypical-networks/protonets/models/few_shot.py official repository ran · metamorphic tier: deterministic MIT (permissive) · a40352cfd6475ec3 · report
AccMetric DrMMZ/ProtoNet/model/ProtoNet.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 5885c112f3046823 · report
CELoss DrMMZ/ProtoNet/model/ProtoNet.py community (archive-listed) ran MIT (permissive) · e3a0222fd8ed2d2f · report
ConvNet HenryCWoo/LTLProject/models/convnet_mini.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 0c8ab3061fc4f61b · report
Convnet cyvius96/prototypical-network-pytorch/convnet.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 03ab81be46e41dfb · report
EmbeddingFunction joshfp/one-shot-learning/model.py community (archive-listed) ran no licence file found · pointer only · fe0021aa329ae860 · report
FewShotClassifier sicara/easy-few-shot-learning/easyfsl/methods/prototypical_networks.py community (archive-listed) ran MIT (permissive) · f798e1a78274cb31 · report
GatherLayer DrMMZ/ProtoNet/model/ProtoNet.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 3144f593c6905e78 · report
Net Hsankesara/DeepResearch/Prototypical_Nets/prototypicalNet.py community (archive-listed) ran MIT (permissive) · fdc838c064947cc9 · report
PSCBert amazon-research/dse/pretrain/models/Transformers.py community (archive-listed) ran Apache-2.0 (permissive) · c9d933d5fb7c5095 · report
ProtoNet Sha-Lab/FEAT/model/models/protonet.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 4eb979c22e4e42d0 · report
ProtoNet orobix/Prototypical-Networks-for-Few-shot-Learning-PyTorch/src/protonet.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 0b1720468e69b9da · report
ProtoNet lif31up/prototypical-network/model/ProtoNet.py community (archive-listed) ran MIT (permissive) · 516db6627dd0d56e · report
ProtoNet RongKaiWeskerMA/INSTA/model/models/protonet.py community (archive-listed) ran MIT (permissive) · c7a6d6154fec9ddf · report
ProtoNet COAOX/Cifar-Prototypical/src/protonet.py community (archive-listed) ran MIT (permissive) · 1bf49c188356596e · report
ProtoNetHead andrewbo29/mtm-meta-learning-sa/protonet/models/classification_heads.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · 75cb52150d9a660a · report
ProtoNetHead goldblum/AdversarialQuerying/models/classification_heads.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 58af5957818ea856 · report
PrototypeLoss maxstrobel/HCN-PrototypeLoss-PyTorch/processor/processor_protonet.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 17f40aa50a000486 · report
Prototypical ulises-jeremias/prototypical-networks-tf/protonet/models/prototypical.py community (archive-listed) ran MIT (permissive) · 08f5684e7687d43e · report
Prototypical schatty/prototypical-networks-tf/prototf/models/prototypical.py community (archive-listed) ran MIT (permissive) · 180e010d21e18799 · report
PrototypicalClassifier learnables/learn2learn/learn2learn/nn/protonet.py community (archive-listed) ran fingerprinted MIT (permissive) · 46fbc98d3054326d · report
PrototypicalNetwork fabian57fabian/prototypical-networks-few-shot-learning/src/prototypical_net.py community (archive-listed) ran · metamorphic tier: invariant GPL-3.0 (copyleft) · pointer only · aa420da10668ccd5 · report
PrototypicalNetwork mariehane/prototypical-networks/prototypical.py community (archive-listed) ran no licence file found · pointer only · f5933c3730b6f339 · report
PrototypicalNetworks sicara/easy-few-shot-learning/easyfsl/methods/prototypical_networks.py community (archive-listed) ran MIT (permissive) · 341b0d9276c53ee2 · report
R2D2Head ajfisch/few-shot-cp/chembl/modeling/encoders.py community (archive-listed) ran no licence file found · pointer only · 9c75d36a2cd52c03 · report
backbone_protonet DrMMZ/ProtoNet/model/ProtoNet.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · f5c1a7acdfadd94b · report
calc_euclidian_dists ulises-jeremias/prototypical-networks-tf/protonet/models/prototypical.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · a84bbc21fe9abc8d · report
computeGramMatrix andrewbo29/mtm-meta-learning-sa/protonet/models/classification_heads.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · 6134727f9d286287 · report
compute_prototypes akshatgarg99/FewShotLearning/Utils/protonet_calculations.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 4de656fa284263c4 · report
compute_prototypes learnables/learn2learn/learn2learn/nn/protonet.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · b737a25e6c29ebc7 · report
compute_prototypes oscarknagg/few-shot/few_shot/proto.py community (archive-listed) ran · our draft was wrong MIT (permissive) · c442feb515d4d8f3 · report
compute_prototypes sicara/easy-few-shot-learning/easyfsl/methods/prototypical_networks.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 9b846f6eab1ad481 · report
conv_block jsalbert/prototypical-networks/models/convnet_mini.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 9d556d61294bb0a8 · report
conv_block cyvius96/prototypical-network-pytorch/convnet.py community (archive-listed) ran · our draft was wrong MIT (permissive) · b0a1286b15398404 · report
conv_block DrMMZ/ProtoNet/model/ProtoNet.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · bf404583e5ea3465 · report
conv_block joshfp/one-shot-learning/model.py community (archive-listed) ran no licence file found · pointer only · 57d2c3e6cce78748 · report
euclidean_dist joshfp/one-shot-learning/model.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 0d9f00b53a9558f8 · report
euclidean_dist maxstrobel/HCN-PrototypeLoss-PyTorch/processor/processor_protonet.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 7ad5cda37c731a0a · report
few_shot_euclidean_similarity zz990704/Reimplementation-Prototypical-network/protonet.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · 24477e2d27f5e8f7 · report
identity_block DrMMZ/ProtoNet/model/ProtoNet.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · f83f4ae2b6c3bc8d · report
pairwise_distances akshatgarg99/FewShotLearning/Utils/protonet_calculations.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · 276c42468f5e8af0 · report
pairwise_distances oscarknagg/few-shot/few_shot/proto.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · 264452c073b536a8 · report
pairwise_distances KamalM8/Few-Shot-learning-Fashion/few_shot/proto.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 9c31448b2eee894f · report
proto_dist barnrang/Prototypical-network-keras-reimplementation/util/loss.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 6ef2681ed9527bea · report
proto_net_episode akshatgarg99/FewShotLearning/Utils/protonet_calculations.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · d76a7926a5b4328a · report
proto_net_episode oscarknagg/few-shot/few_shot/proto.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · 228cdfe23ddb6e6a · report
tf_acc minseop-aitrics/FewshotLearning/ProtoNet/lib/networks.py community (archive-listed) ran · honoured contract no licence file found · pointer only · d76ff0bd573853cd · report
Config lif31up/prototypical-network/model/ProtoNet.py community (archive-listed) unverified MIT (permissive) · be2b72d9c5987b86 · report
FewShotModel Sha-Lab/FEAT/model/models/protonet.py community (archive-listed) unverified MIT (permissive) · 6137fa2b68c126ad · report
FewShotModel_1 RongKaiWeskerMA/INSTA/model/models/protonet.py community (archive-listed) unverified MIT (permissive) · e7053ecec6d213c4 · report
Network minseop-aitrics/FewshotLearning/ProtoNet/lib/networks.py community (archive-listed) unverified no licence file found · pointer only · 7031de287b846201 · report
ProtoNet DrMMZ/ProtoNet/model/ProtoNet.py community (archive-listed) unverified MIT (permissive) · 4c32fdbf4bc74c91 · report
ProtoNet minseop-aitrics/FewshotLearning/ProtoNet/lib/networks.py community (archive-listed) unverified no licence file found · pointer only · ff981c1b19834fdd · report
PrototypicalNet Hsankesara/DeepResearch/Prototypical_Nets/prototypicalNet.py community (archive-listed) unverified MIT (permissive) · dab17e19991f263e · report
PrototypicalNetwork joshfp/one-shot-learning/model.py community (archive-listed) unverified no licence file found · pointer only · 9bd97fbc6d63a34b · report
accuracy_top_k jsalbert/prototypical-networks/utils.py community (archive-listed) unverified MIT (permissive) · f006ac7d22562283 · report
backbone_resnet DrMMZ/ProtoNet/model/ProtoNet.py community (archive-listed) unverified MIT (permissive) · d93d7b512badec9b · report
compute_accuracy jsalbert/prototypical-networks/utils.py community (archive-listed) unverified MIT (permissive) · d91ab830cd1fc8e4 · report
cross_entropy minseop-aitrics/FewshotLearning/ProtoNet/lib/networks.py community (archive-listed) unverified no licence file found · pointer only · f4fb81c626a087a4 · report
euclidean_dist jsalbert/prototypical-networks/utils.py community (archive-listed) unverified MIT (permissive) · e439ae68f44dd2f2 · report
proto_net_episode KamalM8/Few-Shot-learning-Fashion/few_shot/proto.py community (archive-listed) unverified MIT (permissive) · 0f5366e616c6d837 · report
protonet DrMMZ/ProtoNet/model/ProtoNet.py community (archive-listed) unverified MIT (permissive) · 863c7b61e552662a · report
conv_block identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · 4018d80d0425da98 · report
euclidean_dist identical code first harvested elsewhere ran · our draft was wrong fingerprinted licence of this copy not recorded · 4dd319c45d372246 · report

Tasks

Category-Agnostic Pose EstimationFew-Shot Image ClassificationFew-Shot LearningGeneral ClassificationInductive BiasMeta-LearningOne-Shot LearningZero-Shot Learning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Category-Agnostic Pose Estimation MP100 ProtoNet Mean PCK@0.2 - 1shot 44.78 #5 of 5 Archive leaderboard report
Few-Shot Image Classification CUB 200 50-way (0-shot) Prototypical Networks Accuracy 54.6 #1 of 4 Archive leaderboard report
Few-Shot Image Classification Dirichlet Mini-Imagenet (5-way, 1-shot) ProtoNet 1:1 Accuracy 53.6 #10 of 12 Archive leaderboard report
Few-Shot Image Classification Dirichlet Mini-Imagenet (5-way, 5-shot) ProtoNet 1:1 Accuracy 74.2 #8 of 12 Archive leaderboard report
Few-Shot Image Classification Meta-Dataset Prototypical Networks Accuracy 60.573 #17 of 22 Archive leaderboard report
Few-Shot Image Classification Meta-Dataset Rank Prototypical Networks Mean Rank 8.5 #8 of 13 Archive leaderboard report
Few-Shot Image Classification Mini-ImageNet-CUB 5-way (1-shot) ProtoNet (Snell et al., 2017) Accuracy 45.31 #6 of 12 Archive leaderboard report
Few-Shot Image Classification Mini-Imagenet 10-way (1-shot) Prototypical Networks (Higher Way) Accuracy 34.6 #9 of 14 Archive leaderboard report
Few-Shot Image Classification Mini-Imagenet 10-way (1-shot) Prototypical Networks Accuracy 32.9 #10 of 14 Archive leaderboard report
Few-Shot Image Classification Mini-Imagenet 10-way (5-shot) Prototypical Networks (Higher Way) Accuracy 50.1 #8 of 14 Archive leaderboard report
Few-Shot Image Classification Mini-Imagenet 10-way (5-shot) Prototypical Networks Accuracy 49.3 #9 of 14 Archive leaderboard report
Few-Shot Image Classification Mini-Imagenet 5-way (1-shot) Prototypical Networks Accuracy 49.42 #101 of 105 Archive leaderboard report
Few-Shot Image Classification Mini-Imagenet 5-way (10-shot) Prototypical Networks Accuracy 74.3 #5 of 5 Archive leaderboard report
Few-Shot Image Classification Mini-Imagenet 5-way (5-shot) Prototypical Networks Accuracy 68.20 #86 of 95 Archive leaderboard report
Few-Shot Image Classification OMNIGLOT - 1-Shot, 20-way Prototypical Networks Accuracy 96% #12 of 20 Archive leaderboard report
Few-Shot Image Classification OMNIGLOT - 1-Shot, 5-way Prototypical Networks Accuracy 98.8 #9 of 17 Archive leaderboard report
Few-Shot Image Classification OMNIGLOT - 5-Shot, 20-way Prototypical Networks Accuracy 98.9% #10 of 19 Archive leaderboard report
Few-Shot Image Classification OMNIGLOT - 5-Shot, 5-way Prototypical Networks Accuracy 99.7 #9 of 16 Archive leaderboard report
Few-Shot Image Classification Stanford Cars 5-way (1-shot) Prototypical Nets++ Accuracy 40.90 #5 of 6 Archive leaderboard report
Few-Shot Image Classification Stanford Cars 5-way (5-shot) Prototypical Nets++ Accuracy 52.93 #5 of 6 Archive leaderboard report
Few-Shot Image Classification Stanford Dogs 5-way (5-shot) Prototypical Nets++ Accuracy 48.19 #5 of 6 Archive leaderboard report
Few-Shot Image Classification Tiered ImageNet 10-way (1-shot) Prototypical Networks (Higher Way) Accuracy 38.6 #7 of 13 Archive leaderboard report
Few-Shot Image Classification Tiered ImageNet 10-way (1-shot) Prototypical Networks Accuracy 37.3 #8 of 13 Archive leaderboard report
Few-Shot Image Classification Tiered ImageNet 10-way (5-shot) Prototypical Networks (Higher Way) Accuracy 58.3 #6 of 13 Archive leaderboard report
Few-Shot Image Classification Tiered ImageNet 10-way (5-shot) Prototypical Networks Accuracy 57.8 #9 of 13 Archive leaderboard report
Image Classification Tiered ImageNet 5-way (5-shot) Prototypical Net Accuracy 69.57 #6 of 7 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections