Skip to main content

AI in GxP

Can AI be used for automated visual inspection of injectable products, and how do you qualify it?

Yes. EU, UK and PIC/S Annex 1 and FDA’s draft guidance treat a trained model like any automated inspection: validated to detect known defects, equal to or better than manual inspection, and, under Annex 1, challenged with representative defects before start-up and during each batch. Qualify it against manual inspectors with a Knapp comparison on a masked, QA-approved defect set. Draft EU Annex 22 adds a frozen model, independent test data, criteria fixed in advance and change control for retraining.

Illustration of a seal reviewing RUN-214, with its 7.8-hour hold duration circled in red.

1What the rules allow.

EU, PIC/S and FDA texts set the same bar for a trained model as for any other automated inspection. Where automated methods are used, Annex 1 says the process “should be validated to detect known defects (which may impact product quality or safety) and be equal to, or better than, manual inspection methods”, and the equipment should be challenged “using representative defects prior to start up and at regular intervals throughout the batch”.¹ FDA’s draft guidance says automated inspection machines “should be validated to meet or surpass human inspection capabilities and can be qualified using training standards or artificial intelligence technology”.²

TextStatus on 8 November 2026What it adds
EU Annex 1, 8.30 to 8.33In operation since 25 August 2023;¹ same text in PIC/S PE 009-18, in force 24 September 2026;³ MHRA, a PIC/S member, points UK sites to EudraLex Volume 4⁴⁵Validated, equal to or better than manual, challenged during the batch; results trended
Annex 11In operation since 30 June 2011⁶Replacing a manual operation should cause “no resultant decrease in product quality, process control or quality assurance”⁶
21 CFR 211.68Regulation⁷A written program of checks; record changes by authorised people only⁷
USP <790> and <1790>Official; FDA says products with a USP monograph must meet <790>²“Essentially free” of visible particulates; “Visual inspection is a probabilistic process”⁸⁹
FDA particulates draftDraft since December 2021¹⁰Validated against human capability; QA-approved test sets
FDA AI draftDraft since January 2025¹¹Model risk; life-cycle maintenance plans; early engagement¹²
Draft Annex 22Consulted on 7 July to 7 October 2025; not yet in EudraLex¹³¹⁴Frozen model, independent test data, criteria fixed in advance, confidence thresholds, retraining under change control¹⁵

FDA’s AI draft rates AI checking every vial’s fill level as medium risk, because release testing still samples fill volume; its steps are on FDA’s AI guidance.¹² Draft Annex 22 covers only static, deterministic models, though EMA’s June 2026 workshop report says the drafting group has discussed allowing dynamic and probabilistic models backed by “a fully documented, robust, risk-based control strategy”.¹⁵¹⁶ And FDA told Baxter that automated particle inspection “does not supplant the need for 100% manual visual inspection for various other attributes (e.g., cracks)”, so write down what the model judges and what stays with other stations or people.¹⁷

1.1Where a trained model fits.

FDA’s particulates draft leaves out defects inspected alongside particles, such as “container integrity flaws, fill volume, appearance of lyophilized cake/suspension solids”, though Annex 1 still wants every container inspected for “extraneous contamination or other defects”.²¹ It names opaque products, “lyophilized powders, suspension products, tinted vials”, as obvious challenges. Supplemental destructive testing after 100% inspection “may not be warranted” if the technology “is validated to meet or surpass human inspection capabilities”, shown by a feasibility study for the specific product.² Where a rule-based recipe already passes the comparison below, a trained model adds draft Annex 22’s controls without lowering the bar, so test a candidate model the same way before you buy.

2Qualification protocol template.

One protocol can meet Annex 1, which compares the machine with manual inspection, and draft Annex 22, which compares it with the process replaced and wants the plan approved before testing.¹¹⁵

