PCB Defect Detector
An automated computer vision platform designed to detect and classify manufacturing anomalies on printed circuit boards (PCBs) using custom homography alignment and convolutional networks.
What is the PCB Defect Detector?
The PCB Defect Detector is an automated inspection platform built to optimize quality control pipelines in hardware manufacturing. By leveraging computer vision techniques (OpenCV) and deep convolutional neural networks (CNNs), the system automatically aligns camera feeds of printed circuit boards, identifies discrepancies (such as trace anomalies, solder bridges, and component misplacements), and classifies them with high precision.
Defect Detection Subsystems
Homography Alignment
Utilizes SIFT feature detection and perspective transformation matrices to align raw, rotated, or skewed board camera inputs precisely with a golden reference board template.
Image Subtraction Delta Analysis
Computes mathematical difference matrices using NumPy to instantly highlight copper trace breaks, missing drill holes, or foreign particles.
CNN Defect Classifier
Runs delta outputs through a custom 3-layer Convolutional Neural Network trained to classify defects into component anomaly, trace damage, or solder bridges.
High-Performance Evaluation
Optimizes linear algebra delta loops in Python, resulting in sub-300ms cycle times suitable for active conveyor-belt inspection lines.
Vision & Classification Pipeline
The system routes raw camera inputs through a structured linear pipeline before outputting anomalies:
This sequential approach isolates template alignment errors from classification models, maximizing overall precision and reducing false positive anomaly tags.
Technical Insights & Enhancements
- Lighting Sensitivity: Illumination variations introduce severe noise in image subtraction. Normalizing pixel values with CLAHE histogram equalization dramatically improved stability.
- Performance Bottlenecks: Iterating over pixels in pure Python loops was too slow. Re-writing deltas as matrix-wide vector operations in NumPy reduced loop latencies by 95%.
- Dataset Scarcity: Augmenting PCB dataset folders with synthetic rotations, blurs, and random digital trace breaks helped prevent CNN overfitting during training.