学术研究

基于全局先验引导的对抗样本生成方法

  • 席亮 1 ,
  • 汪宇航 1 ,
  • 张力 1 ,
  • 王天博 , 2, *
展开
  • 1. 哈尔滨理工大学计算机科学与技术学院,哈尔滨 150080
  • 2. 北京航空航天大学网络空间安全学院,北京 100191

网络出版日期: 2026-05-06

基金资助

教育部“春晖计划”(HZKY20220291);中央高校基本科研业务费资助(501XYGG2025139018)

版权

版权所有©《网络空间安全科学学报》编辑部 2025

Global prior-guided adversarial example generation method

  • Xi Liang 1 ,
  • Wang Yuhang 1 ,
  • Zhang Li 1 ,
  • Wang Tianbo , 2, *
Expand
  • 1. School of Computer Science and Technology, Harbin University of Science and Technology, Harbin 150080, China
  • 2. School of Cyber Science and Technology, Beihang University, Beijing 100191, China

Online published: 2026-05-06

Copyright

Copyright ©2025 Journal of Aeronautical Materials. All rights reserved.

摘要

深度神经网络在视觉任务中表现卓越,但易受对抗样本威胁。对抗样本在视觉上对人类几乎不可察觉,却能显著误导模型并危及系统安全;其迁移性使攻击者无需了解目标模型结构与参数即可实施有效攻击。已有方法虽在提升迁移性上取得进展,但生成扰动过度依赖短期即时局部梯度,缺乏全局先验约束,导致更新方向不稳,限制样本质量与跨模型泛化能力。因此,提出一种基于全局先验引导的对抗样本生成方法,在初始阶段利用早期扰动信息,形成全局先验以稳定梯度更新,从而更有效地突破目标模型的决策边界,显著提升对抗样本的生成质量。该方法不仅增强黑盒攻击的迁移性,还可集成至已有基于梯度的攻击框架。实验结果表明,在以基于输入变换与基于梯度的攻击方法作为基础方法时,该方法攻击成功率分别提升15.80%和15.60%,同时保持扰动的不可感知性。

本文引用格式

席亮 , 汪宇航 , 张力 , 王天博 . 基于全局先验引导的对抗样本生成方法[J]. 网络空间安全科学学报, 2025 , 3(6) : 90 -99 . DOI: 10.20172/j.issn.2097-3136.250607

Abstract

Deep neural networks have demonstrated remarkable performance in visual tasks but remain vulnerable to adversarial examples. Such examples are visually imperceptible to humans yet can significantly mislead models and threaten system security. Their transferability further enables attackers to launch effective attacks without knowing the structure or parameters of the target model. Although existing approaches have made progress in improving transferability, they often rely excessively on short-term, local gradients while lacking global prior constraints. This leads to unstable update directions, limiting both the quality of adversarial examples and their cross-model generalization. To address this issue, this paper proposes a global prior-guided adversarial example generation method. By leveraging early perturbation information in the initial stage, the method constructs a global prior to stabilize gradient updates, thereby facilitating more effective traversal of the target model’s decision boundary and significantly improving the quality of adversarial examples. The proposed method not only enhances the transferability of black-box attacks but can also be seamlessly integrated into existing gradient-based attack frameworks. Experimental results show that, when using input transformation–based and gradient-based attack methods as the baselines, the proposed method increases the attack success rate by up to 15.80% and 15.60%, respectively, while keeping the perturbations imperceptible.

0 引言

深度神经网络已经被广泛应用于各种任务并展现出了卓越能力,如人脸检测、自动驾驶、医疗诊断等。然而,深度神经网络容易受到对抗样本的攻击,这些对抗样本在正常输入上添加了人类难以察觉的扰动,导致神经网络产生错误的判定[1-2]。而且,对抗样本存在迁移性,即基于一个模型生成的对抗样本可以迁移到其他目标模型上进行攻击。这种可迁移性使得对抗攻击在现实场景中成为可能[3-4]
根据攻击者对于目标模型所掌握的知识程度,对抗攻击可分为白盒攻击[1,5]与黑盒攻击[6-7]两类。白盒攻击需要攻击者拥有目标模型的全部信息。相反,黑盒攻击考虑的是一种更为现实的场景,即攻击者无法直接访问目标模型。因此,黑盒攻击与白盒攻击相比更具有实际意义。
黑盒攻击主要分为两类,基于查询的攻击和基于迁移的攻击。基于查询的攻击通过向目标模型发送查询并收集目标模型的输出构造对抗样本。这种攻击通常需要大量查询,而目标模型的查询接口通常会有次数限制,大量的查询行为会被服务提供商检测到。基于迁移的攻击利用对抗样本的跨模型迁移性,在代理模型上生成对抗样本,对目标模型实施攻击,不需要事先了解目标模型的任何信息,在实际场景中具有很强的隐蔽性。
基于迁移的黑盒攻击的关键挑战是如何提升对抗样本的迁移性,即代理模型生成的对抗样本在目标模型上的攻击成功率。现有的基于迁移的对抗方法大致可被分为4类:①基于梯度的攻击[6,8],通常结合各种动量技术以稳定优化过程并改善收敛性。②基于输入变换的攻击[7,9],对输入图像进行变换,以增强梯度多样性。③基于高级目标函数的攻击[10-11],利用中间层特征设计新的目标函数。④集成攻击[12-13],同时对多个模型进行攻击,以提升对抗样本迁移性。然而这些方法在对抗样本的生成过程中过于依赖当前的梯度信息,缺乏全局的先验引导,使得生成过程中梯度不稳定,导致生成的对抗样本质量不高,迁移能力不足。因此,本文提出了一种基于全局先验引导的对抗样本生成方法(Global Prior-guided Adversarial Example Generation Method,GPAE),将已有方法扩展为多次迭代过程并在迭代初始阶段利用早期扰动信息,形成全局先验以稳定后续过程中的梯度更新,缓解了已有方法依赖短期即时局部梯度而造成的梯度不稳定的局限,从而获得迁移性更好的对抗样本。
本文的主要贡献如下:
1)提出一种基于全局先验的对抗样本生成方法,将已有方法扩展为多次迭代过程,并在迭代初始阶段利用早期扰动信息形成全局先验,稳定梯度更新,缓解已有方法的局限。该方法不仅增强黑盒攻击的迁移性,还可集成至已有梯度攻击框架;
2)在ILSVRC 2012验证集上的实验结果表明,本文提出的方法能够提升已有攻击方法的攻击成功率,并证明了其有效性。

