← All answersAccuracy & training

Why is my YOLO model not accurate?

Short answer

In most cases a YOLO model is inaccurate because of the data, not the model. The usual causes are too few labelled examples, wrong or inconsistent labels, class imbalance, a mismatch between training images and real-world conditions, or training at the wrong image size. Fix the data before changing the architecture.

It is tempting to reach for a bigger model or more epochs, but after training thousands of detectors the pattern is clear: accuracy problems are usually data problems. Work through this list roughly in order.

1. Not enough labelled data

A few dozen images per class is rarely enough for production. Aim for enough examples that every class appears in many contexts, angles, and lighting conditions. Pretrained weights and augmentation help, but they do not replace real, varied data.

2. Wrong or inconsistent labels

Missing boxes, loose boxes, and inconsistent class definitions teach the model the wrong thing. Every unlabelled object in a training image is actively telling the model 'this is background'. Audit a random sample of your labels by eye, you will usually find the problem there.

3. Class imbalance

If one class has 10,000 instances and another has 80, the rare class will be weak. Collect more of the rare class, or balance sampling so it is seen often enough.

4. A domain gap between training and reality

Training on clean stock photos and deploying on a grainy CCTV feed will disappoint. Your validation set must look like the real cameras, angles, and conditions you deploy to, otherwise good validation numbers lie.

5. Image size and thresholds

  • Small objects need a larger imgsz (e.g. 1280 instead of 640).
  • Too high a confidence threshold hides real detections; too low a threshold floods you with false positives. Tune it on your validation set.

How to diagnose it

Run validation and read the confusion matrix and per-class metrics. Low recall on a class means the model is missing it (more or better data). Low precision means false positives (label noise, threshold, or hard negatives). Let the numbers point you at the cause instead of guessing.

from ultralytics import YOLO

model = YOLO("runs/detect/train/weights/best.pt")
metrics = model.val()          # per-class precision/recall, mAP50, mAP50-95
print(metrics.box.maps)        # mAP per class, find the weak ones

Stuck on this in a real project?

Book a free call and I’ll give you a straight answer on your specific case.

Book a consultation