Skip to content

One Shot Learning

  • Enables learning from a single example per class, useful when collecting more data is costly or infeasible.
  • Contrasts with traditional machine learning, which typically requires many examples to perform well.
  • Applied in areas such as image classification, language translation, and playing games.

One shot learning is a machine learning approach where a model can learn to perform a task from a single example. It is particularly useful when the number of training examples is small or when the cost of collecting more examples is high. One shot learning can be contrasted with traditional machine learning approaches, which typically require a large number of examples to perform well.

One shot learning works by using a very small number of labeled examples—often a single example per class—to build a basis for comparison. A common approach is to create a “prototype” for each class that represents its key features; new inputs are classified by comparing them to these prototypes and selecting the most similar one. The approach is analogous to how a child might learn a new word after hearing it once, whereas traditional models would need many examples across varied contexts to generalize.

Suppose we want to train a machine learning model to classify images of animals as either “cats” or “dogs.” Instead of collecting a large labeled dataset, one shot learning uses a single example of each class (one image of a cat and one image of a dog). A “prototype” image for each class represents the key features of that class. To classify a new image, the model compares it to each prototype and assigns the class of the most similar prototype.

One shot learning can be applied to translation by using a single example sentence per language as a “prototype.” To translate a new sentence, the model compares it to the language prototypes and identifies which prototype is most similar. If the new sentence is most similar to the English prototype, it is translated into French; if it is most similar to the French prototype, it is translated back into English.

  • Image classification
  • Language translation
  • Playing games
  • One shot learning is effective when training examples are scarce or expensive to obtain.
  • It may not perform as well as traditional machine learning methods when a larger number of examples is available.
  • The choice between one shot learning and traditional approaches depends on the specific problem and available resources.
  • Traditional machine learning approaches
  • Prototype