Assimilate Grid Search and ANOVA Algorithms into KNN to Enhance Network Intrusion Detection Systems
Abstract
The recent progress of operational network intrusion detection systems (NIDS) has become increasingly essential. Herein, a fruitful attempt to introduce an innovative NIDS methodology that integrates the grid search optimization algorithm and ANOVA techniques with the K nearest neighbor (KNN) algorithm to analyze both spatial and temporal characteristics of data for network traffic. We employ the UNSW-NB15 benchmark dataset, which presents various patterns and a notable imbalance between the training and testing data, with 257674 samples. Therefore, the Synthetic Minority Oversampling Technique has been used since this method is effective in handling imbalanced datasets. Further, to handle the overfitting issue the K folds cross-validation method has been applied. The feature sets within the dataset are meticulously selected using ANOVA mechanisms. Subsequently, the KNN classifier is fine-tuned through hyperparameter tuning using the grid search algorithm. This tuning process includes adjusting the number of K neighbors and evaluating various distance metrics such as 'euclidean', 'manhattan', and 'minkowski'. Herein, all attack types in the dataset were labeled as either 1 for abnormal instances or 0 for normal instances. Our model excels in binary classification by harnessing the strengths of these integrated techniques. By conducting extensive experiments and benchmarking against cutting-edge machine learning and deep learning models, the effectiveness and advantages of our proposed approach are thoroughly demonstrated. Achieving an impressive performance of 99.1%. Also, several performance metrics have been applied to assess the proposed model's efficiency.
Full Text:
PDFReferences
Ahmad, Iftikhar;Basheri, Mohammad;Iqbal, Muhammad Javed, "Performance Comparison of Support Vector Machine, Random Forest, and Extreme Learning Machine for Intrusion Detection," IEEE Access, vol. 6, pp. 33789 - 33795, 2018.
Alsharaiah, Mohammad A.;Abu-Shareha, Ahmad Adel;Hussein, Abdelrahman, "Attention-based Long Short Term Memory Model for DNA Damage Prediction in Mammalian Cells," International Journal of Advanced Computer Science and Applications, vol. 13, no. 9, pp. 91-99, 2022.
Ambusaidi, Mohammed A.;Nanda, Priyadarsi, "Building an intrusion detection system using a filter-based feature selection algorithm," IEEE Transactions on Computers, vol. 65, no. 10, pp. 2986 - 2998, 2016.
Bengio Yoshua;Delalleau, Olivier; Le Roux Nicolas, "The curse of highly variable functions for local kernel machines," Advances in Neural Information Processing Systems, pp. 107-114, 2005.
Hu Zhanhui; Li Yanping; Zhuang Siqing, "SAGB: self-attention with gate and BiGRU network for intrusion detection," Complex and Intelligent Systems, vol. 10, no. 6, pp. 8467 - 8479, 2024.
Kilincer Ilhan Firat; Ertam Fatih; Sengur Abdulkadir, "Machine learning methods for cyber security intrusion detection: Datasets and comparative study," Computer Networks, vol. 188, 2021.
Luíza da Costa; N. Dias de Lima; M., Barbosa, R., "Evaluation of feature selection methods based on artificial neural network weights," Expert Systems with Applications, p. 114312, 2021.
Şenol, Halil, "Estimation of biogas potential from poultry manure to 2040 in Türkiye using time series and the artificial neural network (ANN)," Renewable and Sustainable Energy Reviews, vol. 207, 2025.
Elman, J.L., "Distributed Representations, Simple Recurrent Networks, And Grammatical Structure," Machine Learning,, vol. 7, pp. 195-225, 1991.
Hossain Md. Alamgir;Ahmed Fahad; Haque Md Alimul, "Towards superior android ransomware detection: An ensemble machine learning perspective," Cyber Security and Applications, vol. 3, 2025.
Sakib Mohd; Mustajab Suhel; Alam, Mahfooz, "Ensemble deep learning techniques for time series analysis: a comprehensive review, applications, open issues, challenges, and future directions," Cluster Computing, vol. 28, no. 1, 2025.
Sugitha G.; Solairaj A.; Suresh J., "Block chain fostered cycle-consistent generative adversarial network framework espoused intrusion detection for protecting IoT network," Transactions on Emerging Telecommunications Technologies, vol. 33, no. 11, 2022.
Mohamed R.H; , Mosa F.A, Sadek R.A, "Efficient Intrusion Detection System for IoT Environment," International Journal of Advanced Computer Science and Applications, vol. 13, no. 4, pp. 572-578, 2022.
Jansen Laura Z.H ; Bennin, Kwabena, " machine learning algorithm for personalized healthy and sustainable grocery product recommendations," International Journal of Information Management Data Insights, vol. 5, no. 1, 2025.
Ravi V.; Chaganti R. Alazab, M, "Recurrent deep learning-based feature fusion ensemble meta-classifier approach for intelligent network intrusion detection system," Computers and Electrical Engineering,, vol. 102, 2022.
Verma, A. Ranga, "Statistical analysis of CIDDS-001 dataset for Network Intrusion DetectionSystems using distance-based machine learning.," Procedia Computer Science, Vols. 125, 709-716.
Oliver D. Howes; George E. Chapman, "Understanding variability: the role of meta-analysis of variance," Cambridge University Press, 2024.
Amine, Agalit Mohamed; Khamlichi, Youness Idrissi, "Optimization of Intrusion Detection with Deep Learning: A Study Based on the KDD Cup 99 Database.," International Journal of Safety & Security Engineering, vol. 14, no. 4, p. 1029, 2024.
Nour Moustafa;Jill slay, "The evaluation of Network Anomaly Detection Systems: Statistical analysis of the UNSW-NB15 data set and the comparison with the KDD99 data set," Information Security Journal: A Global Perspective, pp. 18-31, 2016.
Luíza da Costa,;N., Dias de Lima, M., Barbosa, R., "Evaluation of feature selection methods based on artificial neural network weights," Expert Systems with Applications, no. 168, art. no. 114312, 2021.
S. Gopal Krishna Patro, Kishore Kumar Sahu, "Normalization: A Preprocessing Stage," cornell university, 2015.
Bradley J. Erickson , Felipe Kitamura, "Magician’s Corner: 9. Performance Metrics for Machine Learning Models," RSNA, 2021.
Michalas, Antonis;Murray, Rohan, "MemTri: A memory forensics triage tool using Bayesian network and volatility," MIST 2017 - Proceedings of the 2017 International Workshop on Managing Insider Security Threats, co-located with CCS 2017, pp. 57-66, 2017.
Chen, T., & Guestrin, C, "Xgboost: A scalable tree boosting system," In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining, pp. 785-794, 2016.
Khammassi, C., & Krichen, S, "A GA-LR wrapper approach for feature selection in network intrusion detection.," computers & security, no. 70, 255-277., 2017.
Ambusaidi, M. A., He, X., Nanda, , "Building an intrusion detection system using a filter-based feature selection algorithm," IEEE transactions on computers, pp. 65(10), 2986-2998. , 2016.
Janarthanan, T., & Zargari, S., "Feature selection in UNSW-NB15 and KDDCUP'99 datasets," IEEE 26th international symposium on industrial electronics (ISIE), pp. 1881-1886, 2017.
Kumar, V., Sinha, D., Das, A. K., Pandey, S. C., & Goswami, R. T, "An integrated rule based intrusion detection system: analysis on UNSW-NB15 data set and the real time online dataset," Cluster Computing, no. 23, 1397-1418, 2020.
Gao, J., Chai, S., Zhang, , "Research on network intrusion detection based on incremental extreme learning machine and adaptive principal component analysis.," Energies, pp. 12(7), 1223, 2019.
Gao, J., Chai, S., Zhang, B, "Research on network intrusion detection based on incremental extreme learning machine and adaptive principal component analysis," Energies, pp. 12(7), 1223, 2019.
iang, K., Wang, W, "Network intrusion detection combined hybrid sampling with deep hierachical network," IEEE access, pp. 8, 32464-32476, 2020.
Zhu, Z., Ong, Y,S., & Dash, M, ". Wrapper–filter feature selection algorithm using a memetic framework. I," IEEE Transactions on Systems Man, and Cybernetics, no. Part B (Cybernetics), 37(1), 70-76., 2007.
DOI: https://doi.org/10.47738/jads.v6i3.604
Refbacks
- There are currently no refbacks.

Journal of Applied Data Sciences
| ISSN | : | 2723-6471 (Online) |
| Publisher | : | Bright Publisher |
| Website | : | http://bright-journal.org/JADS |
| : | taqwa@amikompurwokerto.ac.id (principal contact) | |
| support@bright-journal.org (technical issues) |
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0




.png)