Build a VGG-style network and a mini-ResNet from scratch, then reuse a pretrained EfficientNetB0 in two ways: frozen as a feature extractor, and partly unfrozen for fine-tuning. The demos here explain why each design works before you compare them in Colab.
This version uses Fashion-MNIST instead of CIFAR-10. It downloads in seconds and fits in memory when resized for the pretrained network.
Pick an architecture to see the idea it introduced, the equation behind it and where it appears in this lab.
VGG replaces one large kernel with several 3×3 layers. Global Average Pooling replaces Flatten, so the head no longer depends on the map size.
Parameters in Dense(256) after the last feature map.
Y = F(x) + x gives the gradient a direct path back through the identity. When the shape changes, a 1×1 projection makes the shortcut match.
An idealised illustration, not a measurement. Plain: the gradient is multiplied by g at every layer. Residual: the identity path always contributes 1, so it cannot vanish.
Both take a 28×28×1 image and end in Global Average Pooling. Compare your counts with model.summary().
A pretrained backbone has already learned edges, textures and parts from millions of images. Feature extraction keeps it fixed and trains only the new head. Fine-tuning then lets the top layers adapt.
Illustrative curves: 8 epochs of frozen training, then fine-tuning at the chosen rate.
The curves are a simulation of typical behaviour on Fashion-MNIST at 64×64. The fine-tuned curve continues after the frozen run, as in Task 9. Your numbers will differ, and the gap between frozen and scratch models may be smaller than you expect, because clothing photos look unlike ImageNet.
Test accuracies are typical ranges, not promises. Report your own Colab values.
Copy each cell into Colab and run them in order. The code differs from the printed lab sheet in a few places: it uses Fashion-MNIST and a tf.data pipeline for the 64×64 transfer images, and it defines the test label arrays that the sheet's code uses but never creates.
Answers are saved in this browser only. Open a hint after you have tried.