Table 2. A template. Draft Annex 22 rows are draft text.
SectionWhat it containsRequirement
Intended useProducts, containers and defect classes the model judges, including rare variations such as amber glass; what it does not judgeAnnex 22 3.1, 3.2 and 5.1¹⁵
Defect libraryEvery known defect class, down to the lower limit of visual detectionAnnex 1 8.30;¹ FDA draft V.C²
Test setGood and defective units, at most 10 to 20% defective, approved by QA, identities masked; generated images “not recommended”FDA draft V.C;² Annex 22 5.6¹⁵
Size per classEnough distinct defective units in each class for stated statistical confidenceAnnex 22 5.2;¹⁵ FDA draft V.C²
BaselinesRepeated inspection by qualified inspectors, and by the process replaced if not manualAnnex 1 8.32;¹ Annex 22 4.3¹⁵
CriteriaDetection and false rejection against each baseline, by class; approved before testingAnnex 22 4.1 to 4.3¹⁵
LabelsEach defective unit’s class confirmed by several experts or a laboratory testAnnex 22 5.3¹⁵
IndependenceNo test unit or image used to train, validate or tune the model, unless its features are independent; access loggedAnnex 22 6.1 to 6.4¹⁵
ConfidenceConfidence logged per decision; an “undecided” threshold; the features behind each rejection reviewedAnnex 22 8.1 to 9.2¹⁵
AccessWho can change recipes, thresholds, the cut-off and model versions; audit trail211.68(b);⁷ FDA Q&A 4;¹⁸ Annex 22 10.2¹⁵
Routine challengeBefore start-up and at set intervals in each batch; response to a failureAnnex 1 8.32¹
OperationConfiguration control, retest triggers, reject trends, input driftAnnex 22 10.1 to 10.4;¹⁵ Annex 1 8.33¹

2.1Knapp test procedure and acceptance criteria.

Neither Annex 1 nor FDA’s draft prescribes how to compare a machine with people. The usual method is Knapp’s, described in a 2011 paper FDA’s draft cites.¹⁹

  1. Build a challenge set of good units and units with one particle each, rejects never more than 20% of it.
  2. Qualified inspectors inspect every unit many times, giving each its own probability of rejection.
  3. Sort units into zones: rejected under 30% of the time is acceptable, 30 to 70% grey, above 70% a reject.
  4. Reject zone efficiency (RZE) is the probability of detecting reject-zone units; false rejection (RAG) is the rejection of acceptable and grey-zone units.
  5. Run the machine on the same set many times and calculate the same figures.

The paper says a replacement must show “a detection probability that is greater than or equal to manual baseline”, and that RAG “is used to set the maximum acceptable level of False Rejection”.¹⁹ So the usual acceptance rule is machine RZE at least the baseline’s, overall and per class, and machine RAG under a ceiling the protocol sets, such as the baseline’s own. FDA has also set a floor for one firm, people and machines alike: “At a minimum, your visual inspection systems should reliably be capable of detecting particulates of 150 microns or greater at a 70% probability of detection.”²⁰

2.2Who does what.

  • Process expert: owns the intended use and acceptance criteria, approved before testing, and helps write the test plan (Annex 22 3.1, 4.2, 7.2).¹⁵
  • Quality assurance: prepares, approves and controls the test set, reviews the defect library and approves the protocol (FDA draft V.C).²
  • Inspectors: confirm each defective unit is detectable under normal conditions before it joins the set (FDA draft V.C),² then form the manual baseline.¹⁹
  • Model developers: use only training and validation data; anyone who has seen test data stays out, or pairs with a colleague who has not (Annex 22 6.1, 6.5).¹⁵

For the rest of the draft, see EU GMP Annex 22.

3Example: qualifying a deep-learning inspection model.

This example is invented for illustration. Exemplomab 50 mg/mL injection in 2 mL clear glass vials is filled at the Larchford site, which replaces its semi-automated particle inspection with a machine running a deep-learning model.

