We developed a GMP-validated computer vision vial inspection system over 18 weeks: (1) Multi-camera inspection station: 8 synchronized cameras (4 Mpx Basler ace2 with telecentric lenses) arranged around a rotating vial holder: 2 side cameras (detecting cracks, chips, label placement, surface defects), 1 bottom camera (vial base integrity), 1 top camera (stopper seating, cap crimping quality), 2 meniscus cameras (fill level measurement through the transparent vial wall — detecting underfill and overfill with ±0.5% volume accuracy), and 2 label cameras (OCR reading lot number, expiry date, product name, barcode — verifying against batch record data). Controlled LED illumination (dark field for particle and crack detection, bright field for surface defects, backlighting for fill level) eliminated environmental lighting dependency.
(2) Multi-task CV model: the system runs 6 specialized models sequentially on each vial (total inference time: 120ms per vial — supporting 6,000 vials/hour throughput): fill level model (regression model predicting fill volume from meniscus image — trained on 8,000 images with calibrated fill volumes), crack/chip detection (object detection model identifying structural defects — trained on 5,000 defect images including synthetically generated crack patterns overlaid on clean vial images, because real defect images are rare for high-value biologics), stopper/cap model (classification model verifying correct stopper seating depth and cap crimping — trained on 12,000 images across 4 stopper/cap combinations the facility uses), label verification (OCR + layout verification — reading printed text and comparing against expected batch data, checking label alignment within ±1mm tolerance), surface defect detection (segmentation model identifying scratches, stains, and foreign material on vial exterior — trained with augmented data to handle the transparent/reflective properties of borosilicate glass), and overall classification (an ensemble model combining outputs from all 5 models to produce Accept/Reject/Review decisions — with configurable sensitivity thresholds per defect category).
(3) GMP validation package: complete GAMP 5 validation documentation: URS (23 user requirements covering inspection scope, accuracy targets, throughput requirements, and regulatory compliance), FS and DS (detailed system specification including model architectures, training data descriptions, and hardware specifications), IQ protocol and report (documenting hardware installation, camera calibration with NIST-traceable reference vials, and software installation verification), OQ protocol and report (testing system performance across the full operating range — fill level accuracy at minimum and maximum fill, defect detection at minimum and maximum line speed, performance with all product/vial/stopper combinations), PQ protocol and report (3 consecutive production runs demonstrating consistent performance — inspecting 12,000+ vials per run with comparison against parallel manual inspection), and validation summary report (consolidating all validation evidence for regulatory review). (4) Continuous monitoring: the system logs every inspection decision with annotated images — creating a complete audit trail.
Statistical process control charts track: reject rate over time (detecting drift from expected reject rate), defect category distribution (detecting shifts in defect types that might indicate production issues), and model confidence distribution (detecting degradation in model certainty that might indicate calibration drift or model degradation).