1 相关工作

1.1 对抗攻击

本文以黑盒攻击为手段研究基于迁移的对抗样本生成策略,现对迁移策略目前的研究进展进行分析,并总结对抗防御的基本方式和特点。

1.1.1 基于梯度的攻击

Goodfellow等[1]提出了快速梯度符号方法(Fast Gradient Sign Method,FGSM),通过在损失函数梯度方向上加噪声来生成对抗样本。Kurakin等[14]将FGSM的单步加噪过程扩展为多步,提出了迭代快速梯度符号方法(Iterative FGSM,I-FGSM)。FGSM和I-FGSM在白盒场景下取得了较为出色的效果,但在黑盒场景下缺乏迁移性。Dong等[6]首次将动量项集成至I-FGSM,提出了动量迭代快速梯度符号方法(Momentum I- FGSM,MI-FGSM),利用动量项存储历史梯度信息,达到更好的迁移性。Lin等[15]采用Nesterov加速梯度,提出了Nesterov动量迭代快速梯度符号方法(Nesterov I-FGSM,NI-FGSM)。Wang等[8]提出了虚拟动量迭代快速梯度符号法(Virtual MI-FGSM,VMI-FGSM),细化梯度方差,稳定更新方向。Ge等[16]发现位于损失曲面局部平缓区域的对抗样本拥有更好的迁移性,提出了惩罚梯度范数(Penalizing Gradient Norm,PGN)方法,使对抗样本能够优化到平坦区域。

1.1.2 基于输入变换的攻击

数据增强是提升模型泛化能力的有效方式之一。许多方法对输入图像进行变换以提升对抗样本的迁移性。Xie等[17]通过在计算梯度之前对输入图像进行随机缩放或填充,获得了多样化的输入方法(Diverse Input Method,DIM),实现了迁移性的提升。Dong等[18]提出了平移不变性方法(Translation-invariant Method,TIM),通过将原始未平移过的图像的梯度与特定的卷积核进行卷积运算,达到了与多幅图像平移后再进行优化同样的效果。Wang等[19]将原始图像与另外不同类别的图像进行融合,提出了Admix方法,实现了将混合思想用于对抗攻击方法,能减少对代理模型的过拟合问题,从而提升对抗样本迁移性。Wang等[7]则从注意力热图的角度出发,将输入图像分块并进行块打乱与旋转,扰乱了原始图像的注意力热图,优化对抗扰动,使对抗样本能够在不同模型上具有更一致的注意力热图,进而提高迁移性。

1.1.3 基于高级目标函数的攻击

该类方法通常对中间层特征进行扰动,设计一个新的目标函数,以提升对抗样本的迁移性。Zhou等[20]提出了可迁移的对抗扰动(Transferable Adversarial Perturbations,TAP),增大中间层特征间的距离,并通过正则化项平滑对抗扰动。Wang等[21]通过最小化加权特征图来破坏对模型决策有显著影响的目标感知特征,通过对输入图像进行随机像素级掩码处理计算聚合权重,并由此计算聚合梯度,以更新对抗扰动。Zhang等[22]提出了基于神经元归因的攻击(Neuron Attribution-based Attacks,NAA),通过评估单个神经元对于对抗样本生成的重要性,更高效地生成对抗样本。

1.1.4 集成攻击

集成攻击的核心是同时对多个模型攻击,以提升迁移性。Dong等[6]通过聚合所有代理模型的输出生成对抗样本;Xiong等[13]通过减小集成模型之间的梯度方差,使生成的扰动更具泛化性,但是集成攻击需要计算多个模型的梯度,会带来额外的开销。
上述4种方法从不同角度来提升对抗样本的迁移性,基于梯度的方法核心思路是优化梯度,基于输入变换的攻击方法与集成攻击都是为了获得多样化的梯度,而基于高级目标函数的攻击则是通过攻击目标模型中间层的特征来提升迁移性,但它们都需要依赖短期即时局部梯度生成对抗样本,缺乏全局的先验引导,导致它们生成对抗样本的过程中梯度不稳定,获得的对抗样本质量不高,迁移性不强。