Table 3. Example. A qualification record, invented for illustration.
FieldEntry
ProtocolVAL-AVI-031, approved by QA on 9 March 2026, before any test unit was run
ModelDL-07 version 1.4, frozen on 3 March 2026, checksum in the protocol; trained on 21,600 images from 2024 and 2025; “undecided” cut-off of 0.80, set on the validation set
ScopeVisible particles in solution. Cracks, closure and fill defects stay with rule-based stations and acceptance quality limit (AQL) sampling
Test set800 vials made 10 to 13 March: 680 good and 120 seeded, 30 per particle class (15%); locked by QA, images access-controlled with an audit trail
Minimum per class20 distinct reject-zone vials: if all are detected, the one-sided 95% lower confidence bound on detection is 86.1%
LabelsParticle size and material confirmed by microscopy and two senior inspectors
BaselinesManual: 5 qualified inspectors, 4 inspections each of every vial, 16 to 27 March (20 per vial). Semi-automated: the same 5, 2 each (10 per vial)
ZonesOf the 120 seeded vials, 90 in the reject zone, 20 grey, 10 accept
Machine runs10 runs of each vial at 300 a minute on 7 April: 8,000 decisions; “undecided” counts as a reject
CriteriaMachine RZE at least the higher baseline, overall and per class; every reject-zone vial rejected in at least 8 of 10 runs; machine RAG no higher than either baseline
Elapsed timeSeven weeks, from model freeze on 3 March to the report on 21 April, not counting the training-set build
Table 4. Example. Rejections of reject-zone vials by baseline.
Particle classVialsManual RZESemi-automated RZEMachine RZE
Glass24394 of 480, 0.821209 of 240, 0.871233 of 240, 0.971
Fibre21361 of 420, 0.860187 of 210, 0.890200 of 210, 0.952
Elastomer22396 of 440, 0.900200 of 220, 0.909220 of 220, 1.000
Metal23396 of 460, 0.861205 of 230, 0.891221 of 230, 0.961
All901,547 of 1,800, 0.859801 of 900, 0.890874 of 900, 0.971

Every reject-zone vial was rejected in at least 8 of 10 machine runs. With all 21 fibre vials detected, the one-sided 95% lower bound for that class is 86.7%; for all 90, 96.7%.

Table 5. Example. Rejections of grey-zone, accept-zone and good vials.
PopulationManualSemi-automatedMachine
Grey zone, 20 vials196 of 400, 49.0%118 of 200, 59.0%151 of 200, 75.5%
Accept zone, 10 seeded31 of 200, 15.5%19 of 100, 19.0%28 of 100, 28.0%
Good, 680 vials381 of 13,600, 2.8%245 of 6,800, 3.6%109 of 6,800, 1.6%
RAG, all three608 of 14,200, 4.3%382 of 7,100, 5.4%288 of 7,100, 4.1%

On the Annex 22 metrics, sensitivity on reject-zone vials was 97.1% (874 of 900) and specificity on good vials 98.4% (6,691 of 6,800). Every criterion was met, and heat maps for every rejection were centred on the particle, not on the vial shoulder or a reflection. QA approved the report on 21 April 2026 and the model was released under change control.

Worth copying: scope written down, so nobody assumes the model finds cracks; grey-zone results reported, so heavy grey-zone rejection, the buffer the paper describes, shows beside lower overall false rejection; and distinct vials counted per class, because ten runs of one vial are not ten vials.

4What an inspector asks to see.

Expect these records at a pre-approval or routine inspection.

  1. Protocol and report, with Knapp data per vial and baseline: Annex 1 8.32, FDA draft V.C, draft Annex 22 7.2 to 7.4.¹²¹⁵
  2. Test-set and challenge-kit records: vial inventory, particle size and material, label checks, QA approval, access log: FDA draft V.C; draft Annex 22 5.3 and 6.2.²¹⁵
  3. Routine challenge records for each batch: Annex 1 8.32 and the written records 211.68(a) requires.¹⁷
  4. Investigations of failed challenges and AQL failures, extended to every unit and batch in doubt: FDA draft V.E, citing 211.192.²
  5. Model version, checksum and change history, with each retest decision: draft Annex 22 10.1 and 10.2; FDA’s life-cycle maintenance plan.¹⁵¹²
  6. Reject trends by defect type and monitoring metrics, adverse trends assessed for marketed product: Annex 1 8.33; draft Annex 22 10.3 and 10.4.¹¹⁵
  7. The role list for changing recipes, thresholds, the cut-off and model versions, with the audit trail. FDA’s data integrity Q&A names “automated visual inspection records” among records only authorised people should change under 211.68(b), and recommends restricting “the ability to alter specifications, process parameters, data, or manufacturing or testing methods by technical means where possible”.¹⁸⁷

