PCB Bare-Board Defect Detection (YOLO26s)
A YOLO26-based object detector that finds manufacturing defects on bare printed circuit boards — the inspection step before any components are placed: missing holes, mouse bites, open circuits, shorts, spurs, spurious copper, and pin holes.
Part of the PCB Inspection Suite. Trained on ParsaVictor/pcb-bare-board-defect-detection.
Metrics
| Split | mAP50 | mAP50-95 |
|---|---|---|
| val | 0.895 | 0.601 |
| test | 0.928 | 0.617 |
Trained: YOLO26s, imgsz 1024, 80 epochs (best at epoch 17), online augmentation, close_mosaic scheduled.
Known weaknesses
shortclass recall is weaker (F1-optimal threshold ≈0.41, lower confidence than most classes)open_circuitrecall drops to ~70% at its F1-optimal threshold (0.77) — prefer the lower global threshold if recall matters more than precision for this class
Per-class confidence thresholds (F1-optimal on val)
| Class | Threshold |
|---|---|
| missing_hole | 0.745 |
| mouse_bite | 0.484 |
| open_circuit | 0.770 |
| short | 0.406 |
| spur | 0.382 |
| spurious_copper | 0.330 |
| pin_hole | 0.571 |
A global fallback threshold of 0.465 is used for any class with too few validation examples to tune individually.
Usage
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
weights = hf_hub_download("ParsaVictor/pcb-bare-board-defect-detection-yolo26", "best.pt")
model = YOLO(weights)
results = model.predict("your_board_photo.jpg", conf=0.465)
results[0].show()
For best accuracy, apply the per-class thresholds above instead of one global confidence value — see thresholds.json in this repo.
Related
- Training dataset: pcb-bare-board-defect-detection
- Sibling model: pcb-solder-defect-detection-yolo26
- Full suite overview: pcb-inspection-suite
License
Research/development use — see the dataset license. Contact the author before commercial use.