New Release: Ultralytics v8.4.40

Ultralytics v8.4.40 is here :rocket:

Summary

Ultralytics v8.4.40 adds a highly practical upgrade to Ultralytics YOLO validation: per-image precision, recall, F1, TP, FP, and FN tracking. This makes it much easier to identify exactly which images your model handles well and which ones need attention. :chart_increasing::framed_picture:

This release is especially useful for debugging, dataset cleanup, and iterative model improvement, and it works cleanly in both single-GPU and distributed validation workflows.

New Features :sparkles:

Per-image validation metrics

With v8.4.40, validation now records image-level metrics including:

  • precision
  • recall
  • f1
  • tp
  • fp
  • fn

These are exposed through metrics.box.image_metrics, and also apply to segmentation and pose metrics where supported. :white_check_mark:

This is a big step forward for anyone who wants more than just dataset-wide averages. Instead of only seeing overall mAP and aggregate scores, you can now inspect performance image by image and quickly spot weak samples. :bullseye:

Better visibility for error analysis

Per-image metrics help you:

  • find hard or mislabeled images faster
  • identify false-positive-heavy samples
  • discover images with missed detections
  • make better decisions about relabeling, augmentation, and dataset balancing

For teams working with Ultralytics Platform or validating newer models like YOLO26, this brings much more actionable insight into model quality. :brain:

Improvements :wrench:

Validation pipeline updates

The detection validation pipeline was updated to:

  • store image names
  • compute image-level stats consistently with validation matching logic
  • keep results aligned with how validation already determines matches

Distributed validation support

Multi-GPU validation now correctly gathers and merges image_metrics across ranks, so image-level results remain complete even in larger distributed runs. :gear:

Metrics class enhancements

The metrics classes now include:

  • image_metrics storage
  • update helpers
  • clear/reset helpers

These changes help prevent stale metrics from carrying over between runs and make the new functionality easier to use programmatically.

Documentation Updates :books:

The docs were also updated to show how to access and use these new metrics across task guides, including:

  • detect
  • segment
  • pose
  • OBB
  • insights
  • custom trainer workflows

Why this matters :light_bulb:

This release makes validation much more actionable:

  • Faster debugging: pinpoint weak images directly
  • Better dataset curation: identify samples causing FP/FN spikes
  • Improved evaluation: move beyond averages to image-level insight
  • Reliable at scale: works in distributed validation too

For many users, especially those training and validating YOLO26 models, this should make iteration cycles noticeably faster. :repeat_button:

What changed

Quick example

Here’s a simple example of how to access validation metrics in Python:

from ultralytics import YOLO

model = YOLO("yolo26n.pt")
metrics = model.val(data="coco8.yaml")

print(metrics.box.image_metrics[:3])

Try it out :test_tube:

You can upgrade with:

pip install -U ultralytics

If you’d like to explore everything included in this release, check out the v8.4.40 release page or browse the full changelog from v8.4.39 to v8.4.40.

Please give v8.4.40 a try and let us know how the new per-image metrics fit into your validation workflow. Feedback, edge cases, and suggestions are always welcome! :handshake: