Note: These two models were trained on different datasets (DeepPCB vs. DsPCBSD+) with different class counts and difficulty levels, so this is not a strictly apples-to-apples benchmark — it's meant to help you choose the right model for your use case.
DsPCBSD+ is a meaningfully harder benchmark than DeepPCB:
More classes (9 vs. 6) increases inter-class confusion risk
Class imbalance is more pronounced (spur: 929 instances vs. short: 169, a ~5.5x gap)
Higher intra-class variability — especially for conductor_scratch and conductor_foreign_object, which vary widely in size, shape, and appearance
DeepPCB's defects are more visually distinct and the dataset itself is smaller and cleaner by design
A lower mAP on DsPCBSD+ does not mean this model is "worse" — it reflects a genuinely harder detection problem with more real-world defect diversity.
Which model should you use?
Use the YOLOv8s / DeepPCB model if your defects match DeepPCB's 6 categories (open, short, mousebite, spur, copper, pin-hole) and you're working with grayscale linear-scan imagery — it's faster and more accurate for that specific defect set.
Use the YOLOv8m / DsPCBSD+ model (this repo) if you need broader defect coverage, including hole breakout, conductor scratches, and foreign object contamination — categories DeepPCB doesn't cover at all.
Model Description
This repository hosts a YOLOv8m object detection model fine-tuned on DsPCBSD+, a large-scale (10,259 image, 20,276 annotation) PCB surface defect dataset covering 9 defect categories across conductors, holes, and base material. This is a substantially harder detection task than DeepPCB — defects are smaller, more varied in shape/scale, and the class distribution is imbalanced.
Alongside the detection weights, this repository includes inspector.py, a companion knowledge-base module providing explanation, severity, root cause, impact, and recommended action per detected defect. This is a deterministic rules layer, not the model itself generating text — best.pt outputs class, bounding box, and confidence only.
Architecture: YOLOv8m (Ultralytics), single-stage anchor-free object detector
Base weights:yolov8m.pt (COCO-pretrained, then fine-tuned)
conductor_foreign_object (mAP50 0.701) and conductor_scratch (mAP50 0.731) are the weakest classes — these defects have high intra-class variability in size, shape, and color, making them inherently harder to detect consistently.
Trained on 226×226-native PCB crop images; performance on full, un-cropped board images has not been separately validated.
Class distribution is imbalanced (spur: 929 instances vs. short: 169); rare-class performance may vary more across different data splits.
The inspector.py explanations are drawn from a static, hand-curated knowledge base — general guidance, not image-specific diagnosis.
Research/baseline model — not validated for production deployment without further testing on real manufacturing data.
Repository Contents
best.pt — fine-tuned YOLOv8m weights
inspector.py — companion module with severity/root-cause/impact/action knowledge base
metrics_chart.png — per-class performance chart
results.png — training loss/metric curves across all epochs
confusion_matrix.png — normalized confusion matrix across all 9 classes
sample*_input.jpg / sample*_predicted.jpg — example detections
Original dataset: Lv, S. et al. "A dataset for deep learning based detection of printed circuit board surface defect." Scientific Data 11, 811 (2024). https://doi.org/10.1038/s41597-024-03656-8
Dataset access:janani-v-sdspd/dspcbsd-plus on Roboflow Universe