- Introduced by
- Pan, S. J. & Yang, Q. (transfer learning framework); popularized for CNNs by Yosinski et al. and Razavian et al.
- Year
- 2010–2014
- Type
- Transfer learning applied to convolutional neural networks
- Family
- Deep learning / NLP / CV
What does it do?
Transfer learning with a CNN reuses a convolutional neural network already trained on a large dataset, most commonly ImageNet, and adapts its learned feature detectors to a new target dataset.
This allows reasonable image-recognition performance on smaller datasets without the data and compute needed to train a CNN from scratch.
The intuition behind the method
A CNN trained on a large photo collection learns to respond to edges, textures and simple shapes in its early and middle layers, and these responses are often useful for other visual tasks. Instead of discarding those weights, transfer learning keeps them and attaches a new output head matched to the target classes. An analogy is a radiologist who has read many scans and then moves to a new hospital: much of the existing visual skill still applies, so less retraining is needed than for a newcomer. The analogy holds only as far as the visual content of the two tasks is similar.
History
Pan and Yang's 2010 survey (IEEE Transactions on Knowledge and Data Engineering) reviewed and categorised the general transfer-learning framework, which is not specific to CNNs. Yosinski et al. (NeurIPS 2014) examined how transferable features are across the layers of deep neural networks. Subsequent ImageNet-pretrained backbones, including AlexNet (2012), VGGNet (2014), ResNet (2016) and EfficientNet (2019), became common starting points in computer-vision research and applications.
When to use it
Choose transfer learning with a CNN for a visual task (classification, detection or segmentation) when the labelled target dataset is too small to train a CNN from scratch without severe overfitting. It tends to work well when the target images share visual structure with natural photographs, as is often the case in medical imaging, satellite imagery and industrial inspection. Avoid it when the input is not spatially structured in a way that resembles the source images, for example raw sensor traces with no image-like layout, when the target dataset is large enough to train from scratch, or when licence terms for the available pretrained weights do not allow your intended use.
Limitations and considerations
- Benefit shrinks when the target imagery differs strongly from ImageNet-style photographs (for example electron microscopy or hyperspectral data), so the transferred early-layer features may be poorly matched and domain-specific validation is needed.
- Pretrained weights can carry biases from the composition of the source dataset, and these may carry over into the target task.
- The choice of which layers to freeze and what learning rate to use usually needs experimentation; poor choices can cause the pretrained features to be overwritten or leave the model under-adapted.
- Large backbones such as EfficientNet-B7 can be memory-intensive and slow to fine-tune on limited hardware.
- Licence terms for some pretrained models, particularly those trained by commercial providers, may restrict deployment.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Reduces the labelled data needed for a usable model, because the pretrained convolutional layers already encode general visual features and only the head, or a subset of layers, must adapt to the target classes.
- Lowers training cost compared with random initialisation, since optimisation starts from weights that already respond to edges and textures found in natural images.
- Widely distributed pretrained backbones such as ResNet, EfficientNet and DenseNet give a common, reproducible starting point that is easy to compare across studies.
- Offers a controllable trade-off between feature extraction and full fine-tuning, so the number of trainable parameters can be matched to the size of the target dataset and the degree of domain shift.
- Saliency-based tools such as Grad-CAM can show which image regions contribute to a prediction, which helps check whether the model attends to meaningful structure.
Applications
- Medical image classification: detecting tumors, lesions, or pathologies from X-ray, MRI, or histology slides.
- Satellite and aerial imagery analysis: land-cover mapping, building detection, and crop monitoring.
- Industrial quality control: defect detection on production lines with limited annotated examples.
- Wildlife monitoring and biodiversity research: species identification from camera traps or drone imagery.
- Document and scene text recognition: fine-tuning on domain-specific fonts or layouts.
- Emotion and facial expression recognition: adapting face-dataset pretrained models to clinical or HCI research contexts.
How it works
How it works
A CNN such as ResNet, VGG, EfficientNet or DenseNet is first trained on a large source dataset, typically ImageNet (about 1.2 million images across 1,000 classes). This pretraining stores general visual features in the convolutional layers.
The pretrained convolutional weights are carried into the target-task architecture. Early layers, which encode low-level edges and textures, are usually frozen so they are not overwritten. Deeper layers, which encode more task-specific patterns, can be left trainable or selectively unfrozen, with the choice guided by how far the target domain departs from the source.
The original classification head (fully connected layers and softmax output) is removed and replaced with a new head sized for the target task: a dense layer that maps the pooled convolutional features to one output per target class, followed by a softmax. The new head is initialised randomly and trained with a cross-entropy loss.
The model is trained on the target dataset with a small learning rate, usually a smaller rate for the pretrained layers than for the new head. Two questions guide the choice of mode. First, how much labelled target data is available: with very little data, only the new head is usually trained (feature-extraction mode). Second, how far the target domain departs from the source: with more data or a more distinct domain, deeper convolutional layers are unfrozen progressively and trained at a small learning rate (fine-tuning mode), while early layers usually stay frozen. These are practical heuristics rather than fixed rules, so the chosen setting should be compared against a model trained from scratch on the same data before it is adopted.
Performance is measured on a held-out test set that was not used for choosing frozen layers or training settings. Metrics depend on the task: accuracy, precision, recall, F1 or AUC for classification, and intersection over union (IoU) for detection and segmentation. Learning curves and confusion matrices are inspected, and saliency maps or Grad-CAM visualisations can be used to check which image regions drive predictions.
Common pitfalls
- Using a learning rate high enough during fine-tuning to overwrite the pretrained features, which is known as catastrophic forgetting.
- Freezing too much of the backbone when the target domain differs substantially from the source, so the model cannot adapt to the new visual content.
- Using the same test data both to choose which layers to freeze and to report final performance, which leaks information into the reported result.
- Omitting data augmentation, which matters more when the target dataset is small and the risk of overfitting the new head is high.
- Reporting only overall accuracy on an imbalanced dataset; per-class F1 and a confusion matrix are needed to show how the model treats minority classes.
Frequently asked questions
Should I freeze the convolutional base or fine-tune all layers?
It depends on the size of your target dataset and how similar its images are to the source data. With a very small dataset from a domain similar to ImageNet, freezing all convolutional layers and training only the new head is the usual starting point. With more data or a more different domain, deeper layers can be unfrozen progressively and fine-tuned with a small learning rate, while early layers are usually kept frozen.
Which pretrained backbone should I choose?
ResNet-50 is a common baseline that many studies use for comparison. EfficientNet models are often chosen when accuracy must be balanced against computational cost. For tasks that need fine spatial detail, DenseNet-style backbones are often used. For segmentation, encoder-decoder networks such as U-Net are typically paired with a pretrained encoder rather than used as a backbone themselves. Larger models have more capacity to overfit, so model size should be matched to the amount of labelled target data.
My target domain looks very different from natural photos. Will transfer learning still help?
It may, but the benefit is often smaller. Early convolutional layers capture edges and textures that tend to generalise, while later layers are more specific to the source task. Validate the choice by comparing a from-scratch baseline against the fine-tuned model. If the difference is small, a backbone pretrained on images from your own domain, such as medical images, may be preferable.
How much target data do I need?
Transfer learning is most valuable when labelled target data is scarce. With only a few labelled images per class, fine-tuning a pretrained backbone is generally more reliable than training from scratch. As the number of labelled images grows, the advantage narrows and other choices, such as the architecture and augmentation strategy, matter more.
How do I explain what the model has learned to a non-technical audience?
Use Grad-CAM, or SHAP for images, to generate heatmaps showing which pixels drove each prediction. These visualisations help stakeholders check whether the model attends to clinically or scientifically meaningful regions rather than to spurious artefacts, although they do not by themselves prove the model is correct.
Related methods
Sources
Pan, S. J., & Yang, Q. (2010). A Survey on Transfer Learning. IEEE Transactions on Knowledge and Data Engineering, 22(10), 1345–1359.
Open DOI referenceYosinski, J., Clune, J., Bengio, Y., & Lipson, H. (2014). How transferable are features in deep neural networks? Advances in Neural Information Processing Systems (NeurIPS), 27, 3320–3328.
Open publication reference