Cascade CNN Face Detection
级联人脸检测:每个阶段对候选窗口做人脸分类,判断是否是人脸。前面的stages使用低分辨率的图片,可以快速rejects非人脸后候选;后面的stages使用高分辨率图片,精确判断人脸是否存在。
PipLine
- 滑窗获取候选:
- 1.image pyramid
- 2.resize image pyramid by 12/F, (F is the acceptable minimum face size)
- 3.densely scanning image pyramid of size W*H with filer of 12 pixels, stride of 4 pixels, get [(W−12)//4+1]∗[(H−12)//4+1] [ ( W − 12 ) / / 4 + 1 ] ∗ [ ( H − 12 ) / / 4 + 1 ] face candidates(“//“向下取整)
- 12-net人脸分类:轻量CNN对face candidates 进行分类, 过滤不是人脸的候选
- 12-calibration-net矫正size and location:
- 对人脸进行矫正,包括size (w,h),locations (x, y)of top-left corner. 采用分类模型进行矫正,矫正patterns 包含5种size 缩放,x 方向3种平移和 y 方向3种平移,共45类。将12-net人脸分类剩下的人脸候选窗口(x, y, w, h)调整到 (x−xnwsn,y−ynwsn,wsn,hsn) ( x − x n w s n , y − y n w s n , w s n , h s n ) 。取分类得分大于阈值 t t 的 pattens平均值作为真正的矫正pattern,根据此pattern对候选窗口进行缩放和平移,在相同scale的图片上做NMS。
- 24-net人脸分类: 和12-net过程相似,只是额外使用了输入图片的12-net fully-connected特征,即multi-resolution structure
- 24-calibration-net矫正size and location
- 48-net人脸分类
- 48-calibration-net矫正size and location: 和前面的calibration-net过程相似,不同点是NMS是global的。
Training Process
- 分类网络training samples获取: 搜集了5800张background images for negative training samples,use faces in the AFLW as positive samples.
- 24-net negative samples mining:使用12-net和12-calibration-net在AFLW子集上选择阈值 T1 T 1 保证99%的召回率。选取background images种分类得分大于阈值 T1 T 1 的窗口作为24-net的负训练样例。
- 48-net negative samples mining:使用12-net,12-calibration-net, 24-net和24-calibration-net在AFLW子集上选择阈值 T2 T 2 保证97%的召回率。选取background images种分类得分大于阈值 T2 T 2 的窗口作为48-net的负训练样例。
- 校准网络training samples获取:将FAFLW种的人脸做N=45 calibration patterns perturb。for the n−th n − t h pattern [sn,xn,yn] [ s n , x n , y n ] , apply [1/sn,−xn,−yn] [ 1 / s n , − x n , − y n ] (following Equation 1) to adjust the face annotation bounding box, crop and resize into proper input sizes (12×12, 24×24 and 48×48).