Deep learning (DL), with its remarkable capability to automatically extract features from source code, has emerged as a prominent approach in the field of source code vulnerability detection. However, existing methods focus solely on spatial domain information, constrained by limited receptive fields and insufficient modeling of long-distance dependencies, failing to adequately capture vulnerability patterns spanning across multiple code segments. To address these limitations, we propose Heterogeneous Wavelet-enhanced Vulnerability Detection (HeteroWaveVD), a novel framework that synergistically leverages the global modeling capabilities of Vision Transformers (ViTs) with the strong local feature extraction ability and computational efficiency of Convolutional Neural Networks (CNNs). We develop WaveDetectCNN by enhancing the CNN architecture with wavelet transform convolutions and a specialized Code Defect Attention mechanism. The wavelet transform enables multi-scale frequency domain analysis of code features, effectively capturing both detailed local patterns and broader structural relationships, while the attention mechanism adaptively emphasizes vulnerability-prone patterns in the feature maps. This combination significantly enhances the model’s ability to detect complex vulnerability patterns spanning different code segments. Extensive experiments on benchmark vulnerability datasets demonstrate that HeteroWaveVD outperforms state-of-the-art approaches, achieving superior F1-scores.

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

HeteroWaveVD: A Heterogeneous Wavelet-Enhanced Source Code Vulnerability Detection Framework

  • Zhen Li,
  • Yuhan Li,
  • Liangze Yin,
  • Ji Wang

摘要

Deep learning (DL), with its remarkable capability to automatically extract features from source code, has emerged as a prominent approach in the field of source code vulnerability detection. However, existing methods focus solely on spatial domain information, constrained by limited receptive fields and insufficient modeling of long-distance dependencies, failing to adequately capture vulnerability patterns spanning across multiple code segments. To address these limitations, we propose Heterogeneous Wavelet-enhanced Vulnerability Detection (HeteroWaveVD), a novel framework that synergistically leverages the global modeling capabilities of Vision Transformers (ViTs) with the strong local feature extraction ability and computational efficiency of Convolutional Neural Networks (CNNs). We develop WaveDetectCNN by enhancing the CNN architecture with wavelet transform convolutions and a specialized Code Defect Attention mechanism. The wavelet transform enables multi-scale frequency domain analysis of code features, effectively capturing both detailed local patterns and broader structural relationships, while the attention mechanism adaptively emphasizes vulnerability-prone patterns in the feature maps. This combination significantly enhances the model’s ability to detect complex vulnerability patterns spanning different code segments. Extensive experiments on benchmark vulnerability datasets demonstrate that HeteroWaveVD outperforms state-of-the-art approaches, achieving superior F1-scores.