← All projects

Visual Quality Control

Watch how an AI-enabled camera catches defects in a string of lights, then decide how much confidence it takes to ship one untouched.

This is a replica of AI-enabled visual inspection. Each unit is a rendered string of lights, and some contain a built-in defect. The system compares each unit with the expected pattern, assigns a confidence score, and then uses the threshold below to decide whether it ships, returns for rework, or waits for a person to inspect it.

65%

A unit ships automatically when its confidence meets or exceeds the threshold. Units within 20 points of the threshold go back for rework, while anything lower waits for manual inspection. A detected wiring fault always goes to a person regardless of confidence.

Approved

8

Sent for rework

2

Manual inspection

6

Missed defects

0

Actually defective, but confidence cleared the threshold and it shipped anyway.

Unnecessary reviews

0

Actually within spec, but confidence fell short and it used a person's time anyway.

No defect92% confidence

Approved

No defect90% confidence

Approved

Missing bulb44% confidence

Manual inspection

No defect90% confidence

Approved

Wrong color43% confidence

Manual inspection

Dim bulb62% confidence

Sent for rework

No defect91% confidence

Approved

Damaged section36% confidence

Manual inspection · wiring fault detected

No defect91% confidence

Approved

Dim bulb62% confidence

Sent for rework

No defect91% confidence

Approved

Missing bulb44% confidence

Manual inspection

No defect92% confidence

Approved

Wrong color43% confidence

Manual inspection

Damaged section37% confidence

Manual inspection · wiring fault detected

No defect90% confidence

Approved

What this shows

Detecting a possible defect and deciding what to do with the unit are two separate steps. The confidence threshold determines whether the product ships, goes back for rework, or needs a person to inspect it, while the cost of a missed defect helps the business decide where that threshold belongs.

How it works

Each sample unit is generated with either a known defect or no defect, which makes it possible to compare the system's decision with the correct outcome. The system compares the color and brightness of every bulb with the expected result, then combines the overall difference with the single largest defect to calculate one confidence score. A clearly incorrect bulb can therefore lower the result even when the rest of the string looks correct.

A separate rule treats three or more consecutive dark bulbs as a wiring fault and sends the unit to a person regardless of confidence.

Design decisions and guardrails

This project connects a replica of AI-enabled visual inspection with an automated routing decision. The confidence score represents what a computer-vision system could detect, while the resulting action shows how an automated workflow could send the product to shipping, rework, or manual inspection.

The confidence score and wiring-fault rule remain separate so the user can see which signal caused the decision. A detected wiring fault always goes to a person regardless of the threshold.

Limitations

The demonstration includes 16 sample units and five defect types. A production system would train on labeled images from the actual manufacturing line and would also account for changes in camera angle, lighting, and product position.

Production next steps

A production version would connect a trained computer-vision model to labeled images from the actual line, then route each unit to shipping, rework, or manual inspection based on the result.

Technology used

This project uses TypeScript in the browser to compare each light against the expected result and calculate a confidence score based on the differences it finds. At a larger scale, an AI-enabled camera and trained computer-vision model could use the same process to inspect each unit and determine what should happen next.