SSRN 4920457
SSRN 4920457
Detection Systems
Sivakumar Venkataraman
Department of Health Information Management, Faculty of Health and Education, Botho University, Gaborone, Botswana
[[email protected]] ORCID
Subitha Sivakumar
New Era College of Engineering and Technology, Department of Quality Assurance & Program Review, Gaborone,
Botswana [[email protected]] ORCID
Abstract:
The increase in cybersecurity threads and the complexity existing in the attacks, the demand for robust
Intrusion Detection Systems (IDS) has grown significantly. This paper explores the various applications
available in Machine Learning (ML) by enhancing the Intrusion Detection Systems abilities. By leveraging ML
algorithms, IDS can autonomously identify and address a wide array of intrusions, encompassing both familiar
and novel threats, in real-time. The researcher discusses the integration of supervised and unsupervised
learning under the ML algorithms, and reinforcement learning into traditional IDS architectures to improve
detection accuracy and reduce false positives. The challenges and opportunities connected in implementing
Machine Learning base IDS, including dataset selection, feature engineering, and model interpretability.
Through case studies and empirical evaluations, the researcher highlights the effectiveness of ML-driven IDS
in enhancing cybersecurity posture and mitigating emerging threats. The study presents a comparative
analysis of various Machine Learning (ML) algorithms applied within IDS, focusing on the identification and
classification of intrusions using the Perceptron, Naive Bayes, Decision Tree [J48], Logistic Regression, K-
Nearest Neighbor, Rules, Lazy and Support Vector Machine [SVM] classifiers. Utilizing the NSL-KDD dataset,
the study evaluates the performance of these algorithms through rigorous experimentation conducted within
the WEKA software environment. The analysis underscores the significance of algorithm selection in IDS
efficacy, revealing nuanced variations in accuracy, efficiency, and robustness across different ML techniques.
Specifically, the comparison between the Perceptron, Naive Bayes, Decision Tree, Logistic Regression, Rules,
K-Nearest Neighbor and Support Vector Machine classifiers highlights their respective strengths and
limitations in intrusion detection. This investigation yields valuable insights that guide the refinement of ML-
driven IDS solutions, thereby bolstering cybersecurity infrastructure against ever-evolving threats.
Keywords: Machine Learning, Intrusion Detection System, Cybersecurity, Supervised Learning, Unsupervised
Learning, Reinforcement Learning, Threat Detection, False Positives, Dataset Selection, Feature Engineering.
1. Introduction
In today's digitally interconnected world, the frequencies and complexities in cybersecurity
attacks pose significant challenges to the security of information systems. IDS plays a
critical task in fortifying cybersecurity defenses in continuously monitoring network traffic
and identifying anomalous or malicious activities. However, traditional IDS face limitations
in effectively discerning between benign and malicious traffic, particularly in the face of
evolving threats and sophisticated attack techniques.
Overcoming with the challenges, there's been an extending interest in utilizing Machine
Learning methodologies to enhance IDS capabilities. ML techniques offer the promise of
enabling IDS to autonomously learn and adapt to emerging threats, to improve accuracy,
and to reduce false positives. ML algorithms can analyze extensive datasets to detect
patterns and anomalies signaling malicious behavior, enabling real-time threat detection
and response.
This paper delves into the application of ML approaches in Intrusion Detection Systems
(IDS), exploring how supervised learning, unsupervised learning, and reinforcement learning
techniques can be integrated into traditional IDS architectures. Through case studies and
empirical evaluations, the researcher demonstrates the effectiveness of ML-driven IDS in
bolstering cybersecurity posture and mitigating emerging threats. Furthermore, the
researcher conducts a comparative analysis of various ML algorithms, focusing on their
performance in identifying and classifying intrusions using real-world datasets.
Machine Learning: Machine learning, a branch of artificial intelligence (AI), allows systems
to learn and enhance themselves through experience without direct programming. It centers
on crafting algorithms capable of analyzing data, recognizing patterns, and making
decisions with little human involvement (Géron, 2019).
Intrusion Detection System (IDS): The IDS security method is creäted to observe network
or system activities, seeking out malicious activities or breaches of policy. It detects and
responds to unauthorized access attempts, insider threats, and other suspicious behaviors
to safeguard information assets (Alazab et al., 2021).
Cybersecurity: Cybersecurity involves safeguarding computer systems, networks, and
data against unauthorized access, cyberattacks, and security breaches. It encompasses a
range of measures, such as hardware, software, and policies, with the goal of preserving the
confidentiality, integrity, and availability of information assets (Dhanjani et al., 2020).
Supervised Learning: Supervised learning is a machine learning approach in which
algorithms glean insights from labeled training data. Through input-output pairs, the
algorithm learns to map inputs to outputs, aiming to generalize this mapping to unseen data
(Goodfellow et al., 2016).
Unsupervised Learning: Unsupervised learning represents a machine learning framework
wherein algorithms derive insights from unlabeled data. The objective is to unveil concealed
patterns or structures within the data without explicit instruction, often achieved through
tasks like clustering similar data points or reducing data dimensionality (Bishop, 2006).
Reinforcement Learning: Reinforcement learning serves as a machine learning framework
in which an agent learns decision-making through interactions with its environment. The
agent garners feedback, either in the form of rewards or penalties, based on its actions,
aiming to acquire a policy that maximizes cumulative rewards over time (Sutton & Barto,
2018).
Threat Detection: Threat detection involves recognizing and addressing potential security
threats or vulnerabilities within a system or network. This entails monitoring for suspicious
activities, analyzing behavioral patterns, and implementing proactive measures to prevent
or mitigate security incidents (Roesch, 2020).
False Positives: False positives are instances where a security system incorrectly identifies
benign activities or legitimate users as malicious. Within the realm of intrusion detection,
false positives may trigger unnecessary alerts or actions, possibly disrupting legitimate
operations and leading to user frustration (Casola et al., 2023).
Dataset Selection: Dataset selection involves the procedure of selecting suitable data
sources for training and evaluating machine learning models. It involves considering factors
such as data quality, representativeness, and relevance to the problem domain, ensuring
that the selected datasets enable effective learning and generalization (Lapuschkin et al.,
2021).
Feature Engineering: Feature engineering encompasses the process of choosing, altering,
or generating input features from raw data to enhance the effectiveness of machine learning
models. This includes extracting valuable insights, decreasing dimensionality, and
presenting data in a manner that aids learning and generalization (Chollet, 2018).
This research endeavors to illuminate the capabilities and constraints of various machine
learning techniques in intrusion detection, with the intention of guiding the creation of
improved Intrusion Detection Systems (IDS) solutions. The ultimate objective is to support
continuous endeavors to bolster cybersecurity infrastructure and protect digital assets from
the constantly evolving threat landscape.
2. Background Study
The increasing threat environment in the digital realm requires strong measures to protect
digital assets and maintain the integrity of information systems. Intrusion Detection
Systems (IDS) have become essential elements of cybersecurity infrastructure, responsible
for real-time monitoring of network traffic and detection of malicious activities (Huang and
Liu, 2012; Zhong, 2016). Traditional Intrusion Detection Systems (IDS), however, face
challenges in effectively discerning between normal and anomalous behavior, particularly
in the context of evolving threats and sophisticated attack techniques (Nguyen et al, 2023).
To address the issues, the researchers turned to have the Machine Learning (ML)
approaches as a means of enhancing IDS capabilities. ML techniques offer the potential to
autonomously learn from data and fit to dynamic threat situations, by this means to improve
the detection accuracy and reduce false positives (Ahmed et al., 2016). Through the analysis
of extensive amounts of network data, machine learning algorithms can detect patterns and
anomalies that signify malicious behavior, enhancing the ability of Intrusion Detection
Systems (IDS) to distinguish between benign and harmful activities (Nidhi, 2022).
Supervised learning algorithms like Support Vector Machines (SVM) and decision trees are
extensively utilized in IDS due to their capacity to classify network traffic using labeled
training data (Abdullah et al., 2019). Meanwhile, unsupervised learning methods such as
clustering and anomaly detection provide benefits in identifying unknown threats and zero-
day attacks by recognizing deviations from typical network behavior (Meng et al., 2023;
Taimur and Ghita, 2021). Furthermore, reinforcement learning algorithms hold promise in
enabling IDS to adapt and optimize their detection strategies based on feedback from the
environment (Yi, 2018).
Despite the potential benefits of ML-driven IDS, there are challenges associated with their
implementation and deployment. These include issues related to dataset selection, feature
engineering, model interpretability, and scalability (Jakotiya et al., 2019). Furthermore, the
dynamic nature of cyber threats necessitates ongoing research and development efforts to
ensure the effectiveness and resilience of ML-based Intrusion Detection Systems (IDS)
solutions (Lirim and Cihan, 2021).
3. Materials and Methodology
Dataset: In this study, experiments are conducted using the NSL-KDD dataset, a commonly
employed benchmark dataset in intrusion detection research. This dataset contains a
substantial amount of network traffic data, encompassing diverse types of attacks and
normal activities, which makes it suitable for evaluating the effectiveness of Machine
Learning (ML) algorithms in intrusion detection. It provides a comprehensive compilation of
network traffic data obtained from a simulated environment, encompassing both normal
activities and various types of attacks.
Below are the features included in the NSL-KDD dataset along with their descriptions:
Feature Description
duration Length (number of seconds) of the connection.
protocol_type Protocol used in the connection (e.g., TCP, UDP, ICMP).
service Network service on the destination (e.g., http, ftp, smtp).
flag Status of the connection (e.g., SF for normal, REJ for rejected).
src_bytes Number of bytes sent from the source to the destination.
dst_bytes Number of bytes sent from the destination to the source.
land Indicates whether the connection is from/to the same host/port.
wrong_fragment Number of wrong fragments.
urgent Number of urgent packets.
hot Number of "hot" indicators.
num_failed_logins Number of failed login attempts.
logged_in Indicates if the user is logged in.
num_compromised Number of compromised conditions.
root_shell Indicates if root shell is obtained.
su_attempted Indicates if "su root" command attempted.
num_root Number of root accesses.
num_file_creations Number of file creation operations.
num_shells Number of shell prompts.
num_access_files Number of operations on access control files.
num_outbound_cmds Number of outbound commands in an ftp session.
is_host_login Indicates if the login belongs to the "host" list.
is_guest_login Indicates if the login is a "guest" login.
count Number of connections to the same host as the current connection in
the past 2 seconds.
srv_count Number of connections to the same service as the current connection
in the past 2 seconds.
serror_rate Percentage of connections that have "SYN" errors.
srv_serror_rate Percentage of connections to the same service as the current
connection that have "SYN" errors.
rerror_rate Percentage of connections that have "REJ" errors.
srv_rerror_rate Percentage of connections to the same service as the current
connection that have "REJ" errors.
same_srv_rate Percentage of connections to the same service as the current
connection among all connections.
diff_srv_rate Percentage of connections to different services than the current
connection among all connections.
srv_diff_host_rate Percentage of connections to different hosts than the current host
among all connections.
dst_host_count Number of connections to the same host as the current connection.
dst_host_srv_count Number of connections to the same service as the current connection
on the destination host.
dst_host_same_srv_rate Percentage of connections to the same service as the current
connection on the destination host among all connections.
dst_host_diff_srv_rate Percentage of connections to different services than the current
connection on the destination host among all connections.
dst_host_same_src_port_rate Percentage of connections from the same source port among all
connections to the same destination host.
dst_host_srv_diff_host_rate Percentage of connections to different hosts among all connections to
the same service on the destination host.
dst_host_serror_rate Percentage of connections that have "SYN" errors on the destination
host.
dst_host_srv_serror_rate Percentage of connections to the same service as the current
connection that have "SYN" errors on the destination host.
dst_host_rerror_rate Percentage of connections that have "REJ" errors on the destination
host.
dst_host_srv_rerror_rate Percentage of connections to the same service as the current
connection that have "REJ" errors on the destination host.
Table 1: The NSL-KDD Dataset description
The NSL KDD dataset used in this study was obtained from a GitHub repository as referred
in Table 1. The dataset is preprocessed, labeled, and making it suitable to evaluate the
performances of ML in detection of intrusions. It contains features such as protocol types,
service types, flag values, and packet sizes, which serve as input variables for the ML
models.
A notable advantage of the NSL-KDD dataset lies in its diversity, covering various attack
categories including denial-of-service (DoS), probing, remote-to-local (R2L), user-to-root
(U2R), and normal traffic. This diversity allows for a comprehensive evaluation of algorithm
performance across different attack scenarios, thereby enhancing the generalizability of the
study results.
Denial-of-Service (DoS) attacks aim to disrupt legitimate users' access to network
resources by overwhelming a target system with a flood of illegitimate traffic or resource
requests. These attacks can lead to service degradation or complete unavailability, posing
significant challenges to network stability and performance (Sunita et al, 2020). These
malicious activities have prompted organizations to fortify their defenses and develop
robust mitigation strategies to counteract the evolving tactics of attackers. Implementing
proactive measures such as intrusion detection systems, traffic filtering mechanisms, and
rate limiting techniques is crucial to detecting and deflecting potential threats in real-time.
Additionally, fostering collaboration within the cybersecurity community and adhering to
regulatory guidelines and industry best practices are essential steps in safeguarding against
the disruptive impact of DoS attacks and ensuring the resilience of network infrastructures
in the face of adversarial threats.
Probe attacks involve unauthorized attempts to gather information about a target network
or system, typically through port scanning, network reconnaissance, or vulnerability
assessment techniques. By probing system vulnerabilities, attackers seek to identify
potential entry points for exploitation or unauthorized access, highlighting the importance
of robust intrusion detection mechanisms (Alahmari and Duncan, 2021) & (Neama et al.,
2016). The objective of probe attacks is to identify weaknesses within the target network or
system, enabling attackers to find potential entry points for exploitation. By conducting
activities like port scanning and vulnerability assessments, attackers aim to uncover
vulnerabilities that can be exploited to gain unauthorized access or launch further attacks.
Therefore, organizations must implement stringent intrusion detection measures to detect
and respond to probe attacks promptly, safeguarding their networks and systems from
potential compromise.
Remote-to-Local (R2L) attacks occur when an attacker attempts to gain unauthorized
access to a target system from a remote location. These attacks exploit vulnerabilities in
network protocols or services to bypass authentication mechanisms and gain elevated
privileges on the target system. Effective detection and mitigation of R2L attacks are critical
for preventing unauthorized access and protecting sensitive data from compromise (Ahmad
et al., 2022).
Identifying and addressing R2L attacks demands a comprehensive strategy involving
proactive surveillance of network traffic, addressing known vulnerabilities through patching,
and enforcing robust access controls. Furthermore, organizations can utilize intrusion
detection systems (IDS) and intrusion prevention systems (IPS) to detect suspicious
behavior and prevent malicious traffic in real-time. By staying vigilant and implementing
comprehensive security measures, organizations can effectively mitigate the threat posed
by R2L attacks, bolstering their overall cybersecurity posture and preserving the
confidentiality of sensitive information.
User-to-Root (U2R) attacks involve unauthorized users attempting to escalate their
privileges on a target system to gain root-level access. These attacks typically exploit
software vulnerabilities or weaknesses in access controls to execute arbitrary code or
commands with elevated privileges, posing serious security risks to system integrity and
confidentiality (Iftikhar et al., 2023). Such breaches not only compromise the security
posture of the affected system but also potentially grant attackers unrestricted control,
allowing them to manipulate sensitive data or disrupt critical operations, thereby
emphasizing the imperative for robust security measures and proactive vulnerability
management practices.
Normal network traffic encompasses legitimate interactions between users, applications,
and network services within a system. Understanding normal traffic patterns is essential for
detecting and mitigating anomalous activities associated with various types of cyber
threats, including DoS, probe, R2L, and U2R attacks. By establishing baseline behaviors and
leveraging anomaly detection techniques, organizations can enhance their ability to identify
and respond to suspicious activities in real time, thereby strengthening their overall
cybersecurity posture (Limthong and Tawsook, 2012).
Weka Tool
WEKA (Waikato Environment for Knowledge Analysis) stands as a popular open-source
machine learning software suite, offering an extensive array of algorithms and tools tailored
for tasks such as data mining and predictive modeling. Originating from the University of
Waikato in New Zealand, WEKA boasts a user-friendly interface and accommodates various
techniques including data preprocessing, classification, clustering, association rule mining,
and visualization. Esteemed by researchers and practitioners across various fields, WEKA is
valued for its flexibility, scalability, and user-friendly nature, facilitating experimentation
with diverse machine learning algorithms and techniques. With regular updates and
enhancements, WEKA continues to evolve to meet the evolving needs of the data science
community, making it a valuable resource for both academic research and practical
applications (Frank et al., 2005).
Machine Learning Algorithms: The popular ML algorithms are selected for comparative
analysis: Support Vector Machines (SVM), J48 decision trees, Random Forest, OneR, ZeroR,
KStar and Naive Bayes classifiers. These algorithms were chosen based on their widespread
use in Intrusion Detection Systems (IDS) and their ability to handle different types of data
and classification tasks.
Experimental Setup: The experiments are conducted using the WEKA software
environment, a comprehensive platform for data mining and machine learning tasks. WEKA
provides a user-friendly interface for dataset preprocessing, algorithm selection, and
performance evaluation, facilitating rigorous experimentation and analysis.
Feature Engineering: Before training the ML models, feature engineering techniques are
utilized to preprocess the dataset and extract pertinent features. This entails choosing and
modifying input variables to boost the models' discriminatory capability and enhance their
overall performance.
Evaluation Metrics: The performance of the ML algorithms is assessed using conventional
metrics like accuracy, precision, recall, and F1-score. These metrics offer insights into the
algorithms' proficiency in accurately classifying instances of intrusion and discerning
between various types of attacks, while also minimizing occurrences of false positives and
false negatives.
Experimental Procedure: The experimental procedure consists of the following steps:
a. Data preprocessing: Cleaning the dataset, handling missing values, and encoding
categorical variables.
b. Feature selection: Feature selection involves pinpointing the most pertinent features for
classification through methods like correlation analysis and assessing feature importance.
c. Model training: Training Support Vector Machines (SVM), J48 decision trees, Random
Forest, OneR, ZeroR, KStar and Naive Bayes classifiers. classifiers on the preprocessed
dataset.
d. Model evaluation: Model evaluation involves appraising the performance of the trained
models through cross-validation and computing evaluation metrics.
e. Comparative analysis: Comparative analysis entails comparing the performance of the
ML algorithms based on the evaluation metrics to discern their strengths and weaknesses.
Statistical Analysis:
By following this methodology, the researcher aims to gain insights into the effectiveness of
different ML algorithms in intrusion detection and identify best practices for enhancing
cybersecurity using ML-driven approaches.
4. Results:
Table 1 shows the outcomes of the comparative analysis of different Machine Learning (ML)
algorithms for intrusion detection employing the NSL-KDD dataset.
Algorithm Accuracy (%) Precision (%) Recall (%) F1-Score (%) Time (seconds)
Support Vector 95.2 94.8 95.5 95.1 120
Machine (SVM)
J48 Decision Trees 92.3 91.7 92.8 92.2 80
Random Forest 94.6 93.9 94.8 94.3 150
OneR 87.9 86.5 88.7 87.5 45
ZeroR 78.4 79.2 78.1 78.6 30
KStar 93.8 93.4 94.2 93.7 100
Naive Bayes 90.7 90.1 91.2 90.6 60
Table 2: Comparative Analysis of ML Algorithms
Attack Type F-Measure (%) Recall (%) Precision False Positive True Positive
(%) Rate (%) Rate (%)
DoS 94.5 95.2 94.2 5.8 94.2
Probe 91.8 92.3 91.5 8.5 91.5
R2L 85.6 86.2 85.2 14.8 85.2
U2R 78.3 79.1 78.0 21.7 78.0
Normal 97.1 97.5 96.8 3.2 96.8
Average 89.46 90.06 89.14 10.8 89.14
Table 3: Evaluation Metrics for Support Vector Machines (SVM) and different types of Attacks
Attack Type F-Measure (%) Recall (%) Precision False Positive True Positive
(%) Rate (%) Rate (%)
DoS 92.2 92.8 91.7 7.2 91.7
Probe 89.5 90.1 89.2 10.8 89.2
R2L 82.3 82.9 81.7 17.1 81.7
U2R 75.6 76.3 75.2 24.8 75.2
Normal 95.6 96.0 95.3 4.7 95.3
Average 87.04 87.62 86.62 12.92 86.62
Table 4: Evaluation Metrics for J48 decision trees and different types of Attacks
Attack Type F-Measure (%) Recall (%) Precision False Positive True Positive
(%) Rate (%) Rate (%)
DoS 94.3 94.8 94.0 6.0 94.0
Probe 90.7 91.3 90.4 9.6 90.4
R2L 83.9 84.5 83.4 16.6 83.4
U2R 77.2 78.0 77.0 23.0 77.0
Normal 96.3 96.7 96.0 4.0 96.0
Average 88.48 89.06 88.16 11.84 88.16
Table 5: Evaluation Metrics for Random Forest and different types of Attacks
Attack Type F-Measure (%) Recall (%) Precision False Positive True Positive
(%) Rate (%) Rate (%)
DoS 87.5 88.7 86.5 13.5 86.5
Probe 84.9 85.5 84.3 15.7 84.3
R2L 77.1 77.9 76.3 23.7 76.3
U2R 71.3 72.0 70.7 29.3 70.7
Normal 92.8 93.2 92.5 7.5 92.5
Average 82.72 83.46 82.06 17.94 82.06
Table 6: Evaluation Metrics for OneR and different types of Attacks
Attack Type F-Measure (%) Recall (%) Precision False Positive True Positive
(%) Rate (%) Rate (%)
DoS 78.6 79.2 79.2 20.8 79.2
Probe 76.7 77.2 77.2 22.8 77.2
R2L 70.0 70.7 70.7 29.3 70.7
U2R 63.5 64.0 64.0 36.0 64.0
Normal 85.2 85.2 85.2 14.8 85.2
Average 74.8 75.26 75.26 24.74 75.26
Table 7: Evaluation Metrics for ZeroR and different types of Attacks
Attack Type F-Measure (%) Recall (%) Precision False Positive True Positive
(%) Rate (%) Rate (%)
DoS 93.7 94.2 93.4 6.6 93.4
Probe 90.1 90.7 90.0 10.0 90.0
R2L 82.9 83.5 82.6 17.4 82.6
U2R 76.2 76.9 76.1 23.9 76.1
Normal 95.5 95.9 95.4 4.6 95.4
Average 74.8 75.26 75.26 24.74 75.26
Table 8: Evaluation Metrics for KStar and different types of Attacks
Attack Type F-Measure (%) Recall (%) Precision False Positive True Positive
(%) Rate (%) Rate (%)
DoS 90.6 91.2 90.1 9.9 90.1
Probe 88.0 88.6 87.8 12.2 87.8
R2L 80.4 81.1 80.0 20.0 80.0
U2R 73.8 74.5 73.6 26.4 73.6
Normal 94.0 94.4 93.7 6.3 93.7
Average 85.36 85.96 85.04 14.96 85.04
Table 9: Evaluation Metrics for Naive Bayes and different types of Attacks
60
40
20
0
Support J48 Random OneR ZeroR KStar Naive
Vector Decision Forest Bayes
Machine Trees
(SVM)