The rapid advancement of information technology has significantly influenced various aspects of life, including an increasing reliance on network-based services. However, this dependence has also led to the emergence of more complex cybersecurity threats, one of the most prominent being Distributed Denial of Service (DDoS) attacks. These attacks can disrupt service availability by overwhelming target systems with excessive traffic. A major challenge in detecting DDoS attacks lies in the wide variety of attack patterns and the class imbalance that commonly occurs in network traffic datasets. To address these issues, a machine learning–based approach capable of handling complex attack behaviors while compensating for imbalanced data distribution is required. One potential solution is the use of the Random Forest algorithm with class-weight techniques, applied to the CICDDoS2019 dataset. The research procedure includes data collection and exploration, preprocessing steps such as handling missing and infinite values, encoding categorical attributes, and feature normalization. The dataset is then divided into training and testing subsets before being processed by the Random Forest model. Model evaluation is conducted using a confusion matrix along with accuracy, precision, recall, and F1-score metrics. Experimental results show that incorporating class weight significantly improves model performance, achieving an accuracy of 99.98%, precision of 99.98%, recall of 99.97%, and an F1-score of 99.97%. These findings demonstrate that the proposed approach is highly effective for accurately detecting and classifying DDoS attacks.
Copyrights © 2025