AI Vision Tablet & Capsule Defect Inspection

By Austin on June 11, 2026

ai-vision-pharma-tablet-capsule-inspection

Oral solid dosage forms — tablets and capsules — are among the highest-volume pharmaceutical products manufactured globally, yet their automated visual inspection remains one of the most technically demanding quality control challenges in pharmaceutical production. A chipped tablet released into a blister pack, a cracked capsule sealed into a bottle, a discoloured unit buried in a batch of correct-appearance product — each represents a failure of the manufacturing process to catch what the patient or pharmacist should never receive. The consequences extend from individual patient safety events to FDA recall actions that carry financial, reputational, and regulatory penalties far exceeding the cost of any inspection system that could have prevented them. The challenge is scale: high-speed tablet and capsule inspection at 100,000 to 500,000 units per hour requires detection performance that human inspection cannot provide and that the rule-based machine vision systems installed on most pharmaceutical lines in the 2000s and 2010s cannot reliably deliver on the complex surface geometries, film coatings, and visual defect profiles of modern oral solid formulations. iFactory's AI vision camera platform applies deep learning defect detection to 100% tablet and capsule inspection — detecting chips, cracks, surface discolouration, dimensional defects, print defects, and contamination at line speed with detection accuracy that exceeds validated manual inspection and false reject rates that protect product yield on high-value formulations. Pharmaceutical quality engineers and production managers evaluating their current OSD inspection architecture regularly choose to Book a Demo with iFactory's pharmaceutical engineering team to see how AI vision defect detection maps to their specific dosage forms, inspection requirements, and regulatory submission needs.

AI VISION · TABLET & CAPSULE INSPECTION · ORAL SOLID DOSAGE · PHARMA QC
100% Tablet and Capsule Inspection — Every Unit, Every Defect, Before Packaging.
iFactory's AI vision defect detection platform inspects tablets and capsules for chips, cracks, discolouration, dimensional deviation, and print defects at full line speed — with 21 CFR Part 11-compliant batch records and false reject rates that protect product yield on high-value formulations.
500K+ Units per hour that iFactory's AI vision platform inspects at line speed across tablet and capsule formats

99.5%+ Detection accuracy achieved for chips, cracks, and dimensional defects after product-specific model calibration

<0.1% False reject rate on calibrated AI vision systems versus 0.5–2% on legacy rule-based machine vision

21 CFR Part 11-compliant audit trail for every unit inspected — batch records ready for QP release and FDA review

Why Legacy Machine Vision Fails on Modern Oral Solid Dosage Forms

The Detection Gap Between Rule-Based Systems and AI Vision on Complex OSD Products

Legacy rule-based machine vision systems for tablet and capsule inspection were designed around intensity threshold and geometric edge detection algorithms — approaches that work reasonably well for simple white round tablets with high-contrast defects but fail systematically on the product complexity that characterises modern pharmaceutical portfolios. Film-coated tablets with colour gradients close to those of coating imperfections, bi-layer tablets with natural interface lines that rule-based systems flag as cracks, soft gel capsules with translucent shells that make internal fill anomalies difficult to distinguish from surface marks, and modified-release tablets with deliberate surface features that interact with defect detection thresholds — each of these product types creates the classification challenge that rule-based systems cannot reliably solve without generating either excessive false rejects or inadequate defect detection. The practical consequence is a forced choice between two unacceptable outcomes: high sensitivity settings that protect patient safety but drive false reject rates above 1–2% and destroy product yield on high-value formulations, or sensitivity settings calibrated for yield protection that leave chipped and discoloured units in the accepted stream. iFactory's AI vision camera platform resolves this choice by applying deep learning models that learn the complete normal appearance envelope of each product — distinguishing genuine defects from natural product variation with specificity that rule-based threshold logic cannot achieve, enabling simultaneously higher detection rates and lower false reject rates on the same product.

Defect Classes Detected Across Tablet and Capsule Formats

Detection Coverage from Surface Integrity to Dimensional Compliance

