Intrusion Detection and Prevention Using Machine Learning for IoT-Based

Authors

  • Rajesh PhD Scholar, ECED, Deenbandhu Chhotu Ram University Science and Technology, Murthal Haryana – 131039, India
  • Mridul Chawla Professor, ECED, Deenbandhu Chhotu Ram University Science and Technology, Murthal Haryana – 131039, India

DOI:

https://doi.org/10.22399/ijcesen.3323

Keywords:

Intrusion detection system (IDS), Machine Learning (ML), IoT, Wireless Sensor Network (WSN), Genetic Algorithm (GA), Gini Impurity-based Weighted Random Forest (GIWRF)

Abstract

The intrusion detection system (IDS) is an essential component for enterprises as it safeguards network infrastructure, assets, and confidential data, effectively preventing cybercriminal actions. Various strategies have been devised and put into action in order to prevent malicious activity up to this point. Given the efficacy of machine learning (ML) techniques, the proposed strategy utilized multiple ML techniques for the IDS. The UNSW-NB15 dataset was utilized to conduct an offline analysis of models’ performance and to create a tailored integrated classification system for detecting malicious activities in a network. The performance analysis involved training and evaluating the “Decision Tree (DT)”, RF, CatBoost, and Hybrid models for a binary classification task. To address the decline in the performance of IDS while using a feature vector with a large number of dimensions, a Gini Impurity-based Weighted Random Forest (GIWRF) model was utilized to choose the most suitable set of features. This approach served as the incorporated choosing features technique. Additionally, feature extraction was performed using the Genetic algorithm (GA). This method utilized Gini impurity in order to enhance the learning algorithm’s comprehension of the class distribution. 27 features were chosen from UNSW-NB 15 based on their relevance value. The results of the study showed that the Hybrid model scored better than the other trained models used in the present study. This study offers useful insights on enhancing the security of IoT networks through the utilization of ML. The research also quantified various attacks (DOS, Probe etc.), assessing their detection efficiency using the hybrid model. The findings proved high accuracy in detecting various threats, further confirming the strength of the proposed method. Study highlights the significance of customized strategies and continuous improvements in increasing the resilience of systems to constantly changing cyber-attacks. In addition, the GIWRF-Hybrid method proposed in the paper showed better performance than other methods considered in the paper, that is, accuracy and loss.

References

[1] Khan, Sharfuddin, E. Sivaraman, and Prasad B. Honnavalli, (2020). Performance evaluation of advanced machine learning algorithms for network intrusion detection system. In Proceedings of International Conference on IoT Inclusive Life (ICIIL 2019), NITTTR Chandigarh, India, 51-59. Springer Singapore. DOI: https://doi.org/10.1007/978-981-15-3020-3_6

[2] Zhao, Ruijie, Guan Gui, Zhi Xue, Jie Yin, Tomoaki Ohtsuki, Bamidele Adebisi, and Haris Gacanin, (2021). A novel intrusion detection method based on lightweight neural network for internet of things. IEEE Internet of Things Journal 9(12): 9960-9972. DOI: https://doi.org/10.1109/JIOT.2021.3119055

[3] Yang, Li, Abdallah Moubayed, Abdallah Shami, Parisa Heidari, Amine Boukhtouta, Adel Larabi, Richard Brunner, Stere Preda, and Daniel Migault (2021). Multi-perspective content delivery networks security framework using optimized unsupervised anomaly detection. IEEE Transactions on Network and Service Management 19(1). 686-705. DOI: https://doi.org/10.1109/TNSM.2021.3100308

[4] Injadat, MohammadNoor, Abdallah Moubayed, Ali Bou Nassif, and Abdallah Shami. (2021). Machine learning towards intelligent systems: applications, challenges, and opportunities. Artificial Intelligence Review 54, no. 5, 3299-3348. DOI: https://doi.org/10.1007/s10462-020-09948-w

[5] Yang, Li, and Abdallah Shami, (2022). IoT data analytics in dynamic environments: From an automated machine learning perspective. Engineering Applications of Artificial Intelligence 116:105366. DOI: https://doi.org/10.1016/j.engappai.2022.105366

[6] Zuo, Wangmeng, David Zhang, and Kuanquan Wang, (2008). On kernel difference-weighted k-nearest neighbor classification. Pattern Analysis and Applications 11: 247-257. DOI: https://doi.org/10.1007/s10044-007-0100-z

