Enhancing Cybersecurity with Random Forest: Efficient Detection of Cyberattacks

Authors

DOI:

https://doi.org/10.33333/lajc.vol13n2.08

Keywords:

artificial intelligence, Cybersecurity, Cyberattack, Intrusion Detection System

Abstract

The rapid increase in the number of cyberattacks in the digital age has reduced the effectiveness of conventional cybersecurity systems. Traditional methods of cybersecurity face considerable difficulty when detecting new, sophisticated attacks and advanced exploitation techniques swiftly. This research addresses critical cybersecurity concerns by developing an AI-driven Intrusion Detection System (IDS), which employs Random Forest (RF) algorithms to detect cyberattacks efficiently. The evaluation of the model was conducted using three publicly available datasets: CICIDS2017 (692,703 records), NSL-KDD (148,517 records), and UNSW-NB15 (257,673 records) with various attack backgrounds and network configurations. A set of evaluation metrics, including accuracy, precision, recall, and F1-score, was employed to assess the performance of the cyberattack detection prototype. Across the three datasets, the model attained an average accuracy of 99.85%, precision of 99.83%, recall of 99.91%, and an F1-score of 99.87%, while maintaining low error rates, with an average false positive rate of 0.25% and a false negative rate of 0.10%. The results indicate that Random Forest is an effective solution for cyberattack detection in data-driven environments. The model was developed with lightweight and easy-to-deploy criteria, but the evaluation reported in this study was done under benchmark test conditions. This work improves the effectiveness of machine learning-based intrusion detection systems and serves as a stepping stone for future research on operational and real-time deployment of machine learning-based intrusion detection systems.

Downloads

Download data is not yet available.

References

[1] F. Tao, M. Akhtar, and Z. Jiayuan, “The future of Artificial Intelligence in Cybersecurity: A Comprehensive Survey,” EAI Endorsed Trans. Creat. Technol., vol. 8, no. 28, p. 170285, Aug. 2021, doi: 10.4108/eai.7-7-2021.170285.

[2] V. Jain and A. Mitra, “Real-Time Threat Detection in Cybersecurity: Leveraging Machine Learning Algorithms for Enhanced Anomaly Detection,” in Advances in Computational Intelligence and Robotics, M. A. Almaiah and Y. Maleh, Eds., IGI Global, 2024, pp. 315–344. doi: 10.4018/979-8-3693-7540-2.ch014.

[3] Ö. Aslan, S. S. Aktuğ, M. Ozkan-Okay, A. A. Yilmaz, and E. Akin, “A Comprehensive Review of Cyber Security Vulnerabilities, Threats, Attacks, and Solutions,” Electronics, vol. 12, no. 6, p. 1333, Mar. 2023, doi: 10.3390/electronics12061333.

[4] M. Markevych and M. Dawson, “A Review of Enhancing Intrusion Detection Systems for Cybersecurity Using Artificial Intelligence (AI),” Int. Conf. Knowl.-BASED Organ., vol. 29, no. 3, pp. 30–37, June 2023, doi: 10.2478/kbo-2023-0072.

[5] Seacom, “Financial impact of security breaches is highest in SA,” Jan. 04, 2024. [Online]. Available: https://seacom.co.za/news/financial-impact-of-security-breaches-is-highest-in-sa

[6] Aswa, “AI-Powered Cybersecurity: Leveraging Deep Learning for RealTime Threat Detection and Prevention,” 2025, 2025, doi: 10.18535/ijecs/v14i01.4975.

[7] Ayodeji Oyindamola Ikudabo, Chinedu C. Onyeje, Daniel O. T. Ihenacho, and K. C. Nwafor, “Mitigating cybersecurity risks in financial institutions: The role of AI and data analytics,” Int. J. Sci. Res. Arch., vol. 13, no. 1, pp. 2895–2910, Oct. 2024, doi: 10.30574/ijsra.2024.13.1.2014.

[8] A. Khemka, “The impact of cyber attacks on financial institutions and the need for improved security measures.,” vol. 9, no. 10, 2024.

[9] Md Anwarul Matin Jony, Rashedul Islam, and F. H. Muhammad Saqib Jalil, “AI-Powered Cybersecurity in Financial Institutions: Enhancing Resilience Against Emerging Digital Threats,” Adv. Int. J. Multidiscip. Res., vol. 2, no. 6, p. 1113, Nov. 2024, doi: 10.62127/aijmr.2024.v02i06.1113.

[10] H. Hussain, M. Kainat, M. Tunio, and T. Ali, “Leveraging AI and Machine Learning to Detect and Prevent Cyber Security Threats,” Jan. 2025, doi: 10.5281/ZENODO.14714679.

[11] Dr. N. Katiyar, Mr. S. Tripathi, Mr. P. Kumar, Mr. S. Verma, Dr. A. K. Sahu, and Dr. S. Saxena, “AI and Cyber-Security: Enhancing threat detection and response with machine learning.,” Educ. Adm. Theory Pract., Apr. 2024, doi: 10.53555/kuey.v30i4.2377.

[12] M. Mohammed, A. J. Mohammed, U. U. M. Mohammed, and Z. A. Mohammed, “Advancements in AI-Based Security and Threat Detection,” IJARCCE, vol. 13, no. 4, Mar. 2024, doi: 10.17148/IJARCCE.2024.13459.

[13] R. C. D. Oliveira and R. D. D. S. E. Silva, “Artificial Intelligence in Agriculture: Benefits, Challenges, and Trends,” Appl. Sci., vol. 13, no. 13, p. 7405, June 2023, doi: 10.3390/app13137405.

[14] A. AI-Kuwaiti et al., “A Review of the Role of Artificial Intelligence in Healthcare,” J. Pers. Med., vol. 13, no. 6, p. 951, June 2023, doi: 10.3390/jpm13060951.

