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

计算机工程与科学 ›› 2026, Vol. 48 ›› Issue (3): 500-511.

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

基于SCViT的图像重构对抗样本防御方法

张新君,郭继发   

  1. (辽宁工程技术大学电子与信息工程学院,辽宁 葫芦岛 125105)

  • 收稿日期:2024-05-21 修回日期:2024-09-13 出版日期:2026-03-25 发布日期:2026-03-25
  • 基金资助:
    辽宁省教育厅高等学校基本科研项目(LJKMZ20220678)

An adversarial examples defense method for image reconstruction based on SCViT

ZHANG Xinjun,GUO Jifa   

  1. (School of Electronic and Information Engineering,Liaoning Technical University,Huludao 125105,China)
  • Received:2024-05-21 Revised:2024-09-13 Online:2026-03-25 Published:2026-03-25

摘要: 随着人工智能的日益发展,它给人们的生活带来极大便利的同时也逐渐引发人类对其安全性的思考。图像分类是计算机视觉领域的重要研究工作,但深度神经网络的脆弱性使其易受对抗样本的攻击。对抗样本是人工智能安全领域的一个重要研究方向,关于对抗样本的生成和防御技术层出不穷。以ViT为基础进行改动,提出了可用于图像块相似度比较的新模型——SCViT。SCViT中,图像块经线性投射层和Transformer Encoder得到对应的表示向量,将这些向量进行余弦相似度比较即可判断图像块的相似程度。为了降低位置编码对相似度计算的影响,在SCViT的位置编码前添加了微小系数α。利用SCViT进行图像块相似度比较,使用干净样本的图像块逐块取代对抗样本的图像块,最后将所有取代完成的干净样本的图像块拼接成新的图像用于分类。在CIFAR-10数据集上的实验结果表明,对参数α进行恰当取值,可提升方法的防御效果;在Inception_v3和Inception_v4分类模型上的实验结果表明,所提方法在不同分类网络上具有良好的迁移性;与几种常用的图像重构防御方法进行对比,所提方法在取得优异防御效果的同时鲁棒性也更好,对4种攻击方法下的图像分类正确率均达到了80%以上;在CIFAR-100和ImageNet数据集上进行实验,对抗样本的分类准确率分别提高了54个百分点以上和46个百分点以上,体现了所提方法的通用性。


关键词: 图像分类;对抗样本;图像拼接;vision Transformer, 泊松融合

Abstract: The growing development of artificial intelligence (AI) has brought great convenience to people’s lives, but it has also gradually triggered human contemplation regarding its security. Image classification is a crucial research task in the field of computer vision; however, the vulnerability of deep neural networks makes them susceptible to attacks from adversarial examples. Adversarial examples represent a significant research direction within the realm of AI security, with a plethora of techniques emerging for both generating and defending against them. This paper introduces modifications based on the vision Transformer (ViT) and proposes a novel model, similarity comparison vision Transformer (SCViT), for comparing the similarity of image patches. In SCViT, image patches are processed through a linear projection layer and a Transformer Encoder to obtain corresponding representation vectors. The cosine similarity between these vectors is then calculated to determine the degree of similarity between image patches. To mitigate the influence  of positional encoding on similarity computation, a small coefficient, denoted as α, is introduced before the positional encoding in SCViT. By utilizing SCViT for image patches similarity comparison, clean sample patches are used to replace adversarial sample patches one by one. Subsequently, all replaced clean sample patches are concatenated to form a new image for classification. Experimental results on the CIFAR-10 dataset demonstrate that selecting an appropriate value for α can enhance the defensive performance of the proposed method. Furthermore, experiments conducted on the Inception_v3 and Inception_v4 classification models indicate that the proposed  method exhibits good transferability across different classification networks. Compared with several commonly used image reconstruction defense methods, the proposed method not only achieves superior defensive performance but also demonstrates greater robustness, with image classification accuracy exceeding 80% against 4 types of attack methods. Additionally, experiments on the CIFAR-100 and ImageNet datasets show that the classification accuracy for adversarial examples improves by over 54 percentage points  and 46 percentage points, respectively, highlighting the versatility of the proposed method.


Key words: image classification, adversarial example, image stitching, vision Transformer, poisson fusion