[7] Safavian, S. Rasoul, and David Landgrebe, (1991). A survey of decision tree classifier methodology. IEEE Transactions on Systems, Man, and cybernetics 21:3. 660-674. DOI: https://doi.org/10.1109/21.97458

[8] Khalil, Ruhul Amin, Nasir Saeed, Mudassir Masood, Yasaman Moradi Fard, Mohamed-Slim Alouini, and Tareq Y. Al-Naffouri. (2021). Deep learning in the industrial Internet of things: Potentials, challenges, and emerging applications. IEEE Internet of Things Journal 8(14): 11016-11040. DOI: https://doi.org/10.1109/JIOT.2021.3051414

[9] Alsabti, Khaled, Sanjay Ranka, and Vineet Singh, (1997). An efficient k-means clustering algorithm.

[10] Li, Lishuai, R. John Hansman, Rafael Palacios, and Roy Welsch, (2016). Anomaly detection via a Gaussian Mixture Model for flight operation and safety monitoring.Transportation Research Part C: Emerging Technologies 64, 45-57. DOI: https://doi.org/10.1016/j.trc.2016.01.007

[11] Liu, Fei Tony, Kai Ming Ting, and Zhi-Hua Zhou, (2008). Isolation forest. In 2008 eighth ieee international conference on data mining, 413-422. IEEE. DOI: https://doi.org/10.1109/ICDM.2008.17

[12] Bamakan, Seyed Mojtaba Hosseini, Behnam Amiri, Mahboubeh Mirzabagheri, and Yong Shi, (2015). A new intrusion detection approach using PSO based multiple criteria linear programming. Procedia Computer Science 55: 231-237. DOI: https://doi.org/10.1016/j.procs.2015.07.040

[13] Wu, Shelly Xiaonan, and Wolfgang Banzhaf, (2010). The use of computational intelligence in intrusion detection systems: A review. Applied soft computing 10(1): 1-35. DOI: https://doi.org/10.1016/j.asoc.2009.06.019

[14] H.-J. Liao, C.-H. R. Lin, Y.-C. Lin, and K.-Y. Tung, (2013). Intrusion detection system: A comprehensive review, Journal of Network and Computer Applications, vol. 36(1), 16–24. DOI: https://doi.org/10.1016/j.jnca.2012.09.004

[15] Suthaharan, Shan, (2014). Big data classification: Problems and challenges in network intrusion prediction with machine learning. ACM SIGMETRICS Performance Evaluation Review 41(4). 70-73. DOI: https://doi.org/10.1145/2627534.2627557

[16] Zhang, Jiong, and Mohammad Zulkernine, (2006). Anomaly-based network intrusion detection with unsupervised outlier detection. In 2006 IEEE International Conference on Communications, vol. 5, 2388-2393. IEEE. DOI: https://doi.org/10.1109/ICC.2006.255127

[17] Alhayali, Royida A. Ibrahem, Mohammad Aljanabi, Ahmed Hussein Ali, Mostafa Abdulghfoor Mohammed, and Tole Sutikno, (2021). Optimized machine learning algorithm for intrusion detection. Indonesian Journal of Electrical Engineering and Computer Science 24(1), 590-599. DOI: https://doi.org/10.11591/ijeecs.v24.i1.pp590-599

[18] Abd, Shamis N., Mohammad Alsajri, and Hind Raad Ibraheem, (2020). Rao-SVM machine learning algorithm for the intrusion detection system. Iraqi Journal for Computer Science and Mathematics 1,(1) 23-27. DOI: https://doi.org/10.52866/ijcsm.2019.01.01.004

[19] Liu, Gaoyuan, Huiqi Zhao, Fang Fan, Gang Liu, Qiang Xu, and Shah Nazir, (2022). An enhanced intrusion detection model based on improved kNN in WSNs. Sensors 22(4). 1407. DOI: https://doi.org/10.3390/s22041407

[20] Liu, Chao, Jing Yang, and Jinqiu Wu, (2020). Web intrusion detection system combined with feature analysis and SVM optimization. EURASIP Journal on Wireless Communications and Networking 2020, no. 1(33). DOI: https://doi.org/10.1186/s13638-019-1591-1

[21] Al-Janabi, Mohammed, and Mohd Arfian Ismail, (2021). Improved intrusion detection algorithm based on TLBO and GA algorithms. Int. Arab J. Inf. Technol. 18(2) 170-179. DOI: https://doi.org/10.34028/iajit/18/2/5

[22] Almomani, Omar, (2020). A feature selection model for network intrusion detection system based on PSO, GWO, FFA, and GA algorithms. Symmetry 12(6), 1046. DOI: https://doi.org/10.3390/sym12061046

[23] Bhattacharya, Sweta, Praveen Kumar Reddy Maddikunta, Rajesh Kaluri, Saurabh Singh, Thippa Reddy Gadekallu, Mamoun Alazab, and Usman Tariq, (2020). A novel PCA-firefly based XGBoost classification model for intrusion detection in networks using GPU. Electronics 9(2):219. DOI: https://doi.org/10.3390/electronics9020219

[24] Kumar, Neeraj, and Sanjeev Sharma, (2023). A Hybrid Modified Deep Learning Architecture for Intrusion Detection System with Optimal Feature Selection. Electronics 12(19): 4050. DOI: https://doi.org/10.3390/electronics12194050

[25] Nazir, Anjum, and Rizwan Ahmed Khan (2021). A novel combinatorial optimization based feature selection method for network intrusion detection. Computers & Security 102, 102164. DOI: https://doi.org/10.1016/j.cose.2020.102164

[26] Hanif, Sohaib, Tuba Ilyas, and Muhammad Zeeshan, (2019). Intrusion detection in IoT using artificial neural networks on UNSW-15 dataset. In 2019 IEEE 16th international conference on smart cities: improving quality of life using ICT & IoT and AI (HONET-ICT), 152-156. IEEE. DOI: https://doi.org/10.1109/HONET.2019.8908122

[27] Harrison, Onel, (2018). Machine learning basics with the k-nearest neighbors algorithm. Towards Data Science 11.

[28] Hassija, Vikas, Vinay Chamola, Vikas Saxena, Divyansh Jain, Pranav Goyal, and Biplab Sikdar, (2019). A survey on IoT security: application areas, security threats, and solution architectures. IEEE Access 7, 82721-82743. DOI: https://doi.org/10.1109/ACCESS.2019.2924045

[29] He, Wenhao, Hongjiao Li, and Jinguo Li. (2019). Ensemble feature selection for improving intrusion detection classification accuracy. In Proceedings of the 2019 international conference on artificial intelligence and computer science, 28-33. DOI: https://doi.org/10.1145/3349341.3349364

[30] Hodo, Elike and Bellekens, Xavier and Hamilton, Andrew and Dubouilh, Pierre-Louis and Iorkyase, Ephraim and Tachtatzis, Christos and Atkinson, Robert, (2016). Threat analysis of IoT networks Using Artificial Neural Network Intrusion Detection System." 2016 International Symposium on Networks, Computers and Communications (ISNCC). IEEE, 1-6. DOI: https://doi.org/10.1109/ISNCC.2016.7746067

[31] Idrissi, Idriss and Boukabous, Mohammed and Azizi, Mostafa and Moussaoui, Omar and El Fadili, Hakim (2021). Toward a deep learning-based intrusion detection system for IoT against botnet attacks. IAES International Journal of Artificial Intelligence. DOI: https://doi.org/10.11591/ijai.v10.i1.pp110-120

[32] Imrana, Yakubu and Xiang, Yanping and Ali, Liaqat and Abdul-Rauf, Zaharawu and Hu, Yu-Chen and Kadry, Seifedine and Lim, Sangsoon, (2022). $chi$ 2-bidlstm: a feature driven intrusion detection system based on $chi$ 2 statistical model and bidirectional lstm. Sensors 22.5. DOI: https://doi.org/10.3390/s22052018

[33] Inamdar, Ashwinin (2021). Data Science. Ensemble Learning Techniques in Machine Learning 18-9.

[34] Jabez, Ja and Muthukumar, B. (2015). Intrusion Detection System (IDS): Anomaly Detection using Outlier. Procedia Computer Science. Elsevier, 338-346. DOI: https://doi.org/10.1016/j.procs.2015.04.191

