{"title":"Vulnerability detection with Graph Attention Network and Metric Learning","authors":"Chunyong Zhang , Liangwei Yao , Yang Xin","doi":"10.1016/j.infsof.2025.107826","DOIUrl":null,"url":null,"abstract":"<div><h3>Context:</h3><div>Static code vulnerability detection is a critical topic in software security. Researchers are interested in employing deep learning to discover vulnerabilities automatically. However, existing software analysis methods have a high rate of false positives and false negatives.</div></div><div><h3>Objective:</h3><div>High false negatives and high false positives may be caused by the problem of insufficient extraction of syntax and semantics, data imbalance, and overlapping feature distributions. Based on the above problems, we construct a vulnerability detection model GSM, which is a loosely coupled method based on the combination of <strong><u>G</u></strong>raph Attention Network, <strong><u>S</u></strong>ampling, and <strong><u>M</u></strong>etric Learning.</div></div><div><h3>Method:</h3><div>Firstly, we utilize the code property graph to represent source code and use graph attention networks for graph embedding learning. Secondly, we adopt a combination of oversampling and undersampling to deal with imbalanced dataset. Finally, we adopt a Metric Learning method based on the quadruple loss function to separate vulnerable and neutral samples.</div></div><div><h3>Results:</h3><div>Compared to the state-of-the-art method Reveal on the imbalanced dataset chrdeb, the performance of Precision, Recall, and F1-Score are improved by about 11.5%, 12.4%, and 12.7%, respectively.</div></div><div><h3>Conclusion:</h3><div>Under different datasets, GSM has shown better performance than state-of-the-art vulnerability detection methods in multiple metrics. GSM can resolve the problem of data imbalance and the inability to separate the two types of samples.</div></div>","PeriodicalId":54983,"journal":{"name":"Information and Software Technology","volume":"186 ","pages":"Article 107826"},"PeriodicalIF":3.8000,"publicationDate":"2025-07-02","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Information and Software Technology","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S095058492500165X","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0
Abstract
Context:
Static code vulnerability detection is a critical topic in software security. Researchers are interested in employing deep learning to discover vulnerabilities automatically. However, existing software analysis methods have a high rate of false positives and false negatives.
Objective:
High false negatives and high false positives may be caused by the problem of insufficient extraction of syntax and semantics, data imbalance, and overlapping feature distributions. Based on the above problems, we construct a vulnerability detection model GSM, which is a loosely coupled method based on the combination of Graph Attention Network, Sampling, and Metric Learning.
Method:
Firstly, we utilize the code property graph to represent source code and use graph attention networks for graph embedding learning. Secondly, we adopt a combination of oversampling and undersampling to deal with imbalanced dataset. Finally, we adopt a Metric Learning method based on the quadruple loss function to separate vulnerable and neutral samples.
Results:
Compared to the state-of-the-art method Reveal on the imbalanced dataset chrdeb, the performance of Precision, Recall, and F1-Score are improved by about 11.5%, 12.4%, and 12.7%, respectively.
Conclusion:
Under different datasets, GSM has shown better performance than state-of-the-art vulnerability detection methods in multiple metrics. GSM can resolve the problem of data imbalance and the inability to separate the two types of samples.
期刊介绍:
Information and Software Technology is the international archival journal focusing on research and experience that contributes to the improvement of software development practices. The journal''s scope includes methods and techniques to better engineer software and manage its development. Articles submitted for review should have a clear component of software engineering or address ways to improve the engineering and management of software development. Areas covered by the journal include:
• Software management, quality and metrics,
• Software processes,
• Software architecture, modelling, specification, design and programming
• Functional and non-functional software requirements
• Software testing and verification & validation
• Empirical studies of all aspects of engineering and managing software development
Short Communications is a new section dedicated to short papers addressing new ideas, controversial opinions, "Negative" results and much more. Read the Guide for authors for more information.
The journal encourages and welcomes submissions of systematic literature studies (reviews and maps) within the scope of the journal. Information and Software Technology is the premiere outlet for systematic literature studies in software engineering.