Once a pre‑trained model has been selected and the decision to use transfer learning has been made, the next step is to determine the best transfer learning approach.
Not all transfer‑learning techniques are equally effective for every task. Choosing the right method—feature extraction, fine‑tuning, or Low‑Rank Adaptation (LoRA)—depends on factors such as dataset size, task complexity, and computational constraints.
There are several other transfer‑learning approaches that may be valuable depending on the use case, but we will focus on the three primary approaches in our hands‑on work while briefly discussing other techniques used in the field.
Overview of Transfer Learning Techniques
There are several approaches to transfer learning, each balancing performance, efficiency, and adaptability.
| Technique | Description | Best Used When… |
|---|---|---|
| Feature Extraction | Uses a pre‑trained model’s frozen layers as a feature extractor; only the final classifier is trained. | Data is limited, and the target task is similar to the source task. |
| Fine‑Tuning | Some layers of the pre‑trained model are unfrozen and retrained on the new dataset. | The target task is moderately different from the source task, and sufficient data is available. |
| LoRA (Low‑Rank Adaptation) | Injects trainable low‑rank matrices into selected model layers, reducing memory requirements while adapting the model. | The target task requires adaptation but computational resources are limited. |
| Domain Adaptation | Adapts a model to a new data distribution without modifying the task itself. | The target dataset differs in style or environment from the pre‑trained dataset. |
| Self‑Supervised Pretraining | Uses unlabeled data to train feature representations before fine‑tuning on a downstream task. | Labeled data is scarce but a large amount of unlabeled data is available. |
| Knowledge Distillation | A smaller “student” model learns from a larger “teacher” model to retain knowledge efficiently. | Model deployment requires high efficiency without losing accuracy. |
| Progressive Neural Networks | Adds new modules to a pre‑trained model instead of modifying existing weights, preserving past knowledge. | The model needs to continually learn new tasks without catastrophic forgetting. |
Each technique is suited for different scenarios, but for this course, we will focus on feature extraction, fine‑tuning, and LoRA due to their practicality and broad applicability.
Feature Extraction: When and How to Use It
Feature extraction is one of the simplest transfer‑learning techniques. The pre‑trained model’s convolutional or transformer layers remain frozen, while a new classifier is trained on top.
When to Use Feature Extraction
- ✅ The dataset is small and lacks diversity.
- ✅ The new task is like the source task.
- ✅ The goal is to deploy a lightweight model with minimal compute requirements.
Example: Classifying Cat and Dog Images
A company wants to build a cat vs. dog classifier using deep learning.
Instead of training from scratch, they:
- Use ResNet‑50 trained on ImageNet as a frozen feature extractor.
- Remove the final classification layer.
- Add a new classifier to distinguish between cats and dogs.
- Train only the classifier while keeping all convolutional layers frozen.
This method minimizes training time and data requirements, making it ideal for small datasets.
Fine‑Tuning: When and How to Use It
Fine‑tuning adjusts the weights of selected layers in a pre‑trained model, allowing it to specialize in the target task while retaining useful knowledge from the source task.
When to Use Fine‑Tuning
- ✅ The target dataset is larger and slightly different from the source dataset.
- ✅ More control over task‑specific feature learning is required.
- ✅ Compute resources allow for some layers to be retrained.
Example: Detecting Defects in Manufactured Products
A manufacturing company wants to detect defective parts in images.
Instead of training a model from scratch, they:
- Use a pre‑trained EfficientNet model.
- Freeze early convolutional layers but unfreeze deeper layers to learn new product‑specific features.
- Train the model on their custom defect‑detection dataset.
Fine‑tuning allows the model to adapt its feature representation, improving accuracy for the new task.
LoRA (Low‑Rank Adaptation): When and How to Use It
LoRA is a parameter‑efficient adaptation method that adds trainable low‑rank matrices to frozen layers instead of fully fine‑tuning them. This significantly reduces computational cost while allowing for effective adaptation.
When to Use LoRA
- ✅ The dataset is moderately sized, but compute resources are limited.
- ✅ The model is a large transformer (e.g., GPT, BERT, ViT) that is expensive to fine‑tune fully.
- ✅ The goal is to preserve the original model’s capabilities while specializing it for a new task.
Example: Adapting a Large Language Model for Finance
A financial services company wants to adapt GPT‑4 for legal document summarization.
Instead of fully fine‑tuning the model, they:
- Apply LoRA to key attention layers in the transformer model.
- Train only the LoRA layers on finance‑related text data.
- Keep most of the model frozen, reducing training time and cost.
LoRA allows efficient adaptation while maintaining the benefits of the large pre‑trained model.
Return to Module 3 or Continue to Performance Evaluation: Measuring the Effectiveness of Transfer Learning