[35] Disha, Raisa Abedin, and Sajjad Waheed, (2022). Performance analysis of machine learning models for intrusion detection system using Gini Impurity-based Weighted Random Forest (GIWRF) feature selection technique. Cybersecurity 5(1):1. DOI: https://doi.org/10.1186/s42400-021-00103-8

[36] Shafiq, Muhammad, Zhihong Tian, Ali Kashif Bashir, Xiaojiang Du, and Mohsen Guizani, (2020). CorrAUC: a malicious bot-IoT traffic detection method in IoT network using machine-learning techniques. IEEE Internet of Things Journal 8(5): 3242-3254. DOI: https://doi.org/10.1109/JIOT.2020.3002255

[37] Koroniotis, Nickolaos, Nour Moustafa, Elena Sitnikova, and Benjamin Turnbull, (2019). Towards the development of realistic botnet dataset in the internet of things for network forensic analytics: Bot-iot dataset. Future Generation Computer Systems 100: 779-796. DOI: https://doi.org/10.1016/j.future.2019.05.041

[38] Liu, Jingyu, Dongsheng Yang, Mengjia Lian, and Mingshi Li, (2021). Research on intrusion detection based on particle swarm optimization in IoT. IEEE Access 9: 38254-38268. DOI: https://doi.org/10.1109/ACCESS.2021.3063671

[39] Chohra, Aniss, Paria Shirani, ElMouatez Billah Karbab, and Mourad Debbabi, (2022). Chameleon: Optimized feature selection using particle swarm optimization and ensemble methods for network anomaly detection. Computers & Security 117: 102684. DOI: https://doi.org/10.1016/j.cose.2022.102684

[40] Moustafa, Nour, Benjamin Turnbull, and Kim-Kwang Raymond Choo, (2018). An ensemble intrusion detection technique based on proposed statistical flow features for protecting network traffic of internet of things. IEEE Internet of Things Journal 6(3): 4815-4830. DOI: https://doi.org/10.1109/JIOT.2018.2871719

[41] Leevy, Joffrey L., John Hancock, Taghi M. Khoshgoftaar, and Jared M. Peterson, (2022). IoT information theft prediction using ensemble feature selection. Journal of Big Data 9, (1): 6. DOI: https://doi.org/10.1186/s40537-021-00558-z

[42] Gavel, Shashank, Ajay Singh Raghuvanshi, and Sudarshan Tiwari, (2022). An optimized maximum correlation based feature reduction scheme for intrusion detection in data networks. Wireless Networks 28(6): 2609-2624. DOI: https://doi.org/10.1007/s11276-022-02988-w

[43] Zhou, Lu, Ye Zhu, Tianrui Zong, and Yong Xiang, (2022). A feature selection-based method for DDoS attack flow classification. Future Generation Computer Systems 132: 67-79. DOI: https://doi.org/10.1016/j.future.2022.02.006

[44] Aggarwal, Ashwani Kumar, (2022). Learning texture features from glcm for classification of brain tumor mri images using random forest classifier. Trans Signal Process 18: 60-63. DOI: https://doi.org/10.37394/232014.2022.18.8

[45] Moustafa N (2021) A new distributed architecture for evaluating AI-based security systems at the edge: network TON_IoT datasets. Sustain Cities Soc 72:102994 DOI: https://doi.org/10.1016/j.scs.2021.102994

[46] M.A. Omari, M. Rawashdeh, F. Qutaishat, M. Alshira’H, N. Ababneh, An intelligent tree-based intrusion detection model for cyber security, Journal of Network and Systems Management 29. doi: 10.1007/s10922-021-09591-y. DOI: https://doi.org/10.1007/s10922-021-09591-y

[47] X. Deng, Q. Liu, Y. Deng, S. Mahadevan, (2016). An improved method to construct basic probability assignment based on the confusion matrix for classification problem. Inf. Sci. 340–341. 250–261. DOI: https://doi.org/10.1016/j.ins.2016.01.033

[48] Awajan, Albara, (2023). A novel deep learning-based intrusion detection system for IOT networks. Computers 12(2), 34. DOI: https://doi.org/10.3390/computers12020034

[49] Saheed, Yakub Kayode, Aremu Idris Abiodun, Sanjay Misra, Monica Kristiansen Holone, and Ricardo Colomo-Palacios, (2022). A machine learning-based intrusion detection for detecting internet of things network attacks. Alexandria Engineering Journal 61(12):9395-9409. DOI: https://doi.org/10.1016/j.aej.2022.02.063

