Smart contracts are programs stored and run on blockchains, which conform to the decentralized characteristics of blockchains. Contract vulnerabilities can cause significant losses to blockchains, so vulnerability detection of smart contracts is crucial. This paper proposes an innovative smart contract vulnerability detection model R1-MFSol based on LLM and embedded multi-modal feature extraction and fusion modules. Specifically, the model extracts features from three modalities: contract source code, abstract syntax tree (AST), and grayscale image. Among them, the AST Encoder and the Grayscale Image Encoder respectively use graph isomorphism network and EfficientNet-B0 for feature extraction, which fully retains the semantic structure information and vulnerability features in the source code, while the DeepSeek-R1 model optimizes the feature extraction of the source code through the BBPE word segmentation algorithm and multi-layer MoE transformer architecture. Finally, R1-MFSol fuses the features of the three modalities with specific weights and classifies the vulnerabilities. We conducted extensive experiments on a real smart contract dataset containing four vulnerabilities, and the R1-MFSol model achieved 97.67% and 97.16% performance in accuracy and F1 score, respectively.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

R1-MFSol: a Smart Contract Vulnerability Detection Model Based on LLM and Multi-modal Feature Fusion

  • Huibo Yang,
  • Zhize Hao,
  • Tao Liu

摘要

Smart contracts are programs stored and run on blockchains, which conform to the decentralized characteristics of blockchains. Contract vulnerabilities can cause significant losses to blockchains, so vulnerability detection of smart contracts is crucial. This paper proposes an innovative smart contract vulnerability detection model R1-MFSol based on LLM and embedded multi-modal feature extraction and fusion modules. Specifically, the model extracts features from three modalities: contract source code, abstract syntax tree (AST), and grayscale image. Among them, the AST Encoder and the Grayscale Image Encoder respectively use graph isomorphism network and EfficientNet-B0 for feature extraction, which fully retains the semantic structure information and vulnerability features in the source code, while the DeepSeek-R1 model optimizes the feature extraction of the source code through the BBPE word segmentation algorithm and multi-layer MoE transformer architecture. Finally, R1-MFSol fuses the features of the three modalities with specific weights and classifies the vulnerabilities. We conducted extensive experiments on a real smart contract dataset containing four vulnerabilities, and the R1-MFSol model achieved 97.67% and 97.16% performance in accuracy and F1 score, respectively.