Distance-based feature selection using Benford’s law for malware detection
Detecting malware in computer networks and data streams from Android devices remains a critical challenge for cybersecurity researchers. While machine learning and deep learning techniques have shown promising results, these approaches often require large volumes of labelled data, offer limited interpretability, and struggle to adapt to sophisticated threats such as zero-day attacks. Moreover, their high computational requirements restrict their applicability in resource-constrained environments. This research proposes an innovative approach that advances the state of the art by offering practical solutions for dynamic and data-limited security scenarios. By integrating natural statistical laws, particularly Benford’s law, with dissimilarity functions, a lightweight, fast, and scalable model is developed that eliminates the need for extensive training and large labelled datasets while improving resilience to data imbalance and scalability for large-scale cybersecurity applications. Although Benford’s law has demonstrated potential in anomaly detection, its effectiveness is limited by the difficulty of selecting relevant features. To overcome this, the study combines Benford’s law with several distance functions, including Median Absolute Deviation, Kullback–Leibler divergence, Euclidean distance, and Pearson correlation, enabling statistically grounded feature selection. Additional metrics, such as the Kolmogorov test, Jensen–Shannon divergence, and Z statistics, were used for model validation. This approach quantifies discrepancies between expected and observed distributions, addressing classic feature selection challenges like redundancy and imbalance. Validated on both balanced and unbalanced datasets, the model achieved strong results: 88.30% accuracy and 85.08% F1-score in the balanced set, 92.75% accuracy and 95.29% F1-score in the unbalanced set. The integration of Benford’s law with distance functions significantly reduced false positives and negatives. Compared to traditional Machine Learning methods, which typically require extensive training and large datasets to achieve F1 scores between 92% and 99%, the proposed approach delivers competitive performance while enhancing computational efficiency, robustness, and interpretability. This balance makes it a practical and scalable alternative for real-time or resource-constrained cybersecurity environments. • Innovative use of Benford’s law to identify significant features in data flows, evaluating compliance with expected numerical patterns through distance functions. • Introduction of a model combining statistical criteria and distance functions as an alternative to traditional feature selection techniques. • The use of distance functions to evaluate the model based on BL focused on selecting the main features that maximise the separation between benign and malicious flows. • Practical application in cybersecurity scenarios, such as detecting malware in network flows, where the selected features improve the effectiveness of monitoring systems.
Authors
- Séamus Ó Ciardhuáin (ORCID: https://orcid.org/0000-0002-3207-8668)
- Pedro Fernandes (ORCID: https://orcid.org/0000-0002-6026-4687)
- Mário Antunes (ORCID: https://orcid.org/0000-0003-3448-6726)
Institutions
- Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento (PT)
- Instituto Politécnico de Leiria (PT)
- Shannon Applied Biotechnology Centre (IE)
- INESC TEC (PT)
Publication Details
- Journal
- Computers & Security
- Published
- 2025-08-22
- DOI
- https://doi.org/10.1016/j.cose.2025.104625
- Citations
- 1
- Primary Topic
- Benford’s Law and Fraud Detection
- Type
- article
- Field-Weighted Citation Impact
- 2.63