# LAN Intrusion Detection Using Convolutional Neural Networks
## 1 Introduction
Each data record comprises 41 network characteristics, and each datum falls into one of four kinds of assaults (DoS, U2R, R2L, and Probe) [13]. The CIC-IDS-2017 and CSE-CIC-IDS-2018 datasets were created by the Canadian Institute of Cyber Security using intrusion traffic characterization techniques. These datasets are divided into seven attack types, each of which describes a current assault scenario. The NSL-KDD dataset, on the other hand, comprises 41 categories, which is more than the CIC-IDS-2018 dataset [14]. The large quantity of redundant records in the KDD dataset leads the learning algorithms to be biased towards frequent records, preventing them from learning rare records, which are frequently more detrimental to networks, such as U2R and R2L assaults. Furthermore, the presence of these repeated records in the test set will bias the evaluation findings in favor of approaches with higher detection rates on frequent records. In addition, the complexity level of the records in the KDD dataset was examined. Surprisingly, all 21 learners accurately categorized roughly 98% of the recordings in the training set and 86% of the records in the test set [15]. The application of the NSL-KDD dataset, a network dataset that is the latest version of its predecessor, KDD CUP 99, is recommended in this paper. NSL-KDD was created to address the inherent issues with KDD CUP 99 [16]. CNN [17] is used to classify data. It alters data using the kernel technique and then computes a suitable boundary between the available outputs based on these modifications [18; 19]. Table 1 details the different types of attacks and their names. There are four different types of assaults. Figure 1: Intrusion Detection System model. The advancement of computing capabilities has accelerated deep learning (DL) for a variety of applications, including processing of images, processing of natural language, computer vision, and the IDS, which is the subject of this article. We developed an intrusion detection model with the help of CNN, a DL approach for training image datasets. We organized convolutional neural layers and max-pooling layers to create a CNN-based IDS. In our project, we use the suggested model to train the dataset and compare the results to those of another CNN model to see how well it performs. The workflow of this article is shown below:  
1. The dataset has been thoroughly explored. Two characteristics must be addressed before the model can be trained. 2. The dataset has a problem with class imbalance, which is addressed using a hybrid method. 3. The use of Python and a deep learning model in the IDS implementation process is discussed in this paper. 4. Regarding time and accuracy, the selected model with the best detection accuracy exceeded numerous proposed approaches. This article's primary contributions are listed below:  
1. We propose a method for an Intrusion Detection System with the help of deep learning that outperforms previously developed systems in terms of accuracy. 2. While implementing the IDS with different hyper parameters, we use a pre-processing step to speed up the training process. 3. We solve difficulties such as class imbalance in the specified dataset, NSL-KDD. 4. In the intrusion detection process, CNN offers flexibility. The CNN model has the capability to assess and confirm that data are correct or partially correct. A Deep Neural Network, on the other hand, is capable of performing nonlinear data analysis. 5. CNN has the capacity to non-linearly handle input from a variety of sources. This is especially critical when numerous attackers launch a coordinated attack on the network. 6. We process data at a high rate and with high generalization ability combined with efficient categorization performance.