YOLOV5学习笔记(九)——损失函数
yolov5
yolov5 - Ultralytics YOLOv8的前身,是一个用于目标检测、图像分割和图像分类任务的先进模型。
项目地址:https://gitcode.com/gh_mirrors/yo/yolov5
·
1、Yolov5损失函数分析

2、bbox 回归损失
v5 使用的是 CIoU Loss,后续又优化出EIOU Loss如下所示
![]()
![]()
论文:Focal and efficient IOU loss for accurate bounding box regression
3、目标置信度损失
目标置信度损失由正样本匹配得到的样本对计算,一是预测框中的目标置信度分数 p0,二是预测框和与之对应的目标框的 iou 值piou,其作为 ground-truth。两者计算二进制交叉熵得到最终的目标置信度损失。
表示二分类交叉熵损失;
表示正样本的权重公式如下:
![]()
4、类别损失
别损失与置信度损失类似,通过预测框的类别分数和目标框类别的 one-hot 表现来计算类别损失,目标置信度损失和类别损失使用的是带 sigmoid 的二进制交叉熵函数BCEWithLogitsLoss。
![]()
yolov5 - Ultralytics YOLOv8的前身,是一个用于目标检测、图像分割和图像分类任务的先进模型。
最近提交(Master分支:27 天前 )
cd44191c
* Bump slackapi/slack-github-action in /.github/workflows
Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/slackapi/slack-github-action/releases)
- [Commits](https://github.com/slackapi/slack-github-action/compare/v2.0.0...v2.1.0)
---
updated-dependencies:
- dependency-name: slackapi/slack-github-action
dependency-version: 2.1.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* Auto-format by https://ultralytics.com/actions
* Update README.md
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Auto-format by https://ultralytics.com/actions
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> 5 天前
a493afe1
* Update Ultralytics Actions permissions
* Update format.yml
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update format.yml
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Auto-format by https://ultralytics.com/actions
---------
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> 14 天前
更多推荐




所有评论(0)