← Back to Projects

Real-time Object Detection for Manufacturing

2024-01-15

Video Demo

Video: /videos/object-detection/demo.mp4

Tech Stack

YOLOv8OpenCVTensorRTPython

About This Project

## Overview Developed a real-time object detection system for automated quality control in manufacturing lines. The system detects defects and anomalies in products moving on conveyor belts at high speed. ## Challenge The client needed to replace manual visual inspection with an automated system that could: - Process 100+ items per minute - Detect multiple defect types simultaneously - Operate in varying lighting conditions - Integrate with existing production line infrastructure ## Solution Implemented a custom YOLOv8 model with the following optimizations: ### Model Architecture - **Base Model**: YOLOv8-Large - **Input Resolution**: 640x640 - **Custom Layers**: Added attention mechanism for small defect detection - **Classes**: 12 defect types across 3 product categories ### Training Strategy - **Dataset**: 50,000 annotated images from production line - **Augmentation**: Mosaic, mixup, color jittering for lighting robustness - **Training Time**: 48 hours on 4x A100 GPUs - **Validation**: 5-fold cross-validation ### Optimization - **TensorRT**: Converted to FP16 for 2.3x speedup - **DeepSORT**: Added tracking for consistent defect logging - **Pipeline**: Multi-threaded preprocessing and postprocessing <VideoPlayer src="/videos/object-detection/demo.mp4" autoplay loop muted /> ## Results | Metric | Before | After | Improvement | |--------|--------|-------|-------------| | Inspection Speed | 40 items/min | 120 items/min | **200%** | | Defect Detection Rate | 78% | 96.5% | **+18.5%** | | False Positive Rate | 12% | 2.1% | **-82%** | | Manual Labor | 4 operators | 1 supervisor | **-75%** | ### Key Achievements - **45% faster** overall inspection time compared to semi-automated system - **96.5% accuracy** in detecting all 12 defect types - **30+ FPS** real-time performance on edge device (NVIDIA Jetson AGX) - **ROI achieved** in 3.5 months of deployment ## Technical Stack - **Framework**: PyTorch, Ultralytics YOLO - **Deployment**: TensorRT, Docker, Kubernetes - **Monitoring**: Prometheus, Grafana dashboards - **Integration**: REST API, MQTT for PLC communication ## Code & Resources - [GitHub Repository](https://github.com/yourusername/manufacturing-defect-detection) - [Technical Paper](#) - [Demo Video](/videos/object-detection/demo.mp4) ## Lessons Learned 1. **Data Quality > Model Complexity**: Spent 60% of time on data cleaning and annotation 2. **Edge Cases Matter**: Rare defect types required targeted data collection 3. **Lighting is Critical**: Added adaptive preprocessing for varying conditions 4. **Monitoring is Essential**: Production drift detection caught model degradation early --- *Project completed: January 2024* *Duration: 4 months* *Team: 3 engineers*