利用BERT编码解决SMS垃圾邮件检测中的Mad-lib攻击
Using BERT Encoding to Tackle the Mad-lib Attack in SMS Spam Detection
摘要:
欺骗垃圾邮件过滤器的策略之一是用同义词或类似的词代替可发音的词,使检测算法无法识别邮件。在本文中,我们调查是否最近开发的语言模型敏感的语义和上下文的话,如谷歌的BERT,可能是有用的,以克服这种对抗攻击(称为“疯狂的库”,根据单词替换游戏)。使用5572个SMS垃圾消息的数据集,我们首先使用广泛已知的文档表示模型(BoW和TFIDF)和新颖的BERT模型,结合各种分类算法(决策树,kNN,SVM,Logistic回归,朴素贝叶斯,多层感知器)建立了检测性能的基线。然后,我们建立了这些消息中包含的词汇的词库,并建立了一个Mad-lib攻击实验,在这个实验中,我们修改了一个数据子集(在基线实验中没有使用)的每条消息,用词库中的同义词替换原始单词的比率不同。最后,我们评估了三种表示模型(BoW,TFIDF和BERT)与基线实验(SVM)中的最佳分类器的检测性能。我们发现经典模型在原始数据集中达到了94%的平衡准确度(BA),而BERT模型达到了96%。另一方面,Mad-lib攻击实验表明,BERT编码在平均替换率为每条消息1.82个单词的情况下,能够保持96%的相似BA性能,在平均替换率为每条消息3.34个单词的情况下,能够保持95%的相似BA性能。相比之下,BoW和TFIDF编码器的BA性能下降到偶然。这些结果暗示了BERT模型在对抗这些类型的巧妙攻击方面的潜在优势,在一定程度上抵消了语言中语义关系的不当使用。
英文摘要:
One of the stratagems used to deceive spam filters is to substitute vocables with synonyms or similar words that turn the message unrecognisable by the detection algorithms. In this paper we investigate whether the recent development of language models sensitive to the semantics and context of words, such as Google's BERT, may be useful to overcome this adversarial attack (called "Mad-lib" as per the word substitution game). Using a dataset of 5572 SMS spam messages, we first established a baseline of detection performance using widely known document representation models (BoW and TFIDF) and the novel BERT model, coupled with a variety of classification algorithms (Decision Tree, kNN, SVM, Logistic Regression, Naive Bayes, Multilayer Perceptron). Then, we built a thesaurus of the vocabulary contained in these messages, and set up a Mad-lib attack experiment in which we modified each message of a held out subset of data (not used in the baseline experiment) with different rates of substitution of original words with synonyms from the thesaurus. Lastly, we evaluated the detection performance of the three representation models (BoW, TFIDF and BERT) coupled with the best classifier from the baseline experiment (SVM). We found that the classic models achieved a 94% Balanced Accuracy (BA) in the original dataset, whereas the BERT model obtained 96%. On the other hand, the Mad-lib attack experiment showed that BERT encodings manage to maintain a similar BA performance of 96% with an average substitution rate of 1.82 words per message, and 95% with 3.34 words substituted per message. In contrast, the BA performance of the BoW and TFIDF encoders dropped to chance. These results hint at the potential advantage of BERT models to combat these type of ingenious attacks, offsetting to some extent for the inappropriate use of semantic relationships in language.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。