Phase 04: Computer Vision

Transfer Learning & Fine-Tuning

Somebody else spent a million GPU hours teaching a network what edges, textures, and object parts look like. You should borrow those features before training your own. Distinguish feature extraction from fine-tuning and pick the right one based on dataset size, domain distance, and compute budget. Load a pretrained backbone, replace its classifier head, and train only the head to a working baseline in under 20 lines. Progressively unfreeze layers with discriminative learning rates so early generic features get smaller updates than late task-specific ones. Diagnose the three common failures: feature drift from too-high LR on unfrozen blocks, BN statistics collapse on tiny datasets, and catastrophic forgetting. Training a ResNet-50 on ImageNet costs around 2,000 GPU-hours. Very few teams have that budget for every task they ship. What almost every team actually ships is a pretrained backbone with a new head trained on a few hundred or few thousand task-specific images. This is not a shortcut. The first conv block of any ImageNet-trained CNN learns edges and Gabor-like filters. The next few blocks learn textures and simple motifs. The middle blocks learn object parts. The final blocks learn combinations that start to look like the 1,000 ImageNet categories. The first 90% of that hierarchy transfers almost unchanged to medical imaging, industrial inspection, satellite data, and every other vision task —…

Transfer Learning & Fine-Tuning: Somebody else spent a million GPU hours teaching a network what edges, textures, and object parts look like. You should…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.