Click to Sign up for a Free Newsletter read by 50,000 people across the world

NewsArticlesInterviewsPress releasesRegulatoryResourcesCompaniesProductsMaterialsMachineryEventsSearchNewsletter

Home › Article

Article

Robotics and machine vision in pharmaceutical packaging and inspection: validation, AI and buyer checks

Published on Pharmaceutical Weekly 27 November 2026 · 9 min read

By Lisa Kremer

Robotic arm placing glass vials on a conveyor beneath a camera inspection station with a tick on the screen
Image credit: Illustration for Pharmaceutical Weekly · Image source

What Annex 1, FDA's draft visible particulate guidance and draft Annex 22 say about automated inspection, rule-based versus AI vision, challenge sets and what to ask a supplier, as of 27 November 2026.

Inspection is where packaging automation meets the quality system most directly. A robot that moves vials is judged on uptime. A camera that rejects them is judged on whether it finds the defects that matter, and whether anyone can show that it still does next quarter. This article covers injectable visual inspection in most detail, because regulators have written the most about it, using the EU GMP Annex 1 (2022 revision), FDA's draft guidance on inspection of injectable products for visible particulates, the draft EU Annex 22 on artificial intelligence and a 2023 PDA Journal paper on machine learning in automated visual inspection.

Last reviewed: 27 November 2026. The FDA document is a draft guidance and Annex 22 is a consultation draft. Passages marked as interpretation are the author's analysis.

Where robots and vision sit on a line

The brief for this topic spans robotic handling in filling, packaging, palletising and material transfer, and vision for labels, print, codes, fill level, particles and cosmetic defects. The cited regulatory guidance speaks mainly to the inspection side, so the guidance below is specific about inspection and general about handling.

Interpretation: a useful way to separate the two is by what a failure does. A handling robot that fails stops the line or damages containers, which is an equipment qualification and cleaning question. An inspection system that fails can pass a defective container, which is a product quality question and sits under the validation rules below.

What regulators say about automated inspection

Annex 1 section 8.30 says all filled containers of parenteral products should be inspected individually for extraneous contamination or other defects. Defect classification and criticality are set during qualification, based on risk and historical knowledge, with factors including the potential impact on the patient and the route of administration. Defect types should be categorised and batch performance analysed; batches with unusual defect levels compared with routine numbers should be investigated. A defect library should capture all known defect classes and be used to train production and quality assurance staff. A critical defect found later in sampling of accepted containers should trigger an investigation, because it indicates a possible failure of the original inspection.

Section 8.32 covers automated methods: the process should be validated to detect known defects that may affect quality or safety, and be equal to or better than manual inspection. Equipment performance should be challenged with representative defects before start-up and at regular intervals throughout the batch. Section 8.33 requires inspection results to be recorded, with defect types and numbers trended and reject levels trended on statistical principles.

The FDA draft guidance describes manual, semi-automated and automated inspection. Automated technology can be used as part of an investigation, as a replacement for manual inspection, or as an additional quality assurance step, and different wavelengths and sensors can help with sterile powders, suspensions or light-protected products where visual inspection is not fully effective. The draft says automated technology may improve detectability because machine variability is generally easier to control than the variability individual people bring to repetitive tasks, and lists high-speed industrial cameras, visible diode arrays, X-ray, near-field radar, and ultraviolet and near-infrared spectroscopy among the technologies in use. It also says equipment should be calibrated and qualified, and that manufacturers may need to adjust in-process action and alert limits when they move from manual to automated inspection, based on statistical data from evaluation and validation.

Rule-based vision and AI-assisted inspection

The 2023 PDA Journal paper by Veillon, Shabushnig and colleagues argues that machine learning can bring the judgement of human inspectors to automated inspection with better throughput and consistency. From its abstract, the authors report studies showing better defect detection and fewer false rejects than conventional inspection tools, that implementing machine learning does not require changes to current qualification strategies, and that freezing the developed model and putting it through current validation strategies can assure reliable performance. These points are the claims of the paper's abstract, not an independent review of the evidence.

The draft Annex 22 sets conditions that matter for a buyer. It applies to static machine learning models used in critical GMP applications with direct impact on patient safety, product quality or data integrity, and says dynamic models that keep learning in use, models with probabilistic outputs, generative AI and large language models should not be used in such critical applications. It requires a documented intended use that characterises the input sample space, including defect types and severity as subgroups; test metrics such as a confusion matrix, sensitivity and specificity with acceptance criteria that are at least as high as the process the model replaces; representative, stratified test data with verified labelling and sufficient size; independence of test data from training; a test plan; explainability, for example heat maps, showing which features drove a rejection; logged confidence scores with a threshold below which the model can flag an outcome as undecided; change and configuration control; monitoring of performance, such as a change in lighting, and of input drift; and, where a human reviews model output, records of that review.

