You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
omidgh1379
changed the title
adding normalization at inferece layer for applying temp scaling in yolov8n
adding normalization at inferece level for applying temp scaling in yolov8n
May 18, 2025
👋 Hello @omidgh1379, thank you for reaching out and for your interest in YOLOv5 🚀! This is an automated response to help you get started—an Ultralytics engineer will assist you further soon.
For questions involving inference normalization, temperature scaling, or custom model modifications, please provide a minimum reproducible example (MRE) if possible. This helps us understand and debug your scenario more efficiently.
If your issue relates to 🐛 bugs, please share the smallest code snippet and dataset sample that reproduces the problem. For custom training or inference questions, include relevant code, logs, and any clarifying details about your dataset or model setup. You can also review our Tips for Best Training Results for guidance.
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.
I notice you're asking about YOLOv8n normalization in the YOLOv5 repository. For consistency between training and inference, you should apply the same normalization in both stages. Since you trained with images normalized by dividing by 255, you should maintain this during inference.
If you're experiencing confidence calibration issues, temperature scaling should be applied to the model's output logits after normalization, not as a replacement for input normalization. The division by 255 is correct for input preprocessing.
For optimal temperature scaling:
Keep your input normalization consistent (img = img / 255)
Apply temperature scaling to the output logits (dividing logits by your learned temperature parameter)
Fine-tune the temperature parameter on a validation set
If you're specifically working with YOLOv8n, you might want to check the Ultralytics YOLOv8 repository for architecture-specific details, as there could be slight differences in how normalization is handled.
Originally posted by @omidgh1379 in #12063
The text was updated successfully, but these errors were encountered: