Shujiang Xu , Haochen He , Miodrag J. Mihaljević , Shuhui Zhang , Wei Shao , Qizheng Wang
{"title":"DBC-MulBiLSTM: A DistilBERT-CNN Feature Fusion Framework enhanced by multi-head self-attention and BiLSTM for smart contract vulnerability detection","authors":"Shujiang Xu , Haochen He , Miodrag J. Mihaljević , Shuhui Zhang , Wei Shao , Qizheng Wang","doi":"10.1016/j.compeleceng.2025.110096","DOIUrl":null,"url":null,"abstract":"<div><div>With the burgeoning of blockchain technology, particularly the Ethereum platform, smart contracts, serving as the core technology of blockchain, have demonstrated immense potential in numerous fields. However, vulnerabilities in smart contracts have also become targets for cyberattacks, potentially leading to significant economic losses. This study introduces a DBC-MulBiLSTM framework designed for the detection of vulnerabilities in smart contracts. The framework first utilizes the lightweight pre-trained model DistilBERT to extract contextual features from smart contracts, while simultaneously utilizing Convolutional Neural Networks (CNN) to identify local features. Through feature fusion, a multi-dimensional feature representation is formed to improve the model’s capabilities to recognize complex vulnerability patterns. Furthermore, the framework incorporates a multi-head self-attention mechanism within the BiLSTM architecture, thereby establishing the MulBiLSTM training framework. This design enables the simultaneous capture of long-range dependencies throughout the entire dataset, enhancing the model’s ability to represent intricate dependencies and contextual information effectively. Experimental results demonstrate that DBC-MulBiLSTM exhibits substantial efficacy in the detection of vulnerabilities within smart contracts, achieving an F1 score of 95.44%, an accuracy rate of 96.57%, and a recall of 95.36%. For various vulnerability types, the model consistently achieves accuracy and F1-scores over 96%, and recall rates above 95%, showcasing efficient and accurate smart contract vulnerability detection capabilities.</div></div>","PeriodicalId":50630,"journal":{"name":"Computers & Electrical Engineering","volume":"123 ","pages":"Article 110096"},"PeriodicalIF":4.0000,"publicationDate":"2025-01-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computers & Electrical Engineering","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0045790625000394","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, HARDWARE & ARCHITECTURE","Score":null,"Total":0}
引用次数: 0
Abstract
With the burgeoning of blockchain technology, particularly the Ethereum platform, smart contracts, serving as the core technology of blockchain, have demonstrated immense potential in numerous fields. However, vulnerabilities in smart contracts have also become targets for cyberattacks, potentially leading to significant economic losses. This study introduces a DBC-MulBiLSTM framework designed for the detection of vulnerabilities in smart contracts. The framework first utilizes the lightweight pre-trained model DistilBERT to extract contextual features from smart contracts, while simultaneously utilizing Convolutional Neural Networks (CNN) to identify local features. Through feature fusion, a multi-dimensional feature representation is formed to improve the model’s capabilities to recognize complex vulnerability patterns. Furthermore, the framework incorporates a multi-head self-attention mechanism within the BiLSTM architecture, thereby establishing the MulBiLSTM training framework. This design enables the simultaneous capture of long-range dependencies throughout the entire dataset, enhancing the model’s ability to represent intricate dependencies and contextual information effectively. Experimental results demonstrate that DBC-MulBiLSTM exhibits substantial efficacy in the detection of vulnerabilities within smart contracts, achieving an F1 score of 95.44%, an accuracy rate of 96.57%, and a recall of 95.36%. For various vulnerability types, the model consistently achieves accuracy and F1-scores over 96%, and recall rates above 95%, showcasing efficient and accurate smart contract vulnerability detection capabilities.
期刊介绍:
The impact of computers has nowhere been more revolutionary than in electrical engineering. The design, analysis, and operation of electrical and electronic systems are now dominated by computers, a transformation that has been motivated by the natural ease of interface between computers and electrical systems, and the promise of spectacular improvements in speed and efficiency.
Published since 1973, Computers & Electrical Engineering provides rapid publication of topical research into the integration of computer technology and computational techniques with electrical and electronic systems. The journal publishes papers featuring novel implementations of computers and computational techniques in areas like signal and image processing, high-performance computing, parallel processing, and communications. Special attention will be paid to papers describing innovative architectures, algorithms, and software tools.