1.2 对抗防御

目前,已出现许多方法来抵御对抗样本带来的威胁。对抗训练[23-24]是其中最为有效的手段之一。它在训练过程中引入对抗样本,让模型在更新参数时同时最小化两类样本的损失,从而提升模型的鲁棒性。Guo等[25]使用多种图像变换(如JPEG压缩)对输入进行预处理,能够一定程度上防范对抗样本。Liao等[26]提出了高层表示引导的去噪器(High-level Representation Guided Denoiser,HGD),通过最小化模型在干净图像与去噪图像上的输出差异来实现防御。Xie等[27]提出了随机缩放与填充(Randomization and Padding,R&P)的方法实现防御。Xu等[28]则通过降低颜色深度(Bit-Depth Reduction,Bit-Red)并结合平滑策略来实现防御。Naseer等[29]开发了神经表示净化器(Neural Representation Purifier,NRP),通过自监督对抗训练来净化图像。此外,一些具有可验证防御能力的认证防御方法也被提出,例如随机平滑[30](Randomized Smoothing,RS)。Nie等[31]提出的基于扩散模型的净化方法也展现出巨大潜力。

2 方法

2.1 问题定义

给定一个被攻击的模型f,它的参数为θ。现在有一个干净的图像xX和真实标签y,其中,xd维,X表示所有合法图像。对抗攻击的目标是找到一个对抗样本x+δX,使得:
$ f(x;\theta )\neq f(x+\delta ;\theta )s.t.{\left|\left|\delta \right|\right|}_{p}\leqslant \varepsilon $
其中,ε代表所能够添加扰动的最大值,δ表示在干净图片x上添加的扰动,||·||pLp范式。本文会与已有工作保持一致,使用L∞范式。对抗攻击可以被视为一个优化问题,寻找的δ是一个最优值,满足在最大的扰动范围内,使得损失函数J最大:
$ \delta =\underset{{\left|\left|\delta \right|\right|}_{p}\leqslant \varepsilon }{\arg \max }J(x+\delta ,y;\theta ) $
对抗样本的迁移性可以由攻击成功率(Attack Success Rates,ASR)度量:
$ {\mathrm{ASR}}=\frac{1}{\left| X\right| }\sum\limits_{x\in X}I[f(x)\neq f(x+\delta )] $
其中,I(·)为指示函数,当条件满足时记为1,反之记为0。

2.2 动机

在对抗样本的生成过程中,损失函数对于输入的梯度是至关重要的。已有研究表明,神经网络损失表面的高度非凸性和不平滑性,直接计算得到的梯度往往包含噪声,在优化过程中还可能出现梯度消失或爆炸问题,从而导致生成的扰动无效或质量欠佳[5-6]。因此,如何提升梯度的稳定性以提高对抗样本的生成质量是一个核心问题。
本文提出一种基于全局先验引导的对抗样本生成方法,将已有方法扩展为多次迭代的过程,并在迭代初期利用早期扰动信息形成全局先验以稳定梯度更新。这样做相当于在每次迭代中引入了一种方向偏置,有助于稳定梯度更新,减少随机性和不稳定性。
从优化的角度看,对抗样本生成可以被视为一个带约束的非凸优化问题,其目标是在有界扰动约束内(如本文中采用L∞范数)内最大化损失函数[5]。然而,传统攻击方法容易陷入局部最优点,因而只能得到次优的对抗扰动。通过引入多次迭代机制,本文方法在本质上实现了一种“重启优化”,每次迭代利用上次迭代的全局先验引导作为初始化,从而增强了全局搜索能力,降低了陷入次优解的风险[32]。从迁移性的角度来看,采用多样化的梯度信息进行攻击通常能生成更具迁移性的对抗样本,其理论基础可归因于不同模型间决策边界的对齐性[6]。本文方法在每次迭代中都引入新的初始化与方向偏差,相当于在攻击过程中增加了多样性,从而进一步提升对抗样本的迁移性。

2.3 先验引导的对抗攻击

在现有的对抗攻击方法中,对抗样本的生成过程为T步,t=0,1,···,T−1。以MI-FGSM为例,其对抗样本的生成过程如下。
首先给定一张干净图片x0,输入到源模型中,得到预测概率$ \widehat{y} $,计算交叉熵损失函数:
$ L(y,\overset{\wedge }{y})=-\sum\limits_{i=1}^{C}{y}_{i}\log ({\overset{\wedge }{y}}_{i}) $
其中,y是真实标签,C是分类类别数。
然后,计算这个损失关于输入的梯度g,通过sign函数获得梯度方向,通过步长α控制每步添加的噪声大小,由此获得经过一步加噪后的对抗样本x1
$ {x}_{1}={x}_{0}+\alpha \cdot {\mathrm{sign}}(g) $
继续把x1作为下一步的输入,经过T步加噪,就可以获得最终的对抗样本。
在第t步时,计算得到的梯度为:
$ {g}_{t}={\nabla }_{{{x}_{t}}}L(f({x}_{t},y;\theta )) $
其中,xt为第t步时的对抗样本。
MI-FGSM进行梯度的累积:
$ {g}_{t+1}=\mu \cdot {g}_{t}+\frac{{g}_{t+1}}{{\left|\left|{g}_{t+1}\right|\right|}_{1}} $
对抗样本的更新过程为:
$ {x}_{t+1}={\mathrm{cli{p}}}_{x,\varepsilon }({x}_{t}+\alpha \cdot {\mathrm{sign}}({g}_{t+1})) $
其中,μ为动量衰减因子,clip为裁剪操作,目的是确保每步添加的噪声不会超过最大值ε
GPAE的整体流程如图1所示。图中左侧部分为对抗样本的生成过程,红色虚线部分为已经生成的对抗样本攻击目标模型的过程。GPAE在已有的方法基础之上扩展为多次迭代过程,其中,每次迭代j=0,1,···,S−1。当j=0时,本文保持已有方法的生成过程不变,经过多步加噪之后得到对抗样本$ x_{T-1}^{0} $,即图中$ x_{T-1}^{j} $j=0时的情形。当j>0时,GPAE开始起作用。本文用上一次迭代最终生成的对抗样本与初始干净样本做减法,获得上一次迭代的全局噪声的信息,利用这个信息为当前迭代提供初始加噪声的方向,即提供了一个全局先验引导,使得后续生成过程中能够保持梯度稳定,最终获得质量高且迁移性更强的对抗样本。
图 1 GPAE整体流程

