Spam Detection Boosted by Firefly-Based Feature Selection and Optimized Classifiers
Mosleh M. Abualhaj
Abstract
Spam email remains a persistent cybersecurity threat, often exploiting deceptive URLs to bypass conventional filters. Effective detection requires models that achieve high accuracy while maintaining low computational overhead for real-time application. This study focuses on URL-based spam detection, addressing the underutilization of domain-specific feature selection and systematic hyperparameter optimization in existing approaches. We propose a Firefly Optimization Algorithm (FOA)–based feature-selection framework integrated with Grid Search–optimized machine learning classifiers, evaluated on the ISCX-URL2016 dataset. FOA reduced the original 72 features to 31, improving efficiency without sacrificing predictive power. With these features, K-Nearest Neighbors and Extra Trees achieved the highest accuracy (99.76%), followed by Random Forest and XGBoost (99.72%), and Logistic Regression (98.55%). The results demonstrate that combining targeted feature selection with optimized classifiers can deliver state-of-the-art detection performance with reduced complexity, offering a scalable and efficient solution for real-time spam filtering.