Vision QC Inspector

Vision QC Inspector (PyTorch + OpenCV)

We built a computer vision quality-control pipeline for high-speed assembly lines, capable of flagging defects like scratches, misalignments, missing parts, and wrong labels in real time. The system inspects every unit on the line, not just random samples, and pushes decisions directly into the plant’s MES.

Using optimized PyTorch models and an OpenCV-based preprocessing stack, the solution runs on edge devices on the shop floor, delivering sub-100ms inference per frame. Operators see live overlays, alerts, and hold actions without slowing down throughput.

CNN defect detection Edge inference & GPU MES integration Live overlays & dashboards
Impact at a glance

Sub-100ms

Per-part inference

↓ False accepts

Defects caught before shipping

24/7

Unattended inspection

Line-safe

No throughput impact

The system reduced manual inspection load, tightened process capability, and gave operations real-time visibility into where and when defects appear along the line.

Problem

Manual visual inspection was:

  • Subjective and inconsistent between shifts and inspectors.
  • Too slow to keep up with high-speed lines without bottlenecks.
  • Missing subtle defects that later caused rework and returns.
Solution

We introduced an AI-driven vision QC pipeline:

  • Camera-based inspection at multiple stations along the line.
  • PyTorch detection models trained on real production footage.
  • OpenCV preprocessing for lighting normalization and alignment.
  • Direct hold/accept decisions integrated into the MES workflow.
Outcome

The Vision QC Inspector delivered:

  • Higher detection rates on critical defects vs. manual-only QA.
  • Lower scrap and rework costs through earlier detection.
  • Data-driven insights on which stations and batches fail most.

Architecture overview

The vision pipeline runs on edge hardware mounted near the line, with models tuned specifically for noisy factory conditions (glare, vibration, part variation). The plant’s MES only sees simple pass/fail events and defect codes — all the heavy AI work is local.

  • Camera capture – Industrial cameras stream frames from the line at defined checkpoints.
  • Preprocessing – OpenCV handles ROI cropping, deblurring, color normalization, and perspective correction.
  • Model inference – PyTorch CNN/detector evaluates each frame for scratches, gaps, misalignments, foreign objects, and missing components.
  • Decision & overlay – The edge device renders bounding boxes/heatmaps on a local screen and returns a pass/fail + defect code.
  • MES integration – Events are pushed to the MES to trigger automatic holds, rework routes, and dashboards.
Key features in production
Multi-defect library

Models trained to recognize multiple defect types per product family, with configurable severity thresholds per plant.

Edge-first design

Runs entirely at the edge to avoid cloud latency and keep production data inside the factory network.

Operator feedback loop

When an operator overrides a decision, that data is logged and can be used to retrain and improve the models over time.

Dashboards & reporting

Per-line and per-shift defect dashboards help quality and process engineers focus on the highest-impact issues first.

The setup is designed to be replicated: new lines or plants can be onboarded by calibrating cameras, capturing a dataset, and reusing the same core pipeline.

AI & CV capabilities
  • Convolutional neural networks for defect detection and classification.
  • Classical OpenCV for preprocessing, edge detection, and alignment.
  • Model calibration to balance false positives vs. false negatives.
  • Active learning loop based on operator feedback and new defects.
Engineering & integration
  • PyTorch for model training, export, and optimized inference builds.
  • OpenCV-based camera and image pipeline on the edge device.
  • Integration with existing MES/SCADA for events and defect codes.
  • Logging, health checks, and watchdogs for 24/7 uptime.
Typical use cases
  • Electronics assembly lines (missing components, solder defects).
  • Automotive and metal parts (scratches, dents, misalignments).
  • Packaging lines (label presence/position, seal integrity).
  • Any high-volume manufacturing line where every unit must be inspected.