Understanding few-shot learning in machine learning

Machine learning has experienced tremendous growth in recent years. Some of the factors fuelling this wonderful growth include increase in the sophistication of algorithms and learning models, the growing computing capability of machines, and availability of big data.

AndreyBu, who has more than five years of machine learning experience and currently teaches people his skills, says that “data is the life-blood of training machine learning models that ensure their success.” “A learning model fed with sufficient, quality data is likely to yield results that are more accurate,” he adds.

However, sometimes accruing enough data to increase the accuracy of the models is unrealistic and difficult to achieve. For example, in enormous business situations, labeling samples becomes costly and difficult to manage.

In such limited-data and challenging scenarios, few-shot learning algorithms have been employed successfully to discover patterns in data and make beneficial predictions.

What is few-shot learning?

As the name implies, few-shot learning refers to the practice of feeding a learning model with a very small amount of training data, contrary to the normal practice of using a large amount of data.

This technique is mostly utilized in the field of computer vision, where employing an object categorization model still gives appropriate results even without having several training samples.

For example, if we have a problem of categorizing bird species from photos, some rare species of birds may lack enough pictures to be used in the training images.

Consequently, if we have a classifier for bird images, with the insufficient amount of the dataset, we’ll treat it as a few-shot or low-shot machine learning problem.

If we have only one image of a bird, this would be a one-shot machine learning problem. In extreme cases, where we do not have every class label in the training, and we end up with 0 training samples in some categories, it would be a zero-shot machine learning problem.

Motivations for few-shot machine learning

Low-shot learning deep learning is based on the concept that reliable algorithms can be created to make predictions from minimalist datasets.

Here are some situations that are driving their increased adoption:

  • Whenever there is scarcity of supervised data, machine learning models often fail to carry out reliable generalizations.
  • When working with a huge dataset, correctly labeling the data can be costly.
  • When several samples are available, adding specific features for every task is strenuous and difficult to implement.

Low-shot learning approaches

Generally, two main approaches are usually used to solve few-shot or one-shot machine learning problems.

Here are the two main approaches:

a) Data-level approach

This approach is based on the concept that whenever there is insufficient data to fit the parameters of the algorithm and avoid underfitting or overfitting the data, then more data should be added.

A common technique used to realize this is to tap into an extensive collection of external data sources. For example, if the intention is to create a classifier for the species of birds without sufficient labeled elements for each category, it could be necessary to look into other external data sources that have images of birds. In this case, even unlabeled images can be useful, especially if included in a semi-supervised manner.

In addition to utilizing external data sources, another technique for data-based low-shot learning is to produce new data. For example, data augmentation technique can be employed to add random noise to the images of birds.

Alternatively, new image samples can be produced using the generative adversarial networks (GANs) technology. For example, with this technology, new images of birds can be produced from different perspectives if there are enough examples available in the training set.

b) Parameter-level approach

Because of the inadequate availability of data, few-shot learning samples can have high-dimensional spaces that are too extensive. To overcome overfitting issues, the parameter space can be limited.

To solve such machine learning problems, regularization techniques or loss functions are often employed — which can be applied to low-shot problems.

In this case, the algorithm is compelled to generalize the limited number of training samples. Another technique is to enhance the accuracy of the algorithm through directing it to the extensive parameter space.

If any standard optimization algorithm is used, such as the stochastic gradient descent (SDG) it may not give the desired results in a high dimensional space because of the insufficient number of training data.

As such, the algorithm is taught to go for the best route in the parameter space to give optimal prediction results. This technique is typically referred to as meta-learning.

For example, a teacher algorithm can be trained using a big quantity of data on how to encapsulate the parameter space. Thereafter, if the real classifier (student) is trained, the teacher algorithm directs the student on the extensive parameter to realize the best training results.

Wrapping up

Few-shot learning in machine learning is proving to be the go-to solution whenever a very small amount of training data is available. The technique is useful in overcoming data scarcity challenges and reducing costs.

What’s your experience with low-shot learning in machine learning?

Please let us know in the comment section below.

Quick Code

Sign up for Developer Updates

By Quick Code

Receive weekly updates about new posts on programming, development, data science, web development and more Take a look.

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Quick Code

Find the best tutorials and courses for the web, mobile, chatbot, AR/VR development, database management, data science, web design and cryptocurrency. Practice in JavaScript, Java, Python, R, Android, Swift, Objective-C, React, Node Js, Ember, C++, SQL & more.

Dr. Michael J. Garbade

Written by

Founder & CEO of Education Ecosystem. Serial entrepreneur with experience from Amazon, GE & Rebate Networks, https://www.education-ecosystem.com/

Quick Code

Find the best tutorials and courses for the web, mobile, chatbot, AR/VR development, database management, data science, web design and cryptocurrency. Practice in JavaScript, Java, Python, R, Android, Swift, Objective-C, React, Node Js, Ember, C++, SQL & more.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store