【YOLOv4】《YOLOv4:Optimal Speed and Accuracy of Object Detection》

在这里插入图片描述

arXiv-2020

部分摘抄整理来自 深入浅出Yolo系列之Yolov3&Yolov4&Yolov5核心基础知识完整讲解(★★★★★)



1 Background and Motivation

现有的 SOTA 目标检测模型,do not operate in real time and require large number of GPUs for training with a large mini-batch-size

作者旨在设计一个目标检测器,which can be easily trained and used

2 Related Work

  • Object detection models
    • backbone
    • neck(FPN / ASPP 等)
    • head 用于 predict classes and bbox
      • Dense Prediction:one-stage
      • Sparse Prediction:two-stage

在这里插入图片描述

  • Bag of freebies
    only change the training strategy or only increase the training cost(不影响推理速度)

    • data augmentation

      • photometric distortions(brightness, contrast, hue, saturation, and nois)
      • geometric distortions(random scaling, cropping, flipping, and rotating)
      • 随机块遮挡(random erase,grid mask)
      • 多合一(MixUp)
    • 解决 semantic distribution in the dataset may have bias,

      • 类别不均衡,eg OHEM,focal loss
      • 类之间的关联程度不一,eg label smoothing
    • bbox regression 方式
      直接预测 (x,y,h,w) 或则基于 anchor 预测 offset 缺点是,treat these points as independent variables, but in fact does not consider the integrity of the object itself

      • IoU loss / GIoU / DIoU / CIoU
  • Bag of specials
    plugin modules and post-processing methods,计算代价小,性能提升明显

    • receptive field:SPP,ASSP,RFB
    • attention mechanism
      • channel-wise:SE
      • point-wise:CBAM
    • feature integration capability:skip connection,FPN family
    • activation function:ReLU family
    • post-processing(screening prediction results):NMS family

3 Advantages / Contributions

在这里插入图片描述
集合各种训炼技巧和模块组件,实现又快又好的目标检测器,且只用 1080Ti 或 2080Ti 单卡就能快速训练

4 Method

与 classifier 不同,detector 要求

  • higher input size 来检测小目标
  • more layers 堆叠更高的感受野来覆盖 input size 增大的网络
  • more parameters 提升模型容量以检测不同大小的目标

感受野的影响:

  • Up to the object size 可以看到整个目标
  • Up to network size 可以 view 目标周围的 context
  • Exceeding the network size,increases the number of connections between the image point and the final activation(就是输出特征图超强,特征图上的一个点可以和原始图片许多点都建立联系)

在这里插入图片描述


YOLOv3 基础上配合 SPP + CSPDarknet + PANet = YOLOv4

在这里插入图片描述

在这里插入图片描述

从功能模块的视角来看 YOLOv4

在这里插入图片描述
在这里插入图片描述

此部分总结来自 深入浅出Yolo系列之Yolov3&Yolov4&Yolov5核心基础知识完整讲解

4.1 Additional improvements

为了高效的进行单 GPU 训练,作者 make additional design

1)Mosaic 数据增广方法,Self-Adversarial Training (SAT)

Figure3

更详细的讲解可参考 YOLOV4-Mosaic数据增强详解

SAT 分两阶段,

第一阶段 alters the original image instead of the network weights(altering the original image to create the deception that
there is no desired object on the image

第二阶段,网络 is trained to detect an object on this modified image in the normal way.

2)We select optimal hyper-parameters while applying genetic algorithms

3)modified Spatial Attention Module (SAM), modified PAN, and Cross mini-Batch Normalization (CmBN)

修改的 SAM 如下图

在这里插入图片描述

CmBN 是 CBN 的改进版,如下所示

在这里插入图片描述

collects statistics only between mini-batches within a single batch

修改的 PAN 如下图
在这里插入图片描述

addition 换成了 concatenation

下面总结来自 深入浅出Yolo系列之Yolov3&Yolov4&Yolov5核心基础知识完整讲解

