▶ Sign up free for the video, slides & prompts
The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.
Checking…
Computer Vision in Practice · Lesson 6 of 15 · 2 min read · 5 min video
Transfer learning
Reuse a model trained on millions of images to get great results with a few hundred.
📄 Download slides (PDF)· free sign-upTraining a CNN from scratch needs millions of labelled images and lots of GPU time. Transfer learning lets you start from a model already trained on a huge dataset, and adapt it with just a few hundred images of your own.
Why it works
A model trained on ImageNet (1.4 million images, 1,000 classes) has already learned edges, textures, shapes and object parts. Those features are useful for almost any image task, whether that's vehicles, plant diseases or fish species at the Vizag fishing harbour.
Two ways to use it
- Feature extraction: freeze the pre-trained layers, replace the final layer, and train only that. Fast, and works with very little data
- Fine-tuning: start the same way, then unfreeze some or all layers and train them gently with a small learning rate. Better accuracy when you have more data
In a few lines
Practical tips
- Use the same preprocessing the original model used (size and normalisation)
- Start with feature extraction, then fine-tune if validation accuracy plateaus
- Use a learning rate around 10× smaller for pre-trained layers than for the new head
- Choose the backbone by need: ResNet or EfficientNet for accuracy, MobileNet for phones
Where to find models
torchvision, timm and the Hugging Face Hub have thousands of pre-trained vision models, ready to download.
In one line
Transfer learning reuses a model already trained on millions of images, replacing its last layer and fine-tuning gently, so you get strong results from a few hundred images.
Share with a friend