Software & integration

Surface defects: bounded AI evaluation

Build a registered reference-difference baseline and compare a bound candidate without turning anomaly scores or AI suggestions into confirmed defect answers.

Send samples for engineering review
Surface defects: bounded AI evaluation — Illustrative engineering scene; not a photograph or a measured result.
Illustrative engineering scene; not a photograph or a measured result.

Purpose and operating boundary

Build a registered reference-difference baseline and compare a bound candidate without turning anomaly scores or AI suggestions into confirmed defect answers.

This tutorial defines an engineering evaluation, not a ready-to-run product certification. The current Deyi Vision public PC example covers an EAN-13 workflow on confirmed sample images. Native OCR and detection work in the engineering code must be checked against the installed runtime, bound models and job before use. A browser template does not prove browser execution: the planned OpenCV.js backend needs separate verification. Cloud recognition requires explicit approval of the image scope, provider, model and cost. A review archive is not an executable release package. Camera, firmware and driver compatibility require their own check. All worksheet values below are hypothetical; they are not Deyi Vision measurements or customer results.

Prepare the evidence

Keep the good reference, registration datum, exclusion mask and defect labels in separately versioned records. Confirm the selected backend actually implements each requested node. Check the intermediate output against its contract before interpreting the final flag. A missing region, malformed text field, invalid coordinate or non-finite numeric value must remain an explicit failure, not a default good result. Record the actual execution backend and dependencies used for that run; do not transfer acceptance from another backend with the same template name. If a new model or preprocessing revision is selected, preserve the previous version and rerun the fixed comparison rather than combining results across identities. Present the complete number of attempted cases, how many returned usable evidence and the decision made for the remainder. These quantities describe coverage and failure handling as well as recognition quality. A surface-defect station must distinguish a material defect from a change in viewing conditions. Scratches, dents, oil, texture and a reflection can produce similar intensity changes, yet require different dispositions. Prepare acceptable parts from the expected finish range and defect samples with recorded locations and orientations. Choose a datum that remains visible when the surface changes. A reference image is useful only after its pose and illumination are comparable with the current part. An image difference is not a physical depth measurement, and a detected region does not by itself identify a defect mechanism. Decide whether dirt is a reject, a cleaning request or an excluded condition before collecting answers. Store original views of ambiguous samples rather than inventing a clean reference or a corrected label. Treat a workflow as a sequence of typed decisions, not as a single model answer. Bind the input identity, region transform, node versions, preprocessing and model package before running an experiment. Separate parameter selection on development images from evaluation on a frozen set whose answers were not used for tuning. Keep the baseline and candidate results for every case, including unsuccessful execution. An AI suggestion can propose a revision but cannot confirm the reference answer, grant data upload permission or approve production use. If a provider call has an uncertain receipt, preserve the request identity and investigate that receipt before considering any resend. Runtime availability, recognition quality and release approval are independent checks.

Procedure

  1. Register source and reference using a stable datum before subtraction; review the transform on both images.
  2. Inspect the difference image before thresholding and morphology so that registration edges are not mistaken for scratches.
  3. Compare a candidate on development data, then freeze it and evaluate the untouched defect and good-part set.
  4. Route missing registration, absent dependencies and unobservable surfaces to Review or Error, never a default good verdict.

Interpret the trial

For the hypothetical set, 2 of 10 defects are missed and 1 of 20 good parts is rejected. Report both denominators. An anomaly score is not a defect probability; unbound segmentation or anomaly models are outside this executable trial.

Recording worksheet

Hypothetical worksheet; values are design examples, not measured performance.
RecordValue / observationInterpretation
Defect casesTP = 8; FN = 2Miss rate: 2 / 10 = 20%
Good casesTN = 19; FP = 1False reject: 1 / 20 = 5%

Two engineering views

Two engineering views · 1

The diagram shows the order of checks. Each arrow requires recorded evidence; it does not imply an implemented automatic connection. Input identity → Bound nodes → Result contract → Review.

  1. Input identity
  2. Bound nodes
  3. Result contract
  4. Review
Illustrative engineering scene; not a photograph or a measured result.
View full-size diagram

Two engineering views · 2

The diagram shows the order of checks. Each arrow requires recorded evidence; it does not imply an implemented automatic connection. Development → Frozen evaluation → Candidate → Approval.

  1. Development
  2. Frozen evaluation
  3. Candidate
  4. Approval
Illustrative engineering scene; not a photograph or a measured result.
View full-size diagram

Failure diagnosis

  • A ring around the part silhouette suggests registration or scale error rather than an entire defective surface.
  • A kernel that removes the narrow scratch improves the image appearance while destroying inspection evidence.

Acceptance and handover

Retain the baseline when the candidate has no demonstrated benefit. Freeze reference, transforms, mask, node/model identities and the complete confusion matrix before approval.

Keep the source images, the expected decision, the exact revision and the complete result record together. Freeze the evaluation set before selecting the final parameters. If those answers are later used to tune the workflow, mark that set as development data and obtain a new independent acceptance set. Keep Review, NoResult, execution error and missing acquisition visible in the denominator; do not turn them into passes by filtering rows. Save a reproducible failure alongside the successful sample. The handover should identify who may change the recipe, how a prior approved revision is restored and which device output remains inhibited until acceptance. A software result alone does not establish that a moving physical part reached the correct destination.

Sources and technical references

These references explain the methods and limits used in this tutorial. Example checks are guidance; production acceptance requires evidence from your own samples.

  1. Deyi Vision machine vision software: evaluation scopeDeyi Vision

    Public EAN-13 PC evaluation scope and separate hardware/production acceptance.

    Checked
  2. Operations on arraysOpenCV

    Explicit array operations including absdiff and inRange; a vendor-neutral workflow must validate type, shape and independent test data.

    Checked
  3. Morphological TransformationsOpenCV

    Opening/closing change binary foreground geometry; verify kernels against the smallest relevant feature.

    Checked
  4. Inspection threshold confusion matrixDeyi Vision

    Use explicit false-positive/false-negative denominators and independent evaluation; do not hide Review, errors or missing acquisition.

    Checked

Engineering review

Bring the inspection problem and the evidence.

Send sample images, your current setup and the check that failed. Include field of view, working distance, line speed and acceptance criteria for a practical review.

Send samples for engineering review
Contact

Direct RFQ contact

Talk to engineering about the inspection problem.

Send sample images, competitor model, FOV, working distance and line speed before model selection.

Target: selection brief within 24h
Send sample images