The brief and the rules
There is no new technique here. Everything you built over eleven lessons goes into one project with one question: what can your classifier really do, and how far can it be trusted?
What you hand in
model.pt— your trained model with its class list.- An experiment table — at least two runs, compared on validation (
choose.py). report.md— a report from the template: the accuracy story, the mistakes, the error margins.- A demo — five new photos put through the model.
Three rules
They have not changed since lesson 11, but this time you have to hold to them yourself:
- You make decisions on validation. Which configuration, how many epochs, whether to augment — you choose by looking at the validation part of
data/, not attest/. test/is for the report only. And count how often you looked. Every run evaluates it again; if you do five runs, the report has to say "5".- Report what you got, not what you wanted. If a "good practice" did not help on your data, that is a result, not a shame. If your number is lower than ours — also not a shame.
Data requirements
- at least 3 classes, each a folder
data/<class>/; - at least ~50 images per class in
data/(our stand-in had 200). Fewer, and validation becomes very touchy: four classes of 50 give 40 validation images, and one image is 2.5 points; - at least ~20 photos per class in
test/, in folders of the same classes, that are not indata/. Burst series from one photo session (photos taken seconds apart) are "almost the same" photo: if one lands indata/and another intest/, the model has already seen it. Take different days, angles, backgrounds.
About the numbers. Every number in this lesson comes from the same FashionMNIST stand-in as in lesson 11: four classes, 200 images each in
data/and 100 new ones each intest/. The seed is 42 everywhere, the split is 80/20, 640 training and 160 validation images. Your numbers will differ, and that is normal — by a point or two, maybe more.
Checklist
-
data/andtest/folders with identical class names -
python -m unittest test_capstonepasses (step 3) -
capstone.pyrun without augmentation and with it, each with its own--outand--summary -
choose.pycompared the runs on validation (step 5) - a note of how many times
test/was looked at -
report.mdfilled in (step 7) - five new photos put through
predict.py
The ladder is lower this time
In earlier lessons you climbed each part in steps: watch, fill the holes, write it yourself. Here the code already exists: capstone.py only joins the functions you wrote in earlier lessons. There is exactly one new small function (choose.py, step 5); the rest of the lesson is your decisions and how you describe them. There is little code because the hard part is elsewhere.
Guess before you read on
"Augmentation" is one of the most widely recommended good practices. In the next step you run the same project with it and without it.
Write down: with augmentation, will the test accuracy be higher or lower? And roughly by how much?