Lecture 17 Transfer Learning
Lecture 17 Transfer Learning
Introduction
• Transfer learning is the reuse of a pre-trained model on a new problem.
• It’s popular in deep learning because it can train deep neural networks with
comparatively little data.
• This is very useful in the data science field since most real-world problems
typically do not have millions of labeled data points to train such complex models.
• We’ll take a look at what transfer learning is, how it works and why and when it
should be used.
• Additionally, we’ll cover the different approaches of transfer learning and provide
you with some resources on already pre-trained models.
What Is Transfer Learning?
• Transfer learning, used in machine learning, is the reuse of a pre-trained model on
a new problem.
• In transfer learning, a machine exploits the knowledge gained from a previous
task to improve generalization about another.
• For example, in training a classifier to predict whether an image contains food,
you could use the knowledge it gained during training to recognize drinks.
• In transfer learning, the knowledge of an already trained machine learning model
is applied to a different but related problem.
• For example, if you trained a simple classifier to predict whether an image
contains a backpack, you could use the knowledge that the model gained during
its training to recognize other objects like sunglasses.
Transfer Learning
• With transfer learning, we basically try to exploit what has been learned in one
task to improve generalization in another.
• We transfer the weights that a network has learned at “task A” to a new “task B.”
• The general idea is to use the knowledge a model has learned from a task with a
lot of available labeled training data in a new task that doesn’t have much data.
Instead of starting the learning process from scratch, we start with patterns learned
from solving a related task.
• Transfer learning is mostly used in computer vision and natural language
processing tasks like sentiment analysis due to the huge amount of computational
power required.
How Transfer Learning Works
• In computer vision, for example, neural networks usually try to detect edges in the
earlier layers, shapes in the middle layer and some task-specific features in the
later layers.
• In transfer learning, the early and middle layers are used and we only retrain the
latter layers. It helps leverage the labeled data of the task it was initially trained on.