Fig.1 Overall Flowchart of GPAE

j>0时,全局先验引导信息gj的定义为:
$ {g}_{j}=x_{T-1}^{j}-{x}_{0} $
其中,$ x_{T-1}^{\mathrm{j}} $为第j次迭代生成的对抗样本。在第j次迭代,第t步时添加噪声的方向$ d_{t}^{j} $为:
$ d_{t}^{j}=\begin{cases} {g}_{j},t=0\\{\nabla }_{{x_{t}^{j}}}L(f(x_{t}^{j},y;\theta )),t \gt 0\end{cases} $
梯度的累积与对抗样本的更新规则变为:
$ d_{t+1}^{j}=\mu \cdot d_{t}^{j}+\frac{d_{t+1}^{j}}{{\left|\left|d_{t+1}^{j}\right|\right|}_{1}} $
$ x_{t+1}^{j}={\mathrm{cli{p}}}_{x,\varepsilon }(x_{t}^{j}+\alpha \cdot {\mathrm{sign}}(d_{t+1}^{j})) $
经过S次迭代之后,本文获得了最终的对抗样本。
使用GPAE获得的对抗样本与已有方法获得的对抗样本以及干净样本分别去攻击目标模型,从图1中可知,已有方法在有些图片生成的对抗样本虽然能够降低模型分类的置信度,但是依旧不能够误导模型,但是这些图片在经过本文所提出的GPAE生成对抗样本之后,能够成功误导模型误分类,且置信度很高,这在后续的实验可视化部分可以被证明,从而说明本文方法的有效性。而且,GPAE兼容性好,可快速集成至已有方法中。以MI-FGSM为例,整体流程如算法1所示。
算法1 GPAE算法(以MI-FGSM为例)
输入:具有真实标签y的干净图片x,交叉熵损失函数L,模型参数为θ。对抗样本扰动上界ε;最大步数T;动量系数μ;最大迭代数S
输出:xadv
1:α = ε /T
2:for j = 0,1,···,S−1 do
3:  g0 = 0
4:  for t = 0,1,···,T−1 do
5:   当j = 0时,通过式(6)、式(7)计算梯度,然后通过式(8)更新
6:   当j >0时,通过式(10)、式(11)得到加噪方向,然后通过式(12)更新
7:返回xadv = $ x_{T-1}^{S-1} $

3 实验结果及分析

3.1 实验设置

与文献[8,19]工作保持一致,本文从ILSVRC 2012数据集[33]验证集中随机选择1000张不同类别的图片来评估本文方法。图片的尺寸为299×299。
实验选取7个自然训练的模型,ResNet-50[34]、ResNet-152[34]、VGG-19[35]、DenseNet-121[36]、Inception-v3[37]、Inception-v4[38]以及Inception-ResNet-v2(IncRes-v2)[38]。这些模型在选取的1 000张图片上的分类准确率都几乎达到100%。
为了充分论证本文方法的优势,本文选择基于输入变换攻击方法中的DIM[17]、TIM[18]、Admix[19]和BSR[7],以及基于梯度攻击中的方法中的MI-FGSM[6]、NIFGSM[15]、SINI-FGSM[15]、VMI-FGSM[8]、VNI-FGSM[8]、GI-FGSM[39]、GAA[40]与本文方法进行对比分析。
对于所有的攻击方法,本文参考相关文献设置扰动的最大值ε=16/255,步数T=10,步长α=ε/T,动量衰减因子μ=1.0。对于DIM,转换概率设置为0.5;对于TIM,采用15×15的高斯核;对于Admix:混合比例设置为0.2,混合的副本数量设置为3;对于BSR,图像被划分的数量num_block为3。对于SINI-FGSM,经过尺度变换的对抗样本的副本数量m=5;对于VMI-FGSM和VNI-FGSM,采样数量N=5,邻域上界因子beta=3/2;对于GI-FGSM,预迭代的次数为5。对于GAA,超参数的设置均按照其原文中最佳设置;对于本文方法,迭代次数S=5。本文所有实验使用PyTorch 1.11.0实现,并在NVIDIA A100 Tensor Core GPU上完成。

