Scoping an Automated Optical Inspection System

How to scope an automated optical inspection system: why webcam proofs fail, how to audit imaging, how many samples to use, and how to tie a defect…

Scoping an Automated Optical Inspection System
Written by TechnoLynx Published on 01 Nov 2026

An automated optical inspection system is a camera, lighting and software rig that scans each part for catastrophic failures, such as a missing component, and for quality defects, such as a skewed component or a badly shaped solder fillet. We would settle four things before committing budget to one. The imaging must make the defect visible. A feasibility study on real parts at representative speed comes before model tuning. A written acceptance specification has to define each defect type that matters. And we would build an evidence trail an auditor or OEM can follow. The standards cited below come from PCB and electronics assembly, but we would apply the same scoping method to any line with visible surface defects.

A complete system has two halves, hardware and software. The hardware (image sensor and illumination) acquires the image, and the software extracts features and classifies each part as defective or not, often feeding a sorting mechanism that diverts rejects. Rules for triggering a defect report can be rule-based (for example, no line on the board narrower than 50μ) or CAD-based, where the board is compared locally with its intended design.

Why the webcam proof of concept failed on the line

A webcam will not work well where software makes the decision, parts move or image quality must be consistent, and no model recovers a defect the camera never captured.

TechnoLynx then specifies the camera, lens and lighting for your part geometry and tolerances, and validates the new rig against your defect taxonomy before full deployment.

  • Rolling shutter. Webcam sensors smear moving objects, while industrial cameras use global shutters that freeze the part.
  • No trigger or strobe I/O. A webcam offers only a USB data interface, with no hardware inputs and outputs to time the exposure to the part or fire a strobe.
  • A fixed lens. The integrated lens suits general viewing and cannot be changed, whereas choosing a machine-vision lens depends on sensor size, working distance, field of view and pixel size.
  • Sensors that change. Webcam makers may swap sensors every six months, which matters when a model’s behaviour depends on sensor sensitivity.
  • No SDK. Webcams ship with a generic video driver, not a programmable interface for controlling exposure and acquisition.

Cognex states that poor lighting is the most common cause of poor machine vision performance, and that sophisticated cameras and software cannot make up for it. Tensoria’s inspection guide makes the same point about pilots: lighting variability is, in its account, the single most common reason early pilots fail to transfer to production, because a model trained on variable shadows learns the shadows. A model also cannot recover what the camera never recorded: if a defect has no contrast under the installed light, it is absent from the pixels. That is the gap between a demo and a production line, and it is why an off-the-shelf detector that looks fine on a desk falls over on real edge cases, lighting and throughput.

An honest caveat applies. Without the original images and logs, blaming the webcam is an informed inference rather than a confirmed diagnosis, which is exactly why the review of those records comes first.

What a proper machine-vision rig costs

You do need industrial hardware instead of a webcam if parts move, if you need consistent image quality, or if software makes the decision; 1stVision’s test is that a “yes” to any of those rules the webcam out. For cost, the published ranges below come from one vendor, Clearview Imaging, which describes them as representative starting points, not quotes:

Component Clearview Imaging range What drives the price
Area scan camera £150 to £15,000+ Resolution, frame rate, interface, mono or colour
Lens Not given as a single range Fixed, zoom or telecentric; sensor format; working distance
Illumination £50 to £3,000+ Spot and ring lights at the low end, domes and custom line lights at the top; controllers extra
Pre-configured inspection system £15,000 to £100,000+ Number of inspection points and throughput

Custom multi-camera, deep learning or 3D systems sit above those figures because they carry engineering, component selection and testing time. Treat the table as a vendor’s framing of the market; integration effort for your line is the variable it cannot price.

Auditing the cameras and lighting you already have

Existing cameras are good enough when they resolve the smallest defect with margin, freeze motion at line speed, and see it under lighting that stays the same from shift to shift; if any of those fails, fix the imaging before bringing in the model.

Resolution is calculated at the object, not read off the megapixel count. Cognex recommends three to five pixels across the smallest defect you need to catch, and ten or more for dimensional measurement. A high-megapixel camera can still miss a defect if the field of view spreads its pixels too thin.

