## 6 Lightweight IDS for IoT Devices
### Feature Selection Based Lightweight IDSfor IoT
Furthermore, data sampling, dimensionality reduction, and feature selection are resource-intensive tasks that were not considered in resource consumption statistics. [PERSON] et al. [116] proposed a lightweight IDS using a correlation-based feature selection approach, where the feature selection algorithm is used to identify and retain relevant features in a dataset based on their correlation with the target variable. The proposed IDS was trained and tested while utilizing the UNSW-NB15 dataset, where only 3 out of the total 44 features were selected. These selected features were further provided to the SVM as the algorithm of choice for preparing the classification model. Evaluation results showed that the developed classification model has achieved 98% accuracy. However, the developed classifier was not tested for its resource consumption efficiency, i.e., performance in terms of CPU, memory, and power usage. Another lightweight cyber-attack detection model was proposed by [PERSON] et al., where the authors presented four steps in the complete process, i.e., data collection, data cleaning, model training, and model testing [117]. Deployment of the developed classification model was also performed to effectively evaluate the performance of the classifier over a real-time environment. To reduce system overheads and improve the accuracy of the proposed model, a pair of distinct features was generated using a permutation technique, where each generated pair was fed to the ML algorithm of choice. Based on accuracy results, the relevant pair was chosen for a specific algorithm to have high accuracy rates. While doing so, the time complexity of each algorithm was tested and reported. Experimental results show that Random Forest (RF), Decision Tree (DT), Neural Network (NN), and AdaBoost algorithms achieved the highest accuracy rates. However, the same models did not perform well when deployed in real-world environments. To make the IDS a lightweight solution, the authors have selected a total of 12 features only, where 10 out of 12 are selected using correlation coefficient and entropy. [PERSON] and [PERSON] [118] presented a resource-preserving solution for IoT networks to detect cyber-attacks. The proposed solution is based on a testbed that includes indoor and outdoor Wi-Fi security cameras. To increase the training speed, reduce memory utilization, and avoid overfitting issues in the given detection system, the correlation coefficient feature selection method is used to reduce the irrelevant features. For training and testing purposes, various ML algorithms, including SVM, DT, RF, LDA, Stochastic Gradient Descent, and K-Nearest Neighbor (KNN), were used to identify benign and attack packets. Amongstvarious ML classifiers, RF showed better performance in terms of detection rates. However, the evaluation of the model does not include an assessment of resource consumption. [PERSON] et al. [31] proposed a lightweight IDS for resource-constrained IoT devices. The proposed FS-based model primarily starts with the data exploration phase, which examines the dataset ADFA-LD for normal and attack packets. Furthermore, the data preprocessing phase performs feature extraction using N-gram transformation and is further fed to the feature selection phase, where Mutual Information (MI) and Principal Component Analysis (PCA) are performed for dimensionality reduction. The reduced features are then passed to the modeling phase to train the classification model using the Multi-Layer Perceptron (MLP) classifier. In the testing phase, the performance of MLP was compared with DT, RF, SVM, KNN, and NB. From the obtained results, it was realized that RF has shown minimum memory usage as compared with other algorithms, including MLP. In addition, RF achieved better accuracy and FPR among all studied algorithms. Accordingly, the usage of MLP was found to be inappropriate for preparing an intrusion detection classification model for resource-constrained devices. [PERSON] et al.