## 2 Related Work  
The proposed framework specially targets the class imbalance issue using an algorithm-based approach and, later on, an applied feature selection method to provide efficient NIDS. Therefore, a summary of the recently applied relevant studies are discussed here and shown in Table 1 with their weaknesses and strengths to enhance understanding about the proposed framework. The class imbalance issue was discussed in a study by [PERSON] et al. [21] and the KDD 99 Cup dataset was used in it to make NIDS, where the random forest classifier was used for classification. It showed in the results that the classification was improved (from 92.39% to 92.57%) while using the SMOTE-based solution of the class-imbalance problem. Other classifiers were also used, and the best one is discussed here. Another study [22] used SMOTE and Gaussian mixture model (GMM)-based methods to oversample and solve the class imbalance problem. Two datasets, UNSW-NB15 and CICIDS2017, were used. The binary classification using the proposed SGM-CNN on UNSW-NB15 obtained an accuracy of 98.82%, and a precision of 95.53% F1-score, where the multi-class achieved 96.54% accuracy and 97.26% F1-score. The other dataset was classified on multi-class only and showed 99.85% accuracy with 99.86% F1-score. The deep-learning-based study [23] proposed a Bi-LSTM model that assigns the attention weights via adaptive synthetic sampling (ADASYN) to handle the class imbalance problem found in the NSL-KDD dataset. The accuracy reaches up to 90.73% and 89.65% F1-score. [PERSON] et al. [24] proposed a NID based on SMOTE and the KNN clustering method to solve the class imbalance problem found in the NSL-KDD dataset and then applied the random forest classifier to solve the classification problem. It achieved 78.47% accuracy on the test set. The Focal loss is a function mostly used in ML to measure the loss-based performance of a model to classify the instances. A study [25] used this cost-sensitive function to solve the class imbalance problem and proposed a deep neural network (DNN) and convolutional neural networks (CNN) to classify data on three datasets (NSL-KDD, UNSW-NB15, and Bot-IoT). The results section of this study is enriched with scalability-based data, the layer-wise results evaluation for binary and multi-class classification on all datasets. However, the final results for binary DNN showed 83.92%, 90.41%, and 79.24% F1-score for the NSL-KDD, UNSW-NB15, and Bot-IoT datasets. For multi-class, it showed 47.33%, 39.78% and 98.90% F1-scores, respectively. On the second model CNN for binary classification, it showed 84.87%, 86.03%, and 95.57% F1-scores, where for multi-class, it showed, 51.96%, 39.52% and 95.51% F1-scores, respectively. The algorithm level class imbalance problem is solved [26] by applying several ML classifiers on the NSL-KDD and UNSW-NB15 datasets. It modifies the cross-entropy function that is used as a loss function and by applying data normalization. The final achieved classification scores on binary data are 90.76% for the UNSW-NB15 dataset, and 85.56% for the NSL-KDD dataset. Secondly, the features-selection methods reduce the training and testing times of NIDS solutions with the most appropriate features engagement while performing classification. One of the recent studies [20] applied various methods, such as GA, PSO and many others to check the effect, where the top16 features were selected from the UNSW-NB15 dataset to classify the binary data. The maximum scores achieved by the J48 algorithm were 90.48% accuracy, 84.136% precision, 97.141% sensitivity, and 90.172% F1-score. However, we have seen a lot of studies applied on class imbalance problem solutions, where the proposed study not only solved the class imbalance problem, but also applied feature selection based upon the chi-square method of features ranking and selected the topmost-ranked features. Similarly, we can see that few studies have been applied separately for class imbalance solutions and feature-selection methods.