# LAN Intrusion Detection Using Convolutional Neural Networks
## 5 Results
* Compare the results of the classifier. To distinguish between redundant and unnecessary data, feature selection is used, which is a method of picking important features that fully reflect an issue while causing the least amount of display degradation. As a result, concentrating on a small set of features may yield superior outcomes. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **Training Time at Every Epoch** & **Test Time** \\ \hline CNN & 22 s & 11s \\ CNN–LSTM & 52 s & 11s \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Time comparison of the two models. \begin{table}
\begin{tabular}{c c} \hline \hline
**Language** & **English** \\ \hline Algorithms & CNN, CNN-LSTM \\ Dataset & NSL-KDD \\ Methodology & TensorFlow \textgreater{} CNN 1 Layer \textgreater{} CNN 2 Layer \textgreater{} Evaluation \\ Evaluation Metrics & Sample Identified by Model, Confusion Matrix, \\ Classification Report, Accuracy \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Summary of results. The lowest collection of features that can accurately define the training dataset will be retrieved as a generic strategy for feature selection. It is sufficient to describe the data, and the label class is associated with attributes (that is, it is an exact predictor). Moreover, the predictive power drops and may be poor if an attribute always has the same value. In the recursive feature elimination approach, a model is built periodically, a feature is placed aside, and the procedure is repeated with leftover features until all features in the dataset have been exhausted. A good attribute selection criterion is not always synonymous with a good feature subset construction method. We evaluated the impact of removing one feature at a time since we wanted to meet a given set of requirements. Our aim was to see if an attribute selection process would increase the accuracy of a model's detection on different types of attack classes found in the NSL-KDD dataset. In our experiment, each attack category was fixed separately because they all have different characteristics and are unique in nature. This choice was made in order to find all-important characteristics for each attack type and evaluate the accuracy gain over the original set of features. Because important features that are appropriate to identify those distinct assaults classes have been discovered, the model's performance has been significantly enhanced, according to the analysis. This study provides fresh insight into the use of a learning algorithm and reduction approach to choose relevant and vital features with the help of Confusion Matrix and Classification Report to increase an Intrusion Detection System's accuracy and find prospective characteristics that might help with this development. By using the sklearn split function, we have split the NSL-KDD dataset into two parts, train, and test, with an 80:20 ratio. The accuracy of the train and test datasets for both models are displayed in Table 5. According to Ref. [35], the conventional LSTM model shows low performance on the NSL-KDD test dataset due to the low number of data attributes present in this file. Our method of splitting the dataset into two parts shows higher performance. Classification models produce multiple category outputs. The overall error in our model is calculated by most error measures, but we cannot detect specific instances of faults in our model. The model may misclassify some categories more than others, but using a conventional accuracy metric, we cannot discern this. Figure 4a,b shows the confusion matrix of the NSL-KDD dataset for each CNN model (Custom CNN and CNN model with LSTM). The confusion matrix was divided into 5 \(\times\) 5 matrices with five different classes. Table 5 shows the accuracy of the training and test datasets of both models. For further verification, reports on f1-score, precision, recall, and support are generated for both CNN and CNN-LSTM models. Table 5 describe the metrics of the CNN model for all the categories of attacks.