Data ScienceDeep learning and computer vision

Transfer learning: freeze, fine-tune and compare baselines

PK
Pankit Kumar
Sr. Data Scientist at Parexel (a Goldman Sachs–backed company) · 20 September 2026 · 2 min read
Technically reviewed by Ishaan Sharma
In this article (5 sections)

Transfer learning initializes a target model from parameters learned on a source task. Freezing retains the source feature extractor and trains a new head. Fine-tuning updates some or all transferred weights, usually with a smaller learning rate. Both should be compared with training from scratch under a declared target-data budget.

The local lab pretrains its NumPy convolutional model on 180 clean stripe images. The target task has heavier noise and only 60 training images.

Target candidateValidation accuracy
Train from scratch50%
Freeze transferred convolution filters100%
Fine-tune transferred model100%
python
from deep_learning_cases import transfer_case

result = transfer_case()
scores = result["validation_accuracy"]
assert result["target_training_rows"] == 60
assert set(scores) == {"scratch", "frozen_features", "fine_tuned"}
print(scores)

This large gap is expected in an intentionally related, simple authored fixture. It demonstrates reuse of learned filters; it is not a benchmark for a public pretrained model or real images. Frozen and fine-tuned candidates tie, so the cheaper frozen option is sufficient under this validation result.

Establish source compatibility

Record the source dataset, task, preprocessing, license and model version. Check input channels, resolution and normalization. A source model trained on unrelated imagery or restricted data may provide little value or create governance problems.

Train a fresh task-specific head first. Then unfreeze a declared block, lower the learning rate and monitor validation. If batch-normalization statistics are present, decide whether they update. Changing every layer immediately can erase useful features on a small target set.

Compare fairly

Give scratch, frozen and fine-tuned candidates comparable tuning budgets. Report trainable parameters, elapsed resources and several seeds. Keep source-related duplicates out of target test; public datasets can overlap unexpectedly.

Inspect errors by target slice. Transfer may improve the average while preserving a source bias. A perfect validation score on a small set has wide uncertainty and warrants a harder, independent test.

The Data Science course treats transfer learning as an evaluated initialization choice with provenance and operating costs.

Exercise

Vary target training size and unfreeze zero, one or all blocks. Plot validation distribution, trainable parameter count and fit time. Select on validation, then assess once on an untouched source-disjoint test.

Continue learning

This article is part of the Deep learning and computer vision sequence. Use the neighbouring tasks when you need the prerequisite or the next application.

Reference: PyTorch transfer-learning tutorial.

PK
Pankit Kumar
Lead Instructor, NeuraPath Academy

Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.

This article is part of our Data Science programme — 6 months. From data foundations to machine learning, deep learning and deployment.

Explore Data Science
Counselling is free · no obligation

Not sure which programme fits?

Tell us your background and we will map it to the right entry point — including saying so when a cheaper programme is the better fit. A counsellor replies within one working day.