5Retraining and model updates.

New training data, labels, pre-processing and the confidence cut-off are all changes. Draft Annex 22 asks for every change, “including any change to physical objects the model is using as input”, to be evaluated for retesting, and a decision not to retest should be “fully justified”.¹⁵ The model in use does not learn: production rejects are labelled, trained on offline and released as a new version.

ChangeUsual responseRule
Retrained on more imagesNew version: full retest on test data the retraining never touchedAnnex 22 6.1 and 10.1¹⁵
Confidence cut-off movedChoose it on validation data, never by tuning on the test set; confirm the metrics on test dataAnnex 22 6.1, 9.2 and 10.1¹⁵
New container or supplierAssess as a new subgroup; usually retestAnnex 22 3.2 and 10.1¹⁵
Camera or lighting changeRetest and check drift against the baselineAnnex 22 10.3¹⁵
Platform patch onlyRegression test and a written justification for not retesting the modelAnnex 22 10.1¹⁵

6What inspectors cite.

“We encourage the use of automated visual inspection for particulates to augment the 100% manual visual inspection program. Automated methods should be rigorously studied for their capability and robustness under various conditions, machine settings, container-closure sizes, defect types, and other variables.” Baxter Healthcare Corporation, warning letter 320-23-18, 25 July 2023¹⁷

The Form 483 behind that letter recorded that “The existing machine recipes were found to be inadequate for further qualification work”, yet they stayed in use until 13 October 2022.²¹ In 2026 FDA found Fresenius Kabi’s systems “often exhibited low detectability and high variability regardless of particle type”.²⁰

“Particulates in challenge kits were excessively large (e.g., greater than (b)(4) microns), approximately (b)(4) times larger than what operators should be capable of reliably detecting.” Baxter International Inc., warning letter 320-26-132, 29 September 2026²²

A model qualified on that kit inherits its blind spot.

“Specifically, we found that your SCADA system had user accounts with extensive administrative privileges, including the ability to modify/edit critical process parameters and recipes without adequate oversight.” Immacule Lifesciences, Form FDA 483, 18 September 2025²³

That was a filling line; inspection recipes and model versions need the same lock. For inspector qualification and AQL sampling, see visual inspection of injectables.

7How it runs in Seal.

In Seal, the visual inspection blueprint gives automated inspection a recipe and evidence state: cameras, lighting, algorithms, thresholds, software and recipe versions, setup checks and challenges. Each production population references the released recipe actually used, and a failed challenge identifies the time window and population inspected under an unacceptable state before reinspection or investigation is routed. The defect library keeps provenance, approval and effective dates, first-pass findings are kept through reinspection, and the inspection machine can stay the source for its images and classifications. It is part of Seal’s records for sterile injectables.

Seal’s computer system assurance records link a regulated system’s intended use, function risk, supplier evidence, configuration baseline, testing, anomalies and release, and confirm that production matches the released baseline before regulated use. An inspection system’s software and model versions can be released the same way, each change assessed from what moved.

