Computer Science ›› 2026, Vol. 53 ›› Issue (8): 413-425.doi: 10.11896/jsjkx.250800088

• Computer Software • Previous Articles     Next Articles

Semi-supervised Source Code Vulnerability Detection Model with Dual-stage Label Propagation

YAN Qisen, KANG Ming, YANG Yiyao, CHEN Wen   

  1. School of Cyber Science and Engineering, Sichuan University, Chengdu 610207, China
  • Received:2025-08-20 Revised:2025-11-20 Published:2026-08-17
  • About author:YAN Qisen,born in 1996,postgraduate.His main research interests include machine learning and vulnerability detection.
    CHEN Wen,born in 1983,Ph.D,asso-ciate professor,Ph.D supervisor.His main research interests include cyber security and data mining.

Abstract: Automated source code vulnerability detection is crucial for ensuring software security.Currently,deep learning-based vulnerability detection models predominantly rely on supervised learning,which requires a substantial number of credible,labeled vulnerability samples for training.However,the collection of such samples is costly and dependent on expert knowledge.More-over,real-world applications often face challenges such as class imbalance.To address these challenges,this paper proposes DLP-VulD,a novel semi-supervised model that introduces a dual-stage label propagation method to the field of source code vulnerability detection for the first time.Firstly,it extracts program slices containing vulnerability context from source code using code property graphs(CPG) and learns their semantic and structural features with a BiLSTM model to generate code feature vectors.Subsequently,DLP-VulD employs the dual-stage label propagation mechanism to extend the training set by propagating trusted label information from labeled to unlabeled samples.In the first stage of label propagation,leveraging an initial small set of labeled samples,DLP-VulD calculates label influence to select high-credible pseudo-labeled(HCP) samples and partial-labeled(PAL) samples(those with multiple candidate labels) from the unlabeled set.In the second stage,to mitigate label propagation noise,a multi-source partial label learning(MSPLL) method is proposed to perform label disambiguation for the PAL samples.Finally,in the vulnerability detection module,DLP-VulD utilizes the original labeled samples,the HCP samples,and the disambiguated PAL samples to form an augmented dataset for reinforced training,thereby enhancing the classifier’s detection performance.Additionally,DLP-VulD adopts a class-weighting mechanism to reduce the impact of class imbalance.Comparative experiments on multiple real-world open-source project datasets and synthetic vulnerability datasets demonstrate that DLP-VulD surpasses traditional supervised methods in overall performance,showing significant improvements in Recall and F1-score compared to baselines such as Devign,VulDeePecker,and LineVul.On six real-world vulnerability datasets characterized by class imbalance and diverse vulnerability types,DLP-VulD achieves an average reduction of 8% in false positive rate(FPR) and 29.6% in false negative rate(FNR) compared to the baselines.Even with a very limited labeled set(10%),DLP-VulD effectively balances its detection capability for true vulnerabilities with control over false positives,achieving superior comprehensive performance.Experimental results confirm the effectiveness of DLP-VulD for training and deploying vulnerability detection models in environments with scarce labeled data.

Key words: Vulnerability detection, Label influence, Multi-source partial label learning, Class weighting, Semi-supervised learning

CLC Number: 

  • TP181
