Transfer Learning for Images
Transfer learning reuses a network trained on a large dataset as a starting point for a new task. It is the standard approach when you have limited labeled images.
Why it works
The early layers of a vision network learn general features like edges and textures that are useful across almost any image task. Only the later layers are highly specific to the original classes. So we keep the general part and replace the specific part.
Two common strategies
- Feature extraction freezes the pretrained layers and trains only a new classifier head on top.
- Fine tuning unfreezes some or all layers and trains them at a small learning rate.
Feature extraction is fast and safe with very little data. Fine tuning can reach higher accuracy when you have a moderate amount of task data.
Practical tips
- Start from a model pretrained on a large dataset like a general image collection.
- Replace the final layer to match your number of classes.
- Use a small learning rate when fine tuning so the useful features are not destroyed.
This approach turns a task that would need huge data into one solvable with a few thousand or even a few hundred images.
Key idea
Transfer learning reuses a pretrained network and either freezes it for feature extraction or fine tunes it, solving new tasks with little data.