YOLO3的一些理解

最近实习用到了YOLOv3,该模型的论文写得很飘逸,网上也有很多不同版本的解读和实现,但是总觉得大家的观点都有点飘,不深刻。这里把遇到的问题和找到的解答逐个做一些记录。由于我这里代码主要是基于caffe的,所以重点不会放到Keras和PyTorch实现上,这两种版本的代码仅作参考。
本文发布时不是最终版本,后续会一边理解一边完善。

关于mask

https://blog.csdn.net/Julialove102123/article/details/79836975 :
Every layer has to know about all of the anchor boxes but is only predicting some subset of them. This could probably be named something better but the mask tells the layer which of the bounding boxes it is responsible for predicting. The first yolo layer predicts 6,7,8 because those are the largest boxes and it’s at the coarsest scale. The 2nd yolo layer predicts some smallers ones, etc.

The layer assumes if it isn’t passed a mask that it is responsible for all the bounding boxes, hence the ifstatement thing.

关于roi

论文和大部分blog都没有看到关于roi的介绍。然而代码中每层金字塔却给出了大小为200的roi,这里还需要再问问大佬。

补充:roi表示每张图最多拥有的目标数量,主要用于C/C++的数组申请和内存管理。

关于金字塔结构

在这里插入图片描述

关于loss

关于loss的形式,网上有一些基于BCE loss和MSE loss的分歧,见:
https://stackoverflow.com/questions/55395205/what-is-the-loss-function-of-yolov3
根据darknet代码和类似的caffe代码,采用sigmoid-1的形式传递梯度。
https://github.com/AlexeyAB/darknet/issues/1695#issuecomment-426016524
https://github.com/AlexeyAB/darknet/issues/1845#issuecomment-434079752
objness的loss计算见:
https://stats.stackexchange.com/questions/373266/yolo-v3-loss-function

关于预测输出

每个anchor中的输出主要包含x, y, h, w, objness, classes, 具体见:
https://blog.paperspace.com/how-to-implement-a-yolo-object-detector-in-pytorch/
这位小哥基于PyTorch实现了YOLO3并用一个系列的博客详细介绍了推理过程,可惜没有介绍训练过程(尤其是loss),太遗憾了。

some refs

https://blog.csdn.net/weixin_42078618/article/details/85005428
https://blog.csdn.net/weixin_42078618/article/details/87787919

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值