# 人脸检测

人脸检测是一种计算机视觉方法，用于在图像或视频中定位人脸，并为每张检测到的人脸输出一个边界框、一个置信度分数，通常还输出面部关键点坐标。它是人脸识别流水线的前端：这些流水线会裁剪检测到的边界框，用关键点将其对齐，并提取用于比对的嵌入。<sup>[1](https://www.mdpi.com/1424-8220/25/5/1410)</sup> 检测器也运行在数码相机、照片管理软件和交互式移动视觉应用中。<sup>[2](https://ibug.doc.ic.ac.uk/media/uploads/documents/face_detection_survey.pdf)</sup>

| 关键事实 | 数值 | 来源 |
|---|---|---|
| 每张人脸的输出 | 边界框、置信度分数和一个关键点字典（MTCNN 默认格式 xywh） | <sup>[3](https://mtcnn.readthedocs.io/en/latest/usage_params/)</sup> |
| 关键点 | 5 个点（MTCNN）或 6 个点（MediaPipe：眼睛、鼻尖、嘴、耳屏点） | <sup>[3](https://mtcnn.readthedocs.io/en/latest/usage_params/)</sup>, <sup>[4](https://developers.google.com/edge/mediapipe/solutions/vision/face_detector)</sup> |
| 经典方法速度 | 维奥拉–琼斯（Viola–Jones）：在 700 MHz Pentium III 上以 384×288 达到 15 FPS（2001 年） | <sup>[5](https://merl.com/publications/docs/TR2004-043.pdf)</sup> |
| 高精度 WIDER FACE 验证集 AP（Easy/Medium/Hard） | RetinaFace 96.9 / 96.1 / 91.8% | <sup>[6](https://openaccess.thecvf.com/content_CVPR_2020/papers/Deng_RetinaFace_Single-Shot_Multi-Level_Face_Localisation_in_the_Wild_CVPR_2020_paper.pdf)</sup> |
| 高效 GPU 检测器 | SCRFD-34G：96.06 / 94.92 / 85.29 AP，9.80M 参数，VGA 下 11.7 ms | <sup>[7](https://github.com/deepinsight/insightface/blob/master/detection/scrfd/README.md)</sup> |
| 微型边缘端检测器 | YuNet：75,856 个参数，81.1% hard mAP，320×320 下每帧 1.6 ms（Intel i7-12700K） | <sup>[8](https://doi.org/10.1007/s11633-023-1423-y)</sup> |
| 基准规模 | WIDER FACE：32,203 张图像，393,703 个标注框 | <sup>[9](https://openaccess.thecvf.com/content_ICCVW_2019/papers/WIDER/Deng_Single-Stage_Joint_Face_Detection_and_Alignment_ICCVW_2019_paper.pdf)</sup> |

## 工作原理

维奥拉（Viola）和琼斯（Jones）的经典检测器结合了三个要素：用于快速计算特征的积分图、用于选择一小组特征的 AdaBoost，以及一种只把计算花在有希望区域上的注意力级联。<sup>[10](https://ipol.im/pub/art/2014/104/revisions/2022-01-01/article.pdf)</sup> 积分图是每张图像只计算一次的累积和；任意矩形的像素和则为
\[ II[m+h,n+w] - II[m,n+w] - II[m+h,n] + II[m,n], \]
这只需三次加法。<sup>[11](https://courses.grainger.illinois.edu/ece417/fa2023/slides/lec11.pdf)</sup> 完整级联有 38 个阶段、超过 6000 个特征，但级联对每个扫描子窗口平均只进行约 10 次特征评估；这一平均值主要由非人脸窗口拉低，前几个阶段（分别使用 1、5、20 和 50 个特征）会丢弃这些窗口，平均每个非人脸窗口评估的阶段少于 2 个；而被接受为人脸的窗口会遍历完整级联<sup>[5](https://merl.com/publications/docs/TR2004-043.pdf)</sup>,.<sup>[12](https://proceedings.neurips.cc/paper/2001/file/0b1ec366924b26fc98fa7b71a9c249cf-Paper.pdf)</sup>

现代检测器是卷积网络，分为级联 CNN 架构、单阶段检测器、带[区域提议网络](https://www.edgepedia.org/zh/region-proposal-network)和锚框的基于 R-CNN 的流水线，以及特征金字塔模型<sup>[13](https://ar5iv.labs.arxiv.org/html/2103.14983)</sup>,.<sup>[14](https://doi.org/10.48550/arxiv.1506.01497)</sup> [MTCNN](https://www.edgepedia.org/zh/mtcnn) 在图像金字塔上运行全卷积提议网络、一个通过边界框回归拒绝错误候选的精炼网络，以及一个产生最终边界框和五个关键点的输出网络。<sup>[15](https://doi.org/10.48550/arxiv.1604.02878)</sup> RetinaFace 是单阶段、多任务的，在 P2 到 P6 金字塔层级上统一进行边界框预测、二维关键点定位和三维顶点回归，并使用可变形卷积上下文模块。<sup>[6](https://openaccess.thecvf.com/content_CVPR_2020/papers/Deng_RetinaFace_Single-Shot_Multi-Level_Face_Localisation_in_the_Wild_CVPR_2020_paper.pdf)</sup> SCRFD 将约 80% 的计算重新分配到浅层阶段，因为在 VGA 分辨率下，WIDER FACE 中 78.93% 的人脸小于 32×32 像素，并在这些浅层阶段被预测。<sup>[16](https://doi.org/10.48550/arxiv.2105.04714)</sup> 重叠预测通过非极大值抑制（NMS）剪除：它移除与保留框重叠且分数较低的检测，而不是合并它们的坐标；加权融合（如 BlazeFace 中）则是一种确实会合并边界框预测的方法。<sup>[1](https://www.mdpi.com/1424-8220/25/5/1410)</sup>

## 实现方式

实践中，检测器通过几个阈值来配置。MTCNN 的默认值是最小人脸尺寸为 20 像素、图像金字塔缩放因子为 0.709、各阶段置信度阈值为 0.6、0.7 和 0.8，以及 NMS IoU 阈值为 0.5（在每个金字塔尺度内）、0.7（跨尺度）、0.7 和 0.7；后期阶段更高的 IoU 阈值实际上更不激进，但其更严格的置信度阈值只留下高置信度的最终检测<sup>[3](https://mtcnn.readthedocs.io/en/latest/usage_params/)</sup>,.<sup>[17](https://mtcnn.readthedocs.io/en/latest/stages/)</sup> MediaPipe 的人脸检测器提供 IMAGE、VIDEO 和 LIVE_STREAM 运行模式，默认最小检测置信度为 0.5，默认抑制阈值为 0.3。<sup>[4](https://developers.google.com/edge/mediapipe/solutions/vision/face_detector)</sup> BlazeFace 完全用重叠预测的加权均值融合替代抑制，在其前置摄像头数据集上把准确率提高了 10%，并把抖动降低了 40%。<sup>[18](https://doi.org/10.48550/arxiv.1907.05047)</sup> Soft-NMS 和 IoU-Net 是提高定位准确率的替代方案。<sup>[1](https://www.mdpi.com/1424-8220/25/5/1410)</sup>

## 起源

神经网络人脸检测早于提升方法时代：亨利·A·罗利（Henry A. Rowley）、舒米特·巴卢贾（Shumeet Baluja）和[金出武雄](https://www.edgepedia.org/zh/takeo-kanade)（Takeo Kanade）以 1997 年技术报告的形式发布了旋转不变神经网络人脸检测，并在 CVPR 1998 上作了展示<sup>[19](https://doi.org/10.21236/ada341629)</sup>；他们的多层网络检测正立正面人脸，并通过一个用于旋转人脸的路由网络加以扩展，在两个大型测试集上以很少的假阳性检测到 76.9% 的人脸。<sup>[20](https://cse.msu.edu/~rossarun/BiometricsTextBook/Papers/Face/Yang_FaceDetectionSurvey_PAMI02.pdf)</sup> 保罗·维奥拉（Paul Viola）和迈克尔·琼斯（Michael Jones）于 2001 年描述了提升级联检测器<sup>[5](https://merl.com/publications/docs/TR2004-043.pdf)</sup>，并于 2004 年发表了其期刊版本<sup>[21](https://link.springer.com/article/10.1023/B:VISI.0000013087.49260.fb)</sup>；一篇配套的 2001 年论文提出了非对称 AdaBoost，达到每秒 15 帧、超过 90% 的检测率，以及百万分之一的假阳性率。<sup>[12](https://proceedings.neurips.cc/paper/2001/file/0b1ec366924b26fc98fa7b71a9c249cf-Paper.pdf)</sup> 一篇综述认为，它是第一个使人脸检测在真实世界应用中实际可行的算法。<sup>[2](https://ibug.doc.ic.ac.uk/media/uploads/documents/face_detection_survey.pdf)</sup> MTCNN 由张（Zhang）及其同事于 2016 年在 arXiv 上发布<sup>[15](https://doi.org/10.48550/arxiv.1604.02878)</sup>；WIDER FACE 基准由杨（Yang）及其同事于 2015 年在 arXiv 上发布<sup>[22](https://doi.org/10.48550/arxiv.1511.06523)</sup>；BlazeFace 由巴扎列夫斯基（Bazarevsky）及其同事于 2019 年在 arXiv 上发布<sup>[18](https://doi.org/10.48550/arxiv.1907.05047)</sup>；SCRFD 由郭（Guo）及其同事于 2021 年在 arXiv 上发布，并在 ICLR 2022 上展示<sup>[16](https://doi.org/10.48550/arxiv.2105.04714)</sup>,.<sup>[23](https://spiral.imperial.ac.uk/entities/publication/bdf701a0-1776-4c94-bafe-7aa5e27e8c18)</sup> YuNet 由吴伟（Wei Wu）、彭汉阳（Hanyang Peng）和于仕琪（Shiqi Yu）于 2023 年在《机器智能研究》（Machine Intelligence Research）上发表。<sup>[8](https://doi.org/10.1007/s11633-023-1423-y)</sup>

## 变体

两个标志性的经典方法是 Haar 级联分类器和 HOG 后接 SVM；Haar 级联因通过积分图快速评估特征而流行，但在更新、更复杂的数据集上无法竞争，而 HOG 加 SVM 非常高效，却难以处理小目标和姿态变化<sup>[13](https://ar5iv.labs.arxiv.org/html/2103.14983)</sup>,.<sup>[1](https://www.mdpi.com/1424-8220/25/5/1410)</sup> MTCNN 仍是常见的默认选择，可联合输出边界框和五个关键点。<sup>[15](https://doi.org/10.48550/arxiv.1604.02878)</sup> RetinaFace 增加了多层级关键点和三维监督，发表时是 WIDER FACE 上表现最好的模型之一，尽管后来 RefineFace（ResNet-152，TTA）和 ASFD-D6（ResNet-152，TTA）等模型超过了它，在 WIDER FACE（验证集）上达到 97.2 mAP Easy / 96.5 Medium / 92.5 Hard。<sup>[6](https://openaccess.thecvf.com/content_CVPR_2020/papers/Deng_RetinaFace_Single-Shot_Multi-Level_Face_Localisation_in_the_Wild_CVPR_2020_paper.pdf)</sup> SCRFD 以重新分配的计算预算换取速度，官方模型参数从 0.57M 到 9.80M；其关键点变体（_KPS）增加了五关键点预测，例如 SCRFD_10G_KPS 以 4.23M 参数达到 95.40/94.01/82.80 AP。<sup>[7](https://github.com/deepinsight/insightface/blob/master/detection/scrfd/README.md)</sup> SCRFD-0.5GF 在 hard AP 上比 RetinaFaceM0.25 高 21.19%，同时只使用其 63.34% 的计算量和 45.57% 的推理时间。<sup>[16](https://doi.org/10.48550/arxiv.2105.04714)</sup> MediaPipe 提供 BlazeFace 短距离（基于 SSD，用于类似自拍的前置摄像头图像）、全范围（类似 CenterNet，用于后置摄像头场景）以及一个约小 60% 的稀疏全范围模型。<sup>[4](https://developers.google.com/edge/mediapipe/solutions/vision/face_detector)</sup> YuNet 是无锚框的，参数仅有 75,856 个，模型大小不到其他小型检测器的 1/5。<sup>[8](https://doi.org/10.1007/s11633-023-1423-y)</sup>

## 应用

检测质量会传导到识别：在 ArcFace 识别流水线中用 RetinaFace 替换 MTCNN，可将 IJB-C 上 \( \mathrm{FAR} = 10^{-6} \) 时的真接受率从 88.29% 提高到 89.59%，并将 CFP-FP 验证准确率从 98.37% 提高到 99.49%<sup>[6](https://openaccess.thecvf.com/content_CVPR_2020/papers/Deng_RetinaFace_Single-Shot_Multi-Level_Face_Localisation_in_the_Wild_CVPR_2020_paper.pdf)</sup>,.<sup>[24](https://doi.org/10.1109/cvpr.2019.00482)</sup> 维奥拉–琼斯检测器仍广泛应用于数码相机和照片管理软件。<sup>[2](https://ibug.doc.ic.ac.uk/media/uploads/documents/face_detection_survey.pdf)</sup> MediaPipe 的检测器接受静态图像、解码后的视频帧或实时视频，支持相机取景等交互式用途。<sup>[4](https://developers.google.com/edge/mediapipe/solutions/vision/face_detector)</sup> MTCNN 也已在 CUFS、CUFSF 和 CASIA NIR-VIS 2.0 数据集上，针对涵盖可见光、近红外和素描的异质人脸图像得到验证。<sup>[25](https://digital-library.theiet.org/doi/10.1049/ipr2.12344)</sup>

## 局限与替代方案

人脸检测与通用目标检测的不同之处在于：其宽高比变化较小，但尺度变化大得多，从几个像素到数千像素。<sup>[13](https://ar5iv.labs.arxiv.org/html/2103.14983)</sup> 架构上的权衡是：级联 CNN 模型适合边缘设备和相机拍摄，基于 R-CNN 的流水线提供更好的准确率，而单阶段或无锚框检测器占据中间地带；基于 Transformer 的架构是一种有前景的扩展<sup>[13](https://ar5iv.labs.arxiv.org/html/2103.14983)</sup>，其基础是用焦点损失训练的稠密检测器。<sup>[26](https://doi.org/10.48550/arxiv.1708.02002)</sup> WIDER FACE 基线量化了困难情形：在 Hard 子集上，四个基线（VJ、ACF、DPM、Faceness）的 AP 都低于 30%；对于高度为 10–50 像素的人脸，提议检测率低于 30%，且没有基线超过 12% AP；在部分遮挡下，最佳基线仅达到 26.5% AP，在重度遮挡下降至 14.4%；对于非典型姿态（翻滚角或俯仰角超过 30 度，或偏航角超过 90 度），最佳召回率低于 20%。<sup>[27](https://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Yang_WIDER_FACE_A_CVPR_2016_paper.pdf)</sup> NeurIPS 2022 对三个商业检测器（Amazon Rekognition、Microsoft Azure、Google Cloud）和三个学术检测器（MogFace、TinaFace、YOLO5Face）的审计发现，每个模型都对深肤色个体存在统计显著的偏差，且在最年轻年龄组中最高；除 YOLO5Face 外，每个模型在昏暗图像上都更容易受噪声影响；商业模型与学术模型在差异程度上没有系统性差异。<sup>[28](https://proceedings.neurips.cc/paper_files/paper/2022/file/f9faef4e1b4dbbd48ef60056ffe14c90-Paper-Datasets_and_Benchmarks.pdf)</sup> 涵盖 2015–2024 年的综述指出，算法在应对光照变化、遮挡和多样姿态方面仍存在困难，而人类感知在这些方面仍领先。<sup>[29](https://www.techscience.com/cmc/v84n1/61736)</sup> 截至综述文献所覆盖的范围，尚没有工作专门关注人脸检测中的人口统计偏差，这一点与人脸识别不同。<sup>[13](https://ar5iv.labs.arxiv.org/html/2103.14983)</sup>

## References

1. [A Review of Machine Learning and Deep Learning Methods for Person Detection, Tracking and Identification, and Face Recognition with Applications (Sensors, MDPI, 2025)](https://www.mdpi.com/1424-8220/25/5/1410)
2. [A Survey on Face Detection in the wild: past, present and future (Zafeiriou, Zhang, Zhang, CVIU 2015)](https://ibug.doc.ic.ac.uk/media/uploads/documents/face_detection_survey.pdf)
3. [Detection Parameters, MTCNN Documentation](https://mtcnn.readthedocs.io/en/latest/usage_params/)
4. [Face detection guide | Google AI Edge (MediaPipe)](https://developers.google.com/edge/mediapipe/solutions/vision/face_detector)
5. [Rapid Object Detection Using a Boosted Cascade of Simple Features (Viola & Jones, CVPR 2001 / MERL TR2004-043)](https://merl.com/publications/docs/TR2004-043.pdf)
6. [RetinaFace: Single-Shot Multi-Level Face Localisation in the Wild (Deng et al., CVPR 2020; arXiv:1905.00641)](https://openaccess.thecvf.com/content_CVPR_2020/papers/Deng_RetinaFace_Single-Shot_Multi-Level_Face_Localisation_in_the_Wild_CVPR_2020_paper.pdf)
7. [insightface detection/scrfd README (official code and model zoo)](https://github.com/deepinsight/insightface/blob/master/detection/scrfd/README.md)
8. [Wei Wu, Hanyang Peng, Shiqi Yu (2023). YuNet: A Tiny Millisecond-level Face Detector. Machine Intelligence Research.](https://doi.org/10.1007/s11633-023-1423-y)
9. [Single-Stage Joint Face Detection and Alignment (RetinaFace technical report, ICCVW 2019, WIDER Challenge)](https://openaccess.thecvf.com/content_ICCVW_2019/papers/WIDER/Deng_Single-Stage_Joint_Face_Detection_and_Alignment_ICCVW_2019_paper.pdf)
10. [An Analysis of the Viola-Jones Face Detection Algorithm (IPOL)](https://ipol.im/pub/art/2014/104/revisions/2022-01-01/article.pdf)
11. [Lecture 11: AdaBoost and the Viola-Jones Face Detector (UIUC ECE 417)](https://courses.grainger.illinois.edu/ece417/fa2023/slides/lec11.pdf)
12. [Fast and Robust Classification using Asymmetric AdaBoost and a Detector Cascade (Viola & Jones, NIPS 2001)](https://proceedings.neurips.cc/paper/2001/file/0b1ec366924b26fc98fa7b71a9c249cf-Paper.pdf)
13. [Going Deeper Into Face Detection: A Survey](https://ar5iv.labs.arxiv.org/html/2103.14983)
14. [Ren, Shaoqing and colleagues (2015). Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1506.01497)
15. [Zhang, Kaipeng and colleagues (2016). Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1604.02878)
16. [Guo, Jia and colleagues (2021). Sample and Computation Redistribution for Efficient Face Detection. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2105.04714)
17. [Networks, MTCNN Documentation](https://mtcnn.readthedocs.io/en/latest/stages/)
18. [Bazarevsky, Valentin and colleagues (2019). BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1907.05047)
19. [Henry A. Rowley, Shumeet Baluja, Takeo Kanade (1997). Rotation Invariant Neural Network-Based Face Detection. .](https://doi.org/10.21236/ada341629)
20. [Detecting faces in images: a survey (Yang, Kriegman, Ahuja, IEEE TPAMI 2002)](https://cse.msu.edu/~rossarun/BiometricsTextBook/Papers/Face/Yang_FaceDetectionSurvey_PAMI02.pdf)
21. [Robust Real-Time Face Detection (Viola & Jones, IJCV 57:137–154, 2004)](https://link.springer.com/article/10.1023/B:VISI.0000013087.49260.fb)
22. [Yang, Shuo and colleagues (2015). WIDER FACE: A Face Detection Benchmark. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1511.06523)
23. [Sample and computation redistribution for efficient face detection, Imperial College London repository record](https://spiral.imperial.ac.uk/entities/publication/bdf701a0-1776-4c94-bafe-7aa5e27e8c18)
24. [Jiankang Deng and colleagues (2019). ArcFace: Additive Angular Margin Loss for Deep Face Recognition. CVPR 2019.](https://doi.org/10.1109/cvpr.2019.00482)
25. [Heterogeneous face detection based on multi-task cascaded convolutional neural network (IET Image Processing)](https://digital-library.theiet.org/doi/10.1049/ipr2.12344)
26. [Lin, Tsung-Yi and colleagues (2017). Focal Loss for Dense Object Detection. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1708.02002)
27. [WIDER FACE: A Face Detection Benchmark (Yang et al., CVPR 2016)](https://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Yang_WIDER_FACE_A_CVPR_2016_paper.pdf)
28. [Robustness Disparities in Face Detection (NeurIPS 2022 Datasets and Benchmarks)](https://proceedings.neurips.cc/paper_files/paper/2022/file/f9faef4e1b4dbbd48ef60056ffe14c90-Paper-Datasets_and_Benchmarks.pdf)
29. [A Comprehensive Review of Face Detection/Recognition Algorithms and Competitive Datasets to Optimize Machine Vision (CMC, 2025)](https://www.techscience.com/cmc/v84n1/61736)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Language and vision AI › Computer vision › Vision methods and geometry › Recognition and matching methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/face-detection

English original: https://www.edgepedia.org/face-detection
