Author Login Chief Editor Login Reviewer Login Editor Login Remote Office

Computer Engineering ›› 2026, Vol. 52 ›› Issue (7): 287-301. doi: 10.19678/j.issn.1000-3428.0070755

• Cyberspace Security • Previous Articles     Next Articles

Multi-Level Chinese Adversarial Example Generation Method Based on Glyph and Semantic

SUN Yu1, WANG Hongjie1, DU Yanhui1, LIU Nan2,*()   

  1. 1. School of Information and Cyber Security, People's Public Security University of China, Beijing 100038, China
    2. National Engineering Research Center of Classified Protection and Safeguard Technology for Cybersecurity, Shanghai 200031, China
  • Received:2024-12-27 Revised:2025-03-02 Online:2026-07-15 Published:2025-04-14
  • Contact: LIU Nan

基于字形和语义的多级中文对抗样本生成方法

孙宇1, 王红杰1, 杜彦辉1, 刘楠2,*()   

  1. 1. 中国人民公安大学信息网络安全学院, 北京 100038
    2. 网络安全等级保护与安全保卫技术国家工程研究中心, 上海 200031
  • 通讯作者: 刘楠
  • 作者简介:

    孙宇(CCF学生会员), 男, 硕士研究生, 主研方向为人工智能安全、自然语言处理

    王红杰, 硕士研究生

    杜彦辉, 教授、博士

    刘楠(通信作者), 助理研究员、硕士

  • 基金资助:
    网络安全等级保护与安全保卫技术国家工程研究中心行动计划项目(C23640-XD-08); 中央高校基本科研业务费专项资金(2024JKF14)

Abstract:

Deep neural network language models are vulnerable to adversarial example attacks during application. To address this issue, adversarial examples are typically generated by adding minor perturbations to the original samples to mislead the model into making incorrect decisions. By studying generation methods for adversarial examples, the robustness of the models can be evaluated. Most existing Chinese adversarial example generation methods focus on improving the attack success rate of adversarial examples while overlooking quality indicators such as their stealthiness. Therefore, focusing on Chinese text adversarial example generation techniques and incorporating the unique characteristics of Chinese in terms of glyph structure and semantic features, a multi-level adversarial example generation method called CMSPSO is proposed that combines Chinese character glyphs and semantic information. The CMSPSO utilizes the Particle Swarm Optimization (PSO) algorithm to search for appropriate replacement combinations in a predesigned replacement knowledge base to generate adversarial examples. CMSPSO-M combines the multilingual visually similar character features of Chinese characters, calculates the similarity of visually similar characters through a trained Siamese Neural Network (SNN), and constructs a high-quality visual replacement character knowledge base to generate character-level adversarial examples. CMSPSO-S constructs a semantic replacement word knowledge base based on HowNet and WordNet to generate word-level adversarial examples and evaluates them using attack effectiveness and attack cost metrics. The experimental results demonstrate that CMSPSO exhibits significant attack effectiveness across multiple models and datasets, particularly on the XNLI dataset, where CMSPSO-M achieves an attack success rate of 84.22% against the RoBERTa model. Additionally, CMSPSO shows distinct advantages in terms of attack cost metrics, outperforming the baseline methods in terms of overall performance.

Key words: textural adversarial example, Chinese feature, Chinese text classification, deep neural network, artificial intelligence

摘要:

深度神经网络语言模型在应用过程中容易受到对抗样本攻击, 对此, 通常在原始样本中添加微小扰动生成对抗样本, 以误导模型做出错误决策。通过研究对抗样本的生成方法, 可以发现并评估模型的鲁棒性缺陷。现有的中文对抗样本生成方法大多关注如何提升对抗样本的攻击成功率, 而忽略了对抗样本的隐蔽性等质量指标。为此, 关注中文文本对抗样本生成技术, 结合中文在字形结构和语义特征方面的独特性, 提出一种结合汉字字形和语义信息的多级对抗样本生成方法CMSPSO。CMSPSO通过利用粒子群优化(PSO)算法, 在预先设计的替换知识库中搜索合适的替换组合以生成对抗样本。其中, CMSPSO-M结合汉字的多语言形近字特征, 通过训练的孪生神经网络(SNN)计算形近字相似度, 构建高质量的视觉替换字知识库, 以生成字符级对抗样本; CMSPSO-S基于HowNet和WordNet构建语义替换词知识库, 以生成词级对抗样本, 并通过攻击效果和攻击代价指标进行评估。实验结果表明, CMSPSO在多个模型和数据集上均展现出显著的攻击效果, 尤其在XNLI数据集上, CMSPSO-M对RoBERTa模型的攻击成功率达到84.22%。此外, 在攻击代价指标方面, CMSPSO也表现出明显优势, 整体性能优于基线方法。

关键词: 文本对抗样本, 中文特征, 中文文本分类, 深度神经网络, 人工智能