Defect 01
Chips and Edge Fractures
Mechanical damage resulting in material loss from tablet edges, corners, and faces — the most common tablet defect class and a direct patient safety risk. AI models classify chip size, location, and severity to enable configurable reject thresholds aligned to product and regulatory risk classification.
All Tablet Formats
Defect 02
Cracks and Surface Fractures
Linear surface fractures ranging from hairline cracks on film-coated tablets to deep fractures that compromise dosage form integrity. Polarised and structured light illumination enhances crack contrast on surfaces where coating colour makes cracks difficult to detect under standard illumination.
Coated & Uncoated Tablets
Defect 03
Discolouration and Coating Defects
Surface colour anomalies including coating mottling, colour patches, picking and sticking marks, twinning damage, and logo fill contamination — classified by the AI model against the product's approved colour specification using calibrated multi-illumination imaging that accounts for normal batch-to-batch colour variation within specification.
Film-Coated & Colour-Coded Units
Defect 04
Dimensional and Shape Defects
Tablets and capsules outside specified dimensional tolerances — thickness, diameter, length, and weight proxy via dimensional measurement — identified using sub-pixel precision geometric models calibrated to each product's dimensional specification. Double tablets, broken capsule bodies, and deformed soft gel capsules are classified as dimensional reject events.
All Dosage Form Formats

AI Vision Detection Architecture for High-Speed OSD Inspection

From Product Entry to Reject Actuation — the Complete Inspection Sequence

iFactory's oral solid dosage inspection platform integrates multi-illumination imaging with deep learning defect classification into an inspection sequence that provides full surface coverage of every unit at line speed. The architecture is designed for the specific constraints of high-throughput OSD inspection — sub-millisecond detection latency for synchronised reject actuation, multi-face imaging for complete surface coverage, and product-specific model loading from a centralised recipe management system for changeover without inspection hardware reconfiguration.

01
Multi-Face Imaging with Configurable Illumination
Tablets and capsules are presented to camera stations providing top, bottom, and side surface coverage in the same inspection pass. Illumination configurations — bright field, dark field, polarised, and multi-spectral — are selected per product to optimise contrast for the specific defect types of concern for each formulation. Film-coated tablets use dark field illumination to maximise crack and chip contrast against the coating surface; soft gel capsules use diffuse bright field illumination to reveal fill anomalies through the translucent shell; bi-colour capsules use calibrated colour imaging with product-specific reference models for cap-body colour verification.

02
Deep Learning Defect Classification Per Product Recipe
Each product has a dedicated deep learning inspection model trained on labelled defect and non-defect imagery from the actual manufacturing line — capturing the specific coating appearance, natural variation patterns, and defect morphology of that product rather than relying on generic OSD models that under-perform on products with atypical appearance characteristics. Models are loaded from the centralised recipe management system at product changeover, with detection thresholds configurable per defect class to align inspection sensitivity with the risk classification of each defect type in the product's defect catalogue.

03
Synchronised Reject Actuation at Line Speed
Detection results are processed by the edge compute node within sub-millisecond latency — generating reject signals synchronised to the unit position in the conveyor or chute geometry to ensure precise rejection of the detected defective unit without disturbing adjacent conforming product. Reject confirmation sensors at the reject gate verify that the targeted unit has been physically diverted, generating a confirmed rejection event in the batch record for each reject actuation. Reject rate trending is displayed in real time on the operator HMI to enable process adjustment response when defect rates indicate an upstream process condition requiring attention.

04
21 CFR Part 11-Compliant Batch Record Generation
The inspection system generates a complete batch inspection record for every production run — including total units inspected, units accepted, units rejected per defect class, reject rate trending, system performance validation checks, and alarm events — with timestamps, electronic signatures, and immutable audit trail integrity that satisfies 21 CFR Part 11 requirements. Batch records are available for QP release review within seconds of batch completion and are retained in the compliance record management system for the retention periods specified in the validated system description. Individual defect images are archived per batch for trend analysis and investigation support.

