当前位置:网站首页>Retinanet网络结构详解
Retinanet网络结构详解
2022-07-27 22:36:00 【@BangBang】
1. 概述
Retinanet的论文:Focal Loss for Dense Object Detection
论文2017年发表在CVPR(computer vision and pattern recongnition) ,该论文提出来后 one-stage网络首次超过two-stage网络
One-stage和two-stage网络的区别
- two-stage : 以
Faster RCNN为主的two-stage网络,首先需要通过一个RPN网络去生成我们的Proposal, 然后通过Fast RCNN对我们的目标进行最终的预测,它是分两步的。 - one-stage:以
SSD、YOLO系列为主的,它是一步直接预测出我们最终的结果,但是在这篇论文提出前,one-stage网络的精度都是低于two-stage的,本篇论文提出来之后one-stage网络首次超越two-stage网络。
retinaNet性能指标

从RetinaNet给出的性能参数可以看到,AP (IoU从0.5-0.95的均值)最高达到了40.8%。可以看到同期的one-stage网络YOLOv2 SSD513等他们的AP都是在21~33之间。two-stage网络当时比较主流的Faster-RCNN达到了36.8,很明显与RetinaNet的40.8比起来要低很多。
2. RetinaNet网络的详细结构

RetinaNet网络结构与 FPN的不同
RetinaNet网络结构采取了类似于FPN的网络结构,但与FPN结构有3个不同的地方。
- 第一个不同点: FPN中会使用
C2生成我们的P2,但是在我们的RetinaNet中并没有使用C2生成P2,论文作者给的原因就是P2会占用更多的计算资源(P2的特征图相对于P3~P6会更大些),为了节省资源作者就没有使用P2,而是从C3开始生成P3, BackBone这部分跟FPN比较类似。参考:目标检测FPN(Feature Pyramid Networks)的使用 - 第二个不同点:在
P6这个地方,在FPN中是通过最大池化进行下采样的,这里是通过卷积核3x3,步距为2进行下采样的,得到了我们P6 - 第三个不同点:在FPN中是从
P2~P6,但是在RetinaNet网络中是从P3~P7,P7在P6的基础上通过Relu激活函数以及积核3x3,步距为2进行下采样得到的。
预测特征层采用的scale 和 ratio
在之前博客中讲的FPN,每个预测特征层都使用了一个scale和3个Ratios 即3个anchor, 但是在RetinaNet作者针对每个预测特征层使用了3个scale和3个ratios, 9种不同的anchor.
预测器部分
在之前博客介绍FPN网络时,其实它与我们Faster RCNN是类似的,都是Two-stage网络。首先会通过一个RPN生成Proposal,然后通过Fast RCNN生成最终的预测参数。但是我们RetinaNet是一个One-stage网络直接使用预测器。
针对P3-P7预测特征层,共享一个预测器,预测器的细节部分如下,分为两个分支class subnet 和box subnet分别预测每个目标所属的类别以及针对每个anchor去预测目标边界框回归参数。
class subnet: 首先使用4个3x3的卷积层,每个卷积层后面都跟有Relu激活函数 ,最后接一个3x3卷积层是没有激活函数的,同样它的卷积核大小为3x3,步距为1,c=KA这里的K表示检测目标个数,不包含背景类别的,这里A是在预测特征层上每个位置的anchor个数,这里是9box subnet:同样也是跟4个3x3的卷积层,卷积核大小3x3,步距为1, channel为256,最后接一个3x3卷积层是没有激活函数的,同样它的卷积核大小为3x3,步距为1,它的channel=4A,A对应anchor个数9. 这个与Faster RCNN是不同的,Faster RCNN是对预测特征层上每一个anchor都会针对每个类别去生成一组边界框回归参数,因此它对应的channel=4KA
3. 损失函数
正负样本匹配
- 之前将
Faster RCNN的时候,首先我们会对所有的Anchor进行匹配,将它分为正样本以及负样本,在正样本与负样本中进行采样,在根据采样的样本计算它的损失。 - 在
RetinaNet我们也同样需要匹配正负样本,与Faster RCNN不同的地方主要体现在:首先会将Anchor与GT计算IoU,如果IoU大于0.5的话我们会将它标记为正样本,如果某个anchor与所有的GT都小于0.4,我们将它标记为负样本。IoU在[04,0.5]之间的anchor我们会舍弃掉。
损失函数计算

RetinaNet一个比较核心的知识点就是Focal Loss ,详见博客:Focal Loss详解
- 上面的损失函数分为两部分:
分类损失,回归损失 - Focal Loss的
分类损失计算的是所有正负样本的损失,并除以正样本的个数 回归损失是针对所有正样本计算的,加起来后除以正样本的个数- 分类损失使用的
sigmoid Focal Loss,对于回归损失使用的是L1 Loss
边栏推荐
- MySQL中的运算符
- Postman download and use tutorial
- Interesting Huffman tree
- Jerry caused other messages to accumulate in the message pool [article]
- Red team killer behinder_ V4.0 (ice scorpion 4.0)
- UML类图的六大关系,最佳学习理解方式
- C type use of reflection
- 110. SAP UI5 FileUploader 控件深入介绍 - 为什么需要一个隐藏的 iframe
- 《KMP复习 + AC自动机》前传
- Swear, swear, swear
猜你喜欢

Iperf installation and use

Multithreading & high concurrency (the latest in the whole network: interview questions + map + Notes) the interviewer is calm

Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始

Analysis and recurrence of network security vulnerabilities
![[proteus simulation] 51 single chip microcomputer washing machine simulation control program](/img/a1/d4256a5e350078b791c0b5cd512fe3.png)
[proteus simulation] 51 single chip microcomputer washing machine simulation control program

Sign up now | cloud native technology exchange meetup Guangzhou station has been opened, and I will meet you on August 6!

Interface test practical project 02: read interface test documents and practice

Six relationships of UML class diagram, the best way to learn and understand
![[300 opencv routines] 241. Scale invariant feature transformation (SIFT)](/img/7a/a764c779c3162920c832325f89f340.png)
[300 opencv routines] 241. Scale invariant feature transformation (SIFT)

Storage of deep planing data in memory
随机推荐
SAP各模块优缺点和发展简析
计算属性的基本使用
论文赏析[ICLR18]联合句法和词汇学习的神经语言模型
Solve maze problem recursively
C语言程序设计 | 单身狗题目讲解
Process and process scheduling
Sign up now | cloud native technology exchange meetup Guangzhou station has been opened, and I will meet you on August 6!
Six relationships of UML class diagram, the best way to learn and understand
Postman 的使用
自用图床搭建教程
为华为打造无美系设备的产线,台积电三星能做到吗?
Impact of privilege changes on existing connections
Jerry caused other messages to accumulate in the message pool [article]
立即报名 | 云原生技术交流 Meetup 广州站已开启,8 月 6 号与你相遇!
Multithreading & high concurrency (the latest in the whole network: interview questions + map + Notes) the interviewer is calm
Red team killer behinder_ V4.0 (ice scorpion 4.0)
Count the six weapons of the domestic interface cooperation platform!
网络设备硬核技术内幕 防火墙与安全网关篇 (五) 安全双修大法 中
Basic operations of MySQL database (2) --- Based on data table
【STM32】看门狗模块