[关键词]
[摘要]
研究提出了一种基于混合风格迁移的智能合约漏洞检测方法,旨在解决智能合约新漏洞出现时数据集不足和无法有效检测未知漏洞问题。该方法首先从智能合约源代码中提取抽象语法树,使用图注意力网络来捕获节点间的依赖关系和信息流;然后,采用最大均值差异来实现从旧漏洞到新漏洞的有效知识迁移,从而增加深度学习模型训练的数据量;最后,在分类器中融入MixStyle技术以增强模型的泛化能力并提高对新型漏洞类型的识别准确度。实验结果表明,在四种漏洞类型的检测上,该方法在F1、ACC、MCC指标上优于BLSTM-ATT、BiGAS、Peculiar方法。
[Key word]
[Abstract]
The study proposes a smart contract vulnerability detection method based on MixStyle transfer, aiming to solve the problem of insufficient datasets and the inability to effectively detect unknown vulnerabilities when new vulnerabilities emerge in smart contracts. The method first extracts the abstract syntax tree from the smart contract source code and uses graph attention network to capture the dependencies and information flow between nodes; then, the Maximum Mean Discrepancy is used to achieve effective knowledge migration from old vulnerabilities to new ones, thus increasing the amount of data for deep learning model training; finally, the MixStyle technique is incorporated into the classifier to enhance the model"s generalization ability and improve the accuracy of identifying novel vulnerability types. The experimental results show that the method outperforms BLSTM-ATT, BiGAS, and Peculiar methods in F1, ACC, and MCC metrics for the detection of the four vulnerability types.
[中图分类号]
TP391?
[基金项目]