AI Vision Pharma Label & Serialization Verification

By Josh Brook on October 15, 2026

ai-vision-pharma-label-serialization-qr-inspection

Every pharmaceutical pack has to carry the correct product code, a unique serial number, the right lot and expiry, and approved label text, and the 2D code has to scan cleanly wherever the pack goes next. A single wrong lot, duplicate serial or unreadable code can mean a rejected shipment, a recall or a gap in track-and-trace. AI vision checks every pack at line speed, which you can see in a short live demo.

AI VISION · PHARMA LABEL & SERIALIZATION

Verify Every Label, Lot, Expiry and Serial Before the Pack Leaves the Line

iFactory Vision OCR Inspection reads and verifies printed text and 2D codes on every carton, bottle and blister. It grades code quality, rejects mismatches automatically and logs evidence for track-and-trace and batch release.

Pack verificationPass
Carton · Line 4 · Batch B24117
(01) GTIN 00312345678906
(21) SN 7XK29F41A
(10) LOT B24117
(17) EXP 280331
✓Product code matches order
✓Serial is unique in this batch
✓Lot and expiry match the work order
✓Printed text matches the code (OCV)
✓Code grade A (ISO/IEC 15415)
Serial committed to the batch record
WHAT MUST BE RIGHT ON EVERY PACK

Four Data Elements, Two Forms, One Pack

Under the US DSCSA, each saleable unit carries a product identifier made up of the NDC, a serial number, the lot number and the expiration date. In the EU, the Falsified Medicines Directive's delegated regulation requires a product code, a serial number of up to 20 characters, a batch number and an expiry date. Both regimes encode the data in a 2D Data Matrix, usually with GS1 Application Identifiers, and require key elements to be printed in human-readable form as well. Every one of those fields has to be correct, readable and consistent with the others. Our support team can map these fields to your pack formats.

(01)
Product Code

The GTIN, which carries the NDC in the US. It must match the product actually being packed.

(21)
Serial Number

Unique to each unit. A duplicate breaks traceability and gets flagged further down the supply chain.

(10)
Lot / Batch

Must match the batch record. A lot carried over after a changeover is a classic mix-up.

(17)
Expiry Date

Must match the approved shelf life for the batch, in both the 2D code and the printed text.

Machine-readable2D Data Matrix, graded for print quality
+
Human-readablePrinted text that must say the same thing
=
One verified packLogged against serial and batch
OCR, OCV AND CODE GRADING

Three Checks That Each Answer a Different Question

"Label inspection" covers three different jobs, and a packaging line needs all three. Reading the text is not the same as confirming it is correct, and a code that decodes today won't necessarily scan at a distributor's dock. Here is what each check does. If you want to see them run on your own cartons, book a sample test.

OCR
What does it say?

Optical character recognition reads printed text without knowing in advance what it should be. It is useful for capturing lot and expiry values into the record.

OCV
Is it what it should say?

Optical character verification compares printed text with the expected values from the work order and the 2D code, and fails any character that doesn't match or is badly printed.

Grade
Will it scan downstream?

Code grading scores the Data Matrix against ISO/IEC 15415 for contrast, modulation, damage and other parameters. The EU rules presume compliance at grade 1.5 or above.

Why deep learning helps on pharma packs

Variable data is printed by thermal transfer, inkjet or laser onto coated board, foil lidding, curved bottles and shrink sleeves. Glare, embossing and low contrast defeat rule-based OCR that has been tuned to one font on one substrate. Deep learning OCR is trained on your real print across these surfaces, so it reads reliably without constant retuning. OCV still makes the final call by comparing the result with the expected string.

WHERE ERRORS COME FROM

The Label Failures That Lead to Rejects and Recalls

Most label errors on pharma lines are mix-ups, changeover mistakes and print-quality drift rather than exotic failures. FDA's packaging and labeling rules exist precisely to keep the right label on the right product with the right lot number. The matrix below shows the common failure modes and how a vision check catches each one at the line. Our validation team can help match it to your packaging lines.

