Personal R&D · open benchmark data
VisionForge - AI Vision Platform

Problem
PCB inspection requires checking solder joints and component placement against IPC-A-610 acceptability standards, but manual or rule-based optical inspection is slow, inconsistent, and struggles with rare defect types. The engineering goal was a vision system that detects multiple PCB defect classes, maps them to IPC-A-610 Class 1/2/3 compliance categories, and is structured to run on a high-throughput line. A core challenge addressed in the design is class imbalance: rare defect types are underrepresented in typical PCB defect datasets. The project is a personal/R&D build developed on the open PKU-Market PCB defect dataset, not real production data from any factory or client.
What I built
- IPC-A-610 compliance mapping (the differentiator): built the module that grades each detected defect to ACCEPTABLE / PROCESS_INDICATOR / NONCONFORMING / DEFECT per IPC Class 1/2/3, with per-class tolerances and solder requirements, so the output is a recognized compliance verdict rather than a raw model label.
- Multi-model vision pipeline: wired YOLOv8 (Ultralytics 8.3.182, yolov8n/s/m/l/x via a FastAPI route) for multi-class detection, a from-scratch NeRF (PositionalEncoder, ray bundles, volume rendering) + Open3D for 3D solder-joint inspection, and a Stable Diffusion module (NoiseScheduler, CLIPTextEncoder, SafetyChecker via diffusers) for synthetic augmentation — though the only augmentation actually wired into the training pipeline is geometric OpenCV transforms, and the SD module's measured effect is not in the repo.
- Built end-to-end as solo developer: the dual-service FastAPI backend (VisionForge on :8000, standalone PCB_Vision API on :8001) and a tkinter live-inspection desktop GUI (image overlays, pass/fail status, batch processing).
Approach
Design decisions
-
Map detections to IPC-A-610 Class 1/2/3 compliance
Detected defects are classified against the IPC-A-610 industry acceptability standard via an explicit mapping module (PCB_Vision/core/ipc_standards.py + config), which encodes per-defect outcomes (ACCEPTABLE / PROCESS_INDICATOR / NONCONFORMING / DEFECT) for Class 1, Class 2, and Class 3 separately, plus per-class tolerance levels and solder requirements. Output is expressed as a recognized compliance category rather than a raw model label, making results actionable for quality control. This compliance-verdict layer is the platform's core differentiator.
Each detected defect is graded against IPC-A-610 Class 1/2/3, so the same defect can be acceptable under one class and nonconforming under a stricter one — output is a recognized compliance category, not a raw model label. -
Multi-model architecture instead of a single detector
Rather than relying on one model, the pipeline combines YOLOv8 for real-time 2D defect detection, a Stable Diffusion module for generative image synthesis, and a from-scratch NeRF + Open3D for 3D reconstruction. Each component targets a distinct need: fast 2D detection, training-data coverage, and 3D solder-joint geometry inspection. All four are present in the repo (ultralytics 8.3.182 in models/detection/yolo_detector.py; diffusers-based Stable Diffusion in advanced_vision/generative_ai.py; PyTorch NeRF in models/reconstruction/nerf_model.py; Open3D across models/vision3d and models/depth).
-
YOLOv8 for multi-class defect detection
YOLOv8 (Ultralytics 8.3.182, PyTorch) is the detection engine, producing bounding boxes and confidence scores. The FastAPI detection route accepts yolov8n/s/m/l/x variants (VisionForge/api/routes/detection.py), and the defect taxonomy is defined as a DefectType enum (PCB_Vision/core/defect_detector.py) covering solder_bridge, solder_cold_joint, solder_insufficient, component_misalignment, open_circuit and more. The defect data shipped in the repo is the open PKU-Market PCB dataset (missing_hole / mouse_bite / open_circuit / short / spur / spurious_copper).
-
Stable Diffusion generative module for the class-imbalance problem
Because rare defect types are underrepresented in PCB defect datasets, a Stable Diffusion generative-AI module (diffusers, with NoiseScheduler, CLIPTextEncoder, and a SafetyChecker in advanced_vision/generative_ai.py) is available to synthesize images and help balance the training distribution. Honest scope: the module exists and is exposed via the advanced-vision API, but no committed code path connects it to PCB defect-class balancing; the augmentation actually used in the training pipeline is geometric OpenCV transforms (DataAugmentationStep). The amount of synthetic data generated and its measured effect on accuracy/recall are not in the repo.
-
NeRF + Open3D for 3D solder-joint inspection
Solder-joint quality depends on 3D geometry that 2D images cannot fully capture, so a from-scratch NeRF (PositionalEncoder, ray bundles, volume rendering in models/reconstruction/nerf_model.py) and Open3D were integrated to reconstruct and analyze solder joints in 3D.
-
FastAPI backend + tkinter live-inspection desktop GUI
A FastAPI (Python 3.10+) backend serves the models as two services (VisionForge on :8000, standalone PCB_Vision API on :8001), and a tkinter desktop GUI (PCB_Vision/gui/app.py, documented in docs/FRONTEND_EN.md) provides live inspection feedback (image overlays, pass/fail status) plus batch processing of multiple boards.
-
GPU acceleration and containerized packaging
The system uses GPU acceleration (CUDA 12.1, PyTorch 2.1.0+cu121) and is packaged with Docker (deployment/docker/Dockerfile + docker-compose.yml, plus Kubernetes manifests under deployment/k8s) for reproducible setup. The repo does not contain committed throughput/latency/FPS benchmark output; README performance figures are self-reported and not backed by committed measurement files, so no quantitative performance number is claimed here.
In operation





