[论文笔记] Generalized Intersection over Union

[论文笔记] Generalized Intersection over Union

论文链接
在这里插入图片描述

一,大纲

​ 包围框回归是2D/3D 视觉任务中一个最基础的模块,不管是目标检测,目标跟踪,还是实例分割,都依赖于对bounding box进行回归,以获得准确的定位效果。目前基于深度学习的方法想获得更好的检测性能,要么是用更好的backbone,要么是设计更好的策略提取更好的feature,然而却忽视了bounding box regression中L1、L2 loss这个可以提升的点。

​ 而在该篇论文中,作者先表明了常用的Ln LOSS没法很好地体现出regression的效果,然后分析了直接使用IOU指标(判断predict box和gt的距离的最直接的指标)作为损失函数的利弊,然后提出了改进指标GIOU并用GIoU loss替换掉了大多数目标检测算法中bounding box regression loss,最后接用实验结果证明了GIOU的优越性。

二,Ln LOSS的不足

​ 首先,IoU是目标检测中最常用的评估尺度,它是一种比值的概念,具有scale不敏感的特性。

​ 目前,检测任务通常都是采用回归损失(如MSE loss, smooth l1 loss)作为网络的目标函数,用IoU作为评估的尺度,但是这两者之间实际上是不等价的(如下图)

### GIoU 参考文献及本科论文格式写法 #### 1. GIoU 的参考文献 GIoUGeneralized Intersection over Union)的提出基于一篇发表于 CVPR 2019论文,标题为《Generalized Intersection over Union: A Metric and A Loss for Bounding Box Regression》[^1]。这篇论文详细介绍了 GIoU 的定义、计算方法及其在目标检测中的应用。 以下是 GIoU 的主要参考文献: - Rezatofighi, H., Tsoi, N., Gwak, J., Sadeghian, A., Reid, I., & Savarese, S. (2019). Generalized Intersection over Union: A Metric and A Loss for Bounding Box Regression. *CVPR 2019*. [PDF](https://arxiv.org/abs/1902.09630)[^1] 此外,后续研究中提出了 DIoU 和 CIoU,这些改进版本进一步提升了边界框回归的性能。相关文献包括: - Zheng, Z., Dai, J., & Sun, Y. (2020). Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression. *AAAI 2020*. [PDF](https://arxiv.org/abs/1911.08287)[^2] - Zheng, Z., Dai, J., & Sun, Y. (2021). Towards Real-Time Object Detection with Region Proposal Networks. *TPAMI 2021*. [PDF](https://arxiv.org/abs/2005.00064)[^3] #### 2. 本科论文参考文献格式写法 根据本科论文的要求,参考文献通常需要按照特定的格式书写。以下是一些常见的参考文献格式示例: ##### (1)APA 格式 Rezatofighi, H., Tsoi, N., Gwak, J., Sadeghian, A., Reid, I., & Savarese, S. (2019). Generalized intersection over union: A metric and a loss for bounding box regression. *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)*, 658–666. https://doi.org/10.1109/CVPR.2019.00075[^1] ##### (2)IEEE 格式 H. Rezatofighi, N. Tsoi, J. Gwak, A. Sadeghian, I. Reid, and S. Savarese, "Generalized intersection over union: A metric and a loss for bounding box regression," in *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)*, 2019, pp. 658-666[^1]. ##### (3)MLA 格式 Rezatofighi, Hamid, et al. "Generalized Intersection Over Union: A Metric and A Loss for Bounding Box Regression." *Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)*, 2019, pp. 658-666. ##### (4)GB/T 7714 格式 Rezatofighi H, Tsoi N, Gwak J, et al. Generalized intersection over union: A metric and a loss for bounding box regression[J]. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019: 658-666[^1]. #### 3. 示例代码 以下是 GIoU 的 Python 实现示例: ```python import torch def generalized_iou_loss(pred, target): x1 = torch.max(pred[:, 0], target[:, 0]) y1 = torch.max(pred[:, 1], target[:, 1]) x2 = torch.min(pred[:, 2], target[:, 2]) y2 = torch.min(pred[:, 3], target[:, 3]) w = (x2 - x1 + 1).clamp(min=0) h = (y2 - y1 + 1).clamp(min=0) intersection = w * h area_pred = (pred[:, 2] - pred[:, 0] + 1) * (pred[:, 3] - pred[:, 1] + 1) area_target = (target[:, 2] - target[:, 0] + 1) * (target[:, 3] - target[:, 1] + 1) union = area_pred + area_target - intersection iou = intersection / union x1_c = torch.min(pred[:, 0], target[:, 0]) y1_c = torch.min(pred[:, 1], target[:, 1]) x2_c = torch.max(pred[:, 2], target[:, 2]) y2_c = torch.max(pred[:, 3], target[:, 3]) c_area = (x2_c - x1_c + 1) * (y2_c - y1_c + 1) giou = iou - ((c_area - union) / c_area) return 1 - giou.mean() ``` #### 4. 注意事项 在撰写本科论文时,确保参考文献部分符合导师或学校要求的格式规范。如果不确定具体格式,可以咨询导师或参考学校提供的写作指南。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值