Tablet and Vial Visual Defect Detection
Vision models that flag chipped, cracked, spotted or broken tablets and cap, crimp, glass or particle defects in vials, sending uncertain units to manual inspection and storing every reject image.
- Capability:
- Computer Vision
- Industry:
- Pharma & Life Sciences
Who it is for
- Production Manager, Solid Orals or Injectables
- Head of Quality Assurance
- Visual Inspection Supervisor
- Plant Engineering Manager
The problem
Tablets are inspected after compression and coating, and injectable vials and ampoules are inspected for particles and container defects before packing. Much of this is still done by trained inspectors at booths or sorting belts, followed by AQL sampling, and fatigue makes results vary across a shift.
Fatigue and variability
Manual inspection depends on concentration, and detection of small chips or particles varies between inspectors and over long shifts.
Fixed-threshold systems reject good units
Older automated inspection uses fixed rules that reject good units for embossing shadows or glass reflections and need constant retuning.
Defect data goes unused
Reject counts are recorded, but images and defect types are rarely kept, so recurring tooling or coating problems surface late.
Qualification effort
Every change to an inspection system needs defect libraries and requalification, which teams struggle to keep current.
What we build
We build defect detection models trained on images of your own products. For tablets, the model classifies chips, cracks, capping, black spots, embossing faults and coating defects on a sorting belt or inspection drum. For vials and ampoules, it checks cap and crimp, fill level, glass cracks and visible particles from images captured on your inspection machine or a dedicated camera station. Each unit gets a defect class and a confidence score. Clear rejects are removed, uncertain units go to a manual inspection lane, and every reject image is stored with its class for trending.
- Classifies tablet defects such as chips, cracks, capping, spots, embossing faults and coating defects
- Inspects vials and ampoules for cap and crimp faults, fill level, glass cracks and visible particles
- Sends low-confidence units to a manual inspection lane instead of forcing a decision
- Builds a labelled defect library from your rejects for qualification and retraining
- Trends defect types by batch, machine, punch set or filling line
- Works with images from existing inspection machines where they can be exported
How it works
- 01Build the defect libraryInspectors label images of good units and known defects from your products to create training and challenge sets.
- 02Train and challenge testThe model is trained and tested against a fixed challenge set before it sees live production.
- 03Capture and classifyCameras capture each tablet or container, and the model assigns a defect class and confidence score.
- 04Route by confidenceClear passes continue, clear rejects are removed, and uncertain units go to the manual lane.
- 05Inspector decisionA trained inspector checks uncertain units, and the decision is added to the labelled library.
- 06Trend and reportDefect counts and images per batch go to production and QA for investigation and product quality review.
Architecture
- Image capture
- Area or line-scan cameras with controlled lighting
- Spin-and-stop presentation for vials
- Encoder-based triggering
- Inference at the line
- Edge GPU
- Defect classification model
- Confidence-based routing
- Model management
- Labelled defect library
- Training and challenge test pipeline
- Model version registry
- Review and quality data
- Manual inspection lane interface
- Reject image archive
- Defect trend dashboard
Inputs and outputs
Inputs
- Images of good and defective units from your products
- Defect catalogue with definitions and criticality
- Line images from cameras or existing inspection machines
- Batch and machine identifiers
- Manual inspection and AQL results
Outputs
- Pass, reject or uncertain decision per unit
- Defect class and confidence with image
- Batch-level defect summary
- Trend reports by machine, tooling or filling line
- A growing labelled defect library
Where people stay in control
Trained inspectors decide every uncertain unit and confirm the labels used for retraining. QA approves each new model version after challenge testing, and AQL sampling continues as your batch-level check.
Integrations
- Inspection machines or sorting systems with image export
- Line PLC for reject actuation
- MES or ERP for batch and machine data
- QMS for deviations and CAPA
- Data platform for product quality review trending
Guardrails
- Challenge sets with known critical defects run at start-up and after any change
- Model updates only through change control with documented test results
- Uncertain units always go to manual inspection
- No retraining on labels an inspector has not reviewed
- Critical defect classes tuned to avoid misses, accepting more manual checks
Compliance notes
- Supports pharmacopoeial expectations for visible particles in injections, such as USP chapters 790 and 1790 and Ph. Eur. 2.9.20, alongside your AQL programme.
- Models and inspection recipes are validated as part of a GMP computerised system, with versioning and audit trails aligned to EU GMP Annex 11 and 21 CFR Part 11.
A typical pilot
Duration: 6 weeks
One tablet product on a sorting belt, or one vial size on an existing inspection machine, using offline images first and then a shadow run alongside manual inspection.
Deliverables
- 01Labelled defect library for the pilot product
- 02Trained model with challenge test results
- 03Shadow-run comparison with manual inspection
- 04Camera and edge hardware recommendation
- 05Qualification and roll-out plan
What we measure
- Detection of known defects
- Challenge sets with seeded critical and major defects run through the model.
- False rejects
- Good units rejected by the model, confirmed by inspector review.
- Agreement with manual inspection
- Model decisions compared with inspector decisions on the same units during the shadow run.
- Units sent to the manual lane
- Count of uncertain units per batch.
FAQs
01How many defect images do we need?
It depends on the defect type and how rare it is. We start with your existing reject samples and images, and create seeded defects where real examples are scarce. The pilot report states how many examples each class had.
02Will this replace our inspectors?
It changes their work rather than removing it. Inspectors handle uncertain units, label new defect types and run challenge tests, and AQL sampling continues.
03Can it work with our existing inspection machine?
Often, if the machine can export images. Otherwise we specify a separate camera station. We confirm this in the first week of the pilot.
04How is the model validated?
Against a fixed challenge set of known defects, documented in a test report and re-run after any model or hardware change. We provide the documents your validation team needs to qualify it.
Related use cases
- Pharma & Life Sciences
Packaging and Label Inspection
Camera checks on cartons, labels and blister foils that verify batch, expiry, MRP and codes, compare print against approved artwork, and reject mismatches with image evidence.
- Pharma & Life Sciences
Batch Manufacturing Record Review
Pre-review of executed batch manufacturing and packaging records that flags blank fields, out-of-limit values, signature gaps and unlinked deviations, with page references, before QA starts.
- Manufacturing
Visual Quality Inspection on Production Lines
Cameras and vision models at the inspection station flag scratches, dents, missing features and print errors, divert clear rejects and hold borderline parts for an inspector.
- Pharma & Life Sciences
Validation and Security Testing of AI Tools in GxP Settings
Risk-based testing of LLM and ML tools used in quality, manufacturing or pharmacovigilance: accuracy, prompt injection, data leakage and audit-trail checks, packaged as validation evidence.

Founded by Akhilesh Mittal. 8 years building a security platform for a New Zealand company. IIT ISM Dhanbad and IMT Ghaziabad. Builds production agentic AI.
Test one record type on your own batches
Book a discovery call to choose a narrow pilot, such as BMR pre-review for one product or COA checks for one material group, and compare the results with your QA team's own review.