Transfer Learning

Samrat Sahoo
2 min readDec 15, 2019

--

Recently I was trying to create a facial recognition-based attendance tracker for a high school project using small amounts of data because I did not have much data to work with, in the first place. This seems illogical to do especially when the current state of machine learning emphasizes this idea of large amounts of data to create accurate models and fields such as Big Data popping up.

Overview

Through these struggles, I recently discovered something known as Transfer Learning — or one-shot learning. Transfer learning uses the idea of a pre-trained model which has been trained upon millions of images and then uses this pre-trained model on virtually anything. It does this because the pre-trained model can identify key features within the images it analyzes and then applies this to images that the user of the model inputs.

Using Transfer Learning in my Projects

As someone who was only recently gone into the world of Computer Vision, I have very little experience with the machine learning aspect of computer vision. However, I knew I had one central goal in mind: getting facial recognition working. Through a little bit of research, I came across a Python library known as facial_recognition, developed by Adam Geitgey, which thoroughly simplified the pains of creating my own model.

This facial recognition class embodied all the aspects of transfer learning I was looking for. In essence, facial_recognition class only required me to input one image datasets for each face I was recognizing. These image datasets would then be converted into encodings which are saved NumPy arrays. I would finally use these arrays and then get arrays that are produced live directly from the webcam. I would then compare the arrays and find the variance between these arrays. Whichever array from the image dataset had the lowest variance is the respective name I would output.

If you would like to view my project, just click here.

When to Use Transfer Learning?

Transfer learning is obviously a very powerful tool in a day and age that is filled with data. However, it does have its drawbacks. First and foremost, transfer learning sacrifices some form of accuracy. Additionally, transfer learning is generally used for simple circumstances. For instance, facial recognition is a relatively simple problem within the computer vision world. The same goes for object recognition and so transfer learning is the absolute ideal solution for these situations. However, in more complex situations, transfer learning is not ideal.

Synthesis

Transfer learning is a very powerful tool when it comes to smaller datasets. The usage of a pre-trained model makes the machine learning process much faster while making the programming much simpler. And while Transfer Learning has its drawbacks, the versatility it offers is one that should not be overlooked.

--

--

Samrat Sahoo
Samrat Sahoo

Written by Samrat Sahoo

comp sci @ georgia tech 🐝 • formerly @ roboflow, cruise • I occasionally write: samratsahoo.com

No responses yet