[50] Almiani, Muder, Alia AbuGhazleh, Amer Al-Rahayfeh, Saleh Atiewi, and Abdul Razaque, (2020). Deep recurrent neural network for IoT intrusion detection system. Simulation Modelling Practice and Theory 101: 102031. DOI: https://doi.org/10.1016/j.simpat.2019.102031

[51] Mopuru, Bhargavi, and Yellamma Pachipala, (2024). Advancing IoT Security: Integrative Machine Learning Models for Enhanced Intrusion Detection in Wireless Sensor Networks. Engineering, Technology & Applied Science Research 14(4). 14840-14847. DOI: https://doi.org/10.48084/etasr.7641

[52] Karthikeyan, M., D. Manimegalai, and Karthikeyan RajaGopal, (2024). Firefly algorithm based WSN-IoT security enhancement with machine learning for intrusion detection. Scientific Reports 14(1): 231. DOI: https://doi.org/10.1038/s41598-023-50554-x

[53] Sakshi Taaresh Khanna, Khatri, S. K., & Sharma, N. K. (2025). Advancements in Artificial Intelligence for Oral Cancer Diagnosis. International Journal of Computational and Experimental Science and Engineering, 11(2). https://doi.org/10.22399/ijcesen.1666 DOI: https://doi.org/10.22399/ijcesen.1666

[54] Ibeh, C. V., & Adegbola, A. (2025). AI and Machine Learning for Sustainable Energy: Predictive Modelling, Optimization and Socioeconomic Impact In The USA. International Journal of Applied Sciences and Radiation Research , 2(1). https://doi.org/10.22399/ijasrar.19 DOI: https://doi.org/10.22399/ijasrar.19

[55] G. Prabaharan, S. Vidhya, T. Chithrakumar, K. Sika, & M.Balakrishnan. (2025). AI-Driven Computational Frameworks: Advancing Edge Intelligence and Smart Systems. International Journal of Computational and Experimental Science and Engineering, 11(1). https://doi.org/10.22399/ijcesen.1165 DOI: https://doi.org/10.22399/ijcesen.1165

[56] Hafez, I. Y., & El-Mageed, A. A. A. (2025). Enhancing Digital Finance Security: AI-Based Approaches for Credit Card and Cryptocurrency Fraud Detection. International Journal of Applied Sciences and Radiation Research, 2(1). https://doi.org/10.22399/ijasrar.21 DOI: https://doi.org/10.22399/ijasrar.21

[57] M.K. Sarjas, & G. Velmurugan. (2025). Bibliometric Insight into Artificial Intelligence Application in Investment. International Journal of Computational and Experimental Science and Engineering, 11(1). https://doi.org/10.22399/ijcesen.864 DOI: https://doi.org/10.22399/ijcesen.864

[58] Olola, T. M., & Olatunde, T. I. (2025). Artificial Intelligence in Financial and Supply Chain Optimization: Predictive Analytics for Business Growth and Market Stability in The USA. International Journal of Applied Sciences and Radiation Research, 2(1). https://doi.org/10.22399/ijasrar.18 DOI: https://doi.org/10.22399/ijasrar.18

[59] ZHANG, J. (2025). Artificial intelligence contributes to the creative transformation and innovative development of traditional Chinese culture. International Journal of Computational and Experimental Science and Engineering, 11(1). https://doi.org/10.22399/ijcesen.860 DOI: https://doi.org/10.22399/ijcesen.860

[60] García, R., Carlos Garzon, & Juan Estrella. (2025). Generative Artificial Intelligence to Optimize Lifting Lugs: Weight Reduction and Sustainability in AISI 304 Steel. International Journal of Applied Sciences and Radiation Research, 2(1). https://doi.org/10.22399/ijasrar.22 DOI: https://doi.org/10.22399/ijasrar.22

Downloads

Published

2025-07-08

How to Cite

Rajesh, & Mridul Chawla. (2025). Intrusion Detection and Prevention Using Machine Learning for IoT-Based . International Journal of Computational and Experimental Science and Engineering, 11(3). https://doi.org/10.22399/ijcesen.3323

Issue

Section

Research Article