[1] KREINDL J,BONETTA D,STADLER L,et al.Dynamic taint analysis with label-defined semantics[C]//Proceedings of the 19th International Conference on Managed Programming Languages and Runtimes.2022:64-84.
[2] JOHNSON B,SONG Y,MURPHY-HILL E,et al.Why don’tsoftware developers use static analysis tools to find bugs?[C]//2013 35th International Conference on Software Engineering(ICSE).IEEE,2013:672-681.
[3] GHAFFARIAN S M,SHAHRIARI H R.Software vulnerability analysis and discovery using machine-learning and data-mining techniques:A survey[J].ACM Computing Surveys,2017,50(4):1-36.
[4] ZOU D,WANG S,XU S,et al.$ \\mu $ μ VulDeePecker:A Deep Learning-Based System for Multiclass Vulnerability Detection[J].IEEE Transactions on Dependable and Secure Computing,2019,18(5):2224-2236.
[5] CAO S,SUN X,BO L,et al.Bgnn4vd:Constructing bidirectional graph neural-network for vulnerability detection[J].Information and Software Technology,2021,136:106576.
[6] LI Z,ZOU D,XU S,et al.Vuldeepecker:A deep learning-based system for vulnerability detection[J].arXiv:1801.01681,2018.
[7] RUSSELL R,KIM L,HAMILTON L,et al.Automated vulnerability detection in source code using deep representation lear-ning[C]//2018 17th IEEE International Conference on Machine Learning and Applications(ICMLA).IEEE,2018:757-762.
[8] HANIF H,NASIR M H N M,AB RAZAK M F,et al.The rise of software vulnerability:Taxonomy of software vulnerabilities detection and machine learning approaches[J].Journal of Network and Computer Applications,2021,179:103009.
[9] LI Z,ZOU D,XU S,et al.Sysevr:A framework for using deep learning to detect software vulnerabilities[J].IEEE Transactions on Dependable and Secure Computing,2021,19(4):2244-2258.
[10] ZHOU Y,LIU S,SIOW J,et al.Devign:Effective vulnerability identification by learning comprehensive program semantics via graph neural networks[C]//Proceedings of the 33rd International Conference on Neural Information Processing Systems.2019:10197-10207.
[11] WANG Q W,LI Y,ZHOU Z H.Partial Label Learning with Unlabeled Data[C]//IJCAI.2019:3755-3761.
[12] CHEN W,WANG C Z.Combine labeled and unlabeled data for immune detector training with label propagation[J].Knowledge-Based Systems,2022,236:107661.
[13] WANG W,ZHANG M L.Partial label learning with discrimination augmentation[C]//Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data mining.2022:1920-1928.
[14] ZHENG W,JIANG Y,SU X.Vu1SPG:Vulnerability detection based on slice property graph representation learning[C]//2021 IEEE 32nd International Symposium on Software Reliability Engineering(ISSRE).IEEE,2021:457-467.
[15] LIN G,XIAO W,ZHANG J,et al.Deep learning-based vulner-able function detection:A benchmark[C]//International Confe-rence on Information and Communications Security.Cham:Springer,2019:219-232.
[16] ZHANG H,SAKURAI K.A survey of software clone detection from security perspective[J].IEEE Access,2021,9:48157-48173.
[17] Flawfinder.Flawfinder[EB/OL].https://dwheeler.com/flawfinder/.
[18] SANG Q,WANG Y,LIU Y,et al.Airtaint:Making dynamic taint analysis faster and easier[C]//2024 IEEE Symposium on Security and Privacy(SP).IEEE,2024:3998-4014.
[19] CHENG X,WANG H,HUA J,et al.Deepwukong:Statically detecting software vulnerabilities using deep graph neural network[J].ACM Transactions on Software Engineering and Methodology,2021,30(3):1-33.
[20] CHAKRABORTY S,KRISHNA R,DING Y,et al.Deep lear-ning based vulnerability detection:Are we there yet?[J].IEEE Transactions on Software Engineering,2021,48(9):3280-3296.
[21] LI Y,WANG S,NGUYEN T N.Vulnerability detection with fine-grained interpretations[C]//Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering.2021:292-303.
[22] WU Y,ZOU D,DOU S,et al.Vulcnn:An image-inspired scal-able vulnerability detection system[C]//Proceedings of the 44th International Conference on Software Engineering.2022:2365-2376.
[23] ZHANG C,XIN Y.VulGAI:vulnerability detection based ongraphs and images[J].Computers & Security,2023,135:103501.
[24] CASCANTE-BONILLA P,TAN F,QI Y,et al.Curriculum labeling:Revisiting pseudo-labeling for semi-supervised learning[C]//Proceedings of the AAAI Conference on Artificial Intelligence.2021,35(8):6912-6920.
[25] FAN Y,KUKLEVA A,DAI D,et al.Revisiting consistency re-gularization for semi-supervised learning[J].International Journal of Computer Vision,2023,131(3):626-643.
[26] VAN ENGELEN J E,HOOS H H.A survey on semi-supervised learning[J].Machine Learning,2020,109(2):373-440.
[27] LIU S,LIN G,QU L,et al.CD-VulD:Cross-domain vulnerability discovery based on deep domain adaptation[J].IEEE Transactions on Dependable and Secure Computing,2020,19(1):438-451.
[28] ZHANG C,LIU B,XIN Y,et al.CPVD:Cross project vulnerability detection based on graph attention network and domain adaptation[J].IEEE Transactions on Software Engineering,2023,49(8):4152-4168.
[29] WEN X C,WANG X,GAO C,et al.When less is enough:Positive and unlabeled learning model for vulnerability detection[C]//2023 38th IEEE/ACM International Conference on Automated Software Engineering(ASE).IEEE,2023:345-357.
[30] BLACK P E.A software assurance reference dataset:Thousands of programs with known bugs[J].Journal of research of the National Institute of Standards and Technology,2018,123:1-3.
[31] FU M,TANTITHAMTHAVORN C.Linevul:A transformer-based line-level vulnerability prediction[C]//Proceedings of the 19th International Conference on Mining Software Repositories.2022:608-620.
[32] CHEN X,CHEN W,CHEN T,et al.Self-pu:Self boosted and calibrated positive-unlabeled training[C]//International Confe-rence on Machine Learning.PMLR,2020:1510-1519.
[1] LI Xiaochao, YUAN Zisu, LI Qianmu, LIU Fan, CHE Xun. Survey on Code Representation Learning for Vulnerability Detection [J]. Computer Science, 2026, 53(8): 388-402.
[2] CHEN Shanshan, JING Ningkang. OptimalFix:Complete Framework for Efficient Detection and Patch of Vulnerabilities in SmartContracts Automatically [J]. Computer Science, 2026, 53(7): 422-432.
[3] ZHANG Yuanyuan, LIU Tieming, LIU Guoan, GE Xueshuai. Symbolic Execution-based Automated Verification Method for Binary Vulnerabilities [J]. Computer Science, 2026, 53(6A): 250600035-7.
[4] NIU Jilong, GUAN Wenhui, ZONG Chenchen, HUANG Shengjun. Semi-supervised Learning Method Enhanced by Prototype Loss [J]. Computer Science, 2026, 53(6): 315-319.
[5] ZHANG Run, LI Xiaobin, XU Yamin. Review of Uniform Manifold Approximation and Projection [J]. Computer Science, 2026, 53(5): 109-118.
[6] XU Yamin, LI Xiaobin, ZHANG Run. Semi-supervised Learning Algorithm Based on Pointwise Manifold Structures and Uniform Regularity Constraints [J]. Computer Science, 2026, 53(4): 173-179.
[7] GE Zeqing, HUANG Shengjun. Semi-supervised Learning Method for Multi-label Tabular Data [J]. Computer Science, 2026, 53(3): 151-157.
[8] WANG Yiming, JIAO Min, ZHAO Suyun, CHEN Hong, LI Cuiping. Prompt-conditioned Representation Learning with Diffusion Models for Semi-supervised Clustering [J]. Computer Science, 2026, 53(3): 158-165.
[9] SONG Jianhua, HE Jiawei, ZHANG Yan. Dual-channel Source Code Vulnerability Detection Model Based on Contrastive Learning [J]. Computer Science, 2026, 53(3): 424-432.
[10] ZHOU Tao, DU Yongping, XIE Runfeng, HAN Honggui. Vulnerability Detection Method Based on Deep Fusion of Multi-dimensional Features from Heterogeneous Contract Graphs [J]. Computer Science, 2025, 52(9): 368-375.
[11] CHEN Qirui, WANG Baohui, DAI Chencheng. Research on Electrocardiogram Classification and Recognition Algorithm Based on Transfer Learning [J]. Computer Science, 2025, 52(6A): 240900073-8.
[12] DU Yuanhua, CHEN Pan, ZHOU Nan, SHI Kaibo, CHEN Eryang, ZHANG Yuanpeng. Correntropy Based Multi-view Low-rank Matrix Factorization and Constraint Graph Learning for Multi-view Data Clustering [J]. Computer Science, 2025, 52(6A): 240900131-10.
[13] BAO Shenghong, YAO Youjian, LI Xiaoya, CHEN Wen. Integrated PU Learning Method PUEVD and Its Application in Software Source CodeVulnerability Detection [J]. Computer Science, 2025, 52(6A): 241100144-9.
[14] WANG Xiao, LI Guanxiong, LI Na, YUAN Dongfeng. Semi-supervised Learning Flow Field Prediction Method Based on Gaussian Mixture Discrimination [J]. Computer Science, 2025, 52(6): 88-95.
[15] ZHANG Xuming, SHI Yaqing, HUANG Song, WANG Xingya, HU Jinchang, LU Jiangtao. Survey of Open-source Software Component Vulnerability Detection and Automatic RepairTechnology [J]. Computer Science, 2025, 52(6): 1-20.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!