A machine learning approach to vulnerability detection combining software metrics and topic modelling: Evidence from smart contracts

This paper introduces a methodology for software vulnerability detection that combines structural and semantic analysis through software metrics and topic modelling. We evaluate the approach using smart contracts as a case study, focusing on their structural properties and the presence of known security vulnerabilities. We identify the most relevant metrics for vulnerability detection, evaluate multiple machine learning classifiers for both binary and multi-label classification, and improve classification performance by integrating topic modelling techniques. Our analysis shows that metrics such as cyclomatic complexity, nesting depth, and function calls are strongly associated with vulnerability presence. Using these metrics, the Random Forest classifier achieved strong performance in binary classification (AUC: 0.982, accuracy: 0.977, F1-score: 0.808) and multi-label classification (AUC: 0.951, accuracy: 0.729, F1-score: 0.839). The addition of topic modelling using Non-Negative Matrix Factorization further improved results, increasing the F1-score to 0.881. The evaluation is conducted on Ethereum smart contracts written in Solidity.

Authors

Institutions

Publication Details

Journal
Machine Learning with Applications
Published
2025-10-18
DOI
https://doi.org/10.1016/j.mlwa.2025.100759
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A machine learning approach to vulnerability detection combining software metrics and topic modelling: Evidence from smart contracts

Rumyana Neykova, Giacomo Ibba, Giuseppe Destefanis, Marco Ortu et al.
Machine Learning with Applications
Software Engineering Research
article

A machine learning approach to vulnerability detection combining software metrics and topic modelling: Evidence from smart contracts

Rumyana Neykova, Giacomo Ibba, Giuseppe Destefanis, Marco Ortu, Roberto Tonelli, Steve Counsell
article en

Abstract

This paper introduces a methodology for software vulnerability detection that combines structural and semantic analysis through software metrics and topic modelling. We evaluate the approach using smart contracts as a case study, focusing on their structural properties and the presence of known security vulnerabilities. We identify the most relevant metrics for vulnerability detection, evaluate multiple machine learning classifiers for both binary and multi-label classification, and improve classification performance by integrating topic modelling techniques. Our analysis shows that metrics such as cyclomatic complexity, nesting depth, and function calls are strongly associated with vulnerability presence. Using these metrics, the Random Forest classifier achieved strong performance in binary classification (AUC: 0.982, accuracy: 0.977, F1-score: 0.808) and multi-label classification (AUC: 0.951, accuracy: 0.729, F1-score: 0.839). The addition of topic modelling using Non-Negative Matrix Factorization further improved results, increasing the F1-score to 0.881. The evaluation is conducted on Ethereum smart contracts written in Solidity.

Machine Learning with ApplicationsVol. 22
University of London (GB), University of Cagliari (IT), University College London (GB), Brunel University of London (GB)
Openalex Percentile: Top 57%
Software Engineering Research
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.

A machine learning approach to vulnerability detection combining software metrics and topic modelling: Evidence from smart contracts — Rumyana Neykova, Giacomo Ibba, et al. · Machine Learning with Applications (2025) | TGRS Research Map | TGRS