Opsio - Cloud and AI Solutions
Rows of clear glass vials with grey aluminium crimp caps on a stainless-steel conveyor between guide rails, passing in front of a bright white backlight panel in a cleanroom

AI Visual Inspection for Pharmaceuticals & Medical Devices

Find visible particles in vials and syringes, chipped tablets and empty blister cavities, and label and serialization errors on every unit, with an audit trail your QA can review.

What is AI visual inspection for pharmaceuticals and medical devices?

AI visual inspection for pharmaceuticals and medical devices uses industrial cameras and deep-learning models to check every unit on the line. Opsio applies it to three defect families: visible particles and container defects in vials and syringes, solid-dose defects found by tablet inspection and blister checks, and labelling and serialization errors on packs.

Key facts

  • Covers visible particles, glass cracks, fill level, tablet chips, empty blister cavities and code faults.
  • Particle inspection spins each container, then stops it, so moving particles separate from fixed glass marks.
  • Edge inference runs in under 50 ms per image on NVIDIA Jetson or Intel OpenVINO hardware.
  • Pass/fail results reach the machine PLC over PROFINET, OPC UA or Modbus.
  • Audit trail, user roles and electronic signatures support FDA 21 CFR Part 11 and EU GMP Annex 11.
  • Images and audit records stay on the edge, on-premises or in an EU cloud region.
  • A feasibility study on your own samples typically takes 1 to 2 weeks.

Main defect families

Parenteral container defects
Visible particles, glass cracks, wrong fill level, stopper, crimp and plunger faults in vials, syringes and cartridges.
Solid-dose defects
Chipped, capped, discoloured or foreign tablets, empty or mis-joined capsules, and incomplete or badly sealed blisters.
Packaging and serialization errors
Illegible lot or expiry data, missing, skewed or wrong labels, missing leaflets and unreadable serial codes.

Last reviewed by Praveena Shenoy, Head of AI & Data, Opsio, a Swedish cloud and AI services company. Part of Opsio's AI Visual Inspection service.

Why is vial and tablet inspection hard to automate?

Parenteral and solid-dose lines run fast and leave no margin for escapes. A vial inspection machine typically handles 300 to 600 containers per minute, far faster than the seconds per background the manual method in USP <790> describes.

The physics work against you. A 100 µm particle in clear liquid looks much like a scratch, an air bubble or a reflection from the vial heel, and only motion separates them. Tablet colour varies within a batch, coatings throw highlights, and clear PVC film distorts what sits beneath it.

Manual detection of small particles is statistical, so the same container can pass one inspector and fail the next; the Knapp method exists to measure that probability. Rule-based vision adds false rejects every time a new glass supplier, coating or carton artwork arrives.

Escapes are costly in a regulated way: a particle complaint or mislabelled pack can trigger an investigation, a field alert or a recall.

Inspection use cases on parenteral, solid-dose and packaging lines

Each use case follows one stage of the line: filled containers, solid dose and blisters, then packaging, with the defects, imaging and station position.

Visual inspection of vials, ampoules, syringes and cartridges

Backlit glass vial with crimped stopper: a dark fibre particle suspended in clear liquid and a hairline crack in the glass near the shoulder
Visible fibre particle and hairline crack in a backlit vial

Situation

Your filled and stoppered containers leave the filler or isolator and enter 100% inspection before labelling, typically at 100 to 600 units per minute. Many sites still run manual booths alongside, with inspectors working against black and white backgrounds.

Rule-based machines flag every new glass supplier, siliconised barrel or viscous product as suspect, and the manual re-inspection queue is where throughput is lost. High-speed vision inspection only pays off when the reject decision holds at full rate.

Defects

  • Visible particles in liquidparticles large enough to see, typically from about 100 µmGlass flakes, stopper rubber, fibres and metal enter during washing, filling or stoppering, or form later as product precipitates.
  • Glass cracks and chipsHairline cracks at shoulder, neck or heel and chipped finishes come from glass-to-glass and glass-to-metal contact on star wheels, and can break container closure integrity.
  • Fill level out of toleranceOver- or under-filled units come from dosing pump drift, foaming or start-up fills, and put dose accuracy at risk.
  • Stopper position and crimp defectsA raised or tilted stopper, missing flip-off cap or folded, loose or cracked crimp comes from capping misalignment and threatens the sterile barrier.
  • Cosmetic glass defectsscratches, airlines, stones and scuffs in the glassThese form in tubing conversion or handling; they are usually minor defects, but they mimic particles and drive false rejects.
  • Missing or bent plungerIn syringes and cartridges the plunger stopper can be missing, tilted or at the wrong depth after insertion, affecting dose and auto-injector fit.

