文献阅读 - FaceBoxes: A CPU Real-time Face Detector with High Accuracy

FaceBoxes: A CPU Real-time Face Detector with High Accuracy


S.F. Zhang, X.Y. Zhu, Z. Lei, et al, FaceBoxes: A CPU Real-time Face Detector with High Accuracy, IJCB (2017)


摘要

FaceBoxes:

  • CPU实时处理(real-time speed on the CPU)

  • 高准确率(superior performance on both speed and accuracy)

  • 轻量且性能强大的网络结构(a lightweight yet powerful network structure),包括高速抽取卷积层(Rapidly Digested Convolutional Layers,RDCL)和多尺度卷积层(Multiple Scale Convolutional Layers,MSCL)

  • RDCL使FaceBoxes能够在CPU上实时处理

  • MSCL用于丰富感知域(enriching the receptive fields)并通过在多个卷积层上锚点离散化处理不同尺度的面部

  • 锚点稠密化(anchor densification strategy)使图像上不同类型的锚点密度相同(样本平衡),以提升小尺寸面部的召回率(improves the recall rate of small faces)

  • 检测速度与面部数量无关

1 引言

FaceBoxes是一种全卷积网络(fully convolutional neural network),能够进行端到端训练(be trained end-to-end)。

FaceBoxes采用轻量化(lightweight)网络结构(Fig. 1),由高速抽取卷积层(Rapidly Digested Convolutional Layers,RDCL)和多尺度卷积层(Multiple Scale Convolutional Layers,MSCL)组成。

RDCL(Rapidly Digested Convolutional Layers,高速抽取卷积层):使FaceBoxes能够在CPU上实时处理

MSCL(Multiple Scale Convolutional Layers,多尺度卷积层):丰富感知域(enriching the receptive fields),通过在多个卷积层上锚点离散化处理不同尺度的面部

在这里插入图片描述

锚点稠密化(anchor densification strategy):使输入图像上不同类型锚点的密度相同,以提升小尺寸面部的召回率。

在VGA分辨率(VGA-resolution)下,FaceBoxes检测器在单核CPU(a single CPU core)上的运行速度为20FPS,在GPU上的运行速度为125FPS,且检测速度与面部数量无关。

本文贡献:RDCL、MSCL、锚点稠密化

2 相关工作

2.1 人工特征表示(Hand-craft based methods)

2.2 卷积神经网络特征表示(CNN based methods)

3 FaceBoxes

RDCL、MSCL、锚点稠密化

3.1 高速抽取卷积层(Rapidly Digested Convolutional Layers)

高速抽取卷积层(Rapidly Digested Convolutional Layers,RDCL):使用合适尺寸的卷积核快速缩小输入空间尺寸并减少输出通道数(fast shrink the input spatial size by suitable kernel size with reducing the number of output channels)。

  • 缩小输入空间尺寸(shrinking the spatial size of input)

增加卷积层与池化层的步长,快速缩小输入空间尺寸。Conv1、Pool1、Conv2、Pool2步长分别为4、2、2、2。

  • 核尺寸(choosing suitable kernel size)

满足有效性及高效率(keep efficient as well as effective),Conv1、Conv2、Pool1的核尺寸分别为 7 × 7 7 \times 7 7×7 5 × 5 5 \times 5 5×5 3 × 3 3 \times 3 3×3

  • 减少输出通道数(reducing the number of output channels)

低层卷积滤波器输出成对、相位相反(filters in the lower layers form pairs, i.e., filters with opposite phase)。CReLU(Concatenated Rectified Linear Units)激活(Fig. 2-a)将输出取反后与原输出并联,使输出通道数翻倍(double the number of output channels by simply concatenating negated outputs before applying ReLU)。

CReLU ( x ) = [ max ⁡ ( x , 0 ) , max ⁡ ( − x , 0 ) ] = ReLU ( [ x , − x ] ) \text{CReLU} (x) = [\max(x, 0), \max(-x, 0)] = \text{ReLU} ([x, -x]) CReLU(x)=[max(x,0),max(x,0)]=ReLU([x,x])

在这里插入图片描述

3.2 多尺度卷积层(Multiple Scale Convolutional Layers)

应用区域候选网络(region proposal network,RPN)检测面部存在的问题:

(1)锚点仅分配给最后一层卷积层的输出特征图

(2)锚点的输入特征图感知域尺寸单一

  • 网络深度多尺度(multi-scale design along the dimension of network depth)

以Inception_3、Conv3_2、Conv4_2输出组成多尺度特征图(multi-scale feature maps),特征图尺寸逐层减小

  • 网络宽度多尺度(multi-scale design along the dimension of network width)

