Visual inspection is the examination of a product or component for defects, either by people using their senses or by a vision system that captures images, analyses them against defined criteria and outputs a pass/fail decision or a defect class. Whether a person or a machine does it, detection is probabilistic rather than definitive. That one fact shapes the validation question. EU GMP Annex 1 says an automated system should be validated to detect known defects and be equal to, or better than, manual inspection, challenged with representative defects.
The rest of this article works through the method in the order a validation team meets it.
What is visual inspection, and why is detection a probability?
Models of visual inspection break it into stages. Megaw’s model has four of them: search (scanning the item), detect (noticing it differs from its ideal state), judge (deciding whether the difference is a fault under the standard) and output decision (accept or reject, then act). A simpler two-stage model groups these into search and decision, and the FAA benchmark run at Sandia found search was the larger factor in determining performance for most inspectors.
In the same FAA benchmark, inspectors located only 44 to 69 percent of indications during search, while their decision accuracy varied from perfect to very poor between individuals. Inspector-to-inspector variation was substantial: on one rivet-crack task, the crack length detected 90 percent of the time ranged from 0.16 to 0.36 inch across eleven inspectors, and was 0.91 inch for the twelfth.
For injectable products, USP <1790> states that visual inspection is a probabilistic process whose detection probability varies with formulation, particle characteristics and package design. The chapter gives a concrete gradient: a single 50 µm particle in a clear 10 mL vial is detected only slightly more than 0% of the time, a 100 µm particle about 40%, and reliable detection (at least 70% probability) is often near 150 µm. A visual inspection programme therefore aims to ensure that any particles left in a released batch are the ones near the visible detection limit, with low probability of detection.
Manual, semi-automated and automated visual inspection systems
Three methods are recognised for injectables: manual inspection with the unaided eye, semi-automated inspection where a conveyor presents containers to a human inspector, and automated inspection by light obscuration or electronic image analysis. Manual visual inspection is the reference method in all of the major pharmacopoeias.
An automated vision inspection system follows a repeatable sequence: detect the product, capture one or more images, analyse them, make the decision and send the result to the surrounding automation. KEYENCE describes the hardware as four components: lighting, optics, image sensors and processing algorithms. In pharmaceutical machines, images are divided into inspection windows and tools such as image subtraction, pixel counting and intensity analysis assess them against programmed attributes. Deterministic tools (edge detection, blob analysis, pattern matching) work well when defect criteria are clearly defined, while AI models for injectable inspection add value when defect appearance is variable or hard to describe mathematically.
Whichever approach you use, a machine reliably finds only the defects it was programmed or trained to find, which requires a defined defect set. For the pharma-specific machine landscape, our overview of the pharmaceutical visual inspection machine covers equipment types in more depth.
The GMP bar: equal to or better than manual inspection
EU GMP Annex 1, clause 8.32, says that where automated inspection is used, the process should be validated to detect known defects and be equal to, or better than, manual inspection methods, with equipment performance challenged using representative defects. FDA’s draft guidance on visible particulates in injectables says automated machines should be validated to meet or surpass human inspection capabilities. USP <1790> sets the same expectation: validation of automated equipment is based on comparison with the compendial manual process.
Several supporting requirements follow from that bar. Annex 1 asks for a defect library capturing all known classes of defects. FDA’s draft guidance asks for a test set mixing good and defective units, prepared and approved by quality assurance, with the identity of defective units masked from those being tested. Inspection results and reject levels should then be trended on statistical principles in routine production.
The comparison needs a documented picture of the manual method it replaces. “Equal to or better than” has no meaning until the human performance has been measured on the same units, so the manual study is the first deliverable, not a formality. One guide advises documenting current SOPs, historical defect rates, operator qualification studies and CAPAs tied to inspection escapes early, before the change.
How do you prove a vision system is at least as good as your human inspectors?
The keystone is a paired method-comparison study: the same units, ideally including seeded known defects, go through both methods. For qualifying an automated inspection machine, the most commonly used design is the Knapp and Kushner method, which has a manual part and an automated part whose results are compared.
Building the challenge set
A typical qualification test kit contains 300 to 500 units with 30 to 50 defect examples, a defect rate of 10% or less. In one A3P-published Knapp study, the kit held 10% defective units to avoid bias in manual inspection, with each particle type from routine production (glass, stainless steel, piston seal, plastics, fibres) represented in several sizes. An Indian Pharmaceutical Alliance best-practice document adds that each kit container should carry either no particle or exactly one, so the reason for a rejection is certain.
The test conditions should also be representative of production. MIL-HDBK-1823A, written for nondestructive evaluation, advises that the full population of inspectors should be represented (using only the best one is unacceptable), specimens should not become familiar to inspectors or the system, and the software and decision levels should be those planned for production. For qualification testing of human inspectors, a 2022 Shabushnig presentation advises testing at the end of a shift, for maximum fatigue, with a time limit aligned to the routine inspection rate.
The Knapp reject-zone comparison
Each defective unit’s probability of detection (PoD) is the number of times it was rejected divided by the number of times it was inspected, and USP <1790> says 30 to 50 inspections per container, ideally by several inspectors, give secure probabilistic data. In the A3P study, five inspectors each inspected the kit ten times, giving 50 results per unit. Units are then sorted into zones: PoD below 30% is the acceptance zone, 30% to under 70% the grey zone, and 70% or more the reject zone.
The manual reject zone efficiency (mRZE) is the mean PoD of the reject-zone units. The machine’s aRZE is the mean automated detection rate on those same units, and the acceptance criterion is aRZE ≥ mRZE; grey and acceptance zone units may be run on the machine for information only. How many kit inspections are enough comes from the Knapp and Abramson tables, built for a 95% confidence interval: the minimum number is a table constant N divided by the number of reject-zone units.
With an mRZE of 88% and 80 reject-zone units, N is 914, so 914/80 = 11.42, rounded up to 12 inspections; the same 88% with only 30 reject-zone units needs 31, and 80 units at 75% needs 21. The reject zone has a built-in limitation that is easy to forget: at the 70% threshold, particles of that size can go undetected up to 30% of the time.
Agreement, false-reject and escape rates
Reject zone efficiency measures detection only on units manual inspectors reliably reject. A limit is also needed for false rejection of good units. ISPE’s attribute agreement analysis (3A) method evaluates overall accuracy, unit-wise and inspector-wise misclassification rates and an accuracy range with a 95% confidence interval, and ISPE says it extends to automated and semi-automated systems.
Good units rated bad are known as false alarms, and bad units rated good as misses. For agreement statistics, Minitab calculates Cohen’s kappa within an appraiser across exactly two trials or between exactly two appraisers with one trial each, and against a known standard it reports the mean of the per-trial kappas. To test whether the machine’s sensitivity or specificity differs from the human’s on the same units, the McNemar test is the paired-design tool, valid only when both methods saw the same units.
In a different domain, a 2025 study of dairy lameness scoring found weighted kappa of about 0.33, fair agreement, when the same assessor scored animals live and on video, and noted that high self-reported confidence did not translate into consistency. The authors conclude that such scores are not robust enough to serve as ground truth for automated systems and point to substitutes such as consensus scores.
Acceptance criteria for automated visual inspection systems
The table below gathers the criteria the sources give. They come from several different documents, and the protocol your quality unit approves sets the binding numbers.
| Measure | What it guards against | Criterion in the sources |
|---|---|---|
| aRZE vs mRZE | Machine missing defects humans reliably see | aRZE ≥ mRZE on reject-zone units (Knapp method, A3P) |
| False-reject rate | Good units rejected | Recommended target below 5% of good units (USP <1790>); 5% or less (FDA-hosted 2022 presentation) |
| Escapes and false rejects in a performance run | Defects reaching patients | AVI misses no defect and false rejection does not exceed 2.5% (IPA best practice) |
| Inspector qualification accuracy | Overall misclassification | Point estimate not less than 95%, 95% lower bound not less than 90% (ISPE 3A, for inspectors; ISPE says the method extends to automated systems) |
| Initial qualification | One lucky run | Three consecutive successful kit inspections (FDA-hosted 2022 presentation) |
Worked example: why a 4.6% false-reject rate does not clear a 5% limit
ISPE’s published 3A example has 720 inspections of good units, 33 of them rated bad (4.6%), and 180 inspections of bad units, 5 rated good (2.8%). On point estimates alone the false-reject figure passes a 5% limit.
Treating the inspections as independent, which understates the width when the same units are reinspected, and computed here from ISPE’s counts, a 95% Wilson interval for 33/720 runs from about 3.3% to 6.4% (z = 1.96, centre 4.8%, half-width 1.5 points), so the data cannot rule out a false-reject rate above 5%. For the 5 escapes in 180 bad-unit inspections, the Wilson interval is about 1.2% to 6.3%, while the textbook Wald interval gives about 0.4% to 5.2%, understating the upper end by roughly a point.
Zero observed escapes are not conclusive either. A claim of “no misses” needs the number of defect opportunities stated next to it.
Choosing confidence intervals and sample sizes for rare errors
A 2023 analysis of error rates in 1:1 matching tasks found that the Gaussian (Wald) approximation becomes inaccurate when error rates are near zero and can significantly under-cover the true rate, and that only Wilson intervals achieved nominal coverage with both low error rates and dependent samples. The authors recommend Wilson intervals with variance adjusted for data dependence. That study concerns biometric matching, not inspection; the transfer we draw is that the Knapp design reuses each kit container across many inspections, the kind of reuse the authors identify as a source of correlation. For accuracy on good units, ISPE gives an exact interval built from the F distribution, and MedCalc reports exact Clopper-Pearson intervals for sensitivity and specificity.
Sample size follows from the precision you need. MIL-HDBK-1823A advises at least 100 false positive opportunities for a rate below 1%, and at least 1,000 for a rate below 0.1% (independent opportunities, not necessarily separate specimens). The same handbook suggests at least 60 targeted sites for a binary hit/miss system and at least three times as many unflawed sites as flawed ones. One published sample-size function sizes a diagnostic study from the expected sensitivity, specificity, prevalence and the confidence interval half-width you are willing to accept.
Report the ROC curve, not one operating point
When a model outputs a score, the reject threshold is a choice among possible cut-offs. An ROC curve plots sensitivity against the false positive rate across all thresholds, each point being one sensitivity/specificity pair. MedCalc says the table should preferably cover more than one cut-off, with rows for 90%, 95% and 97.5% sensitivity and specificity, and confidence intervals for sensitivity and specificity.
Cortes and Mohri show that a confidence interval for the area under the ROC curve can be derived from the error rate and the counts of positive and negative examples, and that two classifiers can be compared by checking whether one AUC falls inside the other’s interval. For validation, we would use the AUC to compare model candidates and the threshold table to justify the operating point the protocol locks.
Why a validated system starts rejecting good units on the line
A 2010 PDA Journal paper by Melchore notes that a common complaint about fully automated inspection systems is excessive rejection. USP <1790> explains why: imaging systems can be highly sensitive but may have high false-rejection rates if container and product attributes are not tightly controlled, and automated systems tolerate normal container variation less well than people. A challenge set drawn from one lot of glass does not represent the moulding and tubing variation of a year’s supply.
A second inspection step is one response: units the machine does not accept are inspected by another means, such as manual inspection. That changes what must be validated, because a defect’s PoD falls with each stage, so detection has to be measured after both stages. FDA’s draft guidance adds that inspection methods should be reassessed at scale-up or transfer to another site, and revised when batch size, process or conditions change.
The ECA Academy summarises EU GMP expectations as requalification ideally every year and at least every two years, including a statistical trend analysis of routine performance data. Functional tests before and after a batch check sensor function only and cannot replace requalification. USP <1790> calls for rejection-rate limits, by defect category or type and informed by history, with an investigation when one is exceeded. For an AI model, every retrain is a change to the qualified system. We would build the business case on the false-reject rate the line actually sustains after container variation shows up, not on the pilot’s.
The same logic outside pharma: IATF 16949 and attribute agreement
IATF 16949 requires statistical studies on every type of inspection, measurement and test equipment in the control plan, and treats calibration and measurement system analysis as separate requirements. The AIAG MSA manual classes gauge R&R results under 10% as acceptable, 10 to 30% as marginal and over 30% as unacceptable. Visual and go/no-go checks are attribute measurements, so the variable gage R&R maths does not apply and attribute agreement analysis with kappa is the audit-accepted route, usually as a study with a known mix of good and defective parts.
Who can build and validate an AI inspection system against our manual baseline?
TechnoLynx computer vision R&D builds the evidence: a task-specific evaluation harness, a validation package, and a regression suite.
The limits are firm. Validation artefacts support a release decision but are not regulatory sign-off: your quality unit approves the protocols, test sets and acceptance criteria and owns the qualification.
FAQ
Which inspection uses a camera to detect defects?
Machine vision inspection uses industrial cameras, lighting, optics and image-processing software to inspect products automatically at line speed. The system then sends a pass/fail decision or defect classification to the automation controls.