Computer Vision Quality Control System for Manufacturing
Automated visual inspection of manufactured parts to detect defects at production line speeds, replacing manual inspection that was slow, inconsistent, and error-prone.
Business Context
Automotive parts manufacturer with 5 production lines running 24/7. Manual inspection caught only 85% of defects, leading to costly recalls. Production speed: 120 parts/minute required sub-500ms inference time.
Scale & Constraints
17M parts inspected annually, <500ms latency requirement, 99.5% accuracy target (false negatives expensive), edge deployment (factory floor), harsh environment (dust, vibration, temperature swings), limited connectivity.
Architectural Role
AI/ML Architect for manufacturing modernization. Designed end-to-end CV pipeline, edge deployment strategy, model lifecycle management, and integration with production systems.
System Design
Dual-tier architecture: Edge inference on NVIDIA Jetson devices at production line + Cloud training/monitoring on Azure. Real-time pipeline: High-speed camera (240 FPS) → Image preprocessing → CNN inference → Classification + bounding boxes → Quality decision → Reject actuator trigger. Continuous learning loop: Edge → Cloud sync → Retraining → Model deployment.
AI/ML Technical Deep Dive
Model Architecture
Custom ResNet50-based architecture with attention mechanisms for defect localization. Transfer learning from ImageNet, fine-tuned on 100K labeled part images (12 defect classes). Multi-task head: defect classification + bounding box regression. Model size: 98MB (optimized for edge deployment). Input: 224x224 RGB images. Output: 12-class probabilities + defect coordinates.
Training Pipeline & MLOps
Automated training on Azure ML: Weekly retraining on production feedback data → Data augmentation (rotation, brightness, noise) to handle environmental variations → Hyperparameter optimization with Bayesian search → Validation on hold-out test set (stratified by defect type) → Automated threshold tuning (precision-recall tradeoff) → Shadow deployment for A/B testing → Model versioning and rollback capability.
Inference Optimization
TensorRT optimization for NVIDIA Jetson: FP16 quantization for 2.8x speedup (820ms → 290ms) with <1% accuracy drop. Dynamic batching for parallel processing (4 cameras per Jetson). Custom CUDA kernels for preprocessing. Memory optimization to fit 4 models on single device. Achieved 290ms average latency (60% faster than requirement).
Monitoring & Observability
Edge telemetry: Inference latency tracking, confidence score distribution per defect class, model version tracking. Cloud analytics: Precision/recall metrics by defect type, confusion matrix analysis, drift detection via feature distribution monitoring, false negative root cause analysis. Production integration: Real-time dashboard showing parts inspected, defects caught, line throughput. Automated alerts for model degradation or inference failures.
Key Architectural Decisions
- ✓Edge inference vs cloud—sub-500ms latency requirement + unreliable connectivity demanded edge deployment
- ✓Custom ResNet50 vs EfficientNet—better accuracy (97.2% vs 95.8%) despite slightly slower inference
- ✓TensorRT FP16 over INT8—accuracy preservation (99% vs 96%) worth 15% slower inference
- ✓Dual-tier architecture—edge for inference, cloud for training/monitoring
- ✓Multi-task learning—single model for classification + localization reduced deployment complexity
- ✓Active learning—prioritized labeling of low-confidence predictions, reduced labeling cost by 60%
Trade-offs
- ⚠Edge hardware cost ($800/device × 20 lines) vs cloud latency—edge won for business criticality
- ⚠Accepted 2.5% false positive rate to achieve 99.5% recall—cost of extra inspection < cost of recalls
- ⚠Weekly retraining vs daily—balanced model freshness with compute costs
- ⚠Custom model vs pre-trained API—longer development (3 months vs 2 weeks) for 10x lower operating cost
Technologies
Measurable Outcomes
- →99.6% defect detection accuracy (vs 85% manual baseline)
- →$3.8M annual savings from reduced recalls and manual inspection
- →290ms average inference latency (42% faster than 500ms requirement)
- →Zero production line slowdowns due to inspection system
- →95% reduction in false negatives (costly defects reaching customers)
- →Edge deployment resilient to 48+ hour cloud disconnection
Lessons Learned
"Edge AI is essential when latency and reliability are non-negotiable, but the complexity is real. We learned that MLOps for edge is fundamentally different from cloud—model versioning, rollback, and monitoring across 20 disconnected devices required custom tooling. Also, involving production operators early in model design (e.g., explainability via bounding boxes) drove adoption."