Journal of Cybersecurity and Information Management JCIM 2690-6775 2769-7851 10.54216/JCIM https://www.americaspg.com/journals/show/3586 2019 2019 AI-Driven Features for Intrusion Detection and Prevention Using Random Forest Department of Computer Networking Systems, College of Computer Sciences and Information Technology, University of Anbar, Al Anbar, Ramadi, Iraq Mohammed Mohammed Department of Computer Networking Systems, College of Computer Sciences and Information Technology, University of Anbar, Al Anbar, Ramadi, Iraq Khattab M. Ali Alheeti In this research, we investigate sophisticated methods for Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS), leveraging AI-based feature optimization and diverse machine learning strategies to bolster network intrusion detection and prevention. The study primarily utilizes the NSL-KDD dataset, an enhanced version of the KDD Cup 1999 dataset, chosen for its realistic portrayal of various attack types and for addressing the shortcomings of the original dataset. The methodology includes AI-based feature optimization using Particle Swarm Optimization and Genetic Algorithm, focusing on maximizing information gain and entropy. This is integrated with the use of Random Forest (RF) to reduce class overlapping, further enhanced by boosting techniques. Grey Wolves Optimization (GWO) alongside Random Forest. This innovative approach, inspired by grey wolf hunting strategies, is employed for classification tasks on the NSL-KDD dataset. The performance metrics for each intrusion class are meticulously evaluated, revealing that the GWO-RF combination achieves an accuracy of 0.94, precision of 0.95, recall of 0.93, and an F1 score of 0.94. 2025 2025 01 14 10.54216/JCIM.160101 https://www.americaspg.com/articleinfo/2/show/3586