SSS

Be honest with yourself.


  • Home

  • About

  • Tags

  • Categories

  • Archives

YOLO-V1笔记

Posted on 2019-05-09 In deep learning

学习YOLO-v1整理的一些笔记

Yolo-v1简单介绍

发表于2015年,作者J Redmon 个人网站

原始论文

YOLO 全称为 you only look once,意思是像人去识别图像一样,我们只看一遍就可以知道图像中包含的信息。在COCO dataset的 mAP 的表现很好,达到了57.9%。

目标检测目前可以分为两大类

  1. 基于区域提名(region proposal),R-CNN, FAST R-CNN, FASTER R-CNN, R-FCN
  2. 基于端到端(end to end), YOLO, SSD, Retinanet

YOLO-v1主要思想

只有图片作为网络的输入,经过网络,输出得到bounding box的偏移和所属类,然后进行loss计算,回归整个网络。

YOLO主要三步骤

  1. 将输入图像调整为448x448的长宽
  2. 在图像上进行卷积网络计算
  3. 通过回归,得到最终训练的网络

YOLO-v1实现

  1. 将图像分为S x S个网格(Grid Cell),如果某个Object的中心落在某个网格中,则这个网格就负责预测这个Object

  2. 每个网格有B个Bounding box, 每个box有x,y,w,h预测以外,还有个参数confidence的值,这个值代表了bounding box中是否含有Object,若有,这个预测的可能性有多准确(多大)
    $$
    Probability(Object) *IOU\frac{truth}{pred}
    $$
    如果Object中心落在这个网格里,Probality(Object)为1,否则为0

  3. 在test time,将上述公式乘以类的probability

    $$Probability(Class_i|Object) \ast Probability(Object) \ast IOU\frac{truth}{pred}$$

  4. YOLO模型检测回归问题将图片分为了S x S 网格(grid),同时每个网格包含B个bounding box,每个bouding box外加一个参数confidence, 最好是C个classes probabilities。 最终预测的输出格式为 $S \times S \times (B * 5 + C)$ tensor

  5. 在PASCAL VOC数据集的训练中,S=7,B=2,C=20,最终输出为$7\times7\times30$ tensor

YOLO-v1网络设计

Imgur

YOLO检测网络使用了24个卷积层和两个全连接层,循环使用1x1卷积层减少features space.

第一块一个卷积层,第二块一个卷积层,第三块四个卷积层,第四块4x4=16个卷积层,第五块3x2=6个卷积层,第六块2个卷积层

1+1+4+16+6+2 = 6 + 24

前六层为预处理,24为检测网络

Imgur

在全连接层之前的channel变化流程图

Encode方法

网上一张很好的解释图

S = 7

$w_b$为ground truth bounding box的宽,$h_b$为ground truth bounding box的高

$w_i$为整张图的宽,$h_i$为整张图的高

$(x_c,y_c)$为ground truth bounding box的中心点

蓝色方块为ground truth bounding box所落在的网格grid cell, 此网格的col=1,row=4

Imgur

# DP basic
画Bounding box的几种方法
Accuracy, Precision and Recall
  • Table of Contents
  • Overview
haoyu

haoyu

Make it come true.
20 posts
6 categories
10 tags
GitHub
  1. 1. Yolo-v1简单介绍
  2. 2. YOLO-v1主要思想
  3. 3. YOLO-v1实现
  4. 4. YOLO-v1网络设计
  5. 5. Encode方法
© 2018 – 2019 Haoyu
Powered by Hexo v3.7.0
|
Theme – NexT.Gemini v7.3.0