Failure Mode
Typical Cause
How Vision Catches It
Line Action
Wrong label or artwork
Label stock left over from the previous job, wrong roll loaded, artwork version mix-up
Pattern and text match against the approved artwork for this order
Reject and stop
Wrong lot or expiry
Printer not reset at changeover, typed in wrong, wrong job loaded
OCV against work-order values, cross-checked with the 2D code
Reject and stop
Duplicate serial
Serial pool reused, printer buffer replayed after a jam
Serial checked against all serials already committed in the batch
Reject
Low-grade or unreadable code
Worn printhead, ink starvation, glossy substrate, speed changes
ISO/IEC 15415 grade on every code, with the trend tracked over the run
Reject and alert
Text and code disagree
Separate print streams for the code and the human-readable text get out of sync
Decoded code compared field by field with the OCR result
Reject
Missing, skewed or partial print
Label misfeed, print outside the clear zone, smudging
Presence, position and character-quality checks
Reject
Tamper-evidence missing
Seal or label not applied, or applied off position
Presence and position check on the anti-tampering feature
Reject

See Serialization Checks Running at Line Speed

iFactory reads, verifies and grades every pack on an edge server beside the line. It rejects mismatches through the line PLC and gives operators a plain-language explanation of what went wrong.

Line 4 · Operator Assist
OperatorWhy were the last 12 cartons rejected?
iFactory AIThe code grade fell from A to D over 40 cartons, and the printhead's left edge is printing light. The data itself is correct, but the codes may not scan downstream.
OperatorWhat should we do?
iFactory AIClean the printhead and check ribbon tension. The rejected serials are already flagged as not commissioned, so they won't appear in the shipment record.
FROM PRINT TO TRACE RECORD

Where Vision Fits in the Serialization Flow

Serialization is only as trustworthy as the check between printing a serial and recording it. A serial that was printed but never verified, or that was rejected but still reported, produces exactly the kind of data mismatch that trading partners and regulators flag. Vision is the gate that decides which serials become real. It also keeps the trace record and the physical packs in agreement, because the only serials ever commissioned are the ones a camera has confirmed on an actual pack. We can show this gate on your line in a working session.

1
Assign

The serialization system issues serials for the batch.

2
Print

The code and text are printed on the pack.

3
Verify

AI vision reads, grades and matches every field.

4
Commit or reject

Good serials are commissioned, and rejected ones are logged as void.

5
Aggregate and report

Packs are linked to cases and pallets and shared as trace events.

COMPLIANCE MAP

What Each Regulation Expects, and the Evidence Vision Provides

Vision inspection doesn't make a site compliant on its own, but it produces the objective, per-unit evidence that labeling controls, serialization rules and electronic record requirements all depend on. Our quality team can help align it with your existing procedures.

US · DSCSA
Product identifier on every unit

NDC, serial, lot and expiry in a 2D code plus human-readable text, with interoperable tracing between trading partners. FDA's remaining exemptions mainly cover small dispensers.

Evidence: per-serial verification and void log
EU · FMD 2016/161
Unique identifier and anti-tampering

A Data Matrix carrying the product code, serial, batch and expiry, a print quality presumed compliant at ISO/IEC 15415 grade 1.5, and a tamper-evident device on the pack.

Evidence: code grade and tamper-evidence check per pack
21 CFR 211
Packaging and labeling controls

Procedures that keep the correct labels on the correct product, a lot number on every unit, and controls against label mix-ups, including electronic examination of labeling.

Evidence: label and lot verification in the batch record
21 CFR Part 11
Trustworthy electronic records

Inspection results used for batch release must be attributable, time-stamped, secure and auditable, with validated systems behind them.

Evidence: audit-trailed results and recipe changes
TURNKEY AI DEPLOYMENT

Hardware, Software, Integration and Validation Support as One Package

iFactory delivers label and serialization vision as a turnkey bundle. A pre-configured NVIDIA AI server ships racked and ready with Vision OCR Inspection pre-loaded. You rack it, plug in power and Ethernet, and the AI is live. For regulated lines, the rollout includes the documentation your validation team needs. To scope your lines, request a turnkey quote.

What's Included
  • Pre-configured NVIDIA AI edge server, racked and ready
  • Cameras and lighting for cartons, bottles and blisters
  • Vision OCR Inspection software pre-loaded
  • Cabling and plant network setup
  • PLC/SCADA and serialization system integration
  • Operator and quality team training
  • 24×7 remote monitoring of models and hardware
Live in 6–12 weeks
Wk 1–4
Ship, Network, Data

Server and cameras installed, line connected, pack images captured across SKUs and substrates.

Wk 5–8
Train and Pilot

Models trained and run alongside existing checks, with challenge tests using known-bad packs.

Wk 9–12
Go-Live and Training

Reject control enabled, validation evidence handed over and operators trained.

THE OPERATING DIFFERENCE

Manual Line Checks Compared With AI Vision on Every Pack

