[1]张光华,张思怡,高业萍,等.基于预训练和混合神经网络的智能合约漏洞检测[J].计算机技术与发展,2025,(01):94-100.[doi:10.20165/j.cnki.ISSN1673-629X.2024.0299]
 ZHANG Guang-hua,ZHANG Si-yi,GAO Ye-ping,et al.Smart Contract Vulnerability Detection Based on Pre-training and Hybrid Neural Networks[J].,2025,(01):94-100.[doi:10.20165/j.cnki.ISSN1673-629X.2024.0299]
点击复制

基于预训练和混合神经网络的智能合约漏洞检测()

《计算机技术与发展》[ISSN:1006-6977/CN:61-1281/TN]

卷:
期数:
2025年01期
页码:
94-100
栏目:
网络空间安全
出版日期:
2025-01-10

文章信息/Info

Title:
Smart Contract Vulnerability Detection Based on Pre-training and Hybrid Neural Networks
文章编号:
1673-629X(2025)01-0094-07
作者:
张光华张思怡高业萍武少广
河北科技大学 信息科学与工程学院,河北 石家庄 050018
Author(s):
ZHANG Guang-huaZHANG Si-yiGAO Ye-pingWU Shao-guang
School of Information Science and Engineering,Hebei University of Science Technology,Shijiazhuang 050018,China
关键词:
混合神经网络BERTTextCNN-BiLSTM智能合约漏洞检测
Keywords:
hybrid neural networksBERTTextCNN-BiLSTMsmart contractvulnerability detection
分类号:
TP309
DOI:
10.20165/j.cnki.ISSN1673-629X.2024.0299
摘要:
针对现有智能合约漏洞检测方法准确率低以及对合约源代码特征提取不足的问题,该文提出一种基于预训练 BERT 模型(Bidirectional Encoder Representations from Transformer,BERT)和混合神经网络串行的智能合约漏洞检测方案 SCVD-PBHNN。 首先,对源代码进行数据预处理,去除冗余信息,保留源代码中的关键语句信息;其次,利用 BERT 模型替换了传统的静态词嵌入模型,深入挖掘智能合约源代码的语义特征;然后,结合文本卷积神经网络(Text Convolutional Neural Network,TextCNN)和双向长短期记忆网络(Bi-directional Long Short-Term Memory,BiLSTM)混合神经网络构建特征提取层,对传入的词向量进行训练,充分提取源代码上下文信息和局部关键特征;最后,通过激活函数对特征向量进行归一化处理,实现漏洞检测与识别。 实验结果表明,该方案在准确率、精确率、召回率以及 F1 值等评价指标上相比已有方案均有明显提升,能准确识别四种常见的漏洞,准确率分别为 94. 40% 、93. 72% 、96. 29% 、93. 53% 。
Abstract:
Aiming at the problems of low accuracy of existing smart contract vulnerability detection methods and insufficient feature extraction of smart contract source code, we propose a new method based on pre - trained BERT model ( Bidirectional Encoder Representations from Transformer, BERT) and hybrid neural network serial smart contract vulnerability detection scheme SCVD - PBHNN. Firstly,the source code is preprocessed to remove redundant information and retain key statement information. Secondly,BERT model is used to replace the traditional static word embedding model and dig deep into the semantic features of smart contract source code. Then,combined with Text Convolutional Neural Network (TextCNN) and Bi-directional Long Short-Term Memory (BiLSTM) hybrid neural network to construct feature extraction layer,the incoming word vectors are trained to fully extract source code context in-formation and local key features. Finally,the feature vector is normalized by activation function to realize vulnerability detection and i-dentification. The experimental results show that compared with the existing schemes,the proposed scheme has significantly improved in the evaluation indexes of accuracy,precision,recall rate and F1 value,which can accurately identify four common vulnerabilities,with accuracy rates of 94. 40% ,93. 72% ,96. 29% and 93. 53% ,respectively.

相似文献/References:

[1]王珊珊,邹 佳,程 序,等.GSGD:一种基于 BERT 与本体推理的自动分级系统[J].计算机技术与发展,2020,30(08):97.[doi:10. 3969 / j. issn. 1673-629X. 2020. 08. 016]
 WANG Shan-shan,ZOU Jia,CHENG Xu,et al.An Automatic Grading System Based on BERT and Ontology Reasoning[J].,2020,30(01):97.[doi:10. 3969 / j. issn. 1673-629X. 2020. 08. 016]
