0%
BuildRound 2 rehearsalabout 20 min, 4 steps

Train on a photo collection

Apply the complete train, develop, predict, and export workflow to your saved photos or the included shape demonstration.

What this reading is for

This is one full run from start to finish: the workflow you have learned in pieces, done in one go. Check the labels, give photos their jobs, train, evaluate on development photos, choose a version, run the final test once, and export predictions. Treat the stages below as a checklist. Each one is short, because every step was taught in an earlier reading, which the stage names if you want to look back.

Use either your saved mug and glass project or the shape demonstration from Setting up your image lab. The demonstration trains a real model on simple drawings. It is good for practising the controls, but its scores say nothing about real photos.

Build with me · 1

Inspect the collection before training anything

Whether the photos came from your camera or from someone else, you are responsible for knowing what is in them. With a collection someone hands you (often one folder per class), open several images per class, check that they display, and check that the labels follow one consistent rule. A folder name can be wrong. Near-identical files spread across jobs can leak the same scene into the test. A supplied collection is not automatically balanced, correct, or a fair picture of real use. If a file looks mislabelled, settle the rule before training; do not quietly guess.

Upload a collection one job and one label at a time: choose the job, press the label, then upload that group. Target photos with hidden answers go to Unlabelled targets, never into Training with guessed labels.

Your image lab at this stageWorked example
Text
Look at the photos, then check the label rule, the jobs, and the counts. Only then train.  Training files      go to Training only  Development files   go to Development only  Target files        go to Unlabelled targets only

In Photos, switch through each job and label to review what is there, and count each group. In Notes, write where the collection came from, what it covers, and whether it is your own photos or the shape drawings.

What to look for

Training holds only training photos, reserved photos sit in their own jobs, every ID can be traced, and your notes say what the data is.

Make it yours

Think of one awkward file you might meet in a supplied collection: a broken image, a duplicate, or a photo that fits neither class. Write a rule for handling it that does not depend on whether the model gets it right.

Build with me · 2

Train and evaluate a fresh run

This is the loop from Your first training run and Test it honestly in one go. Check the counts in Train, keep 20 rounds so the run can be compared with earlier ones, and press Train model. Then predict the Development collection and read three things together: the accuracy as a fraction, the baseline line, and the table. Work out the score for each class from the table's rows, as in Class balance, and what accuracy hides.

If the results suggest an improvement, make one change to the Training photos and train again, comparing on the same development photos, as in Fix the data and retrain. Download the project and model for any run you might want to return to.

Your image lab at this stageWorked example
Text
Train:          check both counts, 20 rounds, Train modelTest & export:  Development, Predict collectionRead together:  Accuracy, the Always- baseline, the tableNotes:          run name, counts, development fraction, score for each class

Train, predict Development, and record the run in Notes: run name, training counts, rounds, development fraction, baseline fraction, and the score for each class.

What to look for

A run record another person could check against the lab, with the model's score next to the baseline on the same photos.

Make it yours

Before training, write in Notes the development accuracy you expect, and why. Compare your guess with the result afterwards.

Build with me · 3

Choose a version, then run the final test once

Pick your version from development evidence, then load it if needed and predict the final test once, confirming the reminder. Whatever the result, it is the honest estimate for that version. If you then change the model because of it, the final set has become development data, and a new final score needs new photos.

Your image lab at this stageWorked example
Text
1. Pick the best run using Development results only2. Open model, if the chosen run is not the one loaded3. Test & export: Final test, Predict collection, Evaluate selected model4. Record the result, even if it disappoints

Run the final test on your chosen version and copy the fraction, the class counts, and one limitation into Notes.

What to look for

Your notes keep the development result that chose the version apart from the final result measured afterwards.

Make it yours

Write one situation your final test does not cover, such as another camera, a different room, or both objects in one photo.

Build with me · 4

Export predictions and keep everything together

Finish by producing a labels file, as in From predictions to a labels file. If you have target photos, predict Unlabelled targets and download the CSV. If you have none, export your final-test predictions to practise the format. Then download the project and the model for the chosen run, and give all three files the same run name. If you corrected any prediction by hand, record that separately from the model's own output.

Your image lab at this stageWorked example
Text
Test & export: Unlabelled targets (or Final test), Predict collection, Download predictions.csvTest & export: Download modelBottom of the lab: Download projectThe same run name on all three files

Download the CSV, the project, and the model. Check that the CSV has the header id,label and one line per predicted photo, and that its IDs match the photos you meant to export.

What to look for

Three files that belong to one run: an editable project, a model you can predict with, and a predictions file with intact IDs.

Make it yours

Read your notes as if you were a stranger. Could you tell, from the notes alone, which photos trained the model, which chose the version, and which tested it?

Keep an auditable result

Keep the project, label rules, split record, experiment log, and final predictions together. A useful summary says what was trained, what was held back, how the chosen version was picked, and how many final-test photos it got right.

The next exercise turns these choices into a quick sorting game: teach with training photos, tune with development photos, and test the chosen version once on untouched photos.

Full reference solution

The whole Level 2 workflow on one page. Each reading covers part of it; this list shows where that part fits. The numbers in the readings are examples, and your own results will differ.

Text
1. Name the two classes and write a one-sentence rule for each.2. Reserve objects or sessions for Development and Final test before collecting.3. In Photos, choose Training and a label, then add varied photos of both classes.4. Add reserved photos under Development and Final test, never under Training.5. In Notes, record label rules, objects, conditions, the split, and a run name.6. In Train, check both counts, keep 20 rounds for the first run, and press Train model.7. Download project and Download model, with matching run names.8. In Test & export, predict Development and read every ID, actual label, prediction, and score.9. Work out accuracy yourself, read the confusion matrix, and compare with the Always- baseline.10. Write one hypothesis. Change only the Training photos (or one stated setting), retrain, and predict the same Development collection.11. Choose a version using Development results. Open its saved model if needed.12. Predict Final test once, after choosing, and report its fraction, conditions, and limits.13. For photos with no known answer, use Unlabelled targets, predict, and Download predictions.csv.14. Keep project, model, notes, and predictions file together under one run name. None of them replaces another.

Compare this with your version. Different names and personal choices are fine when the program follows the same logic.

Keep your progress

Sign in and every reading, quiz, and exercise you finish is saved.

Sign in