WorkflowIT & Data

GxP AI Validation & Monitoring

AI validation in pharma, designed around the draft EU GMP Annex 22: each model's test set laid over real production cell by cell and its independence from training proven by file hash. Criteria are signed before the test, subgroups are judged one by one, and a signed monitor pulls a drifting input back to manual work.

Watch one lab model tested, narrowed and signed ↓
Watch with transcript →
The problem

A model scores well on a test set that came partly from its own training

Data science builds a model for the lab, reports one headline accuracy, and hands over a test set drawn from whatever injections were already double-checked. Nobody lays that set over what the lab actually runs, so the newest instrument may have no test injections at all and the hardest method only a handful. Nobody asks the builder for the training manifest in a form that can be compared, so the test may reuse sequences the model learned from.

A classic CSV package of requirements, scripts and a trace matrix holds none of this. Criteria get written after the results are in, and one overall figure hides the method that fails. After go-live nothing watches the inputs: when a supplier changes a label layout, the reader starts guessing and an inspector notices first.

Built forCSV and IT compliance leadsQC lab headsQA approversMethod expertsHeads of quality

The Problem Today

A headline accuracy hides the inputs a model was never tested on, and a test drawn from its training.

Evidence pieced together by hand

  • Notebooks
  • CDS exports
  • Sheets
  • Emails
  • Drift seen by an inspector firstNobody watches a live model's inputs after go-live
  • Generative tools argued case by caseNo register line between a critical use and an assisted one

The Solution

  1. Test set over productionMethod by instrument, so a thin or empty cell stands out before the test
  2. Independence by file hashThe builder's manifest returned as fields; overlaps replaced from a post-freeze pool
  3. Each subgroup judged aloneAgainst criteria the expert signed first, with the inspector's questions asked
  4. A monitor with a triggerA drifting input goes back to manual work under the signed plan

Built-in controls

  • Model builders never see the test data
  • Acceptance criteria signed before any test runs
  • Nobody signs their own step of the file

What You Get

A model goes live only on the inputs where it proved itself, and its signed monitor pulls it back when they drift.

  • Quality can judge a modelThe CSV team signs AI evidence it could not read before
  • Client auditors read the fileEach AI use that touched their results, failures on page one
  • One register, every plantCritical classifiers and generative assistants on one file shape
Features

AI validation in pharma on one lab model that failed one of five subgroups

An integration-check model meant to direct second-person review of chromatography: the CSV lead runs the re-check, the lab head limits the use, the method expert confirms it and QA signs.

demoSample data: the plants, clients, people, models, injections and results here are invented.

  1. 01Sample space

    Input sample space map: test share against production share, cell by cell

    • Methods down, instruments across. The CSV lead sees where the test set matches what the lab really runs, and where a new instrument has no test injections at all.
    • Thin cells flagged before the test. A method tested at a fraction of its production share is marked thin, so the gap is closed before anyone reads a result.
  2. 02Steer

    Test set top-ups drawn only from post-freeze, double-labeled injections

    • Steer the agents mid-run. A plain instruction to add an instrument's October injections changes the plan and the map, and the steer is logged under the lead's name.
    • Top-ups by a rule QA approved first. Thin cells are filled from the reserve pool in its fixed draw order under the test plan, so nobody picks test data after seeing results.
  3. 03Independence

    Test data independence proven against the training manifest by file hash

    • Manifest requested as fields. Sequence IDs, injection IDs and hashes come back as data, and the builder's free-text note is held until a named person reads it.
    • Overlaps replaced like for like. A test injection that shares a sequence with training is excluded with its reason and replaced from injections acquired after the freeze.
  4. 04Subgroups

    Per-subgroup acceptance criteria: one chiral method fails while the rest pass

    • Each method judged on its own. A subgroup with enough problem injections is held to the expert's bar by itself, so a strong overall figure cannot carry a weak method.
    • A draft page one rewritten. A first page that led with overall sensitivity is caught and rewritten to open with the failed subgroup.
  5. 05Feature map

    Feature attribution on a missed injection, beside the integration rule

    • The chromatogram as the data system holds it. The lab head sees the integration the model called consistent, next to the rule it broke, before deciding anything about scope.
    • Where the model looked. The feature strip shows it weighted the main peak and baseline, so the fix goes back to the builder with a cause.
  6. 06Rehearsal

    Rehearse narrowing, retesting or sending the model back before anyone signs

    • Four options played forward. The system owner sees which subgroups meet under each option and what each leaves live, from narrowing the use to sending the model back.
    • Reviewer workload with editable assumptions. Full integration reviews a month recompute as the lab head changes the problem rate, false flags or random review share.
  7. 07Narrow

    Narrow the intended use of an AI model with a reason and a signature

    • Signed by the system owner. The QC lab head removes the failed method from scope after opening the subgroup results, and the meaning of the signature is recorded.
    • The failed method stays on full review. The lab gets the model on the methods it passed now, while chiral purity goes back to its builder as a new version.
  8. 08Page one

    AI validation file in the draft Annex 22 order, with the failure on page one

    • Ten sections, each with its evidence. The file follows the draft annex from scope to monitoring, so an inspector finds test independence where the annex puts it.
    • QA reads page one before signing. The QA computerized-systems approver signs for use within the stated intended use only after opening the failure-first page.
    • A different person at every step. System owner, method expert, compiler and QA each sign their own step, and a later change clears the signatures.
  9. 09Monitors

    AI model monitoring for drift that pulls one input back to manual work

    • Undecided rate per material, weekly. A supplier's new label layout shows up as one material drifting while the other materials hold.
    • Pull-back under the signed plan. The trigger returns only that material to the two-person label check the morning after its second week over, while every other material stays on the reader.

The CSV lead builds the file, the lab head limits the model, QA signs

Who buys and runs the work in a lab or plant that puts models into GMP decisions.

CSV and IT compliance leads

Own the AI register and every AI file across the plants

  • Where each model was tested, with its scores
  • Independence proven by hash, not by assurance
  • A sign-off queue with clocks per use
QC lab heads

Act as system owner: sign what the model may and may not decide

  • Options rehearsed before narrowing a use
  • Label disagreements settled before any test
  • A model live on the methods it passed
QA computerized-systems approvers

Sign each AI file, each model change and each learned rule

  • The failure on page one, in plain view
  • Retests decided under change control
  • No signature on an incomplete section
Method experts

Set acceptance criteria before the test and confirm the described use is adequate

  • Criteria locked once signed
  • Feature maps on every missed injection
  • A narrowed use to confirm, not rewrite
More screens

The builder of a model can answer a request but never open its test data

Around the file: the register and its queue, blind labels, requests to builders, change control, a generative assistant and the trail.

Fourteen AI uses, each classed with its reasonThe sign-off queue puts each waiting step against its owner and clock; below it, each AI use across five plants with its class under the draft annex, file and monitor.
Two reviewers label each injection without seeing the otherTest set, reserve pool and the new instrument's open batch, each labeled twice; the lab head settles the three disagreements, and an unsettled injection enters no test.
A request to data science answered in fixed fieldsThe manifest request shows the fields asked and returned; its free-text note was held until the CSV lead read it, and only fields change a check.
A new model version waits for its retest decisionThe label reader's next version goes through change control with a fresh test of new-layout labels; the lab model's go-live is ready for approval now its file is signed.
A generative assistant filed as non-critical by designThe deviation drafting assistant has its own test set and a monitor on how often authors change its drafts; the author writes, edits and signs every report it touches.
Each record a signer opened, before the signatureAgents and people on one trail: the steer, the re-check, each record opened and each signature with the reason given and what it means, exportable as CSV.

demoSample data, from the working solution.

An independence checker reads the manifest's fields and ignores its prose

Seven agents map, check, run, challenge, compile and watch; people sign the file.

Intended-use writer

Drafts what the model decides, never decides and who acts on its answer, from the SOP, the data system process and the builder's notes.

  • Sets no acceptance criteria
  • Signs nothing
Sample-space mapper

Counts production by method and instrument against the test set, flags thin and empty cells, and tops them up under the test plan.

  • Picks no test data from training-era sequences
  • Fills no cell with unlabeled data
Independence checker

Asks the builder for the manifest as fields, compares sequence IDs, injection IDs and file hashes, and records every exclusion.

  • Takes no free text as proof
  • Never reads the builder's notebooks
Test runner

Runs the frozen model after checking its hash, counts results per subgroup, and logs confidence and feature maps.

  • Changes no threshold or criterion after the plan is signed
  • Never retrains
Inspector's eye

Asks an inspector's questions of the test set and of the file the compiler drafted.

  • Decides nothing
  • Withdraws a point only when a person answers it
File compiler

Builds the file in the draft annex's section order, each section citing its records, once the method expert confirms the use.

  • Hides no failed subgroup
  • Signs nothing
Performance monitor

Runs each signed monitor plan weekly and returns a drifting input to manual work when its trigger fires.

  • Relaxes no trigger
  • Restores no pulled-back input

A failed subgroup leaves the intended use only on the lab head's signature

Deciding what a model may doThe system owner signs the intended use and any narrowing; the method expert confirms the description is adequate.
Signing an AI fileThe QA computerized-systems approver signs for use within the stated intended use, never the person who compiled it, and not while a section is short of evidence.
Changing the bar after the resultsCriteria and thresholds are locked in the signed test plan; a change needs a new plan and fresh test data.
Restoring a pulled-back inputA model update goes through change control with a retest decision that QA approves.
Releasing a result or a batchThe integration-check model releases no result and edits no integration; batch disposition stays with the plant QA head, and market release with the client.

What CSV and QA teams ask about AI validation in pharma

What is AI validation in pharma?

AI validation in pharma is the evidence that a model used in GMP work does what its intended use says, on the inputs it will really see. That means a test set kept apart from training, labels checked by two experts, criteria set before the test and results per subgroup; here agents build the evidence and people sign it.

What does the draft EU GMP Annex 22 ask for?

It went to public consultation beside a revised Annex 11. For static, deterministic models in critical GMP uses it asks for an intended use with its input sample space, subgroups, criteria approved before testing, independent and verified test data, confidence thresholds, change control and drift monitoring. Generative models stay out of critical uses.

How is test data independence proven?

The model's builder returns the training manifest as fields: sequence IDs, injection IDs, file hashes and the freeze date. The checker compares them with the test set, replaces every overlap with injections acquired after the freeze, and records each exclusion with its reason. Builders get no access to the test data.

What happens when one subgroup fails?

The file says so on page one. The system owner rehearses the options and can narrow the intended use, keeping that method on full human review, or send the model back to its builder for a new version and a new test. QA signs only within the stated use.

How does AI model monitoring catch drift after go-live?

Each live use runs under a signed monitor plan with its own metric and trigger, such as the undecided rate per material for a label reader. When a trigger fires, that input goes back to manual work under the plan, and a model update needs change control and a fresh test.

Where do generative assistants fit?

They sit on the same register, designed as non-critical: a trained person writes, edits and owns every output, the assistant has its own test set, and a monitor tracks how often people change its drafts.

Bring one model
and its test set.

Send its intended use, its test set and the training manifest; we map the test against production and check independence by hash.