Worked example: checking pixels on the defect

Cognex gives a case of locating a 0.25 mm feature with four pixels across it inside a 40 mm field of view, which needs a spatial resolution of 0.0625 mm per pixel. Dividing 40 mm by 0.0625 mm gives 640 pixels across that field (arithmetic from the cited figures). Karas Technologies’ guide runs the check the other way: a 100 mm field spanning 2,000 pixels gives about 0.05 mm per pixel, so a 0.1 mm defect lands on only two pixels, which it calls fragile before blur and optics are even considered.

The rest of the audit runs as a checklist. Each line is a condition to confirm on real parts at representative speed:

Check Pass condition
Pixels on the smallest defect Three to five pixels across it at the object
Motion Exposure or strobe short enough that line-speed motion does not blur the defect
Interface bandwidth The cable and protocol can carry the resolution and frame rate together
Lighting geometry Chosen for the defect: low-angle for relief, dome for specular or curved, backlight for dimension
Ambient light Controlled by strobing, an enclosure or pass filters; sunlight needs an opaque housing
Stable presentation and triggering Part presentation and triggering are stable and consistent
Real defect trial Actual defective parts photographed under several lighting geometries before hardware is chosen

Faststream’s guidance is that a short imaging trial on real defective parts, before any hardware is committed, is what separates a deployment from a pilot that never ships. Tensoria notes that many projects keep existing GigE Vision or USB3 Vision cameras and add an inference server, and that a lighting audit often saves more time than a camera upgrade. Our sibling piece on validating feasibility and repeatability of vision-based defect detection turns this audit into a structured lighting and sensor variation study.

Will inspectors trust the flags enough to stop their own checks?

The inspection screen should show the captured image, with the region that triggered the flag marked, next to every score rather than a bare number. Interpretability matters here: a survey of machine-learning defect detection describes deep models as often perceived as black boxes and calls transparency a crucial requirement in safety-related fields. An overlay helps people judge a flag, but it does not make the model more accurate; it only makes errors easier to spot.

Manual walk-throughs should be phased out gradually. One vendor, iFactory, describes a shadow-run phase in which the camera captures images alongside existing inspectors without making pass/fail decisions, building a training set from real parts and lighting. We would keep manual checks running in parallel or on a sample while agreement between alerts and inspectors is tracked, and reduce them only when that agreement reaches a threshold agreed in advance. Where labellers disagree, the model learns the disagreement, so borderline cases need a single reference labeller or a quality expert to resolve them.

Will auditors or OEM customers accept a model trained this way?

Acceptance depends on documented validation against the quality framework your customer requires, and a good accuracy figure on its own does not amount to sign-off. For automotive suppliers that framework is IATF 16949, and since June 2026 AIAG has published CQI-38, an AI vision inspection guideline designed to supplement IATF 16949 that helps OEMs, suppliers and equipment makers evaluate the capability, accuracy, reliability and risk of AI-based inspection.

TechnoLynx’s AI Governance and Trust work builds the approval evidence pack an external auditor or customer reviews for an AI inspection system.

Quality assurance for an AI inspector includes measurement system analysis, which IPC-9716 lists among AOI requirements. UnitX, an inspection vendor, reads IATF 16949 as requiring documented MSA with gauge repeatability and reproducibility studies for pass/fail inspection systems, and AI systems as needing GR&R below 10% for critical characteristics. Treat the 10% figure as that vendor’s reading; documented MSA is the part worth planning around. The same vendor recommends auditable reject logs traceable to individual part and timestamp.

One published study benchmarked human inspectors against deep-learning models. A 2023 Horticulturae study of floral wreath inspection found inspectors reached 92.4% precision against a quality standard, just below the 93.8% of YOLOv8 and YOLOv5, with a Kappa of 0.941 showing adequate inspector agreement with the standard. The human baseline is itself variable, and that variability has to be documented rather than assumed away. The statistical design of that human-machine comparison is a topic of its own, which we cover separately.

