A High-Performance Smart Contract Vulnerability Detection Scheme Based on BERT
Abstract
With the emergence of technologies like web3.0, smart contracts have witnessed a flourishing development trend. However, the threat posed by contract vulnerabilities hinders the progress in this field. Traditional vulnerability detection tools have lost their effectiveness due to the unique code and function characteristics of smart contracts. Consequently, a novel approach utilizing deep learning for intelligent contract vulnerability detection has emerged. Nevertheless, the current solutions still face bottlenecks in terms of accuracy and efficiency, primarily due to the scarcity of labeled vulnerability samples. To address these challenges, this paper proposes an efficient intelligent contract vulnerability detection approach called SCVulBERT, based on Bidirectional Encoder Representation from Transformers (BERT). The proposed approach leverages transfer learning and utilizes rich prior knowledge for training to ensure the modelās effectiveness in a scarce supervised sample environment. Furthermore, to enhance tokenization efficiency, a specialized tokenizer called SCVulTokenizer is designed to transform contract code into parameters recognizable by neural networks. The proposed approach utilizes the BERT network architecture to extract more precise and efficient features from the context, thereby achieving accurate and efficient vulnerability detection. Experimental comparisons demonstrate that the proposed approach outperforms existing solutions in the context of scarce supervised samples, exhibiting significant improvements in accuracy, precision, recall, and F1-score metrics. Specifically, regarding vulnerability detection for reentrancy, timestamp, and delegate call, the F1-scores achieved by the proposed approach show respective improvements of 13.71%, 13.14%, and 7.7% compared to the state-of-the-art solutions.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.