Inspection setup

Each container is held in a star wheel, spun fast and stopped abruptly before the camera, so liquid and particles keep moving while scratches stay still. A monochrome GigE Vision camera at 5 to 12 MP (megapixels) with a telecentric lens (constant magnification with distance) captures typically 10 to 20 frames per container.

Backlight shows dark particles, fibres and the fill meniscus; dark-field light from below makes glass flakes shine against black. Further stations image shoulder, heel, crimp and plunger. The model compares frames, so only moving objects count as particles.

The station sits after capping, before the labeller. Each unit is accepted, rejected to a locked bin or diverted to a grey-zone channel for manual re-inspection. The same container-glass lighting appears in our bottling and canning inspection work.

Outcome

Every container is inspected, and every reject carries a defect class, an image sequence and a time stamp. The model learns a moving particle from a bubble or glass mark on your own containers, which is designed to cut the volume sent to manual re-inspection.

Each defect class is qualified against a Knapp-style test set, so your quality unit compares automated and manual detection probability before go-live.

Tablets, capsules and blister pack inspection

Backlit clear blister web with white round tablets in formed cavities, one tablet with a broken, crumbled edge and one cavity empty, before the lidding foil is applied
Formed blister web with a chipped tablet and an empty cavity before sealing

Situation

Your solid-dose lines inspect loose tablets or capsules after compression, coating or encapsulation, typically at 50,000 to 300,000 units per hour, and filled blisters at typically 100 to 400 cards per minute.

Today's checks are often a cavity-count camera plus manual AQL sampling, which misses a capping trend from one press or a single foreign tablet. Our guide to blister defect detection covers the packaging side in depth.

Defects

  • Chipped or capped tabletscapping: the top or bottom crown splits away from the tablet bodyChipping comes from edge damage in the press, deduster and chutes; capping comes from trapped air, over-dry granulate or excessive compression force.
  • Broken or doubled tabletsTablets break on falls and in feeders; doubled tablets come from double feed or sticking in the die.
  • Colour deviationSpots, mottling or uneven coating shade come from poor blending or coating-pan faults, and can signal a wrong or degraded product.
  • Foreign tabletsA tablet of another product or strength enters through incomplete line clearance and is a mix-up that can reach a patient.
  • Print and emboss defectsmissing, smudged or incomplete logos, codes and break linesPicking and sticking on punch faces fill embossing, and printing smears when ink or registration drift.
  • Empty or mis-joined capsulestelescoped or split shells where cap and body are not lockedEmpty shells pass when dosing fails; mis-joins occur when cap and body misalign in the closing station.
  • Blister pack completenessEmpty cavities, extra tablets or fragments come from feeder gaps and broken product, and leave a patient with a missing or partial dose.
  • Sealed-cavity integrityWrinkled lidding foil, weak seal pattern, crushed cavities or product in the seal zone come from sealing temperature, pressure or indexing faults.

Inspection setup

For loose product, colour area-scan or line-scan cameras at 5 to 12 MP image both faces as a drum feeder turns each tablet over. Diffuse dome light suppresses coating glare so edge breaks, caps and embossing read as shape; laser triangulation adds 3D height where thickness matters.

On the blister line, a backlight under the formed PVC or PVC/PVDC web shows cavity fill before sealing, while a top colour camera with ring light checks shape, colour and print. After sealing, low-angle light on the lidding foil shows seal pattern and wrinkles.

Decisions are per cavity: each card is tracked by encoder and rejected before the cartoner; tablet machines divert single units by air jet.

Outcome

Every tablet and every cavity is checked, not a sample. Defect classes are logged separately, so you see a capping trend from one press and can correct compression settings.

Colour and foreign-tablet checks use learned appearance, designed to cope with normal batch-to-batch coating variation.

Packaging, labelling and serialization

Row of plain white folding cartons on a packaging conveyor under an overhead machine-vision camera and white LED line light, the nearest carton showing a blank, unprinted label area
Unbranded folding cartons passing a camera and line light for label and code verification

Situation

Your packaging line labels containers, cartons them with a leaflet, prints the serialized code and aggregates cartons into cases, typically at 100 to 400 cartons per minute. A wrong lot number or unreadable code is a nonconformance even when the medicine is perfect.

Code readers verify only what they are told to read, so a valid code on the wrong artwork version can pass. See how label defect detection closes that gap.

