基于残差量化卷积神经网络的人脸识别方法
 计算机系统应用  2018, Vol. 27 Issue (8): 35-41 PDF

1. 复旦大学 计算机科学技术学院, 上海 201203;
2. 上海市智能信息处理重点实验室 上海视频技术与系统工程研究中心, 上海 201203;
3. 上海临港智慧城市发展中心, 上海 201306;
4. 上海无线电设备研究所, 上海 200090

Face Recognition Method Based on Quantized Residual Convolutional Neural Networks
ZHOU Guang-Zhen1, DU Shan-Shan2, FENG Rui1,2, OU Li-Jun3, LIU Bin4
1. School of Computer Science, Fudan University, Shanghai 201203, China;
2. Shanghai Key Laboratory of Intelligent Information Processing, Shanghai Engineering Research Center for Video Technology and System, Shanghai 201203, China;
3. Shanghai Lingang Smart City Development Center, Shanghai 201306, China;
4. Shanghai Radio Equipment Research Institute, Shanghai 200090, China
Foundation item: National Key Research and Development Project of China (2017YFC0803700); Program of Shanghai Committee of Science and Technology (17511101702); Special Projct in Intelligent Manufacturing of Lingang Region (#ZN2016020103); Guided Project of Academy for Engineering and Technology, Fudan University (gyy2017-003)
Abstract: Very deep convolutional neural networks based on residual learning have achieved higher accuracy than other methods for large scale face recognition problem. But the massive floating-point parameters existing in the models need to occupy extensive computational and memory resources, which cannot be satisfied with the demand of occasions with limited resources. Aimed at the solution of this issue, a very deep residual neural network based on network model parameters quantization was designed in this study. In detail, based on the model Face-ResNet, the network was added with batch normalization layers and dropout layers, and also its total layers were deepened. Applying binary quantization to parameters of the designed network models, it can compress the model size substantially and improve computational efficiency with little loss of model recognition accuracy. Both theoretical analysis and experiments prove the effectiveness of the designed method.
Key words: face recognition     residual learning     quantized convolutional neural networks

1 引言

2 算法设计框架

3 残差卷积神经网络模型选择 3.1 残差学习机制

$H(x)$ 表示输入 $x$ 的目标映射, 卷积神经网络学习的目标函数为 $F(x)$ . 常见方法直接学习这个目标映射, 即 $F(x) = H(x)$ . 当恒等映射 $H(x) = x$ 为目标映射时, $F(x)$ 较难拟合这个目标. 残差学习机制则学习目标映射与输入之间的残差量, 即 $F(x) = H(x) - x$ , 而目标映射则可以简单地通过原输入与残差量相加来恢复, 即 $H(x) = F(x) + x$ .

 图 1 本文工作主要流程(上部)与算法细节(下部)

3.2 模型选择过程

4 卷积神经网络参数量化

4.1 二值神经网络

 ${w^b} = sign(w) = \left\{ {\begin{array}{*{20}{l}}{ + 1,\;\;\;\;\;\;{\text{如果}}w\; \ge 0\;}\\{ - 1,\;\;\;\;\;\;{\text{其他情况}}}\end{array}} \right.$ (1)

 $g(w){1_{\left| w \right| \leqslant 1}} = \left\{ {\begin{array}{*{20}{l}} {0,\;\;\;\;\;\;w > 1} \\ {1,\;\;\;\;\;\;w \in \left[ { - 1,1} \right]} \\ {0,\;\;\;\;\;\;w < - 1} \end{array}} \right.$ (2)

4.2 异或网络

4.3 多位量化网络

 ${x^q} = {q_k}(x) = \frac{1}{{{2^k} - 1}}round(({2^k} - 1)x)$ (3)

 ${W^q} = 2{q_k}(\frac{{\tanh (W)}}{{2\max (\left| {\tanh (W)} \right|)}} + \frac{1}{2}) - 1$ (4)
 ${A^q} = q{}_k(h(A))$ (5)

DoReFa-Net使用前两种量化网络的训练方式, 设置网络参数的不同量化位数k, 可对网络模型进行不同程度的量化. 相比BNN和XNOR-Net, 量化位数k越大, 对原浮点网络模型精度导致的损失越小, 但同时网络模型也越大, 需要更多存储空间, 对计算效率的提升也越少. 需要设置合理的k值折衷网络精度损失和网络模型压缩比与计算效率提升.

DoReFa-Net也有对训练梯度的多位量化方法, 但本文考虑到梯度对训练的重要性, 保留其浮点表示. 本文基于多位量化网络的参数量化方法, 在实验中对网络模型参数进行二值量化. 实验情况将在第5节中说明.

5 实验与分析 5.1 实验环境与数据集准备

CASIA-WebFace数据集[10]被用于实验的训练, 利用室外带标注的人脸数据集LFW用于网络模型的精度测试. CASIA-WebFace是目前最大的公开人脸识别数据集之一, 全部数据采集自互联网, 包含10 575人共494 414张图片. LFW数据集则有5749位名人的13 233张网络图片, 均采集自室外场景.

5.2 实验设置与评判方式

LFW提供一份分为10组随机生成的共6000对图像的测试集合验证算法精度. 其中3000对是相同的人, 另3000对是不同的人. 通过以上方法对6000对图像进行测试, 算法在10个分组中交叉验证, 以10组验证结果的均值报告算法精度.

5.3 实验结果

5.4 压缩比与效率提升分析

6 总结

 [1] Taigman Y, Yang M, Ranzato M, et al. DeepFace: Closing the gap to human-level performance in face verification. Proceedings of 2014 Conference on Computer Vision and Pattern Recognition. Columbus, OH, USA. 2014. 1701–1708. [2] Sun Y, Wang XG, Tang XO. Deep learning face representation from predicting 10,000 classes. Proceedings of 2014 IEEE Conference on Computer Vision and Pattern Recognition. Columbus, OH, USA. 2014. 1891–1898. [3] He KM, Zhang XY, Ren SQ, et al. Deep residual learning for image recognition. Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas, NV, USA. 2016. 770–778. [4] Wen YD, Zhang KP, Li ZF, et al. A discriminative feature learning approach for deep face recognition. Proceedings of the 14th European Conference on Computer Vision. Amsterdam, The Netherlands. 2016. 499–515. [5] Huang GB, Mattar M, Berg T, et al. Labeled faces in the wild: A database forstudying face recognition in unconstrained environments. Proceedings of Workshop on Faces in ‘Real-Life’ Images: Detection, Alignment, and Recognition. Marseille, France. 2008. [6] 雷杰, 高鑫, 宋杰, 等. 深度网络模型压缩综述. 软件学报, 2018, 29(2): 251-266. DOI:10.13328/j.cnki.jos.005428 [7] Courbariaux M, Hubara I, Soudry D, et al. Binarized neural networks: Training deep neural networks with weights and activations constrained to +1 or -1. arXiv: 1602.02830, 2016. [8] Rastegari M, Ordonez V, Redmon J, et al. Xnor-net: Imagenet classification using binary convolutional neural networks. Proceedings of the 14th European Conference on Computer Vision. Amsterdam, The Netherlands. 2016. 525–542. [9] Zhou SC, Wu YX, Ni ZK, et al. DoReFa-Net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv: 1606.06160, 2016. [10] Yi D, Lei Z, Liao SC, et al. Learning face representation from scratch. arXiv: 1411.7923, 2014. [11] Ye H, Shao WY, Wang H, et al. Face recognition via active annotation and learning. Proceedings of 2016 ACM on Multimedia Conference. Amsterdam, The Netherlands. 2016. 1058–1062. [12] Zhang KP, Zhang ZP, Li ZF, et al. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 2016, 23(10): 1499-1503. DOI:10.1109/LSP.2016.2603342 [13] Wu X, He R, Sun ZN. A lightened CNN for deep face representation. Proceedings of 2015 IEEE Conference on IEEE Computer Vision and Pattern Recognition. 2015.