Guide: what the draft Annex 22 requires of AI in GMPRead the guide

Automated visual inspection of injectables

A computer vision model checks every filled container and separates the defective ones. It decides whether a unit reaches the patient, so it is a critical application: the model is static and deterministic.

How it would work

One unit, from the moment it passes the cameras to what is recorded.

  • AI prepares
  • A person decides
  • Recorded in the trail
Illustrative example, not a real case

The process, documents and data in this walkthrough are fictitious. They show how the AI would work; your actual process may be different, and the system is designed around yours.

One unit of the batch

The inspection machine takes several images of each container from different angles, with the container spun so that a particle moves and can be told apart from a mark on the glass.

What comes in

Unit of the sample batch

Product
Solution for injection in a glass vial
Images
Several per container, with the container spun

Today and with AI

What changes in the inspection of every batch.

TodayWith AI

TodayQualified inspectors check every container under controlled lighting and background

With AIThe machine checks every container with several images from different angles

TodayFatigue matters: frequent breaks and few distractions are needed

With AIAI doesn't tire, and its performance is checked with challenges during the batch

TodayEach inspector is qualified at least once a year with the defect library

With AIThe model is validated with that same library and challenged before and during every batch

TodayThe reason for each reject depends on what the inspector saw at that moment

With AIEvery reject is kept with the area of the image that justifies it

Which AI it uses and why

A model built for a critical decision.

Type
An image classification neural network, trained on the defect classes in your library.
Static
It is trained, frozen and validated. It doesn't learn in production: a new version goes through change control.
Deterministic
Identical images give an identical result.
What it doesn't do
It doesn't release or reject the batch, and it doesn't change its own thresholds.

Regulatory fit

Where it sits in the draft Annex 22 and which regulations apply.

  1. CriticalIt decides something GMP: only with a static, deterministic model
  2. Non-criticalAI prepares and a person decides
  3. Outside GMPAnnex 22 doesn't apply directly

Inspection decides whether a unit reaches the patient. The draft Annex 22 restricts critical applications to static models with a deterministic output, and Annex 1 requires an automated method to detect known defects and to be equal to or better than manual inspection. A generative model can't make this decision.

EU GMP Annex 1, 8.30
Individual inspection of every filled container of parenteral products, defects classified by risk, and a library that captures all known classes of defects.
Annex 1, 8.31
With manual inspection: controlled lighting and background, qualified inspection rates, inspectors qualified at least once a year and frequent breaks.
Annex 1, 8.32
An automated method is validated to detect known defects and should be equal to or better than manual inspection. It is challenged with representative defects before start-up and at regular intervals throughout the batch.
Annex 1, 8.33
Results are recorded and defects are trended by type.
Draft Annex 22
Critical applications only with static models with a deterministic output.

See the Annex 22 guide

The seven pieces of evidence for this case

What we would deliver for this model.

01Intended use

Classify filled containers of a specific product and format into the defect classes of the library. Another format is another intended use.

02Level of autonomy

Executes with thresholds approved by quality assurance. Uncertain units go to a person.

03Test data

Real images of the defects in the library, stratified by type and kept apart from the training images, with the acceptance criterion set before testing.

04Sources for every proposal

The marked area of the image and the library class.

05Version under change control

The model, the thresholds and the camera configuration.

06Recorded oversight

The reinspection of uncertain units and the batch review by quality assurance.

07Monitoring in production

The challenge with representative defects in every batch and the trend of rejects by type.

See what the seven pieces of evidence are

Frequently asked questions

About this use case.

  • EU GMP Annex 1 allows automated methods if the process is validated to detect known defects and is equal to or better than manual inspection. The machine is challenged with representative defects before start-up and at intervals during the batch, and uncertain units can still go to a person.

  • Inspection decides whether a unit reaches the patient, so it is a critical application. The draft Annex 22 only allows static models there, which don't change with use, with a deterministic output: identical images, identical result. A generative model can't make that decision.

  • Real images of the defects in your library, stratified by type and kept apart from the ones used for training. The acceptance criterion is set before testing, with particular attention to critical defects that slip through.

Other use cases

The same way of working in other processes.

Deviation investigation and CAPA

AI finds the deviations in the history that describe the same problem and drafts an investigation with every source cited.

GMPQuality assuranceGenerative AINon-critical

Pharmacovigilance case intake

AI extracts the data from the report, checks whether the case is valid, proposes the MedDRA coding and looks for duplicates.

GVPPharmacovigilanceExtraction and codingOutside GMP

Laboratory equipment qualification

AI drafts the OQ protocol from the URS and the manufacturer's manual, with one test per requirement and the source of every criterion.

GMPQuality controlExtraction and draftingNon-critical

Process validation and ongoing verification

AI gathers batch data against the protocol's criteria, flags what drifts from the trend and drafts the report with its sources.

GMPQuality assuranceExtraction and trendsNon-critical

Tablet and blister inspection

A vision model checks every blister on the packaging line and separates incomplete ones or those with damaged tablets.

GMPManufacturingComputer visionCritical

Laboratory audit trail review

AI ranks the events of the chromatography data system's audit trail by priority, hiding none; the reviewer decides.

GMPQuality controlRules and anomaliesNon-critical

Inspection readiness

For a question from the inspector or a self inspection, AI finds the records that answer it and proposes a reply with its sources.

GMPQuality assuranceSearch with sourcesNon-critical

Material receipt

At each receipt, AI compares the delivery note, the purchase order, the supplier's labels and its certificate of analysis, and flags what doesn't match.

GMPSupply chainExtraction and comparisonNon-critical

What we need from you

To plan the system with real data.

  • Your defect library, with its samples and its classification by criticality
  • The images your inspection machine takes, or access to it
  • The acceptance and rejection criteria of your process
  • The results of your current manual inspection, as a baseline for comparison

Does it look like your process?

Tell us how you do it today and we'll tell you whether AI adds enough to justify validating it.