AI Quality Inspection
Deploy computer vision systems that detect defects faster and more consistently than human inspectors — running 24/7 on high-speed production lines.
Why AI for Quality Inspection?
Manual visual inspection is subjective, fatiguing, and cannot scale. AI vision systems offer:
- Consistency: Same detection criteria applied to every single product, 24/7
- Speed: Inspect hundreds of parts per minute at full production line speed
- Sensitivity: Detect sub-millimeter defects invisible to the human eye
- Data: Every inspection is logged with images and measurements for traceability
Inspection Types
Surface Defect Detection
Scratches, dents, stains, cracks, and discoloration on product surfaces. Classification and segmentation of defect types.
Dimensional Measurement
Verify product dimensions, tolerances, and geometric features against CAD specifications with sub-pixel accuracy.
Assembly Verification
Confirm all components are present, correctly positioned, and properly assembled. Check labels, barcodes, and packaging.
Color & Texture
Verify color consistency, surface finish quality, and texture uniformity across production batches.
Defect Detection Pipeline
import cv2
import torch
from ultralytics import YOLO
class DefectInspector:
def __init__(self, model_path='defect_model.pt'):
self.model = YOLO(model_path)
self.defect_classes = ['scratch', 'dent', 'crack',
'stain', 'missing_part']
def inspect(self, image_path):
"""Run inspection on a product image."""
results = self.model(image_path, conf=0.3)
defects = []
for det in results[0].boxes:
defect = {
'type': self.defect_classes[int(det.cls)],
'confidence': float(det.conf),
'location': det.xyxy[0].tolist(),
'area': self._compute_area(det.xyxy[0])
}
defects.append(defect)
verdict = 'PASS' if len(defects) == 0 else 'FAIL'
return {'verdict': verdict, 'defects': defects}
def _compute_area(self, bbox):
return (bbox[2] - bbox[0]) * (bbox[3] - bbox[1])
# Run inline inspection
inspector = DefectInspector()
result = inspector.inspect('product_001.jpg')
print(f"Verdict: {result['verdict']}, Defects: {len(result['defects'])}")
Anomaly Detection for Unseen Defects
When you only have "good" examples, anomaly detection finds deviations from normal without labeled defect data:
- Autoencoders: Train on good images. High reconstruction error indicates anomaly.
- PatchCore: State-of-the-art industrial anomaly detection using memory bank of normal features.
- Student-Teacher: A student network trained on good data fails to reconstruct anomalous regions.
- MVTec AD: Benchmark dataset for industrial anomaly detection with 15 categories.
Hardware Setup
| Component | Options | Considerations |
|---|---|---|
| Camera | Area scan, line scan, 3D | Resolution, frame rate, sensor type |
| Lighting | Ring, bar, dome, backlight | Critical for consistent results |
| Compute | Industrial PC, NVIDIA Jetson | Inference speed vs. model complexity |
| Trigger | Encoder, photoelectric sensor | Synchronize capture with line speed |
| Reject mechanism | Air blast, diverter, robot | Integrate with PLC for reject action |
Lilly Tech Systems