Do you need third-party sign-off on your ground-truth method? Our judgement is that if the OEM or auditor has already approved a validation protocol, benchmarking under that protocol may be enough, and if not, you should get explicit customer or third-party approval of the method before production use. We would treat interpreting IATF 16949 for AI-specific practice as a real risk, and recheck each OEM’s requirements over the product’s life.

How do you define a defect taxonomy and tie it to a standard?

A defect taxonomy should list what the system must alarm on, what it must pass, and which look-alikes it must not confuse, agreed by quality, production and the customer before any vendor or model is evaluated. Define the inspection before choosing a model. Quality and quantity of data, and expectations, come before model selection; near-100% accuracy is almost never plausible, so the workflow needs fault tolerance and room for human review.

Karas Technologies frames the starting point as an acceptance specification: which defect types matter, the smallest one that must be found, acceptable variation, the cost of a false accept versus a false reject, and the decision time. “Find damaged parts” is not testable, whereas “detect missing O-rings and surface cuts longer than 2 mm on the visible sealing face, with fewer than one false reject per 1,000 conforming parts” is.

Standards to anchor the taxonomy

We would tie the taxonomy to an existing grading scheme instead of inventing one:

  • IPC-A-610 grades every condition as Acceptable, Process Indicator (does not affect form, fit or function; monitored as process data) or Defect (disposition required). Its three product classes follow the consequence of failure, not the product category.
  • IPC-9716 sets requirements for AOI on printed board assemblies, covering lighting, calibration, detectability, resolution, threshold limits, program setup and measurement system analysis. Its notation states per class whether a condition is acceptable, a process indicator or a defect, so [A1P2D3] means Acceptable for Class 1, Process Indicator for Class 2 and Defect for Class 3.
  • Ordinal severity levels are another option. The ICME 2026 Grand Challenge grades each defect as Acceptable, Marginal NG, NG or Gross NG according to the risk it poses to reliability.
  • Risk-based categories from pharmaceutical inspection classify defects as critical, major and minor, with acceptance quality limits chosen per category (industry means of 0.065%, 0.65% and 2.5%, normally with zero critical defects permitted), according to a 2022 FDA-hosted presentation by Shabushnig.

Where the standard leaves a limit open, IPC uses AABUS (As Agreed Between User and Supplier), and an undefined AABUS criterion leaves part of the acceptance standard to whatever each supplier assumed. Cite the revision and class explicitly, such as “IPC-A-610J Class 3”, because criteria differ between revisions. AOI only sees what a camera can see, so hidden joints under area-array packages still need X-ray inspection.

Who signs it off, and can an outsider validate it?

The taxonomy should be signed off by a named group (quality, production and, where the customer sets acceptance, the customer’s quality contact) before any vendor conversation, because vendor demos will otherwise define the scope for you. Labels need a written guide with quality experts resolving ambiguous examples; if inspectors disagree, a model cannot learn a consistent target until the standard is clarified. An outside assessor or domain expert can validate the taxonomy, and that is worth doing where inspectors disagree or the customer’s acceptance criteria are unwritten.

The same alarm and no-alarm structure applies to a security taxonomy, and in either setting expect gaps that surface only after deployment and revisit the taxonomy when layout, tooling or product changes.

Which defect grades can your capture actually tell apart?

Detectability has to be tested one defect category at a time, because some severity distinctions show clearly in a single image while others need better capture, and assuming one answer for all of them is how feasibility studies mislead. Distinguishing an acceptable cosmetic blemish from a critical structural defect is essential for risk control, yet severity-aware assessment has received limited attention.

TechnoLynx builds computer vision inspection systems through its Computer Vision R&D service.

The decision runs in three steps. Where single-image accuracy is adequate for a category, keep the simple capture. Where it falls short, try controlled capture changes (a different lighting geometry, a second angle, a fixture). Where those still fall short, require extra evidence such as multiple views or 3D for that category only. The same per-category logic applies to photos customers submit, though phone capture differs from a fixed industrial rig. Defects in industrial inspection often show low contrast and ill-defined boundaries, which is why the per-category test matters. Our companion piece on validating AOI feasibility against confounding variation covers how to separate defect signal from lighting, part and supplier noise.

How many samples does a credible feasibility verdict need?