References

  1. 1EudraLex Volume 4, Annex 1: Manufacture of Sterile Medicinal Products, European Commission, 22 August 2022, deadline for coming into operation 25 August 2023, sections 8.30 to 8.33. https://health.ec.europa.eu/system/files/2022-08/20220825_gmp-an1_en_0.pdf (read 8 November 2026)
  2. 2Inspection of Injectable Products for Visible Particulates, draft guidance for industry, FDA, December 2021, sections I, II and V, and footnote 18. https://www.fda.gov/media/154868/download (read 8 November 2026)
  3. 3PE 009-18 (Annexes), Guide to Good Manufacturing Practice for Medicinal Products, Annex 1, sections 8.30 to 8.33, PIC/S, 24 September 2026; entry into force in PE 009-18 (Intro). https://picscheme.org/docview/11333 (read 8 November 2026)
  4. 4Members, PIC/S, United Kingdom: Medicines and Healthcare products Regulatory Agency. https://picscheme.org/en/members (read 8 November 2026)
  5. 5Good manufacturing practice and good distribution practice, MHRA, GOV.UK. https://www.gov.uk/guidance/good-manufacturing-practice-and-good-distribution-practice (read 8 November 2026)
  6. 6EudraLex Volume 4, Annex 11: Computerised Systems, European Commission, in operation since 30 June 2011, principle. https://health.ec.europa.eu/system/files/2016-11/annex11_01-2011_en_0.pdf (read 8 November 2026)
  7. 721 CFR 211.68, Automatic, mechanical, and electronic equipment, paragraphs (a) and (b), eCFR. https://www.ecfr.gov/current/title-21/section-211.68 (read 8 November 2026)
  8. 8General Chapter <790> Visible Particulates in Injections, USP–NF, United States Pharmacopeia, 2017, introduction (public preview), DOI 10.31003/USPNF_M7197_01_01. https://doi.usp.org/USPNF/USPNF_M7197_01_01.html (read 8 November 2026)
  9. 9General Chapter <1790> Visual Inspection of Injections, USP–NF, United States Pharmacopeia, 2023, introduction (public preview), DOI 10.31003/USPNF_M7198_07_01. https://doi.usp.org/USPNF/USPNF_M7198_07_01.html (read 8 November 2026)
  10. 10Inspection of Injectable Products for Visible Particulates, guidance page, FDA, docket FDA-2021-D-0241, content current as of 17 December 2021. https://www.fda.gov/regulatory-information/search-fda-guidance-documents/inspection-injectable-products-visible-particulates (read 8 November 2026)
  11. 11Considerations for the Use of Artificial Intelligence To Support Regulatory Decision-Making for Drug and Biological Products, guidance page, FDA, docket FDA-2024-D-4689, content current as of 6 January 2025. https://www.fda.gov/regulatory-information/search-fda-guidance-documents/considerations-use-artificial-intelligence-support-regulatory-decision-making-drug-and-biological (read 8 November 2026)
  12. 12Considerations for the Use of Artificial Intelligence to Support Regulatory Decision-Making for Drug and Biological Products, draft guidance, FDA, January 2025, sections IV.A.1 to IV.A.3, IV.B and IV.C. https://www.fda.gov/media/184830/download (read 8 November 2026)
  13. 13Stakeholders’ Consultation on EudraLex Volume 4, Good Manufacturing Practice Guidelines: Chapter 4, Annex 11 and New Annex 22, European Commission, open 7 July to 7 October 2025. https://health.ec.europa.eu/consultations/stakeholders-consultation-eudralex-volume-4-good-manufacturing-practice-guidelines-chapter-4-annex_en (read 8 November 2026)
  14. 14EudraLex Volume 4, Good Manufacturing Practice guidelines, European Commission. https://health.ec.europa.eu/medicinal-products/eudralex/eudralex-volume-4_en (read 8 November 2026)
  15. 15EudraLex Volume 4, Annex 22: Artificial Intelligence, draft for consultation, European Commission, drafted by the EMA GMDP Inspectors Working Group with PIC/S, July 2025, sections 1 to 10. https://health.ec.europa.eu/document/download/5f38a92d-bb8e-4264-8898-ea076e926db6_en?filename=mp_vol4_chap4_annex22_consultation_guideline_en.pdf (read 8 November 2026)
  16. 16Multistakeholder workshop on expert contributions to artificial intelligence guidance development (Annex 22), report, EMA/156789/2026, European Medicines Agency, workshop of 30 June 2026, first published 2 October 2026 on EMA’s event page. https://www.ema.europa.eu/en/documents/report/report-multistakeholder-workshop-expert-contributions-artificial-intelligence-guidance-development-annex-22_en.pdf (read 8 November 2026)
  17. 17Baxter Healthcare Corporation (Baxter Pharmaceuticals India, Ahmedabad), warning letter 320-23-18, MARCS-CMS 654136, FDA, 25 July 2023. https://www.fda.gov/inspections-compliance-enforcement-and-criminal-investigations/warning-letters/baxter-healthcare-corporation-654136-07252023 (read 8 November 2026)
  18. 18Data Integrity and Compliance With Drug CGMP: Questions and Answers, Guidance for Industry, FDA, December 2018, question 4. https://www.fda.gov/media/119267/download (read 8 November 2026)
  19. 19Melchore JA, Sound Practices for Consistent Human Visual Inspection, AAPS PharmSciTech 12(1):215–221, published 4 January 2011, the paper cited in FDA’s draft guidance as Melchore 2011. https://pmc.ncbi.nlm.nih.gov/articles/PMC3066354/ (read 8 November 2026)
  20. 20Fresenius Kabi USA LLC, warning letter 320-26-129, MARCS-CMS 733107, FDA, 22 September 2026. https://www.fda.gov/inspections-compliance-enforcement-and-criminal-investigations/warning-letters/fresenius-kabi-usa-llc-733107-09222026 (read 8 November 2026)
  21. 21Form FDA 483, Baxter Pharmaceuticals India Pvt Ltd, Ahmedabad, inspection of 19 to 27 January 2023, observation 1, FDA. https://www.fda.gov/media/175813/download (read 8 November 2026)
  22. 22Baxter International Inc. (Baxter Healthcare Corporation, Round Lake), warning letter 320-26-132, MARCS-CMS 733231, FDA, 29 September 2026. https://www.fda.gov/inspections-compliance-enforcement-and-criminal-investigations/warning-letters/baxter-international-inc-733231-09292026 (read 8 November 2026)
  23. 23Form FDA 483, Immacule Lifesciences Private Limited, Nalagarh, sterile drug product contract manufacturer, inspection of 8 to 18 September 2025, observation 6, FDA. https://www.fda.gov/media/189747/download (read 8 November 2026)

