Safeguarding cyberspace: Enhancing malicious website detection with PSO-optimized XGBoost and firefly-based feature selection

In recent years, the exponential growth of internet usage worldwide has created a conducive environment for the expansion of malicious activities. Among these threats, malicious websites pose a significant risk to individual users and corporations. This paper presents a robust and efficient model for the detection of various types of malicious websites with high accuracy in the process. The proposed approach employs a two-step process. Firstly, a feature selection method based on the Firefly algorithm is utilized to identify the most relevant features. Subsequently, an optimized version of the XGBoost algorithm is applied to classify websites based on the selected features. Optimization of XGBoost’s parameters is achieved through the Particle Swarm Optimization (PSO) algorithm to enhance its performance. To assess the efficacy of the introduced model, the model is evaluated against several benchmark classification algorithms using a dataset comprising over 36,000 websites. In binary classification, the introduced model surpasses other benchmark methods with a significant 98.42 % classification accuracy and an F1 score of 0.984. For multiclass problem classification, it consistently achieves over 98 % accuracy in each class. The test results highlight the proposed model’s robust performance, characterized by exceptional classification accuracy and F1-measure rates. It demonstrates the capability to detect various types of malicious websites with high precision and minimal false error rates.