BobNet YOLOv26n โ€” Microbubble Detection

Single-class detection model for microbubbles in optical microscopy images, distilled from a Cellpose-SAM teacher via pseudolabels.

Usage

from ultralytics import YOLO
import math

model = YOLO("callumtilbury/bobnet-yolov26n/best.pt")
results = model.predict("image.png", conf=0.34, max_det=300)

# Convert bbox to diameter
PIXEL_SIZE_UM = 0.0825
for r in results:
    for box in r.boxes.xywh.cpu().numpy():
        w, h = box[2], box[3]
        d_px = (min(w, h) + math.sqrt(w * h)) / 2
        d_um = d_px * PIXEL_SIZE_UM
        print(f"diameter = {d_um:.2f} um")

Metrics

Metric Value
diameter_mape 1.10%
count_pct_diff 4.25%
best_conf 0.34
model yolo26n
n_train_images 81
epochs 200

Diameter Formula

Blended bbox-to-circle: d_px = (min(w,h) + sqrt(w*h)) / 2, then d_um = d_px * 0.0825.

This formula was empirically shown to outperform mask-based equivalent diameters because rectangular mask artifacts inflate the equivalent diameter.

Domain Caveat

This model is trained on pseudolabels from a specific optical microscope setup. Do not expect generalisation to other microscopes, magnifications, or imaging modalities without retraining or domain adaptation.

Training

  • Architecture: yolo26n (pretrained on COCO, fine-tuned on bobnet-bubbles)
  • Dataset: callumtilbury/bobnet-bubbles (81 train images, 20 val images)
  • Phase 1: 200 epochs, lr0=0.002, imgsz=640, batch=8, patience=50
  • Phase 2: 50 epochs, lr0=0.0005 fine-tune from best Phase 1 checkpoint
  • Teacher: Cellpose-SAM (not included; pseudolabels only)
Downloads last month
53
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support