Want to understand how iFactory's inspection architecture applies to your specific tablet or capsule format and defect catalogue? Book a Demo with iFactory's pharmaceutical vision engineering team for a product-specific detection performance review.

Detection Performance Comparison: AI Vision vs. Rule-Based Machine Vision vs. Manual Inspection

How AI Vision Changes the Economics of OSD Quality Control

Performance Metric Manual Inspection Rule-Based Machine Vision iFactory AI Vision
Chip Detection Rate (>0.5 mm) 75–85% (fatigue-dependent) 88–93% (threshold-dependent) 99–99.5%
Crack Detection (hairline) 55–70% 72–84% 96–98.5%
Discolouration Detection 60–75% (colour vision variable) 65–80% (lighting-dependent) 97–99%
False Reject Rate 0.3–1.0% 0.5–2.5% <0.1%
Throughput Capacity Limited by inspector count 100K–300K units/hr Up to 500K+ units/hr
Regulatory Compliance Documentation Manual log — variable completeness System log — limited audit trail Full 21 CFR Part 11 compliant
Performance on Complex Coatings Moderate — colour interference Poor — threshold calibration instability Excellent — product-specific model

Regulatory Compliance: GMP Annex 11, 21 CFR Part 11, and OSD Inspection Validation

Building the Audit-Ready Documentation Framework for OSD Vision Systems

Automated visual inspection systems for oral solid dosage forms are computerised systems subject to the full scope of 21 CFR Part 11 requirements in FDA-regulated markets and EU GMP Annex 11 requirements in EU-regulated markets — requiring validation documentation that demonstrates the system performs its intended function within defined parameters and maintains its validated state across the product lifecycle. iFactory's platform is delivered with a qualification documentation package aligned to GAMP 5 methodology — covering User Requirements Specification, Design Qualification, Installation Qualification, Operational Qualification, and Performance Qualification documentation in formats designed for pharmaceutical regulatory submissions and audit review. The 21 CFR Part 11 compliance architecture addresses the specific requirements that FDA investigators focus on during Pre-Approval Inspections of automated inspection systems: electronic record integrity (immutable, timestamped batch records with no post-batch modification capability), audit trail completeness (all system events including parameter changes, alarm acknowledgements, and operator access logged with user identity and timestamp), access control (role-based user authentication with documented authority matrix), and electronic signature compliance (batch record QP release signatures with signatory identity, timestamp, and meaning recorded). Performance qualification for OSD inspection systems follows a challenge testing protocol using artificially defected units at defined defect type, size, and frequency — validating that the system detects defects at or above the specification level across the full production throughput range. iFactory's validation engineering team supports customers through the complete PQ protocol execution and technical report preparation for new product launches, product changes, and system upgrades. Pharmaceutical quality and regulatory affairs teams building their inspection system validation strategy can Book a Demo with iFactory's pharmaceutical validation specialists to review the qualification documentation package and its mapping to their specific regulatory submission requirements.

Ready to Replace Your Legacy OSD Inspection System with AI Vision?

iFactory's deep learning defect detection platform delivers higher detection rates, lower false rejects, and complete 21 CFR Part 11 compliance on your most challenging tablet and capsule products — with a qualification documentation package designed for FDA and EMA regulatory submissions.

Frequently Asked Questions: AI Vision for Tablet and Capsule Inspection