3.2 实验结果

3.2.1 基于输入变换攻击的评估

在基于迁移的攻击方法中,基于输入变换的方法受到了广泛的关注。本文方法可以很容易与这些方法结合以提升对抗样本的迁移性。本文将GPAE与4种输入变换方法结合,分别使用Inception-v3、IncRes-v2和DenseNet-121作为源模型,实验结果如表1所示。结果表明,本文方法能够超越原有方法,特别是在以IncRes-v2为源模型时,攻击成功率分别高出13.40%、15.80%、10.40%和5.30%。
表 1 本文方法与基于输入变换的攻击方法的攻击成功率

Table 1 Attack success rate of input transformation-based attack methods and our method

源模型 攻击方法 目标模型
ResNet-50 ResNet-152 VGG-19 DensNet-121 Inception-v3 Inception-v4 IncRes-v2
Inception-v3 DIM 66.30% 56.50% 65.90% 67.90% 99.60% 70.90% 68.30%
DIM-GPAE 68.50% 62.50% 70.90% 73.30% 100.00% 77.40% 73.30%
TIM 45.90% 38.10% 49.30% 53.60% 98.30% 53.10% 47.10%
TIM-GPAE 51.60% 42.50% 55.70% 59.90% 100.00% 60.50% 53.80%
Admix 71.60% 66.50% 73.40% 73.60% 99.90% 78.40% 75.70%
Admix-GPAE 75.40% 70.40% 76.30% 77.60% 100.00% 82.20% 78.70%
BSR 87.90% 78.30% 89.50% 90.10% 99.60% 87.30% 83.80%
BSR-GPAE 92.30% 85.60% 92.10% 95.00% 100.00% 93.80% 90.60%
IncRes-v2 DIM 62.60% 58.00% 65.80% 63.20% 71.10% 68.00% 94.30%
DIM-GPAE 74.00% 69.90% 76.50% 76.60% 82.40% 80.20% 99.00%
TIM 47.70% 41.10% 49.10% 54.10% 56.20% 52.90% 86.50%
TIM-GPAE 60.00% 52.90% 60.00% 66.10% 72.00% 65.10% 96.50%
Admix 72.10% 67.50% 71.90% 72.80% 78.60% 75.60% 96.60%
Admix-GPAE 82.50% 77.20% 81.20% 82.40% 88.20% 84.90% 99.10%
BSR 90.10% 83.00% 89.50% 91.30% 91.90% 89.50% 98.60%
BSR-GPAE 94.10% 88.30% 93.30% 95.50% 95.10% 93.10% 99.20%
DenseNet-121 DIM 93.50% 90.70% 93.20% 100.00% 83.90% 83.10% 76.50%
DIM-GPAE 98.00% 96.20% 97.90% 100.00% 87.90% 90.60% 84.30%
TIM 81.60% 72.10% 79.00% 100.00% 67.50% 68.80% 58.10%
TIM-GPAE 88.20% 81.40% 84.40% 100.00% 75.70% 75.90% 69.20%
Admix 95.90% 91.90% 95.30% 99.90% 82.50% 82.10% 72.30%
Admix-GPAE 97.40% 95.20% 97.60% 100.00% 84.90% 86.20% 78.50%
BSR 97.90% 94.50% 98.90% 100.00% 91.70% 93.50% 85.20%
BSR-GPAE 99.50% 98.80% 99.80% 100.00% 96.00% 97.80% 92.40%

3.2.2 基于梯度攻击的评估

本文选择了7种基于梯度攻击的代表性方法,分别是MI-FGSM、NI-FGSM、SINI-FGSM、VMI-FGSM、VNI-FGSM、GI-FGSM以及GAA。本文依旧采用Inception-v3、IncRes-v2和DenseNet-121作为源模型,实验结果如表2所示。结果表明,本文方法依旧能够在所有模型上超越原有方法。在以Inception-v3模型为源模型时,GPAE攻击成功率相较于原方法提升12.50%,在IncRes-v2和DenseNet-121作为源模型时,GPAE攻击成功率分别提升15.60%和11.20%。
表 2 本文方法与基于梯度的攻击方法的攻击成功率

Table 2 Attack success rate of gradient-based attack methods and our method