Defects

  • Lot and expiry legibilityCoders print faint, broken or smeared characters when ribbons, printheads or focus drift, making the pack unsaleable.
  • Label presence and placementMissing, doubled or flagged labels and labels outside the position tolerance come from labeller splices, web tension or sensor faults.
  • Label skewAn angled label results from container rotation or dispensing-edge misalignment and can cover the code or the product window.
  • Wrong label or artworka label, carton or leaflet for another product, strength, market or artwork versionMix-ups occur at changeover and roll splicing, and a wrong label on the market typically means a recall.
  • Leaflet presenceA missing or double leaflet comes from misfeeds on the cartoner and breaches the marketing authorisation for the pack.
  • Serialization code readability and aggregationthe unique identifier in a GS1 DataMatrix, and the parent-child link between carton, bundle and caseLow print contrast, quiet-zone intrusion or damaged cells lower the code grade, and missed reads at case packing break the aggregation hierarchy.

Inspection setup

A 5 MP colour camera with a 16 or 25 mm lens and diffuse bar light reads variable data with OCR (optical character recognition) and OCV (optical character verification against expected batch data). The same image grades the GS1 DataMatrix to ISO/IEC 15415, including symbol contrast and modulation.

A second camera measures label position and skew in mm against edges, and the model compares the whole face with the approved artwork master. A camera over the open carton confirms the leaflet.

The station sits after the coder, before the tamper-evident seal; a pusher with confirmation removes failing cartons and each rejected serial is reported to your serialization system. Code verification works as on our packaging and printing inspection page.

Outcome

Every pack leaves the line with verified lot and expiry data, a graded code and an image retrievable by serial number.

The audit trail records every recipe change, threshold change and reject override with user, reason and time stamp, the evidence your QA reviews at batch release.

How AI inspection runs on a pharmaceutical line

AI inspection runs at the machine, ties each image to one unit and hands the decision to your PLC.

Enclosed stainless steel vial inspection machine in a cleanroom, with an infeed turntable of glass vials, a carousel of vials inside behind glass doors, inspection cameras with white backlight panels and an operator touch panel
Automatic vial inspection machine: vials enter from the turntable and pass camera stations with backlights on the carousel.
  1. 1

    Trigger and part presentation

    A star-wheel position or line encoder triggers each image. Vials are spun then stopped, tablets turned on a drum, and blisters and cartons tracked by encoder.

  2. 2

    Image acquisition

    GigE Vision or USB3 Vision cameras with telecentric or C-mount lenses sit in cleanable stainless-steel enclosures. Backlight, dark-field, dome and coaxial lights are strobed with each exposure.

  3. 3

    Edge inference and latency budget

    Models run on an NVIDIA Jetson or Intel OpenVINO industrial PC beside the machine, with inference under 50 ms per image, so the decision is ready before the reject point.

  4. 4

    Decision and actuation

    Pass/fail and defect class go to the machine PLC over PROFINET, OPC UA or Modbus. The PLC fires the reject gate, air jet or pusher and confirms it by sensor.

  5. 5

    Traceability and data retention

    Each decision is stored with serial number or position, batch, images, model version and time stamp, on the edge and on-premises or in an EU cloud region.

  6. 6

    Active-learning loop for new defect classes and variants

    Uncertain images go to your trained inspectors for review. Retraining runs on SageMaker, but a new model reaches production only through your change control and an electronic-signature release.

Which imaging finds which pharmaceutical defect?

Each defect family has a standard lighting and camera method.

Defect familyBest-suited imagingWhy
Visible particles in liquidSpin-then-stop, multi-frame backlight and bottom dark-fieldMotion between frames separates particles from fixed glass marks.
Glass cracks, chips and cosmetic glass defectsDark-field ring and low-angle bar lightCracks and scratches scatter light and glow against a dark background.
Fill level and plunger positionBacklight with telecentric lensA sharp silhouette gives meniscus and plunger position precisely.
Stopper and crimp defectsTop-down dome or ring light plus side cameraEven light shows crimp folds, missing caps and raised stoppers.
Tablet capping, tablet chipping and broken tabletsColour area- or line-scan, both faces, diffuse dome; laser triangulation for 3DDiffuse light removes coating glare; 3D adds thickness.
Colour deviation, foreign tablets, print and emboss defectsCalibrated colour camera, diffuse dome or coaxial lightStable colour and even light make spots and filled embossing measurable.
Capsule defect types: empty, mis-joined or dented shellsColour camera with rotation; backlight for translucent shellsRotation shows the full joint; backlight shows fill through translucent shells.
Blister completeness and sealed-cavity integrityBacklight under formed web; low-angle light on lidding foilBacklight shows cavity fill; raking light reveals seal pattern and wrinkles.
Lot, expiry, label and serialization codesDiffuse light, OCR/OCV, ISO/IEC 15415 code gradingEven light gives stable character contrast and repeatable code grades.

Integration, GMP data integrity and validation support

The system exchanges batch and result data with your plant systems. Opsio supplies the technical controls and validation documentation; you own the validated state, SOPs and release decisions.

MES and electronic batch records
Reads batch and recipe from MES at batch start; writes counts per defect class, alarms and events to the electronic batch record.
Serialization and EU FMD
Reports rejected and decommissioned serials to your site serialization server, verifies the EU FMD unique identifier and anti-tampering device, and checks aggregation.
QMS, SPC and ERP
Sends defect trends to SPC, raises deviation triggers in your QMS at alert limits, and passes inspection status to ERP.
Where data lives
Inference runs on the edge; audit trail, results and images sit on-premises or in an EU cloud region.
21 CFR Part 11 and EU GMP Annex 11
Opsio supplies the audit trail, unique user accounts, role-based access and electronic signatures, designed to meet Part 11 and Annex 11 requirements.
GAMP 5 validation support
Opsio supplies a risk assessment, specifications traceable to your URS (user requirements specification), IQ/OQ protocols and PQ support. You own the validated state, SOPs and change control.
Data integrity (ALCOA+)
Raw images, decisions and model versions are stored write-once and attributable; no result changes without an audit-trail entry.
ISO 13485 and medical devices
For syringe, cartridge and device makers, the system supports process validation records under ISO 13485 and the FDA QMSR (21 CFR Part 820).

From first test to your line in five steps

Every step is designed to fit your qualification and change-control process.

  1. 1

    Opsio runs tests in the AI Lab

    You ship typically 200 to 500 good units per format plus 20 to 50 defective units per defect class, ideally a Knapp-style set of real and seeded defects. Classes cover particles, cracks, fill level, crimp and plunger faults; chipped, capped and foreign tablets; empty cavities; label and code faults. Opsio images them with candidate cameras and lighting, trains a first model and measures detection and false-reject rate per class.

    You provide
    Labelled samples, specifications, line speed and your defect catalogue.
    Opsio delivers
    Imaging trials, a first model and per-defect results.
  2. 2

    Present results and pricing

    Opsio walks your QA, engineering and validation teams through per-defect performance, example images of found and missed defects and grey-zone behaviour. You get the recommended cameras, lighting and enclosure, cycle-time fit and a fixed quote for the production system, managed service and validation deliverables.

    You provide
    QA, validation and engineering attendance, and your acceptance criteria.
    Opsio delivers
    Results report, bill of materials and fixed quote.
  3. 3

    Decision and PO/MSA signing

    You decide. The purchase order and master services agreement set scope, acceptance criteria per defect class, data ownership, support and the split of validation responsibilities. Where your procedures require it, a quality agreement and supplier assessment are completed at this step.

    You provide
    Purchase order and quality agreement where required.
    Opsio delivers
    Signed MSA, project plan and responsibility matrix.
  4. 4

    Installation in the Opsio AI Lab

    Opsio builds the production station on the real cameras, lighting, enclosure and edge hardware and commissions it in the AI Lab. A factory acceptance test runs against your criteria and Knapp-style test set, and Opsio prepares IQ/OQ protocols and a traceability matrix for your review.

    You provide
    Document review and FAT witnesses if wanted.
    Opsio delivers
    Commissioned station, FAT report and draft IQ/OQ protocols.
  5. 5

    Installation at the customer location

    The station is installed on your line and connected to PLC, MES and serialization. IQ and OQ are executed with your team, then the system runs in shadow mode beside current inspection for PQ. After QA release, live rejection starts, operators are trained and the active-learning loop begins under change control.

    You provide
    Line access, network, PLC/MES contacts and QA approval of IQ/OQ/PQ and SOPs.
    Opsio delivers
    Installation, executed IQ/OQ, PQ support, training and managed service.

Pricing for the feasibility study, production stations and the managed service is on the AI Visual Inspection service page.

AI visual inspection for Pharmaceuticals & Medical Devices: questions

What is visual inspection in pharma?

Visual inspection in pharma is the 100% check of finished units for particles, container, closure and appearance defects before release. For injectables it is required under USP <790>, EU GMP Annex 1 and Ph. Eur. 2.9.20, and is done manually, semi-automatically or by automated machines. Tablets, blisters and packs are inspected for appearance, completeness and correct labelling. AI inspection adds learned defect classes to the automated route.

What are common tablet defects?

The most common tablet defects are capping, lamination, chipping, cracking, picking, sticking, mottling and double impression. Coated tablets add coating defects such as blistering, blooming, bridging and orange peel, and lines also see broken, doubled and foreign tablets. Camera inspection with diffuse lighting on both faces catches the visible ones on every tablet; internal lamination without a surface sign needs other tests.

What is tablet capping?

Tablet capping is the partial or full separation of the top or bottom crown from the tablet body. It typically comes from air trapped in the granulate, over-dry or too fine granules, worn punches or excessive compression force and speed. A colour camera with diffuse dome light sees the crown edge break or the split line, so capped tablets can be rejected individually and the trend traced back to a specific press.

What are examples of capsule defects?

Typical capsule defects are empty or under-filled shells, telescoped or mis-joined caps and bodies, split or cracked shells, dents, holes, double caps, colour spots and missing or smudged print. Soft-gel capsules add leakers and misshapen units. A colour camera with capsule rotation inspects the full surface and joint, and backlight shows fill level through translucent shells.

What does a visual inspection machine for injectable products check?

A visual inspection machine for injectable products checks every container for visible particles, glass cracks and cosmetic defects, fill level, stopper and crimp integrity, and for syringes and cartridges the plunger position. It spins and stops each unit, captures several frames per camera and rejects or diverts the unit. AI models classify defects from your own containers rather than relying on fixed pixel thresholds.

What is the vial inspection procedure on an automated line?

On an automated line, each vial is spun, stopped and imaged at several stations before labelling. Infeed screws place vials into a star wheel; particle stations capture frame sequences under backlight and dark-field light; further cameras check shoulder, heel, crimp and cap. The machine rejects or diverts each failing vial, and an AQL sample of the accepted lot is then inspected manually, as USP <790> describes.

What is the syringe inspection procedure?

Prefilled syringe inspection follows the same spin-then-stop principle as vials, with extra stations for the plunger stopper and needle shield. The syringe is held by the flange or barrel, rotated and stopped, and imaged under backlight for particles and air-gap size and under dark-field for cracks and flange chips. Siliconised barrels create droplets that look like particles, which is where learned models reduce false rejects.

What lux level is needed for visual inspection in pharmaceuticals?

For manual inspection, USP <790> and <1790> describe 2,000 to 3,750 lux at the inspection point, with higher levels for amber or coloured containers. That applies to human inspectors at a booth. Automated and AI inspection uses strobed LED backlight and dark-field light set for each camera, and its fitness is shown by qualification against test sets, not by a lux reading.

What is the Knapp test procedure?

The Knapp test compares automated and manual inspection using a test set of good and defective containers, each inspected many times, typically 10. For each container the fraction of rejections gives a detection probability, which places it in an accept, grey or reject zone. The automated system must perform at least as well as qualified manual inspectors before it replaces them, and this test is the core of AI inspection PQ.

What does USP <790> say about visible particulates in injections?

USP <790> requires injections to be essentially free of visible particulates, confirmed by 100% inspection of every unit followed by an acceptance sample of the passed lot. It describes manual conditions such as black and white backgrounds, light intensity and inspection time per container, and allows automated or semi-automated methods shown to be equivalent or better. AI inspection supports the 100% step; your sampling plan stays in place.

What is USP Chapter <1790>?

USP <1790> is the general information chapter on visual inspection of injections that explains how to meet USP <790>. It covers particle types, defect classification into critical, major and minor, manual, semi-automated and automated inspection, Knapp-style qualification, test sets, inspector training and the inspection life cycle. Most automated inspection URS documents draw their requirements directly from it.

What are the guidelines for visual inspection in the pharmaceutical industry?

The main guidelines are USP <790> and <1790>, Ph. Eur. 2.9.20, EU GMP Annex 1 for sterile products and the FDA draft guidance on inspection of injectable products for visible particulates. Annex 1 requires 100% inspection, qualified inspectors and validated automated methods. For packaging, EU FMD and GS1 rules apply to serialization, and Part 11 and Annex 11 govern the electronic records.

Is there an FDA guideline for visual inspection of tablets?

No FDA guidance is dedicated to visual inspection of tablets. Appearance is set as a release specification and controlled under 21 CFR Part 211 current good manufacturing practice, usually through in-process checks and AQL sampling against a defect catalogue. Camera inspection of every tablet or blister is a process control you choose and validate, with Part 11 controls on the electronic records it creates.

Book a 20-minute walkthrough for pharmaceuticals & medical devices

Pick the defects that cost you most, and we will show you live how a vision model finds them on a line like yours.

  • Live on your defect type, no slides
  • A reply within one business day
  • No obligation
Your call is with
  • Vaishnavi ShreeDirector & MLOps Lead
  • Praveena ShenoyCountry Manager, India

We use your details to answer your request, as described in our Privacy Policy.