pypi ultralytics 8.4.68
v8.4.68 - Semantic segmentation class weights (#24843)

6 hours ago

🌟 Summary

Ultralytics v8.4.68 is mainly a training-quality and reliability release, led by a major improvement for semantic segmentation: you can now use class weighting to better handle imbalanced datasets 🎯🧠

📊 Key Changes

  • Semantic segmentation now supports class weights via cls_pw 🖼️⚖️

    • Added in PR #24843 by @Y-T-G.
    • This is the headline change in the release.
    • Previously, semantic segmentation did not support user-configurable class weighting.
    • Now, training can emphasize underrepresented classes, which is especially useful when some classes appear far less often than others.
  • Default semantic training behavior stays the same 🔒

    • If cls_pw is not set, or is 0, Ultralytics keeps the previous behavior.
    • Existing Cityscapes-specific weighting is still used automatically when appropriate.
    • This means current training pipelines should continue working without surprises.
  • Better weighting logic for segmentation 🧮➡️🧠

    • Semantic segmentation now uses a weighting approach based on class pixel frequency that is more suitable for dense pixel-level tasks than the method used in detection.
    • This helps avoid overly extreme weighting while still giving rare classes more importance.
  • More robust handling of missing or unreadable labels/masks 🛠️

    • The new class-counting logic safely handles cases where labels or masks are missing or unreadable.
    • Instead of breaking training, it can fall back more gracefully.
  • Detection classification loss can now apply class weights too 📦

    • The release also refactors class counting and weighting into reusable trainer helpers.
    • Detection training now applies computed class weights directly in the classification loss.
  • Several production stability fixes 🚑

    • PR #24840 by @glenn-jocher fixes four real-world issues:
      • crash from empty prediction batches
      • corrupt cached AMP asset loading
      • truncated downloads
      • invalid non-mapping YAML files
    • These changes improve day-to-day reliability for training and inference.
  • Safer model loading on older PyTorch versions 🔐

    • PR #24830 by @glenn-jocher makes restricted loading fall back cleanly on torch<2.5 instead of erroring out.
    • Helpful for older toolchains and export workflows.
  • Security fix for similarity search UI 🛡️

    • PR #24828 escapes user query input properly to prevent a high-severity browser injection issue.
  • Docs and platform updates 📚

    • Added Windows on Snapdragon QNN benchmarks for YOLO26n across all six tasks, showing strong NPU speedups 🚀
    • Updated Ultralytics Platform GPU pricing docs 💳
    • Large cleanup of broken links, page titles, URLs, and navigation for smoother docs browsing.

🎯 Purpose & Impact

  • Better semantic segmentation on imbalanced datasets 🌍

    • If your dataset has rare classes like small road signs, defects, or medical regions, the model can now pay more attention to them during training.
    • This may improve results where minority classes were previously overlooked.
  • Safer upgrade path

    • Because default behavior is preserved unless you use cls_pw, most users can upgrade without changing existing results.
  • More control for advanced users 🎛️

    • Researchers and practitioners training custom semantic datasets now get a useful tuning option that was missing before.
  • Improved robustness in production 🏭

    • Fewer crashes from bad files, corrupt caches, malformed YAML, or odd input batches means smoother automation and more reliable pipelines.
  • Broader hardware confidence 💻

    • The new Windows on Snapdragon benchmark documentation helps users evaluate YOLO26 deployment on modern ARM laptops and NPU hardware.
  • Better security and compatibility 🔒

    • Safer web templates and graceful fallback behavior on older PyTorch versions reduce friction for both developers and deployers.

Overall, v8.4.68 is a practical quality release with its biggest win being more capable and customizable semantic segmentation training, plus several important fixes that make Ultralytics more stable and dependable in real-world use 🚀

What's Changed

New Contributors

Full Changelog: v8.4.67...v8.4.68

Don't miss a new ultralytics release

NewReleases is sending notifications on new releases.