[15] C. Meirinhos, L. Fernandes, and M. Meirinhos, “The emergence of Artificial Intelligence in Education,” 2023.

[16] K. Meduri, H. Gonaygunt, and G. S. Nadella, “Evaluating the Effectiveness of AI-Driven Frameworks in Predicting and Preventing Cyber Attacks,” Int. J. Res. Publ. Rev., vol. 5, no. 3, pp. 6591–6595, Mar. 2024, doi: 10.55248/gengpi.5.0324.0875.

[17] R. Kaur, D. Gabrijelčič, and T. Klobučar, “Artificial intelligence for cybersecurity: Literature review and future research directions,” Inf. Fusion, vol. 97, p. 101804, Sept. 2023, doi: 10.1016/j.inffus.2023.101804.

[18] A. O. Adewusi,U. I. Okoli,T. Olorunsogo,E. Adaga, D. O. Daraojimba, and O. C. Obi, “Artificial intelligence in cybersecurity: Protecting national infrastructure - A USA review,” World Journal of Advanced Research and Reviews, vol. 21, no. 1, pp. 2263–2275, 2024, doi: 10.30574/wjarr.2024.21.1.0313

[19] I. Avci and M. Koca, “Cybersecurity Attack Detection Model, Using Machine Learning Techniques,” Acta Polytech. Hung., vol. 20, no. 7, pp. 29–44, 2023, doi: 10.12700/APH.20.7.2023.7.2.

[20] F. Nabi and X. Zhou, “Enhancing intrusion detection systems through dimensionality reduction: A comparative study of machine learning techniques for cyber security,” Cyber Secur. Appl., vol. 2, p. 100033, 2024, doi: 10.1016/j.csa.2023.100033.

[21] M. Luay, S. Layeghy, S. Hosseininoorbin, M. Sarhan, N. Moustafa, and M. Portmann, “Temporal Analysis of NetFlow Datasets for Network Intrusion Detection Systems,” Mar. 09, 2025, arXiv: arXiv:2503.04404. doi: 10.48550/arXiv.2503.04404.

[22] H. A. Salman, A. Kalakech, and A. Steiti, “Random Forest Algorithm Overview,” Babylon. J. Mach. Learn., vol. 2024, pp. 69–79, June 2024, doi: 10.58496/BJML/2024/007.

[23] D. Koutsandreas and I. Keppo, “Harnessing machine learning algorithms to unveil energy efficiency investment archetypes,” Energy Rep., vol. 12, pp. 3180–3195, Dec. 2024, doi: 10.1016/j.egyr.2024.09.009.

[24] Putta Srivani, “Integrating Natural Language Processing with AdaBoost, Random Forest, and Logistic Regression for an Advanced Ensemble-Based Network Intrusion Detection Model,” J. Inf. Syst. Eng. Manag., vol. 10, no. 3s, pp. 264–283, Jan. 2025, doi: 10.52783/jisem.v10i3s.386.

[25] Zafar Iqbal Khan, Mohammad Mazhar Afzal, and Khurram Naim Shamsi, “A Comprehensive Study on CIC-IDS2017 Dataset for Intrusion Detection Systems,” Int. Res. J. Adv. Eng. Hub IRJAEH, vol. 2, no. 02, pp. 254–260, Feb. 2024, doi: 10.47392/IRJAEH.2024.0041.

[26] Y. Sahli, “comparison of the NSL-KDD dataset and its predecessor the KDD Cup ’99 dataset,” Int. J. Sci. Res. Manag., vol. 10, no. 04, pp. 832–839, Apr. 2022, doi: 10.18535/ijsrm/v10i4.ec05.

[27] Md. A. Talukder et al., “Machine learning-based network intrusion detection for big and imbalanced data using oversampling, stacking feature embedding and feature extraction,” J. Big Data, vol. 11, no. 1, p. 33, Feb. 2024, doi: 10.1186/s40537-024-00886-w.

[28] S. M. Kasongo, “An Advanced Intrusion Detection System for IIoT Based on GA and Tree Based Algorithms,” IEEE Access, vol. 9, pp. 113199–113212, 2021, doi: 10.1109/ACCESS.2021.3104113.

[29] S. More, M. Idrissi, H. Mahmoud, and A. T. Asyhari, “Enhanced Intrusion Detection Systems Performance with UNSW-NB15 Data Analysis,” Algorithms, vol. 17, no. 2, p. 64, Feb. 2024, doi: 10.3390/a17020064.

[30] J. Note and M. Ali, “Comparative Analysis of Intrusion Detection System Using Machine Learning and Deep Learning Algorithms,” Ann. Emerg. Technol. Comput., vol. 6, no. 3, pp. 19–36, July 2022, doi: 10.33166/AETiC.2022.03.003.

[31] I. H. Putro, “Evaluating the Performance of Machine Learning Classifiers for Network Intrusion Detection: A Comparative Study Using the UNSW-NB15 Dataset,” Teknika, vol. 14, no. 2, pp. 330–338, July 2025, doi: 10.34148/teknika.v14i2.1276.

[32] A. M. A. Abdullah and K. A. Abood, “Comparative Analysis of Machine Learning Techniques for Intrusion Detection in IoT Networks,” Univ. Aden J. Nat. Appl. Sci., vol. 28, no. 2, pp. 53–60, Apr. 2025, doi: 10.47372/uajnas.2024.n2.a05.

Downloads

Published

2026-07-07

Issue

Section

Research Articles for the Regular Issue

How to Cite

[1]
“Enhancing Cybersecurity with Random Forest: Efficient Detection of Cyberattacks”, LAJC, vol. 13, no. 2, pp. 95–107, Jul. 2026, doi: 10.33333/lajc.vol13n2.08.