通过动态调节激活值提升模型对抗攻击鲁棒性。
Improving Adversarial Robustness via Activation Amplification and Attenuation

- 设计A3模块,用可学习掩码动态放大或抑制激活值。
- 放大扰动信号后构建对比损失,反向提升防御能力。
- 参数少、开销低,适配多种模型与数据集。
对抗攻击的存在常归因于神经网络中非鲁棒特征的存在。现有防御方法通过剪枝、掩码或特征重校准来减轻其影响,本文提出一种新的激活缩放机制,联合学习放大与抑制这些信号。为此,我们引入轻量级插件模块A3,通过可学习掩码和基于原始激活值的缩放因子动态调整激活值。通过反转缩放操作的符号,同一组可学习参数即可实现对对抗扰动的放大或抑制。被放大的信号作为负样本,用于构建新型对比和排序损失函数。实验表明,在放大模式下学习降低预测性能,能同时提升在抑制模式下的对抗鲁棒性。A3仅需少量可学习参数,其行为主要由缩放机制决定而非额外网络容量。大量实验显示,将A3集成到不同主干网络、数据集和训练方法中,均能一致提升对抗鲁棒性,且相比现有插件模块,计算与内存开销可忽略不计。代码已开源:https://github.com/tgoncalv/A3。
原文摘要 · Abstract (English)
The existence of adversarial attacks is often attributed to the presence of non-robust features in neural networks. While prior defenses reduce their impact via pruning, masking, or feature recalibration, we instead propose to jointly learn to amplify and attenuate these signals through a simple activation scaling mechanism. To this end, we introduce Activation Amplification and Attenuation (A3), a lightweight plug-in module that enhances adversarial robustness with minimal modifications of the activations. A3 dynamically rescales the activations using a learnable mask and a scaling factor derived from the original activation magnitudes. The influence of adversarial perturbations can be amplified or attenuated using the same learnable parameters by simply flipping the sign of the scaling operation. The amplified signals serve as negative references to construct novel contrastive and ranking loss functions. Experimental analysis shows that learning to degrade the predictions in amplification mode simultaneously improves adversarial robustness in attenuation mode. Moreover, A3 relies on only a small number of learnable parameters, with most of its behavior being determined by the scaling mechanism rather than additional network capacity. Extensive experiments demonstrate that integrating A3 into different backbones, datasets, and training methods consistently improves adversarial robustness while introducing negligible computational and memory overhead compared to existing plug-in modules. Code is available at: https://github.com/tgoncalv/A3.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。