Fine-tuning: Unfreezing and Retraining
base_model.trainable = True, layer-by-layer unfreezing, differential learning rates.
When to Fine-Tune
After feature extraction trains your head, fine-tuning squeezes out extra accuracy by letting the top of the pretrained base adapt to your data. Do it only once the head is stable, otherwise large gradients from a random head can damage the base.
Unfreezing the Base
Set base.trainable = True to make weights updatable again. By itself this unfreezes every layer, which is usually too aggressive.
base.trainable = True
print("Trainable layers:", sum(l.trainable for l in base.layers))All lessons in this course
- Transfer Learning Concepts and Strategies
- Using VGG16 and ResNet50 as Base Models
- Fine-tuning: Unfreezing and Retraining
- MobileNet and EfficientNet for Edge Deployment