Tens of defective samples were enough to train one surface-defect model, while MIL-HDBK-1823A asks for at least 60 hit/miss or 40 quantitative flawed sites in a probability-of-detection demonstration. These are the published reference points:

Purpose Reference count Source
Training a surface-defect segmentation model 33 defective samples gave over 99% AP, as did 25; 5 still gave about 96% 2019 segmentation-based surface-defect study
Good-part images for readiness At least 200 under production lighting Tensoria checklist
Inspection qualification test kit 300 to 500 units with 30 to 50 defect examples Shabushnig, FDA-hosted, 2022
Probability-of-detection demonstration At least 60 flawed sites for hit/miss output, 40 for a quantitative signal MIL-HDBK-1823A, 2009
False-positive estimate Three times as many unflawed sites as flawed; 100 opportunities for a rate below 1% MIL-HDBK-1823A, 2009

The 2019 result applies where the defect can be framed as surface segmentation and enough defective samples are available. Defect samples are scarce because strict yield control keeps defective parts rare. Where the defect rate is below 1%, Tensoria suggests starting with anomaly detection trained on good parts only, accepting that it flags “something is wrong” without naming the defect type.

Report the verdict as false accepts and false rejects for each defect type, using a confusion matrix, not overall accuracy: a dataset of 99.9% good parts yields 99.9% “accuracy” from a model that always predicts good. Keep product or lot groups separate between training and final test, or you measure memorisation.

Keeping every release and every capture inside the validated envelope

A validated inspection stays valid only while its validated parameters are unchanged, and any change to lighting, camera position, product, supplier or process needs revalidation.

A repeatable sampling protocol for each release

Sampling plans are selected by the confidence statement they support if passed. Taylor Enterprises’ STAT-04 notes describe variables sampling plans of n=15, 30 or 100 (with matching Ppk limits) that all support a 95% confidence that 99% of units meet the requirement, compared with a minimum of 299 for attribute pass/fail data. Those variables plans assume normality, which should be tested regardless of sample size. The plans differ in their chance of false rejection, not in the confidence statement.

The sample has to cover the range of conditions production will see, or a passing result says little about the parts outside it. Collecting images across shifts, lots, suppliers and machine states gives that coverage. Repeated inspections of the same images tell you about the inspection’s consistency, not about the parts, so they cannot stand in for more samples. The sample set should be approved by Quality, the role the FDA-hosted guidance gives to inspection test kits.

A repeatable capture protocol for every shot

MIL-HDBK-1823A treats threshold levels, resolution, and hardware and software configuration as fixed parameters under a configuration control number, not to be changed without a new demonstration. We would write down the rig settings for exposure, gain, lighting type and angle, working distance and enclosure, and check them at the start of every run.

Karas Technologies recommends tracking exposure, image brightness, focus indicators, processing time, class rates and rejection trends, and notes that a sudden fall to zero defects may mean a broken camera rather than a better process. Revalidate after any change to lighting, camera position, product, supplier or upstream process. Version models, recipes, thresholds, code and acceptance data together, with role-based, audited access to production settings.

Who can scope and build an AOI system for our line?

TechnoLynx scopes and builds AI inspection for manufacturing and automotive production lines through its Computer Vision R&D service. Bringing in a specialist makes sense when the earlier prototype failed and nobody can say why. When choosing a partner, ask for application-specific false-reject and false-accept figures on your parts, not generic accuracy claims.

A team that already has machine-vision engineers who can run the imaging trial and the statistics can reasonably build in-house. This engagement does not suit a team that needs only a turnkey PCB AOI machine with standard rules, where an established equipment vendor is the faster route. It also does not replace IPC certification, your notified auditors or the customer’s own approval of the method.

FAQ

What is AOI in PCB assembly?

AOI is used at several points in PCB assembly, including bare board inspection, solder paste inspection and pre- and post-reflow. Post-reflow has historically been the main location because one system there can catch most defect types, such as placement errors, solder shorts and missing solder.

How does a larger sample size affect the confidence interval?

A larger number of independent samples narrows the confidence interval on an estimated defect proportion, and it can be made as narrow as needed by choosing a large enough sample.

Back See Blogs
arrow icon