To address the issues of poor generalization and weak robustness against strong adversarial perturbations in existing face recognition defense methods against adversarial patches, a segmentation-based adversarial patch defense (SAPD) framework is proposed. In this method, a U-Net segmentation network fused with an attention mechanism is constructed, and a multi-scale hybrid loss function is employed to realize pixel-level patch localization. A morphological mask smoothing (MMS) strategy is introduced to effectively remove perturbations while preserving facial structure. An occluded-area regularization (OAR) loss function is further designed to improve occlusion robustness without adversarial training, maintaining clean-data accuracy. The experiments conducted on the LFW dataset with the added adversarial patches showed that the recognition accuracies of the method for the eyeglass-shaped patches, mask-shaped patch 1, and mask-shaped patch 2 reach 92.50%, 96.16%, and 95.67%, respectively. Furthermore, consistent performance gains are observed across mainstream face recognition models such as MobileFaceNet, FaceNet, and IResNet50, verifying the strong compatibility, generalization capability, and practical value of the proposed approach.
深度学习驱动的人脸识别系统凭借强大的特征表达能力,已成为智能门禁、移动支付和公共安全等关键场景的核心技术。以ArcFace[1]为例,其在LFW(Labeled Faces in the Wild)干净数据集上的识别准确率高达99.83%,显著超越人类水平。然而,其安全性正受到现实世界中局部对抗补丁攻击的严重威胁:攻击者可将打印的对抗补丁附着于眼镜[2]、帽子[3]或口罩[4-5]等日常物品上,诱使系统误判身份。在此类攻击下,识别准确率常从99%以上骤降至10%以下。此类攻击因成本低、隐蔽性强且破坏性高,极易绕过安防机制,造成非授权访问与身份伪造,对金融与公共安全构成重大风险。
利用可见面部区域进行识别,可在一定程度上缓解遮挡带来的负面影响。此类方法被学界称为遮挡感知人脸识别(Occlusion-Aware Face Recognition, OAFR)[8]。当前主流OAFR方法普遍采用“先检测、后识别”范式,即首先定位遮挡区域,再从未被遮挡部分提取判别性特征用于身份匹配。
早期工作中[9-11],将人脸划分为若干非重叠块,训练支持向量机(Support Vector Machine, SVM)分类器判断各块是否被遮挡,并在匹配时融合未遮挡区域特征。在此基础上,文献[12]提出对抗遮挡感知人脸检测(Adversarial Occlusion-Aware Face Detection, AOFD),进一步引入对抗掩码机制,通过随机屏蔽局部区域迫使模型关注核心判别结构,并辅以分割分支处理不完整人脸。文献[13]基于区域重要性评估,降低模型对易遮挡区域的依赖。文献[14]提出一种联合遮挡检测与分割模块,用于识别潜在被遮挡的人脸组件并生成对应的遮挡掩码。
近年来,基于检测—中和和分割—修复的方法成为主流,但是这种思路模型的识别准确率、泛化能力面临挑战。文献[23]提出PatchGuard,利用小感受野和异常值掩蔽机制定位并中和对抗补丁,但需要对主干分类器架构进行大量修改。其改版PatchCleanser[24],采用两阶段判断机制,兼容任意分类器。然而,二者均在面对大面积或复杂形状补丁时性能显著下降。文献[25]提出分割与补全方法(Segment and Complete, SAC),采用基于图像重建的防御范式,首先检测并分割出对抗补丁区域,然后通过图像修复去除扰动。但该方法分割精度较低,且对多样化补丁形状和尺寸的泛化能力较差。文献[26]提出PatchTracker,通过追踪对抗补丁在深层特征图中的高响应区域并动态掩蔽,实现对已知补丁位置的抑制。而PatchTracker依赖补丁在特征空间产生显著激活这一假设,在面对低强度或伪装性强的物理补丁时,其响应与正常人脸区域难以区分,导致漏检或误抑,防御性能不稳定。文献[27]提出一种面向多样对抗补丁的鲁棒自适应防御方法(Robust and Adaptive Defense Against Diverse Adversarial Patches, RADAP),进一步改进这个思路,结合FCutout和F-patch策略,并引入傅里叶空间采样掩码的分割器,增强了人脸识别中的遮挡鲁棒性;同时,引入边缘感知二值交叉熵(Edge-Aware Binary Cross-Entropy, EBCE)损失函数提高补丁检测精度。尽管F-patch实现了更高的分割精度,但其分割与填充(Split and Fill, SAF)策略会改变原有的对抗补丁形状,覆盖由原本未被干扰的有效人脸特征区域,削弱了模型的整体表征能力。综上,以上方法虽摆脱了对抗训练依赖,却陷入高精度分割难实现、低质量修复必伤身份的困境,一旦分割不准或修复策略僵化,防御过程本身即成为性能瓶颈。
ABANet是由Focal、结构相似性指数(Structural Similarity Index Measure, SSIM)与交并比(Intersection over Union, IoU)构成的复合损失函数。Focal可缓解遮挡与非遮挡区域间的像素级类别不平衡,提升边缘定位精度;IoU则通过直接优化预测掩码与真实掩码的空间重叠度,改善边界对齐性能。为进一步增强像素级判别能力,引入BCE损失,度量预测概率与二值标签间的逐像素分类误差,其定义如式(1)所示:
基于FaceNet[30]框架,保留Inception-ResNet-v1[31]的1~16层卷积层;将全局平均池化替换为广义均值池化(Generalized Mean Pooling, GeM)[32]以增强遮挡鲁棒性;用ArcFace损失替代不稳定的三元组损失。设主干输出特征图,对每个位置(i, j)计算通道L2范数的平方作为局部激活强度,以度量局部激活强度,如式(6)所示:
DENGJ K, GUOJ, XUEN N, et al. ArcFace: additive angular margin loss for deep face recognition[C]//Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway, USA: IEEE, 2020:4685-4694.
[2]
SHARIFM, BHAGAVATULAS, BAUERL, et al. Accessorize to a crime: real and stealthy attacks on state-of-the-art face recognition[C]//Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security. New York, USA: ACM, 2016:1528-1540.
[3]
KOMKOVS, PETIUSHKOA. AdvHat: real-world adversarial attack on ArcFace face ID system[C]//Proceedings of the 2020 25th International Conference on Pattern Recognition. Piscataway, USA: IEEE, 2021:819-826.
[4]
LIUX L, SHENF R, ZHAOJ, et al. RSTAM: an effective black-box impersonation attack on face recognition using a mobile and compact printer[DB/OL]. (2022-06-25)[2026-01-02].
[5]
ZOLFIA, AVIDANS, ELOVICIY, et al. Adversarial mask: real-world universal adversarial attack on face recognition models[M]//AMINI M R, CANU S, FISCHER A, et al. Machine learning and knowledge discovery in databases. Cham, Switzerland: Springer, 2023:304-320.
[6]
RONNEBERGERO, FISCHERP, BROXT. U-Net: convolutional networks for biomedical image segmentation[M]//NAVAB N, HORNEGGER J, WELLS W, et al. Medical image computing and computer-assisted intervention. Cham, Switzerland: Springer, 2015:234-241.
[7]
OKTAYO, SCHLEMPERJ, LE FOLGOCL, et al. Attention U-Net: learning where to look for the pancreas[DB/OL]. (2018-04-11)[2026-01-02].
[8]
ZENGD, VELDHUISR, SPREEUWERSL. A survey of face recognition techniques under occlusion[J]. IET Biometrics, 2021,10(6):581-606.
[9]
CHENZ H, XUT R, HANZ Y. Occluded face recognition based on the improved SVM and block weighted LBP[C]//Proceedings of the 2011 International Conference on Image Analysis and Signal Processing. Piscataway, USA: IEEE, 2011:118-122.
[10]
MINR, HADIDA, DUGELAYJ L. Improving the recognition of faces occluded by facial accessories[C]//Proceedings of the 2011 IEEE International Conference on Automatic Face & Gesture Recognition. Piscataway, USA: IEEE, 2011:442-447.
SÁEZ TRIGUEROSD, MENGL, HARTNETTM. Enhancing convolutional neural networks for face recognition with occlusion maps and batch triplet loss[J]. Image and Vision Computing, 2018,79:99-108.
[14]
MINR, HADIDA, DUGELAYJ L. Efficient detection of occlusion prior to robust face recognition[J]. The Scientific World Journal, 2014,2014:No.519158.
[15]
DZIUGAITEG K, GHAHRAMANIZ, ROYD M. A study of the effect of JPG compression on adversarial images[DB/OL]. (2016-08-02)[2026-01-02].
[16]
HAYESJ. On visible adversarial perturbations & digital watermarking[C]//Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. Piscataway, USA: IEEE, 2018:1597-1604.
[17]
NASEERM, KHANS, PORIKLIF. Local gradients smoothing: defense against localized adversarial attacks[C]//Proceedings of the 2019 IEEE Winter Conference on Applications of Computer Vision. Piscataway, USA: IEEE, 2019:1300-1307.
[18]
CHIANGP Y, NIR K, ABDELKADERA, et al. Certified defenses for adversarial patches[DB/OL]. (2020-03-14)[2026-01-02].
[19]
WUT, TONGL, VOROBEYCHIKY. Defending against physically realizable attacks on image classification[DB/OL]. (2019-09-20)[2026-01-02].
[20]
MADRYA, MAKELOVA, SCHMIDTL, et al. Towards deep learning models resistant to adversarial attacks[DB/OL]. (2017-06-19)[2026-01-02].
XIANGC, BHAGOJIA N, SEHWAGV, et al. PatchGuard: a provably robust defense against adversarial patches via small receptive fields and masking[DB/OL]. (2020-05-17)[2026-01-02].
[24]
XIANGC, MAHLOUJIFARS, MITTALP. PatchCleanser: certifiably robust defense against adversarial patches for any image classifier[C]//Proceedings of the 31st USENIX Security Symposium. Berkeley, USA: USENIX Association, 2022:2065-2082.
[25]
LIUJ, LEVINEA, LAUC P, et al. Segment and complete: defending object detectors against adversarial patch attacks with robust patch detection[C]//Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway, USA: IEEE, 2022:14953-14962.
LIUX L, SHENF R, ZHAOJ, et al. RADAP: a robust and adaptive defense against diverse adversarial patches on face recognition[J]. Pattern Recognition, 2025,157:No.110915.
HEK M, ZHANGX Y, RENS Q, et al. Deep residual learning for image recognition[C]//Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway, USA.: IEEE, 2016:770-778.
[30]
SCHROFFF, KALENICHENKOD, PHILBINJ. FaceNet: a unified embedding for face recognition and clustering[C]//Proceedings of the 2015 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway, USA: IEEE, 2015:815-823.
[31]
SZEGEDYC, IOFFES, VANHOUCKEV, et al. Inception-v4, inception-ResNet and the impact of residual connections on learning[C]//Proceedings of the 31th AAAI Conference on Artificial Intelligence. Palo Alto, USA: AAAI Press, 2017:4278-4284.
[32]
RADENOVIĆF, TOLIASG, CHUMO. Fine-tuning CNN image retrieval with No human annotation[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019,41(7):1655-1668.
[33]
REZVANIS, YASINR. MFSD: masked face segmentation dataset for face-related tasks[EB/OL]. (2024-03-17)[2026-01-02].
ANWARA, RAYCHOWDHURYA. Masked face recognition for secure authentication[DB/OL]. (2020-08-25)[2026-01-02].
[36]
KARRAST, AILAT, LAINES, et al. Progressive growing of GANs for improved quality, stability, and variation[DB/OL]. (2017-10-27)[2026-01-02].
[37]
GUOJ Z, ZHUX Y, LEIZ, et al. Face synthesis for eyeglass-robust face recognition[M]//ZHOU J, WANG Y H, SUN Z N, et al. Biometric recognition. Cham, Switzerland: Springer, 2018:275-284.
[38]
TONGL, CHENZ Z, NIJ C, et al. FACESEC: a fine-grained robustness evaluation framework for face recognition systems[C]//Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway, USA: IEEE, 2021:13249-13258.
[39]
CHENS, LIUY, GAOX, et al. MobileFaceNets: efficient CNNs for accurate real-time face verification on mobile devices[M]//ZHOU J, WANG Y H, SUN Z N, et al. Biometric recognition. Cham, Switzerland: Springer, 2018:428-438.