Skip to main content

> ML_RECIPE // AUTOMATED-OPTICAL-INSPECTION-SURFACE-DEFECTS_v1.0

Automated Optical Inspection (AOI) for Surface Defects

Segment and classify microscopic scratches, dents, and voids on manufactured PCB and metallic components at 60 parts per minute.

object detectionmanufacturingApache-2.0free-oss
Back to All Recipes

Business Outcome

Segment and classify microscopic scratches, dents, and voids on manufactured PCB and metallic components at 60 parts per minute.

Acceptance Criteria:

Zero critical defect escapes (thermal cracked joints) allowed on quality assurance acceptance run.

Heuristic Baseline

Computer vision morphological filter: Canny edge detector + contour thresholding flagging surface blobs.

Baseline Evaluation:

Canny edge filtering yielded 38% false rejection rate due to harmless surface oil reflections.

Phase 1: Prototype Path

Collect 2,000 labelled camera images. Fine-tune a lightweight feature extractor on developer GPU workstation. Evaluate mAP@50 and inference latency.

Hardware: Developer PC with 1x NVIDIA GPU (RTX 3080/4090 or cloud T4)

Phase 2: Production Path

Export trained weights to TensorRT engine. Deploy to industrial NVIDIA Jetson Orin edge appliance connected to GigE machine vision camera.

Hardware: Industrial edge appliance (NVIDIA Jetson AGX Orin 32GB or IPC with RTX 4000 series GPU)

Compute & Placement Topologies

Training Placement

Quarterly training on developer/cloud GPU workstation (e.g. 1x RTX 4090 or A10G)

Inference Placement

Industrial edge appliance (NVIDIA Jetson Orin or industrial IPC with TensorRT)

3-Plan Placement Alternatives

Plan A: Simplest Viable

OpenCV thresholding and contour analysis on edge IPC CPU without deep learning weights.

Plan B: Hardware-Fitted

Industrial edge PC with NVIDIA RTX 4060 or Jetson Orin running ONNX Runtime / TensorRT.

Plan C: Production-Ready

Pinned edge appliance with hardware watchdog + dual GigE cameras + TensorRT engine (< 15ms frame latency) + air-gapped model artifact updates via signed registry.

Recommended Libraries & Tools

★ PRIMARY TOOLtorchvisionPyTorch Foundation / Meta
View
OpenCVOpenCV Foundation / Open Source Vision Foundation
View
PyTorchLinux Foundation / PyTorch Foundation
View
ONNX RuntimeMicrosoft / Linux Foundation AI & Data
View

Governance, Safeguards & Risks

Governance Safeguards:
  • Licensing compliance notice: When employing YOLOv8 models, commercial use may occur under AGPL-3.0 subject to its obligations (including open-sourcing the derivative software under AGPL-3.0 upon network deployment); a separate Enterprise licence is required for proprietary/non-AGPL deployment.
  • Artifact security: Enforce SafeTensors or verified PyTorch state_dict checkpoints with cryptographic SHA-256 validation; strictly prohibit unpickling untrusted model files on the factory IPC.
  • Operator review: Route all rejected parts into a secondary physical bin with synchronized high-resolution image logs for manual operator confirmation.
  • Optical calibration: Validate illumination stability with daily calibration target cards before operating shifts.