CoolFace
Modelpublic

Arshia82sbn/pcb-yolov8s-detection

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes63downloads
Model Card

PCB Object Detection - YOLOv8s

A fine-tuned YOLOv8s model for detecting 21 types of PCB (Printed Circuit Board) components. Trained for 90 epochs on a custom PCB dataset with 1,788 training images and 173 validation images.

Model Details

PropertyValue
ModelYOLOv8s (small)
TaskObject Detection
Input Size640x640
Classes21 PCB component types
Training Epochs90
OptimizerAdamW
Learning Rate0.01
Batch Size8
Seed42
AMPEnabled
DeviceCUDA (GPU 0)

Performance Metrics (Epoch 69 - Best)

MetricValue
Precision0.761
Recall0.571
mAP@0.50.619
mAP@0.5:0.950.400

Per-Class mAP@0.5

ClassmAP@0.5
relay0.984
buzzer0.953
display0.933
ic0.801
battery0.799
switch0.788
button0.860
potentiometer0.700
resistor0.635
transistor0.629
connector0.602
capacitor0.587
diode0.556
clock0.561
led0.523
inductor0.384
fuse0.339
pads0.012
pins0.119
heatsink0.000

21 PCB Classes

battery, button, buzzer, capacitor, clock, connector, diode, display, fuse, heatsink, ic, inductor, led, pads, pins, potentiometer, relay, resistor, switch, transformer, transistor

Training Configuration

yaml
task: detect
model: yolov8s.pt
epochs: 90
imgsz: 640
batch: 8
lr0: 0.01
lrf: 0.01
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
optimizer: auto
seed: 42
deterministic: true
amp: true
augmentations:
  hsv_h: 0.015
  hsv_s: 0.7
  hsv_v: 0.4
  fliplr: 0.5
  mosaic: 1.0
  erasing: 0.4

Usage

Installation

bash
pip install ultralytics

Inference

python
from ultralytics import YOLO

model = YOLO("best.pt")
results = model.predict("path/to/pcb_image.jpg", conf=0.25)

for result in results:
    boxes = result.boxes
    print(f"Detected {len(boxes)} objects")
    for box in boxes:
        cls = int(box.cls[0])
        conf = float(box.conf[0])
        xyxy = box.xyxy[0].tolist()
        print(f"  Class: {model.names[cls]}, Confidence: {conf:.3f}, Box: {xyxy}")

Export to ONNX

python
from ultralytics import YOLO

model = YOLO("best.pt")
model.export(format="onnx", imgsz=640, simplify=True)

Files

FileDescription
best.ptBest model checkpoint (epoch 69)
last.ptLast epoch checkpoint
best.onnxONNX exported model
results.csvTraining metrics per epoch
training_args.yamlFull training configuration
results.pngTraining curves
confusion_matrix.pngConfusion matrix
confusion_matrix_normalized.pngNormalized confusion matrix
BoxF1_curve.pngF1-Confidence curve
BoxP_curve.pngPrecision-Confidence curve
BoxPR_curve.pngPrecision-Recall curve
BoxR_curve.pngRecall-Confidence curve
labels.jpgLabel distribution

Training Results

[image]

[image]

[image]

Dataset

This model was trained on the Detecting the PCB Object dataset from Roboflow Universe.

  • —Training images: 1,788
  • —Validation images: 173
  • —Test images: Available
  • —Image size: 640x640

Citation

If you use this model, please cite:

@misc{pcb_object_detection_yolov8,
  title={PCB Object Detection using YOLOv8s},
  author={Arshia},
  year={2026},
  publisher={Hugging Face},
  note={Fine-tuned YOLOv8s model for 21-class PCB component detection}
}

License

This model is released under the MIT License.