Accurate Malware Detection Using Random Forest and XGBoost with Cross-Validation and ROC-AUC Analysis
ID:119
View protection:Participant Only
Updated time:2026-07-22 16:10:09 Views:27
Online
Abstract
Malware detection plays a vital role in cybersecurity, aiming to accurately identify malicious software while minimizing false positives. However, existing approaches often struggle with generalization, especially when models are trained on large but imbalanced datasets, highlighting a research gap. This study proposes a machine learning-based malware detection framework using a CSV-based static feature dataset containing system-level and behavioral attributes extracted from executable files. The dataset consists of 100,000 balanced samples of benign and malicious files, partitioned into distinct training and testing sets. Two classification algorithms, Random Forest and XGBoost, were employed to classify files as either benign or malicious. Model performance was evaluated using stratified five-fold cross-validation and multiple metrics, including accuracy, precision, recall, F1-score, and ROC-AUC, with confusion matrices, ROC curves, and precision–recall curves examined for further insight. The results achieved perfect scores across all metrics (100% accuracy, precision, recall, F1-score, and ROC-AUC), indicating that the models likely overfitted the data rather than learning to generalize. These findings emphasize the need for more careful data partitioning and the incorporation of data augmentation in future work. The proposed framework provides a foundation for developing more reliable malware detection systems in real-world cybersecurity applications.
Keywords
Malware Detection,Machine Learning,Random Forest,XGBoost;,Cybersecurity.
Post comments