信息网络安全 ›› 2026, Vol. 26 ›› Issue (5): 725-735.doi: 10.3969/j.issn.1671-1122.2026.05.005

• 学术研究 • 上一篇    下一篇

基于改进黏菌算法的词级对抗样本生成方法

徐茹枝, 武晓欣()   

  1. 华北电力大学控制与计算机工程学院, 北京 102206
  • 收稿日期:2025-12-10 出版日期:2026-05-10 发布日期:2026-06-03
  • 通讯作者: 武晓欣 120232227082@ncepu.edu.cn
  • 作者简介:徐茹枝(1966—),女,江西,教授,博士,主要研究方向为智能电网、AI安全|武晓欣(2000—),女,河北,硕士研究生,主要研究方向为网络安全、AI安全
  • 基金资助:
    国家自然科学基金(62372173)

A Word-Level Adversarial Sample Generation Method Based on the Improved Slime Mold Algorithm

XU Ruzhi, WU Xiaoxin()   

  1. School of Control and Computer Engineering, North China Electric Power University, Beijing 102206, China
  • Received:2025-12-10 Online:2026-05-10 Published:2026-06-03

摘要:

在人工智能技术的持续革新与广泛应用的背景下,深度学习技术取得了突破性进展,但其在受到对抗样本攻击时往往展现出脆弱性。在自然语言处理领域,文本的离散性和语义约束使文本对抗攻击更具挑战性,其中单词级攻击作为典型组合优化任务,现有方法面临搜索空间构建易引发语义偏移和优化算法常陷入局部最优的双重瓶颈,难以高效探索高质量扰动策略。针对这些问题,文章提出一种基于改进黏菌算法的词级对抗样本生成方法。首先,通过构建基于义原知识的替换候选词搜索空间,有效约束替换词的语义一致性,避免传统方法中因语义偏移导致的文本自然度下降问题;然后,改进的黏菌算法通过离散空间逻辑运算重构位置更新规则,在全局探索与局部开发间实现动态平衡,避免算法陷入局部最优问题;最后,采用中日类形字字典的形近字替换策略,进一步增强对抗样本的攻击性。实验结果表明,该方法在中文情感分类任务中实现了对文本分类模型的有效攻击,分类准确率平均下降30%以上,且在语义相似度上显著优于对比方法。

关键词: 对抗样本, 单词级对抗攻击, 黏菌算法

Abstract:

In the context of the continuous innovation and wide application of artificial intelligence technology, deep learning has achieved significant breakthroughs, but it often shows vulnerability when subjected to adversarial sample attacks. In the field of natural language processing, the discreteness and semantic constraints of text make text adversarial attacks more challenging. Among them, word-level attacks, as a typical combinatorial optimization task, existing methods face the dual bottlenecks of easily causing semantic deviation in the construction of the search space and often getting stuck in local optima of the optimization algorithm, making it difficult to efficiently explore high-quality perturbation strategies. To address these issues, this paper proposed a word-level adversarial sample generation method based on the improved slime mold algorithm. Firstly, by constructing a search space of replacement candidate words based on semantic origin knowledge, it effectively constrained the semantic consistency of the replacement words, avoiding the problem of naturalness degradation of the text caused by semantic deviation in traditional methods; then, the improved slime mold algorithm reconstructed the position update rule through discrete space logical operations, achieving a dynamic balance between global exploration and local development, avoiding the problem of the algorithm getting stuck in local optima; finally, by using the substitution strategy of similar characters in Chinese and Japanese dictionaries, the attackability of the adversarial samples was further enhanced. Experimental results show that this method achieves effective attacks on text classification models in the Chinese sentiment classification task, with an average decrease in classification accuracy of more than 30%, and significantly outperforms the comparison methods in semantic similarity.

Key words: adversarial samples, word-level adversarial attack, slime mold algorithm

中图分类号: