One-Shot Learning

IntermediateMachine Learning

Last updated June 14, 2026

What is One-Shot Learning in simple terms?

In simple terms, one-shot learning is teaching an AI to recognize something new from a single example. Like meeting a person once and knowing their face afterward, instead of needing to study a hundred photos of them first.

What is One-Shot Learning?

One-shot learning is a machine learning approach in which a model learns to recognize a new category from just a single example, by drawing on broader knowledge it already has rather than needing many labeled samples of that category.

Most machine learning is hungry for examples. To learn a new category — a particular animal, a specific product, one person's handwriting — a typical model needs to see many labeled samples of it, often hundreds or thousands. One-shot learning is the goal of getting that down to a single example. Show the system just one picture of a new object, and it should be able to recognize that object again. The number in the name is literal: "one-shot" means one example to learn from, in contrast to the usual many-shot training. (A close cousin, few-shot learning, allows a small handful of examples; zero-shot learning attempts it with none at all, working purely from a description.)

The trick that makes this possible is that the model isn't really learning from scratch each time. Before it ever meets the new category, it has typically been trained on a large and varied collection of *other* things, and from that broad experience it has learned something more general — not "what a cat looks like" but "what makes two things look alike or different." Armed with that, it can take a single new example and judge how closely future inputs match it. You can think of it the way a person handles a stranger's face: you don't need a hundred photos to recognize someone you met once, because you already carry a lifetime's general skill at telling faces apart, and you simply slot the new face into it.

This matters most wherever examples are genuinely scarce or expensive to gather. Some categories are rare by nature — an unusual medical condition, a one-off defect, a signature that exists only once. Others change too fast to collect a training set for, or would cost too much to label in bulk. The honest limit is that one-shot learning leans heavily on the quality and breadth of that earlier general training; if the single new example is unlike anything the model's broad experience prepared it for, one look may not be enough, and its confidence from a single sample should be treated with care. Done well, though, it pushes machine learning closer to the flexible, learn-from-one-glance way people pick up new things.

Real-world example of One-Shot Learning

Imagine the security desk at an office that wants to recognize each new employee from the single photo taken on their first day. There's no time — and no appetite — to photograph every new hire from fifty angles to build a training set. A one-shot system handles it by leaning on having already studied huge numbers of *other* faces beforehand, which taught it the general business of telling faces apart. So when a new employee's one ID photo is added, the system can compare a live face at the door against that single reference and decide whether they match, without ever needing a folder of pictures of that specific person. The one photo is enough precisely because all the heavy learning — how faces differ in the first place — was done long before this particular employee ever walked in.

Related terms

Frequently asked questions about One-Shot Learning

What is the difference between one-shot learning and few-shot learning?

They sit on the same scale and differ only in how many examples of a new category the model gets. One-shot learning means learning from exactly one example; few-shot learning means learning from a small handful — a few examples rather than just one. Both stand in contrast to ordinary machine learning, which usually needs many labeled samples, and to zero-shot learning, which attempts the task with no examples at all, using only a description. In short, the "shot" count is simply how many samples of the new thing you're allowed: zero, one, or a few.

How does one-shot learning work?

It works by doing most of the learning in advance. The model is first trained on a large, varied set of other categories, from which it learns something general — typically how to measure whether two inputs are similar or different — rather than memorizing specific classes. When a single example of a brand-new category then arrives, the model doesn't retrain from scratch; it simply compares new inputs against that one example using its learned sense of similarity, judging how closely they match. So the single example is a reference point, and the heavy lifting comes from the broad experience built up beforehand.

What is one-shot learning used for?

It's used wherever you need to recognize something new but can only get one example of it. Face recognition from a single ID photo is a classic case, as is verifying a signature that exists only once, identifying a rare object or defect with no large sample to train on, or recognizing a handwritten character from one model of it. It's valuable anywhere collecting many labeled examples per category is impossible, too slow, or too costly — letting a system extend to new cases on the strength of a single look.