Adaptive Graph Contrastive Learning for Blockchain Smart Contract Vulnerability Detection
摘要
Detecting vulnerabilities in smart contracts is essential for ensuring the security and reliability of blockchain applications. However, existing graph neural network based methods often rely on expert-crafted features or function call surfaces. And the long-tail distribution in vulnerability datasets causes biased learning toward majority classes. Contrastive learning has been explored as a way to alleviate this issue. But existing augmentation strategies often introduce noise in contrastive learning, degrading representation quality. To address these issues, we propose the Adaptive Graph Contrastive Learning (AGCL) framework. AGCL utilizes the unsupervised multi-level structural attention (UMSA) mechanism to extract the similarity between nodes from semantic, structure and nested function calls. It includes mask degree-free GCN (MDR-GCN) and harmonic distance loss (HDL) to improve the separation between positive and negative representations. Experimental results on ESC and VSC datasets for Reentrancy and Infinite Loop detection surpasses the existing SOTA methods. This performance gain is achieved with full consideration of complex code, such as semantic, structure and nested function calls.