源模型 攻击方法 目标模型
ResNet-50 ResNet-152 VGG-19 DenseNet-121 Inception-v3 Inception-v4 IncRes-v2
Inception-v3 MI-FGSM 51.20% 41.80% 53.50% 51.60% 100.00% 49.30% 46.30%
MI-FGSM-GPAE 53.50% 43.80% 59.40% 55.40% 100.00% 52.80% 51.60%
NI-FGSM 61.50% 50.00% 63.20% 59.80% 100.00% 60.30% 57.50%
NI-FGSM-GPAE 66.70% 54.30% 66.00% 66.70% 100.00% 65.20% 63.10%
SINI-FGSM 73.10% 67.20% 73.00% 75.10% 100.00% 75.60% 75.70%
SINI-FGSM-GPAE 79.50% 72.80% 79.40% 81.50% 100.00% 83.50% 81.50%
VMI-FGSM 64.90% 57.20% 65.90% 67.40% 100.00% 70.40% 69.10%
VMI-FGSM-GPAE 75.90% 70.30% 76.30% 75.90% 100.00% 81.30% 77.70%
VNI-FGSM 72.30% 64.90% 71.70% 73.50% 100.00% 78.00% 75.60%
VNI-FGSM-GPAE 82.00% 78.90% 82.50% 82.90% 100.00% 88.30% 85.90%
GI-FGSM 75.70% 69.70% 73.40% 76.00% 99.60% 81.90% 79.90%
GI-FGSM-GPAE 84.90% 81.50% 85.90% 83.80% 100.00% 89.00% 88.30%
GAA 79.80% 74.70% 79.40% 80.90% 99.70% 85.60% 85.20%
GAA-GPAE 90.90% 87.20% 88.90% 89.50% 100.00% 93.80% 92.40%
IncRes-v2 MI-FGSM 53.50% 45.90% 56.40% 50.50% 56.10% 51.00% 97.50%
MI-FGSM-GPAE 61.40% 51.60% 64.90% 58.60% 63.60% 56.80% 99.70%
NI-FGSM 57.80% 47.00% 62.40% 53.50% 57.60% 53.90% 98.70%
NI-FGSM-GPAE 63.80% 53.20% 68.40% 61.50% 66.30% 60.60% 100.00%
SINI-FGSM 76.40% 72.00% 76.40% 76.90% 85.10% 80.90% 99.30%
SINI-FGSM-GPAE 85.70% 79.30% 84.00% 85.40% 90.30% 86.70% 100.00%
VMI-FGSM 65.90% 61.70% 68.70% 67.10% 74.90% 69.60% 98.20%
VMI-FGSM-GPAE 79.30% 76.50% 81.50% 81.50% 87.00% 85.00% 99.40%
VNI-FGSM 70.80% 65.60% 72.40% 70.80% 77.50% 73.40% 98.20%
VNI-FGSM-GPAE 83.90% 80.60% 85.10% 85.80% 89.70% 89.00% 99.70%
GI-FGSM 74.10% 69.30% 74.00% 73.30% 79.00% 77.50% 97.10%
GI-FGSM-GPAE 85.20% 81.80% 86.40% 87.00% 88.50% 90.30% 98.00%
GAA 77.20% 75.00% 77.20% 76.80% 84.00% 83.40% 94.60%
GAA-GPAE 89.40% 86.20% 90.10% 91.30% 92.30% 94.70% 98.90%
DenseNet-121 MI-FGSM 87.00% 79.60% 85.20% 100.00% 64.50% 62.90% 54.30%
MI-FGSM-GPAE 91.00% 85.10% 89.90% 100.00% 68.20% 68.60% 58.20%
NI-FGSM 92.30% 85.20% 90.70% 100.00% 69.00% 67.10% 59.30%
NI-FGSM-GPAE 95.30% 91.90% 95.90% 100.00% 74.50% 75.20% 64.00%
SINI-FGSM 96.40% 92.00% 95.20% 100.00% 83.30% 83.10% 76.30%
SINI-FGSM-GPAE 98.70% 97.00% 97.80% 100.00% 88.80% 89.70% 82.30%
VMI-FGSM 94.50% 91.50% 93.90% 100.00% 80.10% 82.70% 74.10%
VMI-FGSM-GPAE 98.80% 97.70% 98.90% 100.00% 89.80% 92.00% 85.30%
VNI-FGSM 97.50% 93.50% 95.70% 100.00% 83.50% 84.30% 77.00%
VNI-FGSM-GPAE 99.70% 98.70% 99.30% 100.00% 91.90% 94.10% 87.80%
GI-FGSM 98.00% 94.60% 96.90% 100.00% 85.90% 88.40% 81.90%
GI-FGSM-GPAE 98.60% 96.00% 97.90% 100.00% 92.30% 93.90% 90.50%
GAA 98.90% 97.30% 98.40% 100.00% 93.80% 93.40% 89.60%
GAA-GPAE 99.00% 97.40% 98.00% 100.00% 95.90% 94.00% 93.20%

3.2.3 防御机制的评估

为了进一步评估GPAE攻击的有效性,本文还测试了GPAE在面对JPEG[25]、R&P[27]、Bit-Red[28]、FD[41]、NRP[29]、RS[30]、DiffPure[31]多种先进防御机制时的攻击成功率。本实验选择VNI-FGSM作为基础方法,相关结果如表3所示。从表3可知,GPAE依旧能够提升原有方法在面对诸多先进防御机制时的攻击成功率,平均能够提升13.27%。这些结果证明了GPAE在应对防御机制的有效性。
表 3 本文方法与VNI-FGSM面对7种防御机制时的攻击成功率

Table 3 Attack success-rates between the VNI-FGSM and VNI-FGSM-GPAE against seven defenses

攻击方法R&PBit-RedFDJPEGNRPRSDiffPure平均
VNI-FGSM73.00%71.00%73.50%68.20%43.80%30.40%17.30%53.89%
VNI-FGSM-GPAE86.50%86.20%88.30%84.00%58.90%39.70%26.50%67.16%

3.3 可视化