Interpretation: the practical difference between the two approaches is where the evidence lives. A rule-based system shows its logic in recipe settings that can be reviewed. A trained model has its logic in its training data, so the evidence is the quality and independence of the test set and the monitoring afterwards. Either way, Annex 1 8.32 sets the bar: equal to or better than manual inspection, challenged with representative defects.

Challenge sets, false rejects and false accepts

Annex 1 and Annex 22 together point to the same method. Build a defect library covering known classes, use it to challenge the system at start-up and at intervals, and record results by defect type. Annex 22 names sensitivity and specificity among the metrics; in inspection terms, sensitivity relates to false accepts of real defects and specificity to false rejects of good containers. Neither source sets a numeric acceptance level, so the level has to come from the process being replaced and the product risk.

Line integration, aseptic areas and people

The material cited here gives limited line-integration detail. The FDA draft notes that inspection stations may run as separate units or be connected in series, and Annex 1 and Annex 22 both expect results to be recorded and trended, which is the data-capture requirement for any new system. Annex 22 also says changes to the model, the system, the process or physical objects the model uses as input should be evaluated, which bears on format changeovers.

Interpretation: a changeover to a new container, stopper or fill volume is a change to the inspection input, so a format-flexible system needs a defined rule for which changeovers require a re-challenge. Robots inside aseptic areas bring cleanability and intervention questions that belong in the contamination control strategy and equipment qualification, not in the inspection validation alone.

The packaging-line rules that vision systems must satisfy (US)

For the packaging side, the US current good manufacturing practice rules give a short list that any vision system has to fit into. Under 21 CFR 211.130, written procedures must make sure correct labels, labelling and packaging materials are used. They must include separation to prevent mix-ups and cross-contamination, identification of filled containers that are held unlabelled, a lot or control number that allows the history of the batch to be determined, examination of packaging and labelling materials before packaging with the result documented in the batch record, and inspection of the packaging and labelling area immediately before use, with the result documented, to confirm that products from earlier operations have been removed.

21 CFR 211.68(a) allows automatic, mechanical or electronic equipment, including computers, if it performs its function satisfactorily and is routinely calibrated, inspected or checked under a written programme, with written records of the checks. Under 211.68(c), automated equipment can satisfy the rule that an operation be performed by one person and checked by another if it is used in conformity with that section and one person checks that the equipment properly performed the operation. For a camera that checks labels or codes, that means the check programme, the records of those checks and a person who confirms the system did its job all belong in the validation package.

Interpretation: a vision system that rejects a pack is an automated check, not an exemption from the packaging area line clearance and label reconciliation duties above. The rules do not name vision systems, so the way to show "performs its function satisfactorily" is a challenge test with known good and known defective packs, repeated on a schedule that the written programme sets.

Illustrative scenario

This is a made-up example, not a named company. A site replaces semi-automated inspection of a 10 mL vial with an automated line. Before start-up it builds a challenge set from its defect library, with glass, fibre and rubber particles, cracks and cosmetic marks, labelled by two experienced inspectors. It sets acceptance so that detection of each critical class is at least equal to the current process. It runs the set at the start of each batch and after any lighting or camera service, and trends reject rates by defect type to spot drift.

Buyer's checklist (interpretation)

  • Can the supplier show detection results by defect class against your own defect library, not only a standard set?
  • Is the model static, with configuration control and a way to detect unauthorised change?
  • Are sensitivity and specificity reported separately, with the data size behind them?
  • Does the system log confidence and show why a container was rejected?
  • What is the challenge routine at start-up, mid-batch and after service?
  • Which format changes need re-qualification, and who decides?
  • Does the system export reject data by defect type for trending?

Related reading on Pharmaceutical Weekly: machinery, regulatory updates and Pharma 4.0 and digital twins.

References

  • European Commission, EudraLex Volume 4, Annex 1: Manufacture of Sterile Medicinal Products (2022 revision), sections 8.30 to 8.33: health.ec.europa.eu
  • US FDA, Inspection of Injectable Products for Visible Particulates, draft guidance for industry: fda.gov
  • European Commission, draft Annex 22: Artificial Intelligence (consultation text): health.ec.europa.eu
  • Veillon R, Shabushnig J, et al., Applying Machine Learning to the Visual Inspection of Filled Injectable Drug Products, PDA Journal of Pharmaceutical Science and Technology 77(5):376 (2023), abstract: journal.pda.org
  • U.S. Code of Federal Regulations, 21 CFR 211.130 (Packaging and labeling operations) and 21 CFR 211.68 (Automatic, mechanical, and electronic equipment): ecfr.gov

Pharmaceutical Weekly newsletter

One email each month: new products, regulatory updates and a featured article.
Subscribe