Guide · Inspection technology
How do you calibrate the egg classifier with labelled eggs?
Calibrating means tuning the Vigiovo limits to your eggs, your camera and your light. Gather a few hundred labelled eggs from a trained person, set aside a test set, measure how far each decision sits from its threshold and tune one parameter at a time. Because the classification is deterministic, the same configuration always gives the same result on the same eggs.
Updated · 5 min read
What do I need before calibrating?
You need a few hundred eggs, photographed with the same camera, light and conveyor as production. Calibrating with a different setup tunes the limits for a situation that does not exist on the line.
Light comes before any limit. Diffuse light without glare matters more than any parameter, because strong glare is the main source of false dirty grades. If the light is not yet stable, fix that before touching the limits.
Label each egg as clean, dirty, cracked or unverified, without looking at the system's decision. When two people disagree, decide together and note the case. Deliberately include the doubtful eggs, such as light stains, hairline cracks and eggs touching the frame edge, because they show where the limit should sit.
Which limits should I tune?
Vigiovo decides with fixed limits, and calibration adjusts a few of them. The main ones are:
- Dirt limit (dirty_area_threshold): an egg is dirty when stains cover 3% or more of the visible shell. The area is measured against each egg's shading surface.
- Crack limit (crack_length_threshold): an egg is cracked when the total crack length reaches 0.8 of the radius. A line only counts as a crack if it is elongated, long and deep, as described in how it works.
- Colour deviation (stain_chroma_abs): stains are measured in Lab colour space, by how far their colour sits from the egg's own colour. Adjust it if faint stains are missed or if shell shading gets flagged as stain.
- HSV range for the shell: defines which pixels are shell and which are conveyor. Change it only if the shell tone falls outside the usual range. White or bluish shells need their own limits, set during calibration.
The limits are relative to the reference radius (r), so they hold at any resolution. What changes from one line to another is the light, the shell and the camera, and that is what calibration captures.
How do I know how far each decision sat from its threshold?
Each decision carries a readable reason that puts the measurement and the threshold side by side. For a crack, for example, the reason shows the length measured in multiples of r against 0.8 r. An egg that sits just over the limit is not the same as one that clears it by a wide margin, and the two call for different responses.
So calibration does not look only at right and wrong. It looks at the spread: if many eggs fall very close to the limit, that region is crowded and small changes in light can flip the class. In that case, improve the light first and then adjust the limit. Eggs far from the limit on both sides are what give confidence that the value sits in the right place.
Step by step: how do I tune the limits?
Follow the order below, and repeat from step 3 until there is no further gain:
- Run the calibration set with the current configuration and list every error: a clean egg marked dirty, a cracked egg that passed as clean, and so on.
- List the eggs that landed close to a limit. They show whether the limit is in the right place or whether the region is crowded.
- Change one parameter at a time and rerun the same set, without swapping any eggs.
- Keep the change only if it reduces the errors without creating false positives on clean eggs.
- Repeat for each parameter and save the final configuration with the date and the list of eggs used.
How do I validate the calibration before using it on the line?
Test the final configuration on a set that was not used for calibration. If the same set serves for both tuning and testing, the result looks better than it will on the line, because the limits were chosen for those exact eggs.
Because the classification is deterministic, running the same image with the same configuration always gives the same result. That makes the test repeatable: if someone changes a limit later, rerun the set and compare. The synthetic accuracy figures on this site are not the accuracy of your line. That is only known after calibrating with real images, and it is worth recording per batch.
Recalibrate when the light, the camera position, the shell colour or the conveyor changes. Those changes shift the measurements, and old limits stop holding even if the configuration was never touched.
Frequently asked questions
How many labelled eggs do I need to calibrate?
- A few hundred. Variety matters most: include clean, dirty and cracked eggs, plus the doubtful ones, such as light stains, hairline cracks and eggs touching the edge. Those are the eggs that show where the limits should sit.
Can I calibrate and test with the same images?
- No. Set aside a test set before you start and do not use it to tune limits. If the same set serves for both tuning and testing, the result looks better than it will on the line, because the limits were chosen for those eggs.
Does calibration work for white-shelled eggs?
- Not without adjustment. The default colour limits in Vigiovo target brown and cream shells. White or bluish shells need their own colour limits, set during calibration with eggs from your production.
Sources
How Vigiovo helps
Vigiovo grades eggs on the conveyor as clean, dirty, cracked or unverified, in real time, with deterministic computer vision: every decision comes with the measurements behind it, on an ordinary CPU.