Skip to content
ModelListedExternal
Download

NoBSPCB

This model is a modified YOLOv8n architecture with an additional Dropout layer (p=0.1) placed before the Detect head. It is designed for detecting 6 types of PCB defects: missinghole mousebite opencircuit short spur...

KindOtherVersionRevision e1be300

Model source

Kind
Other
File size
17.5 MB
Version
vRevision e1be300
Updated
Sep 19, 2026
Downloads
2
Source
Hugging Face

Source description

noBSPCB: PCB Defect Detection with Monte Carlo Dropout

Model Description

This model is a modified YOLOv8n architecture with an additional Dropout layer (p=0.1) placed before the Detect head. It is designed for detecting 6 types of PCB defects:

  • missing_hole
  • mouse_bite
  • open_circuit
  • short
  • spur
  • spurious_copper

The model supports Monte Carlo Dropout (MCD) inference: running multiple forward passes with Dropout enabled to estimate epistemic uncertainty. The variance of confidence scores across passes indicates prediction reliability.

Training Dataset

  • Source: PCB Defect dataset (Norbert Elter, Peking University)
  • Size: 10,668 images
  • Split: train/val/test (8534/1066/1068)

Key Results

MetricValue
mAP@0.50.978
False Positives (on test set)30
Recall0.987
Inference time (CPU)31 ms (baseline) / 628 ms (MCD)

The hybrid pipeline achieves 91.5% false positive reduction compared to baseline YOLOv8n.

Usage

Standard Inference

from ultralytics import YOLO

model = YOLO("oborxel/noBSPCB")
results = model("path/to/pcb_image.jpg")

Monte Carlo Dropout Inference

For uncertainty estimation, multiple passes are required:

from ultralytics import YOLO
import torch
import numpy as np

def enable_dropout(model):
    for m in model.model.modules():
        if isinstance(m, torch.nn.Dropout):
            m.train()

model = YOLO("oborxel/noBSPCB")
model.model.eval()
enable_dropout(model.model)

num_passes = 30
all_confs = []

for _ in range(num_passes):
    results = model("image.jpg", verbose=False)
    if results[0].boxes is not None:
        confs = results[0].boxes.conf.cpu().numpy()
        all_confs.extend(confs)

variance = np.var(all_confs) if all_confs else 0.0
print(f"Uncertainty (variance): {variance:.4f}")
print(f"Verdict: {'defect' if variance < 0.02 else 'uncertain'}")

License

MIT

Citation

If you use this model in your work, please cite:

@software{noBSPCB,
  author = {Chukhlov, Alexander},
  title = {noBSPCB: PCB Defect Detection with Monte Carlo Dropout},
  year = {2026},
  url = {https://github.com/ex-alander/noBSPCB}
}

Sources

1 source
Hugging FacePrimaryVersion e1be3001e763d9c09d0135390697dee0bab8a8ce
huggingface.co/oborxel/noBSPCB/tree/e1be3001e763d9c09d0135390697dee0bab8a8ce

Verified Sep 9

Model artifacts

1 artifact

best.pt

pt · 17.5 MB · SHA-256 66be749622b9…76fd · Hugging Face

Download

Source excerpts

2 excerpts

--- license: mit library_name: ultralytics pipeline_tag: object-detection tags: - pcb - defect-detection - yolov8 - mc-dropout - uncertainty-quantification --- # noBSPCB: PCB Defect Detection with Monte Carlo Dropout ## Model Description This model is a modified YOLOv8n architecture with an additional Dropout layer (p=0.1) placed before the Detect head. It is designed for detecting 6 types of PCB defects: - missing_hole - mouse_bite - open_circuit - short - spur - spurious_copper The model supports Monte Carlo Dropout (MCD) inference: running multiple forward passes with Dropout enabled to estimate epistemic uncertainty. The variance of confidence scores across passes indicates prediction reliability. ## Training Dataset - **Source:** PCB Defect dataset (Norbert Elter, Peking University) - **Size:** 10,668 images - **Split:** train/val/test (8534/1066/1068) ## Key Results | Metric | Value | |--------|-------| | mAP@0.5 | 0.978 | | False Positives (on test set) | 30 | | Recall | 0.987 | | Inference time (CPU) | 31 ms (baseline) / 628 ms (MCD) | The hybrid pipeline achieves 91.5% false positive reduction compared to baseline YOLOv8n. ## Usage ### Standard Inference ```python from ultralytics import YOLO model = YOLO("oborxel/noBSPCB") results = model("path/to/pcb_image.jpg") ``` ### Monte Carlo Dropout Inference For uncertainty estimation, multiple passes are required: ```python from ultralytics import YOLO import torch import numpy as np def enable_dropout(model): for m in model.model.modules(): if isinstance(m, torch.nn.Dropout): m.train() model = YOLO("oborxel/noBSPCB") model.model.eval() enable_dropout(model.model) num_passes = 30 all_confs = [] for _ in range(num_passes): results = model("image.jpg", verbose=False) if results[0].boxes is not None: confs = results[0].boxes.conf.cpu().numpy() all_confs.extend(confs) variance = np.var(all_confs) if all_confs else 0.0 print(f"Uncertainty (variance): {variance:.4f}") print(f"Verdict: {'defect' if variance < 0.02 else 'uncertain'}") ``` ## License MIT ## Citation If you use this model in your work, please cite: ``` @software{noBSPCB, author = {Chukhlov, Alexander}, title = {noBSPCB: PCB Defect Detection with Monte Carlo Dropout}, year = {2026}, url = {https://github.com/ex-alander/noBSPCB} } ```

Source context: 2 downloads · 1 likes · Pipeline object-detection · Library ultralytics · Repo oborxel/noBSPCB