Why Transfer Learning Is Useful
Transfer Learning is useful because we can reuse knowledge learned by an existing model instead of training a new model completely from the beginning.
Don't learn everything again.
A pretrained model has already learned useful patterns. We can reuse that knowledge and adapt the model to a different but related task.
Why Do We Need Transfer Learning?
Training a large neural network from scratch can require a lot of data, computing power, and training time.
Instead of starting with random weights, Transfer Learning allows us to start with a model that has already learned useful information.
Training From Scratch
Random Weights
↓
Learn Features
↓
Learn More Features
↓
Learn The New Task
↓
Final Model
With Transfer Learning:
Pretrained Model
↓
Already Learned Features
↓
Train For New Task
↓
Final Model
The second approach can save a significant amount of unnecessary training.
Less Training Data
Deep learning models normally perform better when they have access to large amounts of training data.
However, collecting a huge dataset for every new problem is not always practical.
Transfer Learning helps because the pretrained model has already learned general features from its original training data.
Pretrained Model
↓
Edges
Shapes
Textures
Patterns
↓
Small New Dataset
↓
New Task
Therefore, the new dataset does not necessarily have to teach the model everything from zero.
Faster Training
A model trained from scratch starts with randomly initialized weights.
The model has to gradually learn useful features during training.
A pretrained model already has useful weights, so the new training process can focus on adapting those weights to the new task.
From Scratch
Random Weights
↓
Many Training Steps
↓
Learn Features
↓
Learn Task
Transfer Learning
Pretrained Weights
↓
Adapt Model
↓
Learn New Task
This can make the training process much faster than training the entire model from scratch.
Less Computing Power
Training large deep learning models from scratch can require powerful GPUs and considerable computing resources.
Transfer Learning allows us to reuse an already trained model instead of repeating the entire training process.
Training From Scratch
Large Dataset
+
Large Model
+
Long Training
↓
High Computing Cost
Transfer Learning
Pretrained Model
+
New Dataset
+
Additional Training
↓
Often Less Training Cost
The actual amount of computing saved depends on the model, dataset, and how much of the pretrained model is retrained.
Better Starting Point
When we create a neural network from scratch, its weights start with random values.
The model must discover useful patterns during training.
A pretrained model already contains learned patterns. This gives us a much better starting point.
From Scratch
Random Weights
↓
Start Learning
↓
Discover Features
Transfer Learning
Pretrained Weights
↓
Already Learned Features
↓
Adapt To New Task
Example — Flower Classification
Imagine that we want to build a model that can identify different types of flowers.
We only have a small number of flower images.
Training a large image model completely from scratch would require the model to learn basic visual features before it could learn about flowers.
Instead, we can start with a pretrained image model.
Pretrained Image Model
↓
Already Understands
↓
Edges
Shapes
Textures
Patterns
↓
Flower Images
↓
Flower Classification
We are not teaching the model how to understand every visual pattern again. We are adapting its existing knowledge to recognize flowers.
Example — Plant Disease Detection
Suppose we want to identify whether a plant leaf is healthy or diseased.
We could use a pretrained image model and adapt it to our plant dataset.
Pretrained Model
↓
Visual Features
↓
Plant Leaf Images
↓
Training
↓
Healthy / Diseased
The pretrained model provides the basic visual knowledge. Our new training data teaches the model which visual patterns are associated with healthy and diseased leaves.
When Is Transfer Learning Most Useful?
Transfer Learning is especially useful when we have a relatively small dataset and a suitable pretrained model.
Small Dataset
+
Suitable Pretrained Model
↓
Transfer Learning
↓
New Model
The pretrained model should have learned knowledge that is useful for the new problem.
If the original training task is very different from the new task, Transfer Learning may not provide the same benefits.
Transfer Learning means reusing learned knowledge.
Instead of starting from random weights, we start with a pretrained model and adapt it to our new problem. This can reduce the amount of data, training time, and computing resources needed.
Quick Check
Because we can reuse knowledge from a pretrained model instead of training everything from scratch.
It can. A pretrained model has already learned useful features, so the new task may require less training data.
No. It works best when the pretrained model has useful knowledge related to the new task.