Use a pretrained VGG16 to turn each image into a vector of numbers, then hand those vectors to a classic classifier such as an SVM or a Random Forest. No deep network is trained at all. This lab shows what a pretrained network knows, and where classical machine learning fits in.
Select a stage to see its shape and what happens to it. Only the last stage is trained, and it is trained in seconds.
The output of any VGG block can serve as features. Global Average Pooling turns its maps into one number per channel, so the vector length is the channel count, whatever the image size.
Each block ends in a 2×2 MaxPool, so the size halves (rounded down). VGG needs at least 32×32 input.
Convolution parameters up to each block. These are frozen: they are only used in a forward pass, and the pass runs once per image.
Pick a classifier to see how it treats a 512-number feature vector.
Both charts are illustrations of typical behaviour. Your grid search and forest will give different numbers, but the shape should match.
Select a cell. Validation accuracy of the whole grid, standardised features.
These are typical ranges for this setup, not measurements. Fashion-MNIST pixels are already a good representation, so the gain from VGG features here can be small. On cluttered colour photos the gap is much larger. Decide your prediction first, then run the tasks.
Bars show the middle of each range. Training time for the SVM grows quickly with the number of samples, while a forest can use all CPU cores.
Both reuse a pretrained network. They differ in what is allowed to change.
Copy each cell into Colab and run them in order. Comments in the code explain each step. Feature extraction runs once, and everything after it uses the saved arrays.
Answers are saved in this browser only. Open a hint after you have tried.