Engineering foothold
| Claim | Evidence |
|---|---|
| Validated on the open PKU-Market PCB defect dataset (6 defect classes) | Demo-dataset/PCB_DATASET/Annotations/ contains the canonical 6-class PKU PCB defect set — Missing_hole / Mouse_bite / Open_circuit / Short / Spur / Spurious_copper (~115-116 Pascal-VOC XML annotations per class; 3034x1586 board images), identifying it as the public Peking University PCB defect dataset rather than client data. |
| Detects multiple PCB defect classes mapped to a rich internal taxonomy | DefectType enum in PCB_Vision/core/defect_detector.py defines SOLDER_BRIDGE, SOLDER_COLD_JOINT, SOLDER_INSUFFICIENT, COMPONENT_MISALIGNMENT, OPEN_CIRCUIT (plus ~15 more solder/component/trace types); defect_classes list enumerates the matching labels. |
| Classifies defects against the IPC-A-610 Class 1/2/3 acceptability standard | PCB_Vision/core/ipc_standards.py maps each defect to ACCEPTABLE/PROCESS_INDICATOR/NONCONFORMING/DEFECT per IPCClass.CLASS_1/2/3; PCB_Vision/config + pcb_inspection_config.yaml define per-class tolerances and solder requirements for all three classes. |
| Detection returns bounding boxes and confidence scores; supports YOLOv8 size variants | VisionForge/api/routes/detection.py exposes /single and batch detection returning DetectionBox + confidence and supports yolov8n/s/m/l/x variants. |
| Stable Diffusion generative-AI module is implemented (intended for synthetic-data / class imbalance) | VisionForge/advanced_vision/generative_ai.py implements DiffusionConfig, NoiseScheduler, CLIPTextEncoder, SafetyChecker and loads a StableDiffusion model via diffusers. No code path ties SD output to PCB defect-class balancing; the training-pipeline augmentation actually wired in is the geometric OpenCV DataAugmentationStep in core/preprocessing_implementations.py. |
| 3D solder-joint inspection via from-scratch NeRF + Open3D | From-scratch NeRF in VisionForge/models/reconstruction/nerf_model.py (PositionalEncoder, RayBundle, volume rendering) + advanced_vision/nerf_3d.py; Open3D used in models/vision3d/ and models/depth/. |
| Live inspection with pass/fail status and batch processing (tkinter desktop GUI) | PCB_Vision/gui/app.py (tkinter) implements batch inspection, passed/failed counters, and pass/fail verdict rendering; documented in docs/FRONTEND_EN.md as a tkinter desktop application. |
| GPU-accelerated and Docker/Kubernetes deployable | PyTorch 2.1.0+cu121, CUDA 12.1 (environment.yml, nvidia/cuda:12.1-runtime base in docs/ARCHITECTURE_EN.md); Docker + docker-compose.yml under deployment/docker, K8s manifests under deployment/k8s. No committed throughput/latency/FPS benchmark output exists. |
| Test suite present: 1,039 test functions across 58 test files | grep -rE 'def test_' over the repo: 1,039 test functions across 58 test_*.py files (48 under VisionForge/tests, 7 under PCB_Vision/tests, 3 top-level: PCB_Vision/test_system.py, VisionForge/test_depth.py, VisionForge/test_models.py). The README badge claims 95% coverage but no coverage report or pass-rate output is committed. |
Tech stack
- Deep Learning
- PyTorch 2.1.0+cu121, YOLOv8 (Ultralytics 8.3.182), Stable Diffusion (diffusers), TensorFlow 2.15.0
- 3D Reconstruction
- NeRF (from-scratch PyTorch), Open3D
- Backend
- FastAPI 0.116.1, Python 3.10+, OpenCV 4.12.0
- Frontend / UI
- tkinter desktop GUI (PCB_Vision)
- Infrastructure
- Docker + docker-compose, Kubernetes manifests, CUDA 12.1
- Standards / Domain
- IPC-A-610 Class 1/2/3
- Data
- Open PKU-Market PCB defect dataset (6 classes, Pascal-VOC annotations)