[2]黄东晋,耿晓云,李 娜,等.基于混合特征的电影评分预测系统[J].计算机技术与发展,2020,30(12):136.[doi:10. 3969 / j. issn. 1673-629X. 2020. 12. 024]
 HUANG Dong-jin,GENG Xiao-yun,LI Na,et al.Film Rating Prediction System Based on Mixed Features[J].,2020,30(01):136.[doi:10. 3969 / j. issn. 1673-629X. 2020. 12. 024]
[3]何 涛,陈 剑,闻英友,等.基于堆叠模型的司法短文本多标签分类[J].计算机技术与发展,2021,31(03):27.[doi:10. 3969 / j. issn. 1673-629X. 2021. 03. 005]
 HE Tao,CHEN Jian,WEN Ying-you,et al.Multi-label Classification of Judicial Short Texts Based on Stacking Model[J].,2021,31(01):27.[doi:10. 3969 / j. issn. 1673-629X. 2021. 03. 005]
[4]蔡玉舒,曹 扬,江 维,等.基于 BERT 的端到端旅游评论意见挖掘方法[J].计算机技术与发展,2021,31(09):118.[doi:10. 3969 / j. issn. 1673-629X. 2021. 09. 020]
 CAI Yu-shu,CAO Yang,JIANG Wei,et al.End to End Opinion Mining Method Based on BERT for Tourism Comments[J].,2021,31(01):118.[doi:10. 3969 / j. issn. 1673-629X. 2021. 09. 020]
[5]龚汝鑫,余肖生.基于 BERT-BILSTM 的医疗文本关系提取方法[J].计算机技术与发展,2022,32(04):186.[doi:10. 3969 / j. issn. 1673-629X. 2022. 04. 032]
 GONG Ru-xin,YU Xiao-sheng.Relation Extraction Method of Medical Texts Based on BERT-BILSTM[J].,2022,32(01):186.[doi:10. 3969 / j. issn. 1673-629X. 2022. 04. 032]
[6]苏魁麟,张 凯,吕学强,等.基于融合模型的名词隐喻识别[J].计算机技术与发展,2022,32(06):192.[doi:10. 3969 / j. issn. 1673-629X. 2022. 06. 032]
 SU Kui-lin,ZHANG Kai,LYU Xue-qiang,et al.Noun Metaphor Recognition Based on Fusion Model[J].,2022,32(01):192.[doi:10. 3969 / j. issn. 1673-629X. 2022. 06. 032]
[7]刘华玲,孙 毅.基于实体识别和信息融合的知识图谱研究[J].计算机技术与发展,2022,32(09):107.[doi:10. 3969 / j. issn. 1673-629X. 2022. 09. 017]
 LIU Hua-ling,SUN Yi.Knowledge Graph Based on Entity Recognition and Information Fusion--A Case Study of COVID-19[J].,2022,32(01):107.[doi:10. 3969 / j. issn. 1673-629X. 2022. 09. 017]
[8]胡慧婷,李建平,董振荣,等.基于 BERT 模型的教育技术学领域实体抽取[J].计算机技术与发展,2022,32(10):164.[doi:10. 3969 / j. issn. 1673-629X. 2022. 10. 027]
 HU Hui-ting,LI Jian-ping,DONG Zhen-rong,et al.Named Entity Recognition Method in Educational Technology Field Based on BERT[J].,2022,32(01):164.[doi:10. 3969 / j. issn. 1673-629X. 2022. 10. 027]
[9]陶慧丹,段 亮,王笳辉,等.基于 BERT 的民间文学文本预训练模型[J].计算机技术与发展,2022,32(11):164.[doi:10. 3969 / j. issn. 1673-629X. 2022. 11. 024]
 TAO Hui-dan,DUAN Liang,WANG Jia-hui,et al.BERT Based Pre-training Model of Folk Literature Texts[J].,2022,32(01):164.[doi:10. 3969 / j. issn. 1673-629X. 2022. 11. 024]
[10]许鸿奎,周俊杰,姜彤彤,等.基于 BERT 和混合神经网络的诈骗电话文本识别[J].计算机技术与发展,2022,32(11):37.[doi:10. 3969 / j. issn. 1673-629X. 2022. 11. 006]
 XU Hong-kui,ZHOU Jun-jie,JIANG Tong-tong,et al.Chinese Telephone Fraud Text Recognition Based on Word Embedding and Hybrid Neural Network[J].,2022,32(01):37.[doi:10. 3969 / j. issn. 1673-629X. 2022. 11. 006]

更新日期/Last Update: 2025-01-10