TransURL:通过多层Transformer编码与多尺度金字塔特征改进恶意URL检测
TransURL: Improving malicious URL detection with multi-layer Transformer encoding and multi-scale pyramid features
AI总结:
针对Transformer在恶意URL检测中难提取局部、字符级及结构信息的问题,提出融合多层编码、多尺度特征学习和空间金字塔注意力的TransURL方法,在多类场景下检测性能显著优于现有方法。
摘要:
机器学习的发展正在推动恶意URL检测技术的进步。然而,应用于URL检测的先进Transformer模型在提取局部信息、字符级细节和结构关系方面存在困难。为解决这些挑战,我们提出了一种名为TransURL的新型恶意URL检测方法。该方法通过将字符感知Transformer与三个特征模块协同训练实现:多层编码模块、多尺度特征学习模块和空间金字塔注意力模块。这种专门设计的Transformer使TransURL能够从URL标记序列中提取包含字符级信息的嵌入,三个模块则助力融合多层Transformer编码,并捕获多尺度局部细节与结构关系。我们在多个具有挑战性的场景下评估了所提方法,包括类别不平衡学习、多分类、跨数据集测试和对抗样本攻击场景。实验结果表明,该方法相比已有方法实现了显著提升。例如,在类别不平衡场景下,其F1分数峰值提升了40%;在对抗攻击场景下,其准确率比最优基线模型高出14.13%。此外,案例研究显示,我们的方法准确识别了全部30个活跃恶意网页,而两种已有的先进方法分别漏检了4个和7个恶意网页。代码和数据可在以下链接获取:https://github.com/Vul-det/TransURL/。
英文摘要:
Machine learning progress is advancing the detection of malicious URLs. However, advanced Transformers applied to URLs face difficulties in extracting local information, character-level details, and structural relationships. To address these challenges, we propose a novel approach for malicious URL detection, named TransURL. This method is implemented by co-training the character-aware Transformer with three feature modules: Multi-Layer Encoding, Multi-Scale Feature Learning, and Spatial Pyramid Attention. This specialized Transformer enables TransURL to extract embeddings with character-level information from URL token sequences, with the three modules aiding the fusion of multi-layer Transformer encodings and the capture of multi-scale local details and structural relationships. The proposed method is evaluated across several challenging scenarios, including class imbalance learning, multi-classification, cross-dataset testing, and adversarial sample attacks. Experimental results demonstrate a significant improvement compared to previous methods. For instance, it achieved a peak F1-score improvement of 40% in class-imbalanced scenarios and surpassed the best baseline by 14.13% in accuracy for adversarial attack scenarios. Additionally, a case study demonstrated that our method accurately identified all 30 active malicious web pages, whereas two previous state-of-the-art methods missed 4 and 7 malicious web pages, respectively. The codes and data are available at: https://github.com/Vul-det/TransURL/.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。