Many lines still rely on start-of-batch checks, periodic pulls and a second person signing off the label. Those checks remain important, but they are samples, and on a line running hundreds of packs a minute a wrong roll or a printer that was never reset can run for a long time between them. The comparison below shows what changes when every pack is verified. Our support team can explain how this fits with your existing line clearance.

Sampled Checks
  • Label verified at batch start and at intervals
  • Drift in print quality noticed only when a code fails to scan
  • Duplicate serials found by downstream systems
  • Paper sign-offs collected for batch release
  • A mix-up can run until the next check
AI Vision on Every Pack
  • Every label, code and text field verified
  • Code grade trended so printheads are serviced in time
  • Duplicate serials rejected before they are committed
  • Audit-trailed results attached to the batch record
  • A mix-up is stopped at the first wrong pack
HOW iFACTORY FITS

Vision OCR Inspection Built for Regulated Packaging

iFactory's Vision OCR Inspection combines deep learning OCR, OCV, code grading and serial checks in one edge system, connected to your line controls and serialization software. You can see the full flow on sample packs in a short demo.

1
Read, verify and grade in one pass. OCR, OCV and ISO/IEC 15415 grading run on each pack within the line's cycle time.
2
Serial integrity. Each serial is checked for uniqueness and committed only when every field passes, and rejects are logged as void.
3
Works across substrates. Models are trained on your cartons, foils, bottles and sleeves rather than one font on one surface.
4
Audit-ready records. Results, images and recipe changes are attributable and time-stamped for batch release and inspections.
5
Operator assist. When rejects rise, operators get the cause and the next step in plain language.
1000+
Industrial clients running iFactory
99.9%
Platform uptime for continuous packaging
6-12 wks
From racked server to live line verification
FREQUENTLY ASKED QUESTIONS

What Packaging, QA and Serialization Teams Ask

What is the difference between OCR and OCV on a pharma line?
OCR reads printed characters without knowing what they should be, which makes it useful for capturing values such as lot and expiry into a record. OCV checks printed characters against an expected string from the work order or the 2D code, and fails a pack if any character is wrong, missing or badly formed. A pharma line normally uses both: OCR to capture, OCV to confirm, and a cross-check that the human-readable text and the 2D code agree.
Does AI vision support DSCSA compliance?
It supports the part of DSCSA that happens on the packaging line. The law requires a product identifier on each saleable unit, made up of the NDC, serial number, lot and expiration date, in both a 2D code and human-readable form. Vision verifies that each printed identifier is correct, readable and unique before the serial is commissioned, and it logs rejected serials as void so they never appear in trace data. Compliance overall also depends on your serialization system, trading-partner data exchange and procedures.
Why grade 2D codes if they already decode?
A code that just barely decodes on your line camera may fail on a wholesaler's or pharmacy's scanner, under different light, after handling and abrasion. Grading against ISO/IEC 15415 measures how much margin the code has. The EU delegated regulation presumes compliance at grade 1.5 or above, and many companies set a higher internal target. Trending the grade over a run also shows a printhead wearing out before it starts producing rejects.
Can it read text on foil, curved bottles and glossy cartons?
Yes, which is where deep learning OCR beats rule-based OCR tuned to a single font and surface. Models are trained on images of your real packs, including foil lidding, embossed or laser-etched codes, curved bottles and shrink sleeves, with lighting chosen to control glare. Reading is then stable across SKUs and substrates, and OCV still makes the pass or fail decision against the expected values.
How is the system validated for GMP use?
The same way other computerized systems on a GMP line are validated: through a risk-based approach that your quality unit owns, typically covering installation, operational and performance qualification. The deployment includes challenge testing with known-bad packs such as wrong lots, damaged codes, duplicate serials and missing print, to show that each failure mode is detected and rejected. Results and configuration changes are audit-trailed to support 21 CFR Part 11 expectations for electronic records.
Does it work with our existing serialization software?
In most cases, yes. Vision sits between the printer and the serialization system's commissioning step. It receives the expected values for the batch, returns a pass or fail with the decoded data for each pack, and triggers the line's reject mechanism through the PLC. The integration is scoped to your line and site-level serialization layers rather than replacing them. Our support team can review your current setup before a pilot.

Release Batches With Every Pack Verified

Put AI vision on every carton, bottle and blister, confirm every lot, expiry and serial, grade every code, and attach the evidence to the batch record. The full system is delivered turnkey and goes live in 6 to 12 weeks.

Example batch summary · B24117
Packs verifiedEvery unit
Duplicate serialsNone committed
Rejected serialsLogged as void
Lowest code gradeB
Evidence ready for batch release

Share This Story, Choose Your Platform!