Training a visual inspection model is usually a machine-learning specialist's job: choosing the architecture, batch size, learning rate and number of epochs, then patiently adjusting them after every failed attempt. A quality engineer knows the product and what a defect is, but does not have to do that part. In AIVQC Trainer automatic training does it. This article shows exactly what happens between runs — so the result is not a black box.
What you give it
Just two things: a time budget and a quality target. The target is mAP@50 — a common quality measure for object-detection models that tells you how well the model finds and marks defects. The time budget sets how long training may run before Trainer hands back the best result it has reached.
The third, invisible input is the data. Training always uses a frozen version of the dataset, so later labelling fixes do not change results you have already seen. How to build a dataset that does not inflate the result is covered in A dataset that does not cheat.
Before the first run starts
Trainer first checks that the data is ready — because most model problems start in the dataset, not the algorithm. It warns about under-represented defect classes, very small boxes and images without the product, and an image without a defect has to be deliberately confirmed as negative. It then chooses parameters for your dataset and the hardware it will train on. That way the first hour of GPU time is not spent training on a dataset that has to be fixed anyway.
The loop of runs
Automatic training is a series of full runs. After each one Trainer analyses the results on the validation set, diagnoses what went wrong and corrects the parameters of the next. The loop ends when the model reaches the target or the time budget runs out.
At the end the best model is kept, not the last one. This matters: a later run can be worse than an earlier one, and ordinary training "to the end" would hand you exactly that one.
How training reacts to typical symptoms
A machine-learning specialist watches how the results evolve and recognises a few recurring situations. Automatic training does the same:
- Results plateau — Trainer lowers the learning rate and trains longer so the model can refine the details.
- Results get worse — it returns to the best known configuration instead of pressing on.
- Results jump between epochs — it softens the optimisation so learning is more stable.
- The model lets defects through or rejects good parts — the next run corrects the parameters in the direction that is lacking, rather than guessing.
- The GPU runs out of memory — Trainer repeats the run with a smaller batch on its own and does not use up a run from the budget.
Telling escaped defects apart from false rejects is key here, because on the line these two errors cost very different amounts. More in False accept or false reject?.
Validation chooses, the test only reports
The model is selected on the validation set only. The test set takes no part in any training decision — it only reports how the model will handle images it has not seen. If the test influenced the choice of model, its result would stop being an honest forecast of what will happen on the line.
What happens after training
The best model goes to Evaluation, where you check it through the same inference path the AIVQC Production station uses — on images outside training and on a recording from the target camera. Trainer calculates a recommended confidence threshold with a range of acceptable values and shows precision, recall, F1, mAP@50 and mAP@50–95 for each class.
The deployment package will not be created while any result is below the criteria saved in the project — quality, frames per second and latency — or a measurement on the target computer is missing. The decision to deploy is always yours.
Where training runs
Training runs in the background — on the Trainer computer or on a GPU worker on the local network — and progress is visible in every workspace. On a CPU alone training is slower and better suited to experiments; labelling, evaluation and deployment do not need a GPU. Data does not leave the plant, because training does not use a cloud.
New images from the line: retrain instead of starting over
When new images come back from the station — for example NOK or low-confidence ones — you do not have to train from scratch. You retrain the previous model on the extended dataset, and the result goes through the same evaluation and the same criteria. That way, with every production change, the model learns from the cases it got wrong.
If you want to steer it by hand
For advanced users there is a manual mode with the full set of parameters and four detection architectures to compare. Most teams do not need it: their role is to label the defects, set the target and the time, and judge the result in Evaluation. How many images to prepare to start is covered in How many images do you need to train an AI inspection?.
Want to see automatic training on your own data? Write to us — in a pilot you can train as many times as you need.