// Key takeaways
- Locate first, so every other tool follows the product when it shifts or turns.
- Every check ends as a value compared with a limit, including a deep-learning score.
- Rules suit faults you can define; deep learning suits defects that vary in appearance.
- A recipe holds the tools, limits and expected data for one product and is selected at changeover.
What happens to each image?
Every product goes through the same short sequence, and it must finish before the next product arrives:
- Acquire. The trigger fires, the light strobes or is on, and the camera takes the image.
- Locate. A tool finds the product or a feature on it, so the other tools know where to look even if the product has shifted or turned.
- Inspect. Tools run in regions tied to that position: measure, count, read or compare.
- Judge. Each result is compared with its limit.
- Decide and report. Logic combines the results into one pass or fail, which goes to the PLC with any data, such as the code read or the reason for a fail.
Which tools does a station use?
- Locate: pattern matching, edge, line and circle search find the product or a feature. Everything else hangs off this position.
- Measure: distances between edges, diameters, positions, angles, a fill line against a backlight. Values start in pixels and are converted to millimetres by calibration.
- Count: objects or blobs in a region. Presence or absence is simply a count of one or zero.
- Read: 1D and 2D codes are decoded; OCR reads printed characters; OCV verifies that the print matches the expected text. The OCR/OCV inspection page covers date and batch codes.
- Compare: a region is checked against a reference of a good product, so a wrong label, missing print or an unexpected mark shows up as a difference.
HIKROBOT groups the VisionMaster tools in much the same way: locating, measurement, recognition (code reading and OCR) and defect detection, which includes OCV and anomaly detection (HIKROBOT catalogue 2025 Q4). The VisionMaster algorithm tools page maps each group to typical inspections.
What is the difference between rule-based and deep learning?
Rule-based inspection is a chain of tools an engineer builds: find the label edge, measure its position, fail it if it sits outside a band. Every decision can be traced to a measured value and the limit it was compared with.
Deep learning works from examples instead of rules. You show the station labelled images of good and defective products, and a model learns to classify them, find objects or mark defect areas. Some methods learn from good products only and flag anything unusual, which is called anomaly detection. The model returns a score or a region; a person still sets the threshold that turns it into a fail. HIKROBOT states, for example, that VisionMaster’s deep-learning OCR adapts to characters on complex backgrounds, in low contrast or deformed (VisionMaster product page).
| Aspect | Rule-based | Deep learning |
|---|---|---|
| Best for | Faults you can define as a measurement, count or rule | Defects that vary in shape and appearance, often on a variable surface |
| Main effort | Engineering time to build and tune the tools | Collecting and labelling images, training and validation |
| Samples needed | Fewer images, covering normal variation and each fault | Labelled images of each defect across its variation |
| Explaining a reject | A measured value against a limit | A score, usually with a highlighted region |
| A new product | Usually a new recipe and limits | May need new images and retraining |
Many stations combine both: rules locate the product and read the code, and a deep-learning tool inspects the one area where fixed rules fail. Neither finds a defect that the image does not show. The full comparison, with sample needs and upkeep, is in rule-based inspection or deep learning.
How are the limits set?
A limit is the line between pass and fail for one check: how far a label may be skewed, the lowest acceptable fill line, the size of mark that counts as a defect. Limits start from your quality team’s definition of a defect, written down with example images. They are then set on a sample set that covers normal variation and borderline cases, not on a single good part.
Set a limit too tight and good products are rejected; too loose and defects pass. Each limit is recorded with the reason it was chosen, and every later change is logged. Chapter 6 shows how the two resulting error figures are measured.
What is an inspection recipe?
A recipe holds everything the station needs for one product: references, regions, tools, limits and the expected codes or text. At changeover the PLC or HMI selects the recipe, the station reports back the recipe it is running, and the PLC checks that they match before production restarts.
Expected data that changes, such as today’s best-before date or the batch code, can come from the coder or the PLC, so verification compares the print with the value that should be there now rather than a fixed string. The source still matters: if the recipe and the coder both hold the wrong date, they agree and the error passes.
Define incomplete inspection as an explicit state
A practical decision chain begins by asking whether the image belongs to the current product and whether the required feature was located. Only then should it evaluate the defect or measurement. Defaulting a missing numeric result to zero can create a false pass if zero lies inside the allowed range. Likewise, an OCR failure must not leave the previous recognised text in a field that downstream logic treats as current.
| Requirement or condition | Meaning or risk | Practical check |
|---|---|---|
| Location failed | No valid inspection region | Hold or reject under the agreed fault policy |
| Readable but wrong text | Recognition succeeded; comparison failed | Reject as identity/data failure |
| Classifier uncertain | Decision boundary not resolved | Use the validated hold/review policy |
| Communication timed out | Physical item has no current result | Contain the unresolved item and alarm |
Worked example — hypothetical: For a hypothetical lid recipe, a product passes only when the lid is present, its identity matches and the date text matches the current production data. Deliberately failing each condition in turn verifies the logic. A correct date on a wrong lid must still fail. This truth-table exercise is more informative than showing only a known good pack.
Train and tune learning-based tools on development data, then freeze them before the independent test. Google’s dataset guidance separates training, validation and test sets and warns against duplicate examples crossing those boundaries. (Google Machine Learning Crash Course: dividing datasets) (NIST e-Handbook, 7.2.4.1 Confidence intervals for a proportion)
Keep the original image together with the active recipe and the reference judgement when investigating a disagreement. Change one controlled setting at a time and re-run the relevant challenge samples. Once a correction works, verify the neighbouring requirements too: improving contrast for one feature can hide another. Record the revised configuration and the evidence for release so maintenance does not have to reconstruct the decision from memory.
Frequently asked questions
Does a vision system need to be trained?
Rule-based tools are set up rather than trained: an engineer teaches a reference image and sets limits on samples. Deep-learning tools are trained on labelled images and then checked on a separate set of images that was not used for training.
What is the difference between OCR and OCV?
OCR reads the characters and reports what they say. OCV starts from the text that should be printed, such as the expected date and batch code, and checks that it is present, complete and legible. Many date-code checks use both.
Is AI inspection more accurate than rule-based inspection?
Not as a general rule. Each suits different defects, and the result depends on the image and the samples. Both are accepted the same way: on agreed samples, counting false rejects and missed defects.
Sources
- HIKROBOT Machine Vision Smart Product Catalog, 2025 Q4 (PDF), VisionMaster tool list (vendor catalogue, checked 2026-10-03; locating, measurement, recognition and defect detection groups)
- HIKROBOT VisionMaster product page (vendor page, checked 2026-10-03; deep-learning OCR and defect detection)
- Google Machine Learning Crash Course: dividing datasets (training, validation and independent test sets; read 2026-10-27)
- NIST e-Handbook, 7.2.4.1 Confidence intervals for a proportion (binomial interval methods; read 2026-10-27)