YOLOv3 的 neck 为 FPN 结构,预测特征图为 ①19×19×255、②38×38×255、③76×76×255 [注:255表示80类别 (1+4+80)×3=255]

在这里插入图片描述
YOLOv4 的 neck 为 FPN 配合改进的 PAN,预测特征图为 ①76×76×255,②38×38×255,③19×19×255

在这里插入图片描述
PAN 论文图如下,绿线比红线能更快的到达目的地
在这里插入图片描述

4.4 YOLOv4

Backbone:CSPDarknet53
Neck:SPP,PAN
Head:YOLOv3
在这里插入图片描述

5 Experiments

5.1 Datasets

  • ImageNet (ILSVRC 2012 val) dataset
  • MS COCO (test-dev 2017)

5.2 Influence of different features on Classifier training

在这里插入图片描述

Mosaic 一次四张,随机缩放、随机裁剪、随机排布的方式进行拼接!减小了对大 batch-size 的依赖,均衡了物体的尺寸分布

在这里插入图片描述
图片来自 深入浅出Yolo系列之Yolov3&Yolov4&Yolov5核心基础知识完整讲解

Table 2 和 Table 3

在这里插入图片描述

在这里插入图片描述

只在 Backbone 中采用了 Mish 激活函数,网络后面仍然采用 Leaky_relu 激活函数

5.3 Influence of different features on Detector training

BoF detector
在这里插入图片描述

  • S⬇,计算 b x b_x bx b y b_y by 时,除非 t x t_x tx 的值非常大,否者很难取值到 c x c_x cx or c x c_x cx + 1,作者在 sigmoid 的结果上乘了一个大于 1 的数,这样eliminating the effect of grid on which the object is undetectable

在这里插入图片描述

  • M⬆:Mosaic data augmentation
  • IT⬇:IoU threshold,anchor 与 GT 的IoU 只要大于阈值就会采用这个 anchor 做后续计算,多个 anchor 配对一个 GT
  • GA⬆:Genetic algorithms,the first 10% of time periods 会用 GA 来找网络的最有超参
  • LS⬇:Class label smoothing
  • CBN⬆:CmBN
  • CA⬆:Cosine annealing scheduler
  • DM⬇:Dynamic mini-batch size,多尺度训练时,input size 较小 batch-size 就会调整大一些
  • OA⬆:Optimized Anchors
  • GIoU, CIoU, DIoU, MSE:不同的 bbox regression loss

BoS detector
在这里插入图片描述

5.4 Influence of different backbones and pretrained weightings on Detector training

在这里插入图片描述

5.5 Influence of different minibatch size on Detector training

在这里插入图片描述
加入 BoF 和 BoS 后,对 mini-batch 没有那么敏感

it is no longer necessary to use expensive GPUs for training

在这里插入图片描述

6 Conclusion(own) / Future work

  • 补下 IoU loss 系列,FPN 系列,NMS 系列,ASPP 系列论文,random erase,grid mask
  • Pareto optimality curve
  • Dropblock 则是将 Cutout 应用到每一个特征图,而且并不是用固定的归零比率,而是在训练时以一个小的比率开始,随着训练过程线性的增加这个比率
    在这里插入图片描述
  • SPP 模块
    在这里插入图片描述用不同的 max-pooling size(k={1×1,5×5,9×9,13×13}) 配合 padding 进行步长为 1 的 pooling,输出和输出大小一样
    此部分总结来自 深入浅出Yolo系列之Yolov3&Yolov4&Yolov5核心基础知识完整讲解
  • CIoU loss 和 DIoU NMS 以及为什么不用 CIoU NMS 而用 DIoU NMS 可以参考 深入浅出Yolo系列之Yolov3&Yolov4&Yolov5核心基础知识完整讲解,regression loss 的发展过程 Smooth L1 Loss-> IoU Loss(2016)-> GIoU Loss(2019)-> DIoU Loss(2020)->CIoU Loss(2020)

补充

YOLOV5代码解析(更新中)

猜你喜欢

转载自blog.csdn.net/bryant_meng/article/details/108377133