Legacy machine vision systems use fixed intensity thresholds to classify pixels as defect or non-defect — an approach that cannot distinguish between a genuine chip and a natural coating texture variation that happens to fall below the expected brightness range. When product appearance varies between batches, the threshold that correctly rejects chips in one batch generates false rejects on normal texture variation in the next. iFactory's AI models learn the complete normal appearance distribution of the product — across the full range of batch-to-batch colour, texture, and surface variation within the product specification — and classify defects based on morphological signatures that deviate from this learned distribution. A chip presents as a sharp intensity discontinuity with characteristic edge geometry; a natural coating texture variation presents as a smooth intensity gradient without sharp edges. The model distinguishes these signatures with specificity that threshold logic cannot achieve, enabling detection sensitivity high enough to catch all genuine defects while the false reject rate falls below 0.1% on calibrated deployments.
Yes — iFactory's platform supports all primary oral solid dosage formats from a single hardware and software architecture, with product-specific inspection models and illumination configurations loaded via the recipe management system at changeover. Hard gelatin capsule inspection uses calibrated colour imaging for cap-body colour matching, dimensional inspection for correct lock engagement geometry, and surface inspection for printing legibility and cosmetic defects. Soft gel capsule inspection uses diffuse illumination optimised for the translucent shell material, with AI models trained to distinguish surface marks from internal fill anomalies visible through the shell. Tablet inspection models are developed separately for uncoated, film-coated, sugar-coated, and modified-release formats — each with illumination and model configurations matched to the specific appearance characteristics and defect risk profile of that coating system. Multi-product manufacturing lines with frequent changeovers benefit from the recipe-based product switching that loads the correct inspection configuration in under two minutes without hardware adjustment.
iFactory's OSD inspection models are built from a combination of a pre-trained base model — trained on a broad library of tablet and capsule imagery across multiple product types — and product-specific fine-tuning on imagery from the customer's own product and manufacturing line. The base model provides the foundational understanding of chip morphology, crack signatures, and coating defect patterns; the product-specific fine-tuning teaches the model the specific appearance characteristics of each product that distinguish genuine defects from normal variation. For product-specific fine-tuning, 500–1,500 labelled images per product covering the full range of normal appearance variation and representative defect examples is typically sufficient to achieve the performance specification. For new product launches without production history imagery, iFactory's validation protocol includes a structured image collection phase during the first production batches, with model performance validated against artificially defected reference units before the system is released for 100% inspection operation.
iFactory's inspection platform communicates with upstream and downstream equipment via standard industrial protocols — OPC-UA for integration with modern PLC and DCS systems, and discrete I/O for integration with legacy equipment that lacks network communication capability. Reject actuation signals are delivered via hardwired digital output to the reject mechanism — ensuring the equipment protection signal path is independent of network availability. Batch start and stop signals from the packaging line PLC trigger batch record creation and closure in the inspection system, synchronising the inspection batch record with the packaging line batch record for integrated documentation. Process trend data — reject rate per defect class, defect rate trending — is available via OPC-UA to the line SCADA for display on the central line operator console and for MES batch record integration. For facilities with existing manufacturing execution systems, the inspection platform's batch record data is routable to the MES via REST API for unified electronic batch record management.
The validation timeline for iFactory's OSD inspection system depends on the number of products in scope and the availability of defect reference samples. Physical installation is completed in 3–5 days. IQ and OQ execution typically takes 2–3 weeks, covering hardware verification, software functional testing, electronic record integrity validation, and 21 CFR Part 11 access control and audit trail testing. PQ execution for each product requires production of artificially defected reference units — chips, cracks, and colour defects at defined sizes — and challenge testing across the full production speed range to demonstrate detection rate and false reject rate performance. PQ for a single product format typically takes 3–5 days of testing plus 1–2 weeks for technical report preparation. For a line with 10–15 products, a concurrent PQ approach with multiple products tested in sequence typically completes the full product scope validation in 8–12 weeks. Product-specific model validation for new products added after initial deployment follows an abbreviated PQ protocol — challenge testing with the new product's defect reference set — typically completing in 1–2 weeks per product. Facilities planning to include the inspection system in a regulatory submission can schedule a validation documentation review with iFactory's pharmaceutical team by booking a Book a Demo session.
AI VISION · ORAL SOLID INSPECTION · TABLET & CAPSULE QC · 21 CFR PART 11
Deploy Validated AI Vision Defect Detection on Your Tablet and Capsule Lines.
iFactory's deep learning defect detection platform provides 100% OSD inspection at 500,000+ units per hour — with product-specific AI models, complete 21 CFR Part 11 audit trails, and a GAMP 5-aligned validation documentation package for FDA and EMA regulatory submissions.

Share This Story, Choose Your Platform!