Theory

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

  1. model.pt — your trained model with its class list.
  2. An experiment table — at least two runs, compared on validation (choose.py).
  3. report.md — a report from the template: the accuracy story, the mistakes, the error margins.
  4. 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:

  1. You make decisions on validation. Which configuration, how many epochs, whether to augment — you choose by looking at the validation part of data/, not at test/.
  2. 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".
  3. 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 in data/. Burst series from one photo session (photos taken seconds apart) are "almost the same" photo: if one lands in data/ and another in test/, 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 in test/. 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/ and test/ folders with identical class names
  • python -m unittest test_capstone passes (step 3)
  • capstone.py run without augmentation and with it, each with its own --out and --summary
  • choose.py compared the runs on validation (step 5)
  • a note of how many times test/ was looked at
  • report.md filled 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?