• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2022, Vol. 44 ›› Issue (03): 463-470.

• 图形与图像 • 上一篇    下一篇

融合改进通道和层剪枝的口罩人脸检测

刘紫燕,袁磊,朱明成,马珊珊   

  1. (贵州大学大数据与信息工程学院,贵州 贵阳 550025)
  • 收稿日期:2020-08-16 修回日期:2020-12-29 接受日期:2022-03-25 出版日期:2022-03-25 发布日期:2022-03-24
  • 基金资助:
    贵州省科学技术基金(黔科合基础[2016]1054); 贵州省联合资金(黔科合LH 字[2017]7226 号) ;贵州大学2017年度学术新苗培养及创新探索专项(黔科合平台人才[2017]5788)

A masked face detection algorithm fusing improved channel and layer pruning

LIU Zi-yan,YUAN Lei,ZHU Ming-cheng,MA Shan-shan   

  1. (College of Big Data and Information Engineering,Guizhou University,Guiyang 550025,China)
  • Received:2020-08-16 Revised:2020-12-29 Accepted:2022-03-25 Online:2022-03-25 Published:2022-03-24

摘要: 针对实际场景中目标检测算法部署算力缺乏和资源不足的问题,提出了一种基于改进通道和层剪枝的模型剪枝方法,通过设置自适应局部安全阈值以改进通道剪枝,同时通过综合评价整个残差结构值的方法进行层剪枝,并将模型剪枝方法用于口罩人脸检测。首先采用基于人脸的数据扩增方法构建口罩人脸检测数据集并使用该数据集训练YOLOv4目标检测网络;然后使用改进通道和层剪枝的模型剪枝方法对YOLOv4模型进行剪枝得到不同的剪枝模型,将这些剪枝模型在口罩人脸数据集上与YOLOv4和YOLOv4-tiny进行对比实验。性价比最高的剪枝模型(Prune-best)相对于YOLOv4模型参数量和模型大小减少75%,GFLOPS减少60%,模型推理时间减少3.7 ms,同时其mAP仅下降2.7%;极限剪枝模型(Prune-limit)更是以5.56 MB的模型大小和1.428 MB的参数量达到了0.662的mAP,比YOLOv4-tiny高63%,同时模型大小和参数量仅为YOLOv4-tiny的1/4。实验表明,剪枝后的模型其检测性价比更高,更适合实际场景中的口罩人脸检测部署。

关键词: 模型剪枝, 口罩人脸检测, YOLOv4 , 实际场景

Abstract: Aiming at the problem of shortage of computing power and resources in target detection deployment in real scenarios, this paper proposes a model method based on improved channel and layer pruning. After improving the channel pruning by setting adaptive local security threshold and carrying out layer pruning by comprehensively evaluating the whole residual structure value, the proposed model pruning method is applied to detect masked face. Firstly, for training the YOLOv4 target detection network, the masked face dataset is constructed by using face-based data amplification method. Secondly, after pruning the YOLOv4 model to get different pruning models by the improved channel and layer pruning method, the comparative experiments with YOLOv4 and YOLOv4-tiny was carried out on the masked face dataset. The proposed pruning model (Prune-best) with the highest performance-to-price ratio reduces the number and size of parameters by 75% and 60%, compared with the YOLOv4 model. The reasoning speed of the model decreases by 3.7 ms and its mAP decreases by 2.7%. When the size of the model is 5.56 MB and the number of parameters is 1.428 MB, the mAP of the extreme pruning model (Prune-limit) reaches 0.662 that is 6.3% higher than YOLOv4-tiny, and the number of parameters of the model is only 1/4 of that of YOLOv4-tiny. The experimental results show that the proposed pruning model achieves higher performance-to-price ratio and is more suitable for masked face detection deployment in real scenarios.

Key words: model pruning, mask face detection, YOLOv4, real scenary