CNN-based Network Intrusion Detection and Classification Model For Cyber-Attacks
CNN-based Network Intrusion Detection and Classification Model For Cyber-Attacks
Abstract:- A Convolution Neural Network (CNN)-based Due to the increasing number of network attacks, the
Network Intrusion Detection Model for Cyber-attacks is Intrusion Detection System (IDS) has gained more
of great value in identifying and classifying attacks on importance and attention in practical applications for
any network. The Knowledge Discovery in Database network security [24]. An IDS is considered the second line
Cup '99 dataset containing approximately 4,900,000 of defense used to prevent an intruder from accessing the
single connection vectors was divided into two phases; network and protects the network's data, confidentiality,
75% of the total dataset was used during the learning integrity, and availability[8]. The signature-based IDS or
process of the machine learning technique, while 25% misuse detection methods can detect only known attacks
was used on a fully trained model to validate and and occur with the help of a database of attack signatures.
evaluate its performance. The model's performance However, the problem occurs with unknown attacks, i.e.,
indicated that it can detect and classify different classes zero-day attacks, because no signature is detected for the
of attacks with an accuracy of 98% with 20 epochs at a new attacks such as DDoS, phishing, and ransomware
0.001 learning rate using machine learning. The model attacks. The consequence of a security breach might be
loss for the training and validation was 7.48% and rather severe, but large-scale cyber-attacks could be
7.98%, respectively, over 20 epochs, which implies that countered by effective Network Intrusion Detection
the model performed better on the training dataset. Systems (NIDS) [18]. NIDS involves identifying
This study demonstrated that the convolutional Neural unauthorised access to networks through the collection and
network-based Network Intrusion Detection and analysis of network connections and is essential to securing
classification model shows high detection and low false and protecting the communication infrastructure. Network
negative rates. The CNN model offers a high detection Intrusion detection systems have a wide range of
rate and fidelity to unknown attacks, i.e., it can applications, including fraud detection, network monitoring
differentiate between already-seen attacks and new and security. In surveys, intrusion detection techniques
zero-day attacks. At the end of the experiment, the have been identified as a significant field of research in
proposed approach is suitable in modeling the network ensuring network security.
IDS for detecting intrusion attacks on computer networks
thereby enabling a secured environment for the proper Moreover, new techniques and methods are in high
functioning of the system demand, among which the methods and techniques of ML
and ANNs have been widely accepted. Due to the large
Keywords:- Component; Network; Intrusion Detection volume of data, complexity and irregularity of the attacks,
System (IDS); Convolutional Neural Network(CNN); machine learning-based techniques can be adopted for an
Artificial Neural Network(ANN); Machine Learning (ML) attack detection system. However, supervised learning
increases the chances of a false positive rate during
I. INTRODUCTION detection.
The internet has become an unavoidable part of CNNs have become increasingly popular for network
people’s lives, permeating every sector of human activity. intrusion detection because of their major characteristics,
The importance of the internet is not lost to cybercriminals, such as automatic feature extraction and parameter sharing,
who now prefer the cyber domain over the traditional that reduce computational complexity during training. In
world[14]. Cyber-attacks on computer systems have essence, CNN-based models have specific attributes that
increased rapidly over the years. Any computer system make them suitable. With CNNs showing good results in
connected to a network with open ports is at high risk of various pattern recognition problems, it is believed that this
being accessed. With the increasing complexity and method - CNN can be used to classify different attacks. A
quantity of network packets transmitted in networks, the CNN can learn and filter out irrelevant features, reducing
threat of cyberattacks is on the rise [12]. In the past, the risk of false positive alerts [23]. CNNs are a segment of
firewall systems provided a good enough level of security deep learning, and they are widely used in various fields
by following the defense-in-depth principle. However, with ranging from computer vision [4] to object and pattern
the advancement of cyber-attacks, the same level of recognition.
security can’t be ensured.
In comparison to other machine learning models, There has been an increase in the use of deep learning
Convolutional Neural Network (CNN)-based models are algorithms in developing a Network Intrusion Detection
ideally used for detecting cyber-attacks by decomposing the System (NIDS) to detect known and unknown network
input data using filters. This work aims to model a CNN- attacks. Many software systems and network environments
based Network intrusion detection and classification of have become more complex and prone to security breaches
cyber-attacks [8]. Several of these NIDS based on deep learning have
demonstrated impressive detection accuracy by efficiently
In literature, several techniques for tackling NIDS creating model representations from input data.
have been presented in this respect. Still, many proposed
identifying methods impose excessive computational [11] proposed an intrusion detection model using
complexity and require a significant computing capability AlexNet for multi-class classification of DoS and DDoS
to identify intrusions. To address this concern, the deep attacks. The model has 8(eight) layers with 4(four)
learning strategy is used in this study as it has lately earned convolutions and 3(three) fully connected layers. In their
enormous attention due to its flexibility, scalability, and work, to balance the dataset, a Deep Convolutional
potential to largely assign to (automatic) detection. Generative Adversarial Network(DCGAN) model was used
to generate a fake real-time dataset in the same proportions
II. LITERATURE REVIEW as the actual real-time dataset where the MNIST data set
was used. The Adam Search Optimization Algorithm was
Network intrusion detection systems are the front-line used to optimise the ANN parameters.
defense for modern network security. IDSs play a pivotal
role in the cyber security of organisational computer In 2023, [12] performed experiments on reduced
networks. Traditionally, Intrusion detection is performed in feature sets (CCIDS 2018, UNSW 2016) and multiple
two stages: The first stage identifies threats, and the second supervised classification algorithms to assess the sensitivity
stage creates rules for security devices, including and influence of individual features. Deep CNN and
generating rules for an IDS to identify possible threats and convolutional layers were not used in their work. They
an IPS to save the organisation from possible threats based have only used 3(three) convolutional feature extractor
on these rules. The critical limitation of traditional IDS layers and 2(two) fully connected layers with digital
employing rule-based methods is invaluable to a precise dropout and rectified linear activation functions in their
measure [6]. The main aim of cyber security is to protect model design.
our systems, hardware, software and data from cyber-
attacks that may compromise one or more of the following In another study, [15] tried to achieve a more accurate
properties: Confidentiality, Integrity, Availability, and network packet classification by chopping the time-
Authenticity[2]. Cyber-attacks can be divided into two stamped packet headers to fixed-term intervals. In their
categories: Passive attacks, which use monitoring or work, three ordinal interceptions were captured to detect
viewing techniques, whereas Active attacks, typically network abnormities in the downstream traffic: Up-beam
referred to as altering, modifying and destroying the data, size, down-stream packet average length and the byte
can be achieved using various mechanisms. distribution range of the downstream packet.
In a rapidly evolving cybersecurity arms race, utilising This shows that studies have been conducted on
the most advanced tools and techniques is critical to ensure network-based intrusion detection systems designed using
timely and effective identification of unknown network machine-learning techniques [14]. Still, some of the
attacks [23]. ML technology has transformed the Network reviewed literature revealed that incorporating CNN for
Intrusion Detection System (NIDS) due to its ability to experiments that involve large volumes of traffic, CNN also
recognise unknown attacks effectively. Nowadays, most of proved to be faster than most machine learning models [3]
the research on NIDS is based on the ML technology [25].
Various ML techniques are introduced for the detection of III. METHODOLOGY
network attacks, including decision tree, support vector
machine (SVM), genetic algorithms, ANN, k-nearest The subsections below cover the methodologies
neighbours (KNN), and clustering [10]. ANN has received involved in the implementation of this study. Figure 1
extraordinary attention among these ML techniques due to shows the block diagram for the network Intrusion
its effectiveness. State-of-the-art convolutional neural Detection Model.
networks (CNNs) have produced numerous breakthrough
results in computer vision, speech recognition, and natural
language processing [26]. Machine learning-based IDSs
can provide semiautomatic mechanisms, which are good
learners and quick to secure organisational networks [24].
In recent years, deep learning-based models, specifically
Convolutional Neural Networks (CNNs), have begun to
demonstrate tremendous potential in tackling the problems
of Network Intrusion Detection.
A. Data Collection
The first step in creating an intrusion detection system
is to examine the dataset to detect intrusion attacks [7]. This
stage is the Data Acquisition Process, which collects
different connections.
Table 1: Data Distribution of the Classes of Intrusion Attacks and Normal Connections
The fundamental features of any internet connection implemented based on the TCP/IP connection setting are shown in
Table 2.
Source: [1]
In the data preparation stage, data cleaning, which is (expected outcomes), which represent the 21 different
crucial, involves removing null values and duplicate entries classes of attacks. This stage strips the datasets of errors,
from the dataset and storing them in a pickle file for future missing values, and unnecessary features. This stage
use. The Characteristics of the KDD Cup ’99 dataset, usually involves decision-making before gleaning the
including data points, features and output labels, are information from the dataset.
counted and explored through Exploratory Data Analysis
(EDA) using Python libraries like matplotlib, pandas and C. Dataset Split
seaborn. Utility functions like Bi-variate and Univariate The dataset was split into two sections: a training set
Analysis are employed to create plots showing the to train the CNN detection algorithm and a test set
percentage distribution of the data points for each class and completely hidden from the training process. 75% of the
feature in the dataset. Data encoding converts categorical dataset was used for training, while 25% was used to
data into a numerical form for model training. Finally, the evaluate the model's performance, which was randomly
data is then organised into “x” (training variables) and “y” selected with their statistics, as shown in table 3
D. Model Design and Development used the activation function to incorporate non-linearity
In this research study, an interlinked multi-layered effects into the developed model. Two activation (ReLU
neural network was used. The five-layered neural network and softmax) functions were used in this research. These
is structured with several trainable parameters, as shown in layered neural networks used the same activation function
table 4. (ReLU), while the Softmax activation function was used for
the last layer of the CNN, which is the denser layer (outer
The multiple layered neural networks earn over the layer) due to its capability to handle the classification of
input data using a selected kernel filter to extract important multi-classification problems.
features seen as important in the model. The model training
G. Performance Evaluation
As an essential part of the process of research and
development of the network-based intrusion detection and
classification systems, performance metrics provide
transformation in developing the accuracy, precision, recall,
false positive rate, detection rate, and computational cost of
machine learning-driven detection model [13]. Thus, these
are used to model the system according to the specific
requirement of the problem because all the performance
matrix’s computation depends on the type of classes
present in it.
(1) Where:
[7]. M. Gao, L.. Ma, H. Liu, Z. Zhang, Z. Ning, and J. [19]. M. Tavallaee, E. Bagheri, W. Lu, and A. A.
Xu, “ Malicious Network Traffic Detection Based Ghorbani, “A detailed analysis of the KDD CUP 99
on Deep Neural Networks and Association data set”, In 2009 IEEE symposium on
Analysis”, 2020, computational intelligence for security and defense
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC708 applications, 2009, pp. 1-6
5765/ [20]. M. Vakili, M. Ghamsari, and M. Rezaei,
[8]. A. Henry, S. Gautam, S. Khanna, K. Rabie, T. “Performance Analysis and Comparison of Machine
Shongwe, P. Bhattacharya, B. Sharma, and S. and Deep Learning Algorithms for IoT Data
Chowdhury, “Composition of Hybrid Deep Classification”, arXiv preprint arXiv:2001.09636,
Learning Model and Feature Optimization for 2020, pp. 1-13.
Intrusion Detection Syste”, 2023, [21]. W. Wang, F. Harrou, B. Bouyeddou, S. M. Senouci,
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC986 and Y. Sun, Y, “A stacked deep learning approach
6711/ to cyber-attacks detection in industrial systems:
[9]. N. Ketkar, “Introduction to keras”, In Deep application to power system and gas pipeline
Learning with Python, Apress, Berkeley, CA, 2017, systems”, 2022,
pp. 99-111. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC849
[10]. M. Kodys, Z. Lu, K. Wai Fok, and V. L. Thing, 0 44/
“Intrusion Detection in Internet of Things using [22]. Z. Wang, F. A. Ghaleb, A. Zainal, M. Md Siraj, and
Convolutional Neural Networks”, 2022, X. Lu, “An efficient intrusion detection model
https://arxiv.org/pdf/2211.10062 based on convolutional spiking neural network,
[11]. A. Kumar Silivery, and R. Mohan Rao Kovvur, “A 2024,
model for multi-attack classification to improve https://www.ncbi.nlm.nih.gov/pmc/articles/PMC109
intrusion detection performance using deep learning 63367/
approaches”, 2023, https://arxiv.org/pdf/2310.16380 [23]. P. Wu, H. Guo, and R. Buckland, “A Transfer
[12]. A. Kumar Silivery, K. Ram Mohan Rao, and L. Learning Approach for Network Intrusion
Suresh Kumar, “An Effective Deep Learning Based Detection”,2019, https://arxiv.org/pdf/1909.02352
Multi-Class Classification of DoS and DDoS Attack [24]. T. Ahmad, D. Truscan, J. Vain, and I. Porres, “Early
Detection” 2023, https://arxiv.org/pdf/2308.08803 Detection of Network Attacks Using Deep Learning,
[13]. M. Mihailescu, D. Mihai, M. Carabas, M. 2022, https://arxiv.org/pdf/2201.11628
Komisarek, M. Pawlicki, W. Hołubowicz, and R. [25]. O. Ceviz, P. Sadioglu, S. Sen, and V. G. Vassilakis,
Kozik, “The Proposition and Evaluation of the “A Novel Federated Learning-based Intrusion
RoEduNet-SIMARGL2021 Network Intrusion Detection System for Flying Ad Hoc Networks’,
Detection Dataset”, 2021, 2023, https://arxiv.org/pdf/2312.04135
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC827 [26]. H. Dhillon and A. Haque, “Towards Network
2217/ Traffic Monitoring Using Deep Transfer Learning”,
[14]. X. H. Nguyen, X. D. Nguyen, H. H. Huynh, and K. 2021, [ https://arxiv.org/pdf/2101.00731
H. Le, “Realguard: A Lightweight Network
Intrusion Detection System for IoT Gateways” 2022,
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC877
8231/
[15]. V. Ramanathan, K. Mahadevan, and S. Dua, “A
Novel Supervised Deep Learning Solution to Detect
Distributed Denial of Service (DDoS) attacks on
Edge Systems using Convolutional Neural Networks
(CNN) ”, 2023, https://arxiv.org/pdf/2309.05646
[16]. M. Ring, S. Wunderlich, D. Scheuring, D. Landes,
and A. Hotho, “A survey of Network-Based
Intrusion Detection Data Sets”, Computers &
Security, 2019, vol. 86, pp 147-167
[17]. A. A. Sayed, A. A. Taher Azar, A. Ella Hassanien,
and S. El-Ola Hanafy, “Negative Selection
Approach Application in Network Intrusion
Detection Systems”, 2014,
https://arxiv.org/pdf/1403.2716
[18]. I. Shivhare, J. Purohit, V. Jogani, S. Attari, and D.
Madhav Chandane, “Intrusion Detection: A Deep
Learning Approach”, 2023,
https://arxiv.org/pdf/2306.07601