为了进一步验证GPAE的有效性,本实验使用Grad-CAM[42]工具绘制了干净样本与不同攻击方法生成的对抗样本的注意力热图。注意力热图可以反映模型在做出决策时最为关注的图像区域(颜色由深到浅对应模型关注的程度由强到弱,颜色越深,关注度越高)。本文使用IncRes-v2作为源模型,分别绘制了干净样本、VNI-FGSM生成的对抗样本以及VNI-FGSM-GPAE生成的对抗样本,如图2所示。第一行和第二行分别是样本及其对应的注意力热图。从图中观察可知,VNI-FGSM虽然能够降低模型的置信度,但是不能完全误导模型错误分类,注意力热图也可以体现出来,两者的注意力热图的差异并不大。而本文所提出的方法不仅能够误导模型错误分类,而且置信度可以达到79.32%,从注意力热图上看,可以显著地转移模型的注意力,从而证明本文所提出的方法的有效性。
图 2 干净样本与两种攻击方法生成的对抗样本的注意力热图

Fig.2 Attention heatmaps between clean samples and adversarial samples generated by two attack methods

3.4 参数实验

GPAE引入了迭代次数S,为了探究S对于攻击成功率的影响,本文使用VNI-FGSM-GPAE进行参数实验,迭代数S的范围为1到10,获得的对抗样本依旧在前述的7个模型上进行测试,结果如图3所示。当S=1时,VNI-FGSM-GPAE退化成VNI-FGSM。当S>5时,对抗样本的攻击成功率的提升幅度随S的增大而减少,但S增大会导致对抗样本的生成时间变长。因此,为了兼顾性能与效率,本文最终选择迭代次数为5。综合来看,当S=5时,GPAE在对抗样本生成的时间上比已有方法长,但是对抗样本生成过程中涉及前向与反向过程次数少,由此所带来的额外时间开销换取明显的攻击效果提升是可以接受的,所以GPAE是切实可行且有效的。
图 3 不同S下VNI-FGSM-GPAE的攻击成功率

Fig.3 Attack success-rate of VNI-FGSM-GPAE with different S

4 结束语

本文提出了一种基于全局先验引导的对抗样本生成方法。与已有攻击方法相比,本文方法将对抗样本的生成过程扩展至多次迭代过程,并在迭代的初始阶段利用早期扰动信息提供全局先验引导,使得后续生成过程中梯度更新更加稳定,从而生成迁移性更强的对抗样本。在ILSVRC 2012验证集上进行了大量的实验,证明本文所提出的GPAE方法能够提升已有攻击方法的攻击成功率,此外,本文还进行了可视化的实验,通过Grad-CAM工具分别绘制了现有方法与本文所提出的GPAE方法生成的对抗样本的注意力热图,证明了该方法的可行性与有效性。在未来工作中,本文将进一步探索提升对抗样本生成过程中梯度稳定性的策略,提升已有方法的性能。
1
Goodfellow I J, Shlens J, Szegedy C. Explaining and harnessing adversarial examples[C]//International Conference on Learning Representations, San Diego: 2015. 1-11.

2
Szegedy C, Zaremba W, Sutskever I, et al. Intriguing properties of neural networks[C]//International Conference on Learning Representations, Banff: ICLR, 2014: 1-10.

3
Kong Z L, Guo J F, Li A, et al. PhysGAN: generating physical-world-resilient adversarial examples for autonomous driving[C]//Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2020: 14242-14251.