锚点层输入特征图对应多尺寸感知域。Inception模块(Fig. 2-b)由卷积核尺寸不同的多个卷积分枝组成,因此能够沿网络宽度维度丰富感知域。

FaceBoxes网络结构

  • RDCL
输出卷积核填充步长
输入1024 x 1024 x 3---
conv1256 x 256 x 247 x 7 x 2434
crelu256 x 256 x 48---
max_pool1128 x 128 x 483 x 312
conv264 x 64 x 645 x 5 x 6422
crelu64 x 64 x 128---
max_pool132 x 32 x 1283 x 312
  • MSCL
输出卷积核填充步长
输入32 x 32 x 128---
incept132 x 32 x (32 x 4)---
incept232 x 32 x (32 x 4)---
incept332 x 32 x (32 x 4)---
conv3_132 x 32 x 1281 x 1 x 12801
conv3_216 x 16 x 2563 x 3 x 25612
conv4_116 x 16 x 1281 x 1 x 12801
conv4_28 x 8 x 2563 x 3 x 25612
  • Anchor Box (loc + conf)
输入输出卷积核填充步长平铺间隔(像素步长)
loc + confincept332 x 32 x 1263 x 3 x ((4 + 2) x 21)1132
loc + confconv3_216 x 16 x 63 x 3 x ((4 + 2) x 1)1164
loc + confconv3_28 x 8 x 63 x 3 x ((4 + 2) x 1)11128

3.3 锚点稠密化(anchor densification strategy)

默认锚点长宽比(aspect ratio)为 1 : 1 1 : 1 1:1,incept3的锚点尺度(scale of anchor)为32、64、128像素(pixel)、conv3_2和conv4_2的锚点尺度分别为256和512像素。

图像上锚点的平铺间隔等于对应锚点层的像素单位步长(the tiling interval of anchor on the image is equal to the stride size of the corresponding anchor-associated layer)。例:conv3_2的步长为64像素、锚点尺寸为 256 × 256 256 \times 256 256×256,表示该输入图像上每64个像素都有一个 256 × 256 256 \times 256 256×256的锚点与之对应。锚点平铺密度 A density 定 义 为 A_{\text{density}}定义为 Adensity

(1) A density = A scale A interval A_{\text{density}} = \frac{A_{\text{scale}}}{A_{\text{interval}}} \tag{1} Adensity=AintervalAscale(1)

其中, A scale A_{\text{scale}} Ascale表示锚点尺度(scale of anchor)、 A interval A_{\text{interval}} Ainterval表示锚点平铺间隔(tiling interval of anchor)。默认锚点的平铺间隔分别为32、32、32、64和128,由方程(1)可知,其对应的锚点平铺密度分别为1、2、4、4和4,因此引发不同尺度锚点的平铺密度不平衡问题(tiling density imbalance problem)。与大尺度锚点( 128 × 128 128 \times 128 128×128 256 × 256 256 \times 256 256×256 512 × 512 512 \times 512 512×512)相比,小尺度锚点( 32 × 32 32 \times 32 32×32 64 × 64 64 \times 64 64×64)过于稀疏。

本文采用锚点稠密化策略(anchor densification strategy)处理不平衡问题(Fig. 3):锚点 n n n倍稠密化(densify one type of anchors n n n times),围绕感知域中心均匀平铺 A number = n 2 A_{\text{number}} = n^2 Anumber=n2个锚点(uniformly tile A number = n 2 A_{\text{number}} = n^2 Anumber=n2 around the center of one receptive field instead of only tiling one at the center of this receptive field to predict)。

在这里插入图片描述

