Code vulnerability detection based on augmented program dependency graph and optimized CodeBERT

The increasing complexity of software systems has rendered code vulnerability detection a critical aspect of software security. While deep learning-based approaches have advanced this field, challenges such as coarse-grained function-level detection, scalability limitations, and constrained accuracy persist. Although slice-level detection effectively reduces noise, it frequently sacrifices essential syntactic and semantic information, which undermines vulnerability representation, elevates false positive rates, and ultimately limits practical applicability. To address these challenges, this paper proposes a code vulnerability detection method based on an augmented program dependency graph and optimized CodeBERT. The method augments the traditional program dependency graph by extending its structure to capture richer semantic and structural information in the code. Furthermore, it employs the Code Bidirectional Encoder Representations from Transformers (CodeBERT) pretrained model for extracting code embedding features. Additionally, a hybrid loss function optimization strategy tailored for CodeBERT is proposed to address the long-tail distribution characteristics of code vulnerability detection. The experimental results demonstrate that, compared to other state-of-the-art classical methods, the detection accuracy and F1 score on synthetic and real-world datasets have been improved by an average of up to 8.34% and 29.71%, respectively.

Authors

Institutions

Publication Details

Journal
Scientific Reports
Published
2025-11-10
DOI
https://doi.org/10.1038/s41598-025-23029-4
Citations
2
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
6.49

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Code vulnerability detection based on augmented program dependency graph and optimized CodeBERT

Nan Zhang, Zhuo Zou, Tao Jiang, Jian Luan et al.
2 citations
Scientific Reports
Software Engineering Research
6.49
article

Code vulnerability detection based on augmented program dependency graph and optimized CodeBERT

Nan Zhang, Zhuo Zou, Tao Jiang, Jian Luan, Ting Xue, Yizheng Wang
article en
2 citations

Abstract

The increasing complexity of software systems has rendered code vulnerability detection a critical aspect of software security. While deep learning-based approaches have advanced this field, challenges such as coarse-grained function-level detection, scalability limitations, and constrained accuracy persist. Although slice-level detection effectively reduces noise, it frequently sacrifices essential syntactic and semantic information, which undermines vulnerability representation, elevates false positive rates, and ultimately limits practical applicability. To address these challenges, this paper proposes a code vulnerability detection method based on an augmented program dependency graph and optimized CodeBERT. The method augments the traditional program dependency graph by extending its structure to capture richer semantic and structural information in the code. Furthermore, it employs the Code Bidirectional Encoder Representations from Transformers (CodeBERT) pretrained model for extracting code embedding features. Additionally, a hybrid loss function optimization strategy tailored for CodeBERT is proposed to address the long-tail distribution characteristics of code vulnerability detection. The experimental results demonstrate that, compared to other state-of-the-art classical methods, the detection accuracy and F1 score on synthetic and real-world datasets have been improved by an average of up to 8.34% and 29.71%, respectively.

Scientific ReportsVol. 15(1)
Minzu University of China (CN), Yunnan University (CN)
National Natural Science Foundation of China
Openalex Percentile: Top 3%
Software Engineering Research
6.49
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.