SD-MIL: A Two-Stage De-Noising Framework for Smart Contract Vulnerability Detection via Multi-Instance Learning
Abstract
Safeguarding smart contracts is paramount to the security of the blockchain ecosystem. In recent years, numerous studies have employed deep learning techniques to detect vulnerabilities in smart contracts based on their bytecode. However, such approaches are primarily limited by inherent code redundancy and coarse-grained contract labeling. The former (e.g., auxiliary stack manipulations) dilutes vulnerability-revealing cues in each contract, whereas the latter hinders models from distinguishing the vulnerable contract from benign execution ones. To address these limitations, we propose SD-MIL, a two-stage de-noising detection framework based on Ethereum smart contract bytecode. In the static de-noising stage, SD-MIL employs a target-driven computation strand extraction algorithm to remove irrelevant code segments with respect to critical operation targets, and augments the resulting strands with abstract symbolic expressions to enrich the semantic representation of low-level bytecode with high-level intent. In the dynamic de-noising stage, SD-MIL adopts a detection model with semantic-gated multi-instance learning architecture, where computation strands augmented with symbolic expressions are treated as instances and the contribution of each strand is dynamically calibrated to focus on vulnerability-relevant patterns. Experiments on a real-world dataset covering five vulnerability types demonstrate the effectiveness of SD-MIL, achieving 0.9401 accuracy and 0.9268 F1-score. SD-MIL surpasses traditional static analysis tools with average improvements of 30.28% in accuracy and $\mathbf{2 8. 6 4 \%}$ in F1-score, and outperforms deep learning baselines by 8.46% in accuracy and 8.18% in F1-score.