Enhancing Network Security Using Machine Learning-Based Anomaly Detection: A Random Forest Approach

Authors

  • Mohd Mir Jaffer Ali, Yaqoob Ahmed, Mohd Ismail, Zamil Akhtar BTech Students Department of Computer Science and Engineering, Lords Institute of Engineering and Technology, Hyderabad, India Author
  • Md. Dilwar Alam Assistant Professor Department of Computer Science and Engineering, Lords Institute of Engineering and Technology, Hyderabad, India Author

Keywords:

Network Security, Anomaly Detection, Random Forest, Machine Learning, Flask, scikit-learn, Intrusion Detection, Cybersecurity, Ensemble Learning, Feature Engineering

Abstract

This research article presents a comprehensive investigation into ML-based network security anomaly detection using
a Random Forest ensemble classifier. Modern enterprise networks face escalating cyber threats—DDoS attacks,
intrusions, malware, phishing, and ransomware—that overwhelm traditional signature-based defenses. The proposed
system analyzes 18 network traffic features, including protocol, packet type, anomaly score, severity level, malware
indicators, IDS/IPS alerts, and firewall logs, to classify network packets into six distinct attack categories in real time.
A Random Forest Classifier with 100 estimators is trained on a synthetically generated dataset of 5,000 packets with
realistic, attack-specific feature distributions. Ten LabelEncoders transform categorical traffic attributes into
numerical representations suitable for tree-based classification. The full-stack web platform—built with Flask, scikitlearn,
SQLite, Bootstrap 5, and Chart.js—achieves 99.80% classification accuracy, outperforming Decision Tree
(97.40%), SVM (91.20%), Logistic Regression (89.60%), and Naive Bayes (82.40%) baselines. This paper details the
mathematical foundations of the Random Forest algorithm, the system architecture, the feature engineering pipeline,
algorithmic pseudocode, and a thorough result analysis with comparative tables and performance graphs.

Downloads

Published

2026-04-22

Issue

Section

Articles

How to Cite

Enhancing Network Security Using Machine Learning-Based Anomaly Detection: A Random Forest Approach. (2026). International Journal of Engineering and Science Research, 16(2), 526-535. https://ijesr.org/index.php/ijesr/article/view/1654

Similar Articles

1-10 of 1265

You may also start an advanced similarity search for this article.