MCLF: Smart Contract Vulnerability Detection Based on Multimodal and Contrastive Learning
Abstract
Security vulnerabilities in smart contracts pose a serious threat to the blockchain ecosystem. Traditional detection methods heavily rely on expert-defined rules, leading to issues such as high false positives, false negatives, and poor scalability. Although recent deep learning-based approaches have shown promise, most focus on a single code modality, which limits their ability to capture the multi-dimensional characteristics of complex vulnerabilities. To address these limitations, this paper proposes MCLF, a novel smart contract vulnerability detection framework based on multimodal feature fusion and contrastive learning. The approach simultaneously extracts a Data Flow Graph and code semantic sequences from smart contracts to capture structural dependencies and contextual semantic information, respectively. A dual-branch Transformer architecture is designed to encode each type of feature, while contrastive learning is applied to optimize vector space alignment and enhance intra-class consistency. A masked language modeling task is further incorporated to improve semantic reasoning through multi-task joint training. Finally, transfer learning is employed to fine-tune the model for downstream vulnerability classification. Experimental results on a public benchmark dataset demonstrate that the proposed method achieves precision, recall, and F1score of 91.90%, 92.53% and 92.21%, respectively, significantly outperforming the most advanced vulnerability detection tools and validating the effectiveness of multimodal feature fusion and the contrastive learning mechanism.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.