输入特征图尺寸尺度(人工指定)步长平铺间隔(像素步长)平铺密度稠密化倍数( n n n卷积核倍数( n 2 n^{2} n2锚点框数量
incept3 (1) 32 × 32 32 \times 32 32×32 32 × 32 32 \times 32 32×32132141616384
incept3 (2) 32 × 32 32 \times 32 32×32 64 × 64 64 \times 64 64×641322244096
incept3 (3) 32 × 32 32 \times 32 32×32 128 × 128 128 \times 128 128×1281324111024
conv3_2 16 × 16 16 \times 16 16×16 256 × 256 256 \times 256 256×256164411256
conv4_2 8 × 8 8 \times 8 8×8 512 × 512 512 \times 512 512×512112841164

锚点 n n n倍稠密化后(即锚点数量增加 n 2 n^{2} n2倍),所需卷积核数量增加 n 2 n^{2} n2倍,因此incept3的锚点卷积层的卷积核数量为 16 + 4 + 1 = 21 16 + 4 + 1 = 21 16+4+1=21

卷积核的感知域与锚点框关系(同一感知域表示感知域的中心、长、宽相同):稠密化前,感知域与锚点框一一对应,感知域中心与锚点框中心重合;稠密化后,一个感知域对应 n 2 n^{2} n2个锚点框,感知域中心与锚点框中心有偏移。因此,稠密化后,所需卷积核数量增加 n 2 n^{2} n2倍。

给定输入特图尺寸: w × h w \times h w×h;类别数: n class n_{\text{class}} nclass;坐标数: n offset n_{\text{offset}} noffset;卷积核(预测器)步长: s s s;稠密化倍数: n n n,则卷积核数量: n 2 × ( n class + n offset ) n^{2} \times (n_{\text{class}} + n_{\text{offset}}) n2×(nclass+noffset);锚点框数量: w × h s 2 × n 2 \frac{w \times h}{s^{2}} \times n^{2} s2w×h×n2;每个锚点框对应预测值数量: n class + n offset n_{\text{class}} + n_{\text{offset}} nclass+noffset;预测值数量: w × h s 2 × n 2 × ( n class + n offset ) \frac{w \times h}{s^{2}} \times n^{2} \times (n_{\text{class}} + n_{\text{offset}}) s2w×h×n2×(nclass+noffset)

锚点稠密化实际是增加卷积核数量,其原因在于:卷积核的感知域过大,与锚点框尺寸不匹配。例如,incept3的输出特征图尺寸为 32 × 32 32 \times 32 32×32,其每个点对原始输入图像32个像素,则 3 × 3 3 \times 3 3×3卷积核的感知域为 96 × 96 96 \times 96 96×96;而锚点层incept3 (1)的锚点框尺寸为 32 × 32 32 \times 32 32×32,意味着每个感知域中可能包含多个锚点框,因此需要增加卷积核数量。

3.4 训练

  • 训练数据集(training dataset)

WIDER FACE:训练集中包含12880张图像。

  • 数据增强(data augmentation)

    • 色彩失真(color distortion):光度测定失真(photo-metric distortions);
    • 随机裁剪(random cropping):从原始图像中随机裁剪5块方形区域(square patches),其中一块为原始图像最大的方形区域,其余尺寸随机取原始图像短边的 [ 0.3 , 1 ] [0.3, 1] [0.3,1]。然后随机选取其中之一作为输入图像;
    • 尺度变换(scale transformation):将随机裁剪后的图像区域缩放为 1024 × 1024 1024 \times 1024 1024×1024
    • 水平翻转(horizontal flipping):将缩放后图像以概率 0.5 0.5 0.5随机翻转;
    • 过滤面部框(face-box filter):如果面部框的中心位于随机裁剪后的图像区域中,则保留重叠的部分;然后将其中高度或宽度小于20像素的面部框滤除。
  • 匹配策略(matching strategy)

首先将真实面部框匹配给IoU最大锚点■■防止真实面部框过小,没有锚点与其匹配■;然后为每个锚点分配一个IoU大于门限的真实面部框。

  • 损失函数(loss function)

分类:二分类交叉熵损失(2-class softmax loss for classification);回归:平滑 L 1 L_1 L1损失(the smooth L1 loss for regression)。

  • 决策边界负样本挖掘(hard negative mining)

匹配后的锚点大多数为负样本,引起正负样本数据不平衡问题。对锚点按损失排序,选择排名靠前的锚点,使正负样本比例为 1 : 3 1 : 3 1:3

  • 其它(other implementation details)

参数初始化:xavier;SGD:动量(momentum)0.9、权值衰减(weight decay)0.0005、批尺寸32;最大迭代次数120k,前80k次迭代学习率(learning rate)为 1 0 − 3 10^{-3} 103、随后20k次迭代学习率为 1 0 − 4 10^{-4} 104、最后20k次迭代学习率为 1 0 − 5 10^{-5} 105

4 实验

4.1 运行时效率(runtime efficiency)

在这里插入图片描述

4.2 模型分析(model analysis)

在这里插入图片描述

  • (anchor densification strategy is crucial)

  • (MSCL is better)

  • (RDCL is efficient and accuracy-preserving)

4.3 评估(evaluation on benchmark)

在这里插入图片描述

  • AFW数据集

在这里插入图片描述

  • PASCAL面部数据集

在这里插入图片描述

  • FDDB数据集

在这里插入图片描述

5 结论

致谢

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值