YOLO26s — Visor (Digital Display) Bounding Box
Fine-tuned YOLO26s (small) that detects the digital display (visor) of industrial meters — the digit-counter region — in field photos. One bounding box per image, ready to be cropped for downstream reading.
Resumo (pt-BR): modelo YOLO26s treinado para detectar a bounding box do visor digital em fotos de medidores. Dataset
nuven-mira/visor-bbox-v1.0(9039 imagens). Split 80/10/10 com seed 42 (7231/903/905). mAP50 = 0.992 · mAP50-95 = 0.877 no teste; melhor limiar de confiança 0.40 (F1 = 0.992). Supera o modelo anterior de visor em todos os recortes. Como treinar e replicar está na seção Training.
| Architecture | YOLO26s (Ultralytics, 260 layers) |
| Parameters / GFLOPs | 9,948,638 / 22.7 |
| Classes | 1 — visor_digital |
| Input | images (trained at 640 px, native 480×640) |
| Weights | yolo26s_visor-small-11-11-26.pt (20.3 MB, FP32) |
| Base checkpoint | yolo26s.pt pretrained on COCO |
| mAP50 / mAP50-95 (test) | 0.9922 / 0.8765 |
| Recommended confidence | 0.40 (max F1) |
| Speed (RTX 3050, batch 1) | 14.7 ms/img ≈ 68 FPS |
Dataset
Trained on nuven-mira/visor-bbox-v1.0:
9039 field photos of electricity meters (480×640), 9039 bounding boxes around
the digital display — 3768 annotated manually in Label Studio + 5271 produced
locally with SAM assistance and manual correction. YOLO format, CC BY 4.0,
flat (no official split).
Training (replicable)
Split — 80/10/10, seed 42
Deterministic, created by split_dataset.py:
- collect stems (filenames without extension) that have both image and label, sorted alphabetically;
random.Random(42).shuffle(stems);- cut 80% / 10% / 10% (
int(n*0.8),int(n*0.1), rest);
| Split | Images | Boxes |
|---|---|---|
| train | 7231 | 7231 |
| val | 903 | 903 |
| test | 905 | 905 |
Byte-identical duplicates (md5) are forced into the same split with a
deterministic swap (0 duplicates found). The exact file list of each split is
committed in split_manifest.json.
Hyperparameters
| Parameter | Value | Note |
|---|---|---|
| base checkpoint | yolo26s.pt | COCO pretrained |
| epochs | 100 | with early stopping |
| patience | 30 | stopped at epoch 95, best epoch 65 |
| imgsz | 640 | |
| batch | 4 effective | planned 16; fell back to 4 on OOM (GPU shared at the time). Gradient accumulation (nbs=64) keeps the effective batch. Use 16 on a free GPU |
| workers | 2 | |
| seed | 42 | deterministic=True |
| optimizer | auto (SGD), lr=0.01 | optimizer=auto |
| AMP | enabled |
Total wall time ≈ 6.3 h on a single NVIDIA RTX 3050 8 GB at batch 4 (~3–4 h at batch 16 on a free GPU).
Environment: Python 3.10.12 · Ultralytics 8.4.184 · PyTorch 2.11.0+cu128.
Reproduce from scratch
# 1. dataset (flat: images/ + labels/)
hf download nuven-mira/visor-bbox-v1.0 --repo-type dataset --local-dir datasets/visor-bbox-v1.0
# 2. split (seed 42, 80/10/10) -> datasets/visor-bbox-split/ + data.yaml
python split_dataset.py
# 3. train (early stopping; save_dir holds best.pt / last.pt)
yolo detect train model=yolo26s.pt data=datasets/visor-bbox-split/data.yaml \
epochs=100 imgsz=640 batch=16 workers=2 seed=42 deterministic=True patience=30
# 4. evaluate on the test split
python metrics_report.py --split test
Metrics (test split — 905 unseen images)
Matching TP/FP at IoU ≥ 0.5 (greedy, by descending confidence).
| Metric | Value |
|---|---|
| mAP50 | 0.9922 |
| mAP50-95 | 0.8765 |
| AP50 / AP75 / AP50-95 (101-pt COCO) | 0.9869 / 0.9578 / 0.8703 |
| Precision / Recall (Ultralytics val) | 0.9920 / 0.9923 |
| Confidence at max F1 | 0.40 |
| P / R / F1 @ 0.40 | 0.9923 / 0.9923 / 0.9923 |
| TP / FP / FN @ 0.40 | 898 / 7 / 7 |
| ECE (calibration) | 0.0884 |
| Latency (RTX 3050, batch 1) | 14.7 ms/img ≈ 68 FPS |
Operating threshold
| Threshold | Precision | Recall | F1 | TP | FP | FN |
|---|---|---|---|---|---|---|
| 0.25 | 0.9879 | 0.9923 | 0.9901 | 898 | 11 | 7 |
| 0.40 (max F1) | 0.9923 | 0.9923 | 0.9923 | 898 | 7 | 7 |
| 0.50 | 0.9923 | 0.9923 | 0.9923 | 898 | 7 | 7 |
Confidence distribution (conf ≥ 0.25)
| Set | n | mean | median | std | p10 | p90 |
|---|---|---|---|---|---|---|
| All detections | 909 | 0.894 | 0.908 | 0.064 | 0.831 | 0.954 |
| TPs | 898 | 0.896 | 0.908 | 0.052 | 0.832 | 0.954 |
| FPs | 11 | 0.680 | 0.857 | 0.264 | 0.316 | 0.890 |
Localization quality (898 TPs @ conf ≥ 0.40)
| Metric | mean | median | p10 | p90 |
|---|---|---|---|---|
| IoU | 0.9253 | 0.9533 | 0.8237 | 0.9884 |
| Center error (px) | 2.17 | 1.22 | 0.30 | 4.47 |
| Relative width error | 2.2% | 0.8% | 0.1% | 4.4% |
| Relative height error | 4.7% | 2.1% | 0.3% | 12.6% |
Robustness
| GT box size (area quartile) | GT | Recall |
|---|---|---|
| Q1 (smallest, < 8742 px²) | 226 | 0.9956 |
| Q2 | 226 | 0.9867 |
| Q3 | 226 | 1.0000 |
| Q4 (largest) | 227 | 0.9868 |
- 99.2% of images with perfect recall; 0% with zero detections
- 0.8% with ≥1 FP (0.008 FP/image)
Comparison with the previous visor model
Previous model: yolo26s_visor-small-23-10-26 (trained only on the 5271
local images). Evaluated on the same splits:
| Split | Model | mAP50 | mAP50-95 | F1 (conf) | median IoU |
|---|---|---|---|---|---|
| test (905) | this model | 0.9922 | 0.8765 | 0.9923 (0.40) | 0.9533 |
| test (905) | previous (23-10-26) | 0.9418 | 0.7583 | 0.8827 (0.44) | 0.9250 |
| test LS-only (378) | this model | 0.9899 | 0.7303 | 0.9894 (0.40) | 0.8852 |
| test LS-only (378) | previous | 0.9657 | 0.6448 | 0.9210 (0.09) | 0.8542 |
The full test favors the previous model (it trained on ~46% of those images); this model still wins comfortably. LS-only (378) is the fair subset — Label Studio images never seen in training by either model — and the advantage holds.
Machine-readable metrics: metrics/test/report.json.
How to use
from ultralytics import YOLO
model = YOLO("yolo26s_visor-small-11-11-26.pt")
res = model.predict("meter_photo.jpg", imgsz=640, conf=0.40)[0]
for box in res.boxes:
x1, y1, x2, y2 = box.xyxy[0].tolist() # visor box, pixels
conf = float(box.conf[0])
Or with hf_hub_download:
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
path = hf_hub_download("nuven-mira/yolo26s-visor-small-11-11-26",
"yolo26s_visor-small-11-11-26.pt")
model = YOLO(path)
Limitations
- Very dirty/reflective glass remains the hardest case (see errors).
- Trained on meter front-panel field photos; other products may need fine-tuning.
- One box per display; digit reading is a separate OCR step.
Links
- Dataset: nuven-mira/visor-bbox-v1.0
- Training experiment (scripts + full report):
experiments/visor-bbox/in the nuven-mira/mira-ia-lab repository - Previous visor model: nuven-mira/yolo26s-visor-23-10-26
- Companion serial-number model: nuven-mira/yolo26s-serial-small-10-11-26
License
CC BY 4.0 — same as the training dataset.