当前位置:网站首页>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
边栏推荐
- Wavelet transform learning notes
- 推荐系统-精排模型:xDeepFM
- [proteus simulation] 51 single chip microcomputer washing machine simulation control program
- Use of postman
- 立即报名 | 云原生技术交流 Meetup 广州站已开启,8 月 6 号与你相遇!
- Recommended system - indicators: CTR, CVR
- c# 反射之Type使用
- 一周年创作纪念日,冲吧少年郎
- Code random notes_ Hash_ 1002 find common characters
- Postman download and use tutorial
猜你喜欢

怎么清晰地理解、表达 IaaS 、 PaaS 、 SaaS ?

Basic operations of MySQL database (2) --- Based on data table

Data analysis: disassembly method (details)

代码随想录笔记_哈希_1002查找共用字符

《KMP复习 + AC自动机》前传
![Jericho will make a popping sound when turning on, broadcasting a prompt tone, and turning off [chapter]](/img/e3/ea7278eb855cca2a1af4f96772bcb1.png)
Jericho will make a popping sound when turning on, broadcasting a prompt tone, and turning off [chapter]

分支和循环语句题目练习

Red team killer behinder_ V4.0 (ice scorpion 4.0)

What is the org relationship mitigation strategy of Microsoft edge browser tracking prevention

Basic operations of MySQL database (3) --- Based on fields
随机推荐
推荐系统-模型:dssm双塔模型做embedding的召回
KMP review + AC automata Prequel
网络设备硬核技术内幕 防火墙与安全网关篇 (十)
592. Fraction addition and subtraction: introduction to expression calculation
IP address & subnet mask
Count the six weapons of the domestic interface cooperation platform!
Add a picture in front of the cell
Postman 的使用
When Jerry made a phone call, recording to SD card /u disk was not enough [article]
The program design questions of the 11th national competition of Bluebridge cup single chip microcomputer
小波变换学习笔记
Can TSMC Samsung build a production line without American equipment for Huawei?
Thesis appreciation [iclr18] a neural language model combining syntax and vocabulary learning
Interesting Huffman tree
Learning note 12: Eratosthenes screening method to find prime numbers (within 100) and magic square matrix
推荐系统-模型(三):精排模型【LR、GBDT、Wide&Deep、DCN、DIN、DIEN、MMOE、PLE】
Use of postman
融云 IM & RTC 能力上新盘点
Uniapp display rich text effect demo (organize)
[original] [crawler series] briefly get the most popular topics, related topics and description information