As a cornerstone of blockchain technology in the 3.0 era, smart contracts play a pivotal role in the evolution of blockchain systems. In order to address the limitations of existing smart contract vulnerability detection models with regard to their generalisation capability, an AF-STip smart contract vulnerability detection framework incorporating efficient knowledge migration is proposed. AF-STip employs the teacher network as the main model and migrates the knowledge processed by the smart contract to the student model using a data-free knowledge distillation method. The student model utilises this knowledge to enhance its vulnerability detection capabilities. The approach markedly enhances the model's capacity for feature extraction and cross-class adaptation, while concurrently reducing computational overhead.In order to further enhance the extraction of vulnerability features, an adaptive fusion module is proposed in this paper, which aims to strengthen the interaction and fusion of feature information.The experimental results demonstrate that the STip model attains an average F1 value detection score of 91.16% for the four vulnerabilities without disclosing the original smart contract data. To validate the viability of the proposed lightweight migration approach, the student model is deployed in a migration learning task targeting a novel vulnerability type, resulting in an accuracy of 91.02% and an F1 score of 90.46%. To the best of our knowledge, AF-STip is the inaugural model to apply data-free knowledge migration to smart contract vulnerability detection. While markedly reducing the computational overhead, the method still demonstrates exceptional performance in detecting novel vulnerabilities.
翻译:作为区块链3.0时代的基石,智能合约在区块链系统演进中发挥着关键作用。为克服现有智能合约漏洞检测模型在泛化能力方面的局限,本文提出了一种融合高效知识迁移的AF-STIP智能合约漏洞检测框架。AF-STIP以教师网络为主体模型,采用无数据知识蒸馏方法将智能合约处理后的知识迁移至学生模型。学生模型利用该知识增强其漏洞检测能力。该方法显著提升了模型的特征提取与跨类别适应能力,同时降低了计算开销。为进一步增强漏洞特征提取,本文提出自适应融合模块,旨在强化特征信息的交互与融合。实验结果表明,在不公开原始智能合约数据的情况下,STip模型对四类漏洞的平均F1值检测分数达到91.16%。为验证所提轻量化迁移方法的可行性,将学生模型部署于针对新型漏洞类型的迁移学习任务,获得91.02%的准确率与90.46%的F1分数。据我们所知,AF-STIP是首个将无数据知识迁移应用于智能合约漏洞检测的模型。该方法在显著降低计算开销的同时,仍在对新型漏洞的检测中表现出卓越性能。