Glossary

One-Shot Learning

Discover the power of One-Shot Learning, a revolutionary AI technique enabling models to generalize from minimal data for real-world applications.

Train YOLO models simply
with Ultralytics HUB

Learn more

One-Shot Learning (OSL) is a specialized area within machine learning (ML) where the goal is to classify new examples based on only a single training instance for each class. This contrasts sharply with traditional supervised learning methods, which often require thousands of labeled examples per class to achieve high accuracy. OSL is particularly relevant in scenarios where training data is scarce, expensive, or time-consuming to collect, making it a crucial technique for real-world applications where data limitations are common.

How One-Shot Learning Works

Instead of learning to directly map an input to a class label from numerous examples, OSL models typically learn a similarity function. The core idea is to determine how similar a new, unseen example (query) is to the single available labeled example (support) for each class. If the query example is highly similar to the support example of a specific class, it is assigned that class label. This often involves using deep learning (DL) architectures like Siamese Networks, which process two inputs simultaneously to determine their similarity. These networks are often pre-trained on large datasets (like ImageNet) using transfer learning to learn robust feature representations before being adapted to the OSL task through techniques like metric learning.

Key Concepts in One-Shot Learning

  • Support Set: This contains the single labeled example provided for each class that the model needs to learn from.
  • Query Set: This contains the unlabeled examples that the model needs to classify based on the support set.
  • Similarity/Metric Learning: The process of learning a distance function or metric that measures the similarity between data points, crucial for comparing query examples to support examples.
  • Episodic Training: A common training strategy where the model is trained on many small OSL tasks (episodes) sampled from a larger dataset to simulate the one-shot scenario during training.

Real-World Applications

OSL enables various applications previously hindered by data limitations:

  1. Facial Recognition: Security systems or personal devices might need to identify or verify a person after enrolling them with just a single photograph. NIST conducts extensive testing on facial recognition technologies, many facing similar few-shot or one-shot challenges.
  2. Rare Object Detection: In fields like manufacturing quality control or wildlife conservation, identifying rare defects or endangered species might only be possible with one or very few prior examples. While models like Ultralytics YOLO11 excel at object detection with sufficient data, OSL techniques could augment them for extremely rare classes.
  3. Signature Verification: Authenticating a person's signature based on a single reference signature stored on file. Research explores deep learning for this task, often in low-data regimes.
  4. Drug Discovery: Identifying potential new drug candidates or predicting molecule properties based on very limited experimental results, accelerating the research process. Studies show the application of OSL in predicting drug-target interactions.

Challenges and Future Directions

The primary challenge in OSL is generalization: how can a model reliably learn the essence of a class from just one example without overfitting? The choice and quality of the single support example become critically important. Ongoing research focuses on developing more robust feature representations, better similarity metrics, and leveraging techniques like meta-learning ("learning to learn") to improve OSL performance. Integrating OSL capabilities into general-purpose vision models and platforms like Ultralytics HUB could significantly broaden their applicability in data-constrained environments. Evaluating OSL models requires careful consideration of performance metrics under these challenging conditions.

Read all