Transfer learning with pretrained models
Get strong results from small datasets by starting with a model that has already learned
A taste of a lesson
I have 400 photos of plant leaves in 4 disease classes. Should I fine tune the whole network?
Not at first. With about 100 photos per class, start with feature extraction: keep the pretrained network frozen, compute an embedding for every photo, and train a simple classifier on those. That gives you a fast, honest baseline. If accuracy is not good enough and leaf photos look quite different from everyday images, then unfreeze the top few layers and fine tune with a small learning rate and strong augmentation, checking validation results as you go. Fine tuning everything with so little data risks overfitting. Quick check: how will you make sure photos of the same plant do not end up in both training and test sets?
Written by the teacher as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong.
What you will be able to do
- Explain why features learned on large datasets transfer to new tasks
- Choose between feature extraction and fine tuning for a given dataset
- Fine tune safely with frozen layers and smaller learning rates
- Match preprocessing to a pretrained model and check its licence
- Plan an approach for very small datasets or a large domain gap
Lesson plan
- 1 Why learning transfers Understand what pretrained models have learned and why it helps on new tasks. Start
- 2 Feature extraction Use a frozen pretrained model to produce embeddings and train a small classifier on them. Start
- 3 Fine tuning step by step Unfreeze layers gradually and train with appropriate learning rates. Start
- 4 Preprocessing and tokenizers Feed the pretrained model data in exactly the form it expects. Start
- 5 Domain gaps and tiny datasets Adapt the approach when your data is unusual or very small. Start
- 6 Licences and responsible reuse Check what you are allowed to do with pretrained weights and what biases they bring. Start
Try asking
About this tutor
For beginners who have a modest dataset and want a useful image or text model without training from scratch. You will learn why features learned on large datasets transfer to new tasks, and how to choose between using a pretrained model as a fixed feature extractor and fine tuning some or all of it. Lessons cover freezing layers, using smaller learning rates for pretrained parts, matching the preprocessing the model expects, handling a domain gap such as medical scans or factory images, strategies for very small datasets, and checking the licence of pretrained weights. Examples use both images and text, and no deep maths is needed.
Reviews
4.7
3 ratingsSample
- Jakub D.Sample
Nobody had told me about checking licences on pretrained weights. Useful before I put this into our product.
- Gabriel S.Sample
I had wasted a week training from scratch on 500 images. Feature extraction plus logistic regression beat my old model in an afternoon.
- Nkechi O.Sample
Clear steps. The preprocessing lesson found my mistake: I was using the wrong normalisation values. Wanted a bit more on text models but the ideas carried over.
About the teacher
Generative models and representation learning, explained with intuition first and maths second
9 tutors 335 lessons taught Sample
I teach how models learn useful representations and how they generate new data: autoencoders, GANs, diffusion models, self supervised learning and language model pretraining. I came to this through research engineering work where we had to decide which kind of model was worth the compute, so I teach with trade offs in mind. Each topic starts with a picture or...
See Mateo's profile and tutorsMore like this
Other tutors on the same or nearby topics.