Whale Optimization Algorithm-Enhanced Long Short-Term Memory Classifier with Novel Wrapped Feature Selection for Intrusion Detection
Abstract
:1. Introduction
2. Literature Review
3. Methodology
3.1. Multi-Layer Perceptron
Layers
3.2. Genetic Algorithm
3.2.1. Population Initialization
3.2.2. Chromosome Representation
3.2.3. Fitness Value Calculation
3.2.4. Parent Selection
3.2.5. Crossover
3.2.6. Mutation
3.2.7. Elitism
3.3. The Particle Swarm Optimization (PSO)
3.4. Long Short-Term Memory
3.4.1. Forget Gate
3.4.2. Input Gate
3.4.3. Output Gate
3.5. Whale Optimization Algorithm
3.5.1. Encircling Prey
3.5.2. Bubble-Net Attacking Method
3.5.3. Search for Prey
3.6. Stages of the Proposed Method
Algorithm 1. Pseudo-code of GA-PSO for feature selection. |
Initialize a population of particles with random feature vectors and velocities Evaluate fitness of each particle using MLP Initialize pBest for each particle Initialize gBest based on the best fitness in the population Repeat until stopping criterion is met: //Genetic Algorithm Operations Select particles for mating pool based on fitness Perform crossover on selected particles to create offspring Apply mutation to offspring Evaluate fitness of offspring using MLP //Particle Swarm Optimization Operations For each particle: Update velocity based on current velocity, pBest, and gBest Update feature vector based on new velocity Evaluate fitness of particle using MLP If fitness of particle is better than its pBest: Update pBest to current position |
Algorithm 2. Pseudo-code of WOA-based hyperparameter optimization of LSTM network |
Initialize: Define the LSTM model structure Define the hyperparameters to optimize: Learning Rate (lr), Learning Rate Drop Factor (lr_drop), Batch Size (batch_size), Number of Hidden Units (hidden_units) Set WOA parameters: Population size (N), Maximum number of iterations (T), Boundary values for each hyperparameter, Define the cost function (classification error) Initialize the positions of whales (population) with random values for the hyperparameters Evaluate the fitness (classification error) of each whale using 5 epochs of LSTM training Identify the best whale (solution) with the lowest error While (t < T): //Iterate through WOA optimization loop For each whale i in the population: Update the coefficient vectors A and C Generate a random number p in [0,1] If (p < 0.5): If (|A| < 1): Update the position of whale i towards the best whale (exploitation—encircling the prey) Else: Update the position of whale i randomly far from the best whale (exploration) Else: Move whale i towards a random whale in the population (exploration) Ensure the updated positions of whale i stay within the predefined bounds for hyperparameters For each whale i: Update the LSTM hyperparameters using the whale’s position (current hyperparameter set) Train the LSTM for five epochs and compute the fitness (classification error) Update the best whale if a better hyperparameter set is found Increment iteration counter t Train the final LSTM model with the best hyperparameter set and a larger number of epochs Output the best hyperparameter set (lr, lr_drop, batch_size, hidden_units) and the final LSTM model |
4. Dataset
4.1. The CICIDS 2017
4.2. NSL-KDD
4.3. Preprocessing Steps
- Min-max normalization: normalization is a crucial step in data preprocessing that scales numerical features to a specified range, typically [0, 1], using the min-max normalization method. This technique transforms the data based on the minimum and maximum values of each feature, ensuring that the features are on a comparable scale without distorting differences in the ranges of values. Specifically, each feature value x is scaled using Equation (1):
- Data cleaning using K-nearest neighbor: Data cleaning is an essential preprocessing step aimed at handling missing or inconsistent data entries to ensure the quality and accuracy of the dataset. The k-nearest neighbor (KNN) method is employed to impute missing values based on the values of the k-nearest observations. By selecting an appropriate value of k, the algorithm identifies the k closest data points to the instance with missing values and uses their average (or majority class for categorical data) to fill in the gaps. This approach leverages the assumption that similar instances exhibit similar behaviors, thus providing a robust and reliable means of data imputation that preserves the inherent structure and relationships within the dataset.
- Data partitioning withhold-out method: data partitioning is a fundamental step in preparing a dataset for training and evaluating machine learning models. The hold-out method is utilized to split the dataset into two distinct subsets: 70% of the data is allocated for training the model, while the remaining 30% is reserved for testing its performance. This partitioning strategy ensures that the model’s ability to generalize to new, unseen data can be effectively assessed. By evaluating the model on the test set, which has not been used during the training process, it is possible to estimate its predictive accuracy and identify any potential overfitting or underfitting issues, thereby facilitating the development of a robust and reliable machine learning model.
5. Evaluation Metrics
5.1. Accuracy
5.2. Precision
5.3. Recall
5.4. F1 Score
6. Complexity Analysis
6.1. Time Complexity Analysis
6.2. Space Complexity Analysis
7. Simulation Results
7.1. Feature Selection Results
7.2. Hyperparameter Optimization Results
7.3. Intrusion Detection Results
8. Comparison
9. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Li, M.; Qi, J.; Tian, X.; Guo, H.; Liu, L.; Fathollahi-Fard, A.M.; Tian, G. Smartphone-based straw incorporation: An improved convolutional neural network. Comput. Electron. Agric. 2024, 221, 109010. [Google Scholar] [CrossRef]
- Chafjiri, A.S.; Gheibi, M.; Chahkandi, B.; Eghbalian, H.; Waclawek, S.; Fathollahi-Fard, A.M.; Behzadian, K. Enhancing flood risk mitigation by advanced data-driven approach. Heliyon 2024, 10, e37758. [Google Scholar] [CrossRef] [PubMed]
- Ghazikhani, A.; Davoodipoor, S.; Fathollahi-Fard, A.M.; Gheibi, M.; Moezzi, R. Robust Truck Transit Time Prediction through GPS Data and Regression Algorithms in Mixed Traffic Scenarios. Mathematics 2024, 12, 2004. [Google Scholar] [CrossRef]
- Khansar, H.H.; Chafjiri, A.S.; Fathollahi-Fard, A.M.; Gheibi, M.; Moezzi, R.; Parsa, J.; Annuk, A. Meta-Heuristic-Based Machine Learning Techniques for Soil Stress Prediction in Embankment Dams During Construction. Indian Geotech. J. 2024, 1–23. [Google Scholar] [CrossRef]
- Maseer, Z.K.; Yusof, R.; Bahaman, N.; Mostafa, S.A.; Foozy, C.F.M. Benchmarking of machine learning for anomaly based intrusion detection systems in the CICIDS2017 dataset. IEEE Access 2021, 9, 22351–22370. [Google Scholar] [CrossRef]
- Rosay, A.; Carlier, F.; Leroux, P. MLP4NIDS: An Efficient MLP-Based Network Intrusion Detection for CICIDS2017 dataset. In Proceedings of the Machine Learning for Networking: Second IFIP TC 6 International Conference, MLN 2019, Paris, France, 3–5 December 2019. [Google Scholar]
- Catillo, M.; Del Vecchio, A.; Pecchia, A.; Villano, U. A Case Study with CICIDS2017 on the Robustness of Machine Learning Against Adversarial Attacks in Intrusion Detection. In Proceedings of the 18th International Conference on Availability, Reliability and Security, Benevento, Italy, 29 August–1 September 2023. [Google Scholar]
- Chindove, H.; Brown, D. Adaptive Machine Learning Based Network Intrusion Detection. In Proceedings of the International Conference on Artificial Intelligence and its Applications, Bagatelle, Mauritius, 9–10 December 2021. [Google Scholar]
- Aldarwbi, M.Y.; Lashkari, A.H.; Ghorbani, A.A. The sound of intrusion: A novel network intrusion detection system. Comput. Electr. Eng. 2022, 104, 108455. [Google Scholar] [CrossRef]
- Panwar, S.S.; Raiwani, Y.; Panwar, L.S. An Intrusion Detection Model for CICIDS-2017 Dataset Using Machine Learning Algorithms. In Proceedings of the 2022 International Conference on Advances in Computing, Communication and Materials (ICACCM), Dehradun, India, 10–11 November 2022. [Google Scholar]
- Ho, S.; Al Jufout, S.; Dajani, K.; Mozumdar, M. A novel intrusion detection model for detecting known and innovative cyberattacks using convolutional neural network. IEEE Open J. Comput. Soc. 2021, 2, 14–25. [Google Scholar] [CrossRef]
- Kshirsagar, D.; Kumar, S. Towards an intrusion detection system for detecting web attacks based on an ensemble of filter feature selection techniques. Cyber-Phys. Syst. 2023, 9, 244–259. [Google Scholar] [CrossRef]
- Pelletier, Z.; Abualkibash, M. Evaluating the CIC IDS-2017 dataset using machine learning methods and creating multiple predictive models in the statistical computing language R. Int. Res. J. Adv. Eng. Sci. 2020, 5, 187–191. [Google Scholar]
- Priyanka, V.; Gireesh Kumar, T. Performance Assessment of IDS Based on CICIDS-2017 Dataset. In Information and Communication Technology for Competitive Strategies (ICTCS 2020) ICT: Applications and Social Interfaces; Springer: Singapore, 2022. [Google Scholar]
- Krsteski, S.; Tashkovska, M.; Sazdov, B.; Radojichikj, L.; Cholakoska, A.; Efnusheva, D. Intrusion Detection with Supervised and Unsupervised Learning Using Pycaret Over CICIDS 2017 Dataset. In Proceedings of the Artificial Intelligence Application in Networks and Systems, Online, 9 July 2023. [Google Scholar]
- Alabsi, B.A.; Anbar, M.; Rihan, S.D.A. Conditional tabular generative adversarial based intrusion detection system for detecting DDOS and DOS attacks on the internet of things networks. Sensors 2023, 23, 5644. [Google Scholar] [CrossRef]
- Zavrak, S.; Iskefiyeli, M. Anomaly-Based Intrusion Detection from Network Flow Features Using Variational Autoencoder. IEEE Access 2020, 8, 108346–108358. [Google Scholar] [CrossRef]
- Kumar, R.; Kumar, P.; Tripathi, R.; Gupta, G.P.; Garg, S.; Hassan, M.M. A distributed intrusion detection system to detect DDoS attacks in blockchain-enabled IoT network. J. Parallel Distrib. Comput. 2022, 164, 55–68. [Google Scholar] [CrossRef]
- Zeeshan, M.; Riaz, Q.; Bilal, M.A.; Shahzad, M.K.; Jabeen, H.; Haider, S.A.; Rahim, A. Protocol-based deep intrusion detection for dos and DDoS attacks using unsw-nb15 and Bot-IoT data-sets. IEEE Access 2021, 10, 2269–2283. [Google Scholar] [CrossRef]
- Roopak, M.; Tian, G.Y.; Chambers, J. An Intrusion Detection System Against DDoS Attacks in IoT Networks. In Proceedings of the 2020 10th Annual Computing and Communication Workshop and Conference (CCWC), Vegas, NV, USA, 6–8 January 2020. [Google Scholar]
- Akgun, D.; Hizal, S.; Cavusoglu, U. A new DDoS attacks intrusion detection model based on deep learning for cybersecurity. Comput. Secur. 2022, 118, 102748. [Google Scholar] [CrossRef]
- Khanday, S.A.; Fatima, H.; Rakesh, N. Implementation of intrusion detection model for DDoS attacks in Lightweight IoT Networks. Expert Syst. Appl. 2023, 215, 119330. [Google Scholar] [CrossRef]
- Issa, A.S.A.; Albayrak, Z. DDoS attack intrusion detection system based on hybridization of CNN and LSTM. Acta Polytech. Hung. 2023, 20, 105–123. [Google Scholar] [CrossRef]
- Baldini, G.; Amerini, I. Online distributed denial of service (DDoS) intrusion detection based on adaptive sliding window and morphological fractal dimension. Comput. Netw. 2022, 210, 108923. [Google Scholar] [CrossRef]
- Hussain, Y.S. Network Intrusion Detection for Distributed Denial-of-Service (DDoS) Attacks using Machine Learning Classification Techniques. Bachelor’s Thesis, University of Victoria, Victoria, BC, Canada, 2020. [Google Scholar]
- Ferrag, M.A.; Shu, L.; Djallel, H.; Choo, K.-K.R. Deep learning-based intrusion detection for distributed denial of service attack in agriculture 4.0. Electronics 2021, 10, 1257. [Google Scholar] [CrossRef]
- Huang, W.; Peng, X.; Shi, Z.; Ma, Y. Adversarial Attack Against LSTM-Based DDoS Intrusion Detection System. In Proceedings of the 2020 IEEE 32nd International Conference on Tools with Artificial Intelligence (ICTAI), Baltimore, MD, USA, 9–11 November 2020. [Google Scholar]
- Mendonça, R.V.; Teodoro, A.A.; Rosa, R.L.; Saadi, M.; Melgarejo, D.C.; Nardelli, P.H.; Rodríguez, D.Z. Intrusion detection system based on fast hierarchical deep convolutional neural network. IEEE Access 2021, 9, 61024–61034. [Google Scholar] [CrossRef]
- Adefemi Alimi, K.O.; Ouahada, K.; Abu-Mahfouz, A.M.; Rimer, S.; Alimi, O.A. Refined LSTM based intrusion detection for denial-of-service attack in Internet of Things. J. Sens. Actuator Netw. 2022, 11, 32. [Google Scholar] [CrossRef]
- Amin, M.Z.; Ali, A. Application of Multilayer Perceptron (MLP) for Data Mining in Healthcare Operations. In Proceedings of the 2017 3rd International Conference on Biotechnology, Lahore, Pakistan, 8–9 February 2017. [Google Scholar]
- Manalo, K.D.; Linsangan, N.B.; Torres, J.L. Classification of myoelectric signals using multilayer perceptron neural network with back propagation algorithm in a wireless surface myoelectric prosthesis. Int. J. Inf. Educ. Technol. 2016, 6, 686–690. [Google Scholar] [CrossRef]
- Albadr, M.A.; Tiun, S.; Ayob, M.; Al-Dhief, F. Genetic algorithm based on natural selection theory for optimization problems. Symmetry 2020, 12, 1758. [Google Scholar] [CrossRef]
- Dharma, F.; Shabrina, S.; Noviana, A.; Tahir, M.; Hendrastuty, N.; Wahyono, W. Prediction of Indonesian inflation rate using regression model based on genetic algorithms. J. Online Inf. 2020, 5, 45–52. [Google Scholar] [CrossRef]
- Band, S.S.; Janizadeh, S.; Chandra Pal, S.; Saha, A.; Chakrabortty, R.; Shokri, M.; Mosavi, A. Novel ensemble approach of deep learning neural network (DLNN) model and particle swarm optimization (PSO) algorithm for prediction of gully erosion susceptibility. Sensors 2020, 20, 5609. [Google Scholar] [CrossRef] [PubMed]
- Ulker, E.D.; Ulker, S. Application of particle swarm optimization to microwave tapered microstrip lines. Comput. Sci. Eng. 2014, 4, 59–64. [Google Scholar] [CrossRef]
- Siami-Namini, S.; Tavakoli, N.; Namin, A.S. A comparative analysis of forecasting financial time series using ARIMA, LSTM, and BiLSTM. arXiv 2019, arXiv:1911.09512. [Google Scholar]
- Hernández, J.; Lopez, D.; Vera, N. Primary user characterization for cognitive radio wireless networks using long short-term memory. Int. J. Distrib. Sens. Netw. 2018, 14, 1550147718811828. [Google Scholar] [CrossRef]
- Pham, Q.-V.; Mirjalili, S.; Kumar, N.; Alazab, M.; Hwang, W.-J. Whale optimization algorithm with applications to resource allocation in wireless networks. IEEE Trans. Veh. Technol. 2020, 69, 4285–4297. [Google Scholar] [CrossRef]
- Rana, N.; Latiff, M.S.A.; Abdulhamid, S.I.M.; Chiroma, H. Whale optimization algorithm: A systematic review of contemporary applications, modifications and developments. Neural Comput. Appl. 2020, 32, 16245–16277. [Google Scholar] [CrossRef]
- Jose, J.; Jose, D.V. Deep learning algorithms for intrusion detection systems in internet of things using CIC-IDS 2017 dataset. Int. J. Electr. Comput. Eng. 2023, 13, 1134–1141. [Google Scholar] [CrossRef]
- Choobdar, P.; Naderan, M.; Naderan, M. Detection and multi-class classification of intrusion in software defined networks using stacked auto-encoders and CICIDS2017 dataset. Wirel. Pers. Commun. 2022, 123, 437–471. [Google Scholar] [CrossRef]
- Ferrag, M.A.; Maglaras, L.; Ahmim, A.; Derdour, M.; Janicke, H. Rdtids: Rules and decision tree-based intrusion detection system for internet-of-things networks. Future Internet 2020, 12, 44. [Google Scholar] [CrossRef]
- Henry, A.; Gautam, S.; Khanna, S.; Rabie, K.; Shongwe, T.; Bhattacharya, P.; Sharma, B.; Chowdhury, S. Composition of hybrid deep learning model and feature optimization for intrusion detection system. Sensors 2023, 23, 890. [Google Scholar] [CrossRef] [PubMed]
- Qazi, E.U.H.; Almorjan, A.; Zia, T. A one-dimensional convolutional neural network (1D-CNN) based deep learning system for network intrusion detection. Appl. Sci. 2022, 12, 7986. [Google Scholar] [CrossRef]
Parameter | Value |
---|---|
The number of hidden units | 33 |
Learning rate | 0.0041 |
Learning rate drop factor | 0.42 |
Batch size | 137 |
Reference | Method | Dataset | Accuracy |
---|---|---|---|
[40] | DNN | CIC-IDS 2017 | 94.61% |
LSTM | CIC-IDS 2017 | 97.67% | |
CNN | CIC-IDS 2017 | 98.61% | |
[41] | Sparse Stacked Auto-Encoders + SoftMax | NSL-KDD | 98.5% |
CICIDS2017 | 98.5% | ||
[42] | RDTIDS (REP Tree + JRip + Forest PA) | BoT-IoT | 96.995% |
CICIDS2017 | 96.665% | ||
[43] | CNN-GRU | CICIDS-2017 | 98.73% |
[44] | 1D CNN | CICIDS2017 | 98.96% |
The proposed method | GA-PSO + MLP/LSTM + WOA | CICIDS2017 | 99.62% |
99.40% | |||
NSL-KDD | 99.6% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
AL-Husseini, H.; Hosseini, M.M.; Yousofi, A.; Alazzawi, M.A. Whale Optimization Algorithm-Enhanced Long Short-Term Memory Classifier with Novel Wrapped Feature Selection for Intrusion Detection. J. Sens. Actuator Netw. 2024, 13, 73. https://doi.org/10.3390/jsan13060073
AL-Husseini H, Hosseini MM, Yousofi A, Alazzawi MA. Whale Optimization Algorithm-Enhanced Long Short-Term Memory Classifier with Novel Wrapped Feature Selection for Intrusion Detection. Journal of Sensor and Actuator Networks. 2024; 13(6):73. https://doi.org/10.3390/jsan13060073
Chicago/Turabian StyleAL-Husseini, Haider, Mohammad Mehdi Hosseini, Ahmad Yousofi, and Murtadha A. Alazzawi. 2024. "Whale Optimization Algorithm-Enhanced Long Short-Term Memory Classifier with Novel Wrapped Feature Selection for Intrusion Detection" Journal of Sensor and Actuator Networks 13, no. 6: 73. https://doi.org/10.3390/jsan13060073
APA StyleAL-Husseini, H., Hosseini, M. M., Yousofi, A., & Alazzawi, M. A. (2024). Whale Optimization Algorithm-Enhanced Long Short-Term Memory Classifier with Novel Wrapped Feature Selection for Intrusion Detection. Journal of Sensor and Actuator Networks, 13(6), 73. https://doi.org/10.3390/jsan13060073