AQuestions and answers

Who should label the images used to train and test an inspection model?

Experienced inspectors and process experts label; QA approves the test set. Draft Annex 22 wants test labels verified to a very high degree of correctness, for example by several experts or by laboratory tests such as microscopy. Labels for training images matter too, because a model learns whatever the labels teach it, so record who labelled each set and how disagreements were settled.

Does an AI inspection machine remove the need for AQL sampling?

No. The machine replaces or supports the 100% inspection step. FDA’s draft guidance still expects the quality unit to sample each batch for AQL testing after 100% inspection, and Annex 1 treats a critical defect found in later sampling as a sign the original inspection may have failed, which needs investigating.

How often should an automated inspection machine be challenged during a batch?

Annex 1 asks for a challenge with representative defects before start-up and at regular intervals throughout the batch, but sets no interval. Choose it by how many units you are prepared to reinspect if a challenge fails, because every unit inspected since the last good challenge is in doubt. Long batches and frequent recipe changes argue for shorter intervals.

Does draft Annex 22 apply to inspection machines that use classical vision algorithms?

No. The draft applies to machine learning models that gained their function by training on data rather than being explicitly programmed. A recipe of engineer-set thresholds is not an AI model under it, but Annex 1 and Annex 11 still apply. Many machines mix the two, so record which stations run trained models.

What should happen to vials the model can’t classify confidently?

Draft Annex 22 expects the confidence score of each decision to be logged during testing, and a threshold below which the model flags the result as undecided rather than guessing. Treat undecided vials as rejects or send them to qualified manual inspection, as your procedure says, and count them in the qualification so false rejection is not understated. A rising share of undecided vials in production is a drift signal worth trending.

Do we need to tell FDA before switching to AI visual inspection?

Usually, in some form. For an approved product, a new inspection method is a post-approval manufacturing change, and FDA’s particulates draft says such changes must follow its existing rules, such as 21 CFR 314.70 for drug applications and 601.12 for biologics, which set the reporting category. FDA’s AI draft adds that a summary of the life-cycle maintenance plan for a product- or process-specific model belongs in the marketing application, and that later changes affecting model performance should be reported. It encourages early talks with CDER’s Emerging Technology Program or CBER’s Advanced Technologies Team.

See your process in Seal.

Bring a procedure or a recurring problem. See how your team configures it with Neil and improves the next run.

Book a demo