Introduction

Lately, posts and tutorials about new deep learning architectures and training strategies have dominated the community. However, one very interesting research area, namely few-shot learning, is not getting the attention it deserves. If we want widespread adoption of ML we need to find ways to train them efficiently, with little data and code. In this tutorial, we will go through a Google Colab Notebook to train an image classification model using only 5 labeled samples per class. Using only 5 exemplary samples is also called 5-shot learning.

Image for post

Plot showing the top losses from our model trained on only 10 sample images

Don’t forget to check out our Google Colab Notebook for the full code of this tutorial!

Frameworks and libraries we use

Jupyter Notebook (Google Colab)

The full code of this tutorial will be provided as a notebook. Jupyter Notebooks are python programming environments accessible by web browsers and are very useful for fast prototyping and experiments. Colab is a service from Google where you get access to notebooks running on instances for free.

Fast.ai

Training a deep learning model can be quite complicated and involve 100s of lines of code. This is where fast.ai comes to the rescue. A library developed by former Kaggler Jeremy Howard specifically aimed to make training deep learning models fast and simple. Using fast.ai we can train and evaluate our classifier with just a few lines of code. Under the hood, fast.ai is using the PyTorch framework.

#data-science #machine-learning #few-shot-learning #deep-learning #data analysis

Few-Shot Learning with fast.ai
5.55 GEEK