4
Qi L F, Wang H B, Zhang J Q, et al. Unsupervised domain adaptive person search via dual self-calibration[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2025, 39 (6): 6550- 6558.

DOI

5
Madry A, Makelov A, Schmidt L, et al. Towards deep learning models resistant to adversarial attacks[C]//International Conference on Learning Representations, Toulon, 2018.

6
Dong Y P, Liao F Z, Pang T Y, et al. Boosting adversarial attacks with momentum[C]//Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2018: 9185-9193.

7
Wang K Y, He X R, Wang W X, et al. Boosting adversarial transferability by block shuffle and rotation[C]//Proceedings of the 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) . Piscataway: IEEE Press, 2024: 24336-24346.

8
Wang X S, He K. Enhancing the transferability of adversarial attacks through variance tuning[C]//Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) . Piscataway: IEEE Press, 2021: 1924-1933.

9
Zhu R Y, Zhang Z L, Liu Z, et al. Learning to transform dynamically for better adversarial transferability[C]//Proceedings of the 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2024: 24273-24283.

10
Li Q, Guo Y, Zuo W, et al. Improving adversarial transferability via intermediate-level perturbation decay [C]//Proceedings of the Advances in Neural Information Processing Systems, 2023. 1638-1655.

11
Huang Q, Katsman I, Gu Z Q, et al. Enhancing adversarial example transferability with an intermediate level attack[C]//Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision (ICCV). Piscataway: IEEE Press, 2019: 4732-4741.

12
Chen H, Zhang Y, Dong Y, et al. Rethinking model ensemble in transfer-based adversarial attacks[C]//Proceedings of the International Conference on Learning Representations, Vienna: ICLR, 2024.

13
Xiong Y F, Lin J D, Zhang M, et al. Stochastic variance reduced ensemble adversarial attack for boosting the adversarial transferability[C]//Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2022: 14963-14972.

14
Kurakin A, Goodfellow I J, BENGIO S. Adversarial examples in the physical world [C]//Proceedings of the International Conference on Learning Representations (Workshops), Toulon, 2017. 1-14.

15
Lin J, Song C, He K, et al. Nesterov accelerated gradient and scale invariance for adversarial attacks[C]//Proceedings of the International Conference on Learning Representations New or leans: ICLR, 2019. 1-23.

16
Ge Z, Wang X, Liu H, et al. Boosting adversarial transferability by achieving flat local maxima[C]//Proceedings of the Advances in Neural Information Processing Systems, New York: ACM, 2023. 31766-31781.

17
Xie C H, Zhang Z S, Zhou Y Y, et al. Improving transferability of adversarial examples with input diversity[C]//Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2019: 2725-2734.

18
Dong Y P, Pang T Y, Su H, et al. Evading defenses to transferable adversarial examples by translation-invariant attacks[C]//Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2019: 4307-4316.

19
Wang X S, He X R, Wang J D, et al. Admix: enhancing the transferability of adversarial attacks[C]//Proceedings of the 2021 IEEE/CVF International Conference on Computer Vision (ICCV). Piscataway: IEEE Press, 2021: 16138-16147.

20
Zhou W, Hou X, Chen Y J, et al. Transferable adversarial perturbations[M]. Computer Vision – ECCV 2018. ChamSpringer International Publishing, 2018: 471-486.

21
Wang Z B, Guo H C, Zhang Z F, et al. Feature importance-aware transferable adversarial attacks[C]//Proceedings of the 2021 IEEE/CVF International Conference on Computer Vision (ICCV) . Piscataway: IEEE Press, 2021: 7619-7628.

22
Zhang J P, Wu W B, Huang J T, et al. Improving adversarial transferability via neuron attribution-based attacks[C]//Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) . Piscataway: IEEE Press, 2022: 14973-14982.

23
Shafahi A, Najibi M, Ghiasi A, et al. Adversarial training for free![C]//Proceedings of the 33rd International Conference on Neural Information Processing Systems. New York: ACM, 2019: 3358-3369.

24
Tramer F, Kurakin A, Papernot N, et al. Ensemble adversarial training: attacks and defenses [C]//Proceedings of the International Conference on Learning Representations, Vancouver: ICLR, 2018. 1-29.

25
Guo C, Rana M, Cisse M, et al. Countering adversarial images using input transformations[C]//Proceedings of the International Conference on Learning Representations, Vancouver: ICLR, 2018. 1-16.

26
Liao F Z, Liang M, Dong Y P, et al. Defense against adversarial attacks using high-level representation guided denoiser[C]//Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2018: 1778-1787.

27
Xie C, Wang J, Zhang Z, et al. Miti-gating adversarial effects through randomization [C]//Proceedings of the International Conference on Learning Representations, Vancouver: ICLR, 2018.

28
Xu W, Evans D, Qi Y. Feature squeezing: detecting adversarial examples in deep neural networks [C]//Proceedings of the Network and Distributed System Security Symposium, San Diego: Internet Society, 2018. 1-15.

29
Naseer M, Khan S, Hayat M, et al. A self-supervised approach for adversarial robustness[C]//Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2020: 259-268.

30
Cohen J, Rosenfeld E, Kolter J Z. Certified adversarial robustness via randomized smoothing [C]//Proceedings of the International Conference on Machine Learning, 2019: 1310-1320.

31
Nie W, Guo B, Huang Y, et al. Diffusion models for adversarial purification [C]//Proceedings of the International Conference on Machine Learning, 2022: 16805-16827.

32
Croce F, Hein M. Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks[C]//Proceedings of the 37th International Conference on Machine Learning. New York: ACM, 2020: 2206-2216.

33
Russakovsky O, Deng J, Su H, et al. ImageNet large scale visual recognition challenge[J]. International Journal of Computer Vision, 2015, 115 (3): 211- 252.

DOI

34
He K M, Zhang X Y, Ren S Q, et al. Deep residual learning for image recognition[C]//Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2016: 770-778.

35
Simonyan K. Very deep convolutional networks for large-scale image recognition [C]//Proceedings of the International Conference on Learning Representations, San Diego: ICLR, 2015. 1-14.

36
Huang G, Liu Z, Van Der M L, et al. Densely connected convolutional networks[C]//Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2017: 2261-2269.

37
Szegedy C, Vanhoucke V, Ioffe S, et al. Rethinking the inception architecture for computer vision[C]//Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2016: 2818-2826.

38
Szegedy C, Ioffe S, Vanhoucke V, et al. Inception-v4, inception-ResNet and the impact of residual connections on learning[C]//Proceedings of the AAAI Conference on Artificial Intelligence, San Francisco: AAAI Press, 2017, 31: 4278-4285.

39
Wang J F, Chen Z Y, Jiang K X, et al. Boosting the transferability of adversarial attacks with global momentum initialization[J]. Expert Systems with Applications, 2024, 255, 124757.

DOI

40
Gan F Q, Wo Y. Boosting the transferability of adversarial examples through gradient aggregation[J]. IEEE Transactions on Information Forensics and Security, 2025, 20, 5563- 5576.

DOI

41
Liu Z H, Liu Q, Liu T, et al. Feature distillation: DNN-oriented JPEG compression against adversarial examples[C]//Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Piscataway: IEEE Press, 2019: 860-868.

42
Selvaraju R R, Cogswell M, Das A, et al. Grad-CAM: visual explanations from deep networks via gradient-based localization[C]//Proceedings of the 2017 IEEE International Conference on Computer Vision (ICCV). Piscataway: IEEE Press, 2017: 618-626.

文章导航

/