Explainable AI for cyber security. Improving transparency and trust in intrusion detection systems
Explainable AI for cyber security. Improving transparency and trust in intrusion detection systems
----------------------------------------------------------------------------------------------------------------------------- ----------
Date of Submission: 10-12-2024 Date of Acceptance: 20-12-2024
----------------------------------------------------------------------------------------------------------------------------- ----------
ABSTRACT Transparency, Trust, Model-agnostic Explanations,
In recent years, the integration of Artificial LIME, SHAP
Intelligence (AI) in cybersecurity has significantly
enhanced the capabilities of Intrusion Detection I. INTRODUCTION
Systems (IDS) to detect and mitigate sophisticated Background and Motivation
cyber threats. However, the increasing complexity In today's digital era, the proliferation of
and opaque nature of AI models have led to cyber threats has necessitated the deployment of
challenges in understanding, interpreting, and advanced security measures to protect sensitive
trusting these systems. This paper addresses the data and critical infrastructure. Artificial
critical issue of transparency and trust in IDS by Intelligence (AI) has emerged as a transformative
exploring the application of Explainable AI (XAI) tool in cybersecurity, enabling the development of
techniques. By leveraging XAI, we aim to sophisticated Intrusion Detection Systems (IDS)
demystify the decision-making processes of AI- capable of identifying and mitigating potential
driven IDS, enabling security analysts to security breaches in real-time. AI-driven IDS
comprehend and validate the system's outputs leverage machine learning algorithms to detect
effectively. The proposed framework integrates anomalies and patterns indicative of malicious
model-agnostic XAI methods, such as Local activities, thereby enhancing the speed and
Interpretable Model-agnostic Explanations (LIME) accuracy of threat detection (Hussain et al., 2021).
and SHapley Additive exPlanations (SHAP), with However, the increasing reliance on complex,
state-of-the-art IDS algorithms to improve both "black-box" AI models has raised significant
interpretability and performance. Through concerns regarding their transparency and
comprehensive experiments on benchmark trustworthiness, particularly in critical applications
datasets, we demonstrate that our approach not such as cybersecurity (Zhang et al., 2020).
only maintains high detection accuracy but also
enhances the explainability of the model's Problem Statement
decisions, thereby fostering greater trust among Despite the remarkable advancements AI
end-users. The findings of this study underscore the has brought to IDS, one of the major challenges
potential of XAI to bridge the gap between AI’s that persist is the opaqueness of these systems.
advanced capabilities and the human need for Traditional AI models used in IDS, such as deep
understanding, ultimately contributing to more neural networks, often operate as black-boxes,
secure and reliable cyber defense systems. providing little to no insight into how decisions are
Keywords: Explainable AI (XAI), Intrusion made. This lack of transparency undermines the
Detection Systems (IDS), Cybersecurity, trust of security analysts and end-users, making it
difficult to justify and validate the decisions made
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 229
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
by these systems, especially in high-stakes a wide range of cyberattacks. These systems use
environments (Samek, Wiegand, and Müller, machine learning (ML) and deep learning (DL)
2017). Furthermore, the inability to understand the algorithms to analyze vast amounts of data, identify
reasoning behind an IDS’s decision can lead to patterns indicative of malicious activity, and
challenges in compliance with regulatory respond in real-time (Kumar et al., 2020).
standards, which increasingly demand explain Traditional signature-based IDS, which rely on
ability in AI systems (Rudin, 2019). predefined rules, have become less effective
against zero-day attacks and advanced persistent
Objective threats (APTs), as they cannot adapt to new, unseen
This paper aims to address these threats. In contrast, AI-driven IDS can learn from
challenges by exploring the integration of data, making them more adaptable and capable of
Explainable AI (XAI) techniques into IDS to detecting novel attack patterns (Chollet and Allaire,
improve their transparency and trustworthiness. 2018).
The objective is to demonstrate that XAI can One of the key advantages of AI in
provide meaningful insights into the decision- cybersecurity is its ability to automate threat
making processes of AI-driven IDS, thereby detection, thereby reducing the reliance on human
enabling security analysts to interpret and trust the expertise and improving response times. For
outcomes of these systems. The research focuses instance, deep learning models such as
on the application of model-agnostic XAI methods, convolutional neural networks (CNNs) and
such as Local Interpretable Model-agnostic recurrent neural networks (RNNs) have been
Explanations (LIME) and SHapley Additive successfully applied to network traffic analysis,
exPlanations (SHAP), in enhancing the achieving high detection accuracy and low false
interpretability of IDS without compromising their positive rates (Shamshirband et al., 2020).
performance. Additionally, unsupervised learning techniques,
such as clustering and anomaly detection, have
Structure of the Paper been used to identify outliers in network traffic,
The remainder of this paper is organized potentially flagging new types of attacks (Lopez-
as follows: Section 2 provides a comprehensive Martin et al., 2019). However, while AI has
review of the literature on AI in cybersecurity, XAI significantly advanced the capabilities of IDS, it
techniques, and their application in IDS. Section 3 has also introduced new challenges, particularly
outlines the methodology used in this research, concerning the transparency and interpretability of
including the proposed framework for integrating these systems.
XAI into IDS and the datasets used for evaluation.
Section 4 presents the results of the experiments Explainable AI (XAI)
conducted, showcasing the performance metrics of Explainable AI (XAI) is an emerging field
the proposed model, including accuracy, precision, that seeks to address the opaqueness of AI models
recall, and interpretability scores. Tables and by making their decision-making processes more
figures are used to illustrate these metrics, transparent and understandable to humans. As AI
highlighting the benefits of XAI in improving IDS systems become more complex and are
transparency. Section 5 discusses the implications increasingly deployed in critical domains, such as
of the findings, limitations of the study, and healthcare, finance, and cybersecurity, the need for
potential avenues for future research. Finally, explainability has grown. XAI aims to provide
Section 6 concludes the paper by summarizing the insights into how AI models arrive at their
key contributions and the potential impact of XAI predictions, thereby enhancing trust and enabling
on enhancing trust in AI-driven cybersecurity users to validate the system's outputs (Arrieta et al.,
systems. 2020).
There are various approaches to achieving
II. LITERATURE REVIEW explainability in AI models, ranging from intrinsic
AI in Cyber Security methods, which involve designing inherently
The rapid evolution of cyber threats has interpretable models, to post-hoc techniques, which
necessitated the adoption of advanced technologies, seek to explain the decisions of black-box models
particularly Artificial Intelligence (AI), to enhance after they have been made (Guidotti et al., 2018).
cybersecurity measures. AI has been instrumental Among the most widely used post-hoc techniques
in developing sophisticated Intrusion Detection are Local Interpretable Model-agnostic
Systems (IDS) capable of detecting and mitigating Explanations (LIME) and SHapley Additive
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 230
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
exPlanations (SHAP). LIME explains the the potential of XAI to address the transparency
predictions of any classifier by approximating it and trust issues associated with AI-driven
locally with an interpretable model, such as a linear cybersecurity systems. For instance, Akerkar and
model or decision tree (Ribeiro, Singh, and Badr (2020) proposed a hybrid approach
Guestrin, 2016). SHAP, on the other hand, is based combining XAI techniques with traditional IDS to
on cooperative game theory and provides a unified improve both the interpretability and effectiveness
measure of feature importance by attributing each of the system. Their research demonstrated that
feature's contribution to a prediction (Lundberg and using SHAP to explain the output of a deep
Lee, 2017). learning-based IDS allowed security analysts to
These techniques are model-agnostic, better understand and trust the model's decisions,
meaning they can be applied to any AI model, leading to improved threat detection performance.
regardless of its complexity. This makes them Another study by Kumar et al. (2021)
particularly useful in cybersecurity, where the explored the use of LIME to explain the decisions
interpretability of models used in IDS is critical for of a random forest-based IDS. Their findings
ensuring that security analysts can trust and act on indicated that LIME not only provided valuable
the system's recommendations. insights into the model's behavior but also helped
identify potential biases in the training data, which
Current Challenges in IDS could be addressed to enhance the system's overall
Despite the advances brought about by AI, accuracy and fairness. Additionally, the study
several challenges remain in the development and highlighted that integrating XAI into IDS could
deployment of IDS, particularly regarding the reduce the cognitive load on security analysts by
transparency and trustworthiness of these systems. providing clear, interpretable explanations, thereby
One of the primary concerns is the black-box improving decision-making efficiency.
nature of many AI models used in IDS. Models Despite these advancements, there are still
such as deep neural networks are often highly gaps in the research that need to be addressed.
accurate, but their internal workings are not easily Most studies have focused on applying XAI to
understood by humans, making it difficult to relatively simple AI models, and there is a need for
explain why a particular decision was made further exploration of how XAI can be applied to
(Samek et al., 2017). This lack of transparency more complex, deep learning-based IDS.
poses significant risks in cybersecurity, where the Additionally, while XAI techniques such as LIME
stakes are high, and decisions need to be justifiable. and SHAP have shown promise in improving
Another challenge is the potential for AI transparency, their computational overhead and
models to exhibit biases, which can lead to unfair scalability in real-time applications remain areas of
or incorrect decisions. For example, an IDS trained concern (Bhatt et al., 2020).
on imbalanced data may be more likely to flag
certain types of network traffic as malicious while XAI Techniques in Cybersecurity: A
ignoring others, leading to false positives or Comparative Analysis
negatives (Zhang et al., 2020). Additionally, the The implementation of XAI techniques in
dynamic nature of cyber threats means that IDS cybersecurity, particularly in IDS, has been gaining
must continuously adapt to new attack vectors, momentum, with various studies exploring
requiring models that are not only accurate but also different methods to enhance explainability without
interpretable and explainable. compromising performance. This section provides
Furthermore, the use of AI in IDS raises a comparative analysis of the key XAI
concerns about accountability and compliance with techniques—LIME, SHAP, and other model-
regulatory standards. As regulations such as the agnostic methods—in the context of cybersecurity,
General Data Protection Regulation (GDPR) focusing on their effectiveness, efficiency, and
increasingly demand transparency and applicability in real-world scenarios.
explainability in automated decision-making
systems, there is a growing need to ensure that AI- Local Interpretable Model-agnostic
driven IDS can meet these requirements (Rudin, Explanations (LIME) has been widely adopted
2019). due to its versatility and ease of use. LIME works
by perturbing the input data and observing changes
XAI in Cyber Security in the output, allowing it to build a local,
The integration of XAI into IDS has been interpretable model around each prediction. In
the subject of several recent studies, highlighting cybersecurity, LIME has been successfully applied
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 231
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
Key Findings and Research Gaps: While XAI (Kaur et al., 2020). Future research should explore
techniques like LIME and SHAP have shown ways to optimize XAI techniques for real-time
promise in improving transparency and trust in applications and investigate how different
IDS, there are still challenges to be addressed. The stakeholders, including security analysts, managers,
computational overhead associated with these and end-users, perceive and utilize these
techniques limits their applicability in real-time explanations in their decision-making processes.
cybersecurity scenarios, where quick decision-
making is crucial. Moreover, most existing studies Conclusion of Literature Review
have focused on the technical aspects of XAI, with The integration of AI in cybersecurity,
less attention given to the human factors involved particularly in the development of IDS, has greatly
in interpreting and trusting these explanations enhanced the ability to detect and respond to
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 232
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
complex cyber threats. However, the black-box The proposed model is trained and tested on two
nature of many AI models presents significant benchmark datasets widely used in cybersecurity
challenges in terms of transparency and trust, research: KDD Cup 99 and NSL-KDD.
which are critical for ensuring the reliability and KDD Cup 99: This dataset is a well-known
accountability of these systems. Explainable AI benchmark for IDS and contains
(XAI) techniques, such as LIME, SHAP, and other approximately 4.9 million instances with 41
model-agnostic methods, offer promising solutions features. It includes various types of attacks,
to these challenges by providing interpretable such as Denial of Service (DoS), Probe, and
explanations for AI-driven decisions. While current User to Root (U2R) attacks (Tavallaee et al.,
research has demonstrated the effectiveness of 2009). Despite criticisms for its redundancy
these techniques in improving IDS transparency, and outdated attack patterns, KDD Cup 99
there remain gaps that need to be addressed, remains relevant for evaluating IDS due to its
particularly regarding the scalability and real-time extensive use in the literature.
applicability of XAI in cybersecurity. Addressing NSL-KDD: A refined version of KDD Cup 99,
these gaps will be crucial for advancing the field NSL-KDD addresses some of the criticisms by
and ensuring that AI-driven cybersecurity systems removing duplicate records and ensuring a
can be both powerful and trustworthy. more balanced distribution of attack types. It
contains 125,973 training instances and 22,544
III. METHODOLOGY testing instances (Moustafa and Slay, 2015).
Proposed Model NSL-KDD is used alongside KDD Cup 99 to
This study proposes an innovative model ensure the generalizability and robustness of
that integrates Explainable AI (XAI) techniques the proposed model.
with Intrusion Detection Systems (IDS) to enhance
transparency and trust. The proposed model The data preprocessing step involves
leverages both classical machine learning standardization and feature selection, with
algorithms and modern deep learning techniques, redundant features removed to enhance the model's
augmented by XAI methods such as SHAP and efficiency. Table 2 provides a summary of the
LIME, to provide interpretable outputs. datasets used in this study.
Data Collection
generate local explanations by perturbing the 2. Area Under the Receiver Operating
input data and observing changes in the Characteristic Curve (AUC-ROC): The
model’s output. LIME is particularly useful for AUC-ROC score is used to evaluate the
explaining individual predictions, making it a model’s ability to discriminate between attack
complementary technique to SHAP in this and non-attack instances. A higher AUC-ROC
study (Ribeiro et al., 2016). indicates better model performance (Fawcett,
2006).
Evaluation Metrics 3. Interpretability Scores: The explanations
The performance of the proposed model is generated by SHAP and LIME are evaluated
evaluated using a combination of traditional for interpretability using qualitative and
metrics and novel interpretability scores to assess quantitative measures. Qualitative measures
both detection accuracy and the quality of the involve expert assessments of the explanations,
explanations provided by the XAI techniques. while quantitative measures include stability,
1. Accuracy, Precision, Recall, and F1- fidelity, and consistency scores, as suggested
Score: These standard metrics are used to evaluate by Arya et al. (2019).
the effectiveness of the IDS component. Accuracy 4. Trustworthiness Metric: A novel metric is
measures the overall correctness of the model, introduced to quantify the trust level of users
while precision, recall, and F1-score provide in the model’s predictions. This metric is
insights into the model’s ability to correctly derived from user studies where security
identify intrusions versus normal traffic (Manning analysts rate their trust in the explanations
et al., 2008). provided by the XAI module (Doshi-Velez and
Kim, 2017).
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 234
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
Min Samples Split: The minimum number of understand the overall impact of each feature
samples required to split an internal node is on the model’s predictions. This provides
varied from 2 to 10. insights into which features are most
Max Features: The number of features to influential in detecting intrusions.
consider when looking for the best split is 2. Local Explanations: LIME is used to generate
varied from 'auto', 'sqrt', and 'log2'. explanations for individual predictions,
especially for instances classified as attacks.
For the Convolutional Neural Network (CNN), This allows security analysts to understand
the following hyperparameters are optimized: why a particular instance was flagged as
Learning Rate: Varied from 0.001 to 0.1. suspicious.
Batch Size: Varied from 32 to 256.
Number of Convolutional Layers: The In addition to SHAP and LIME, feature
number of convolutional layers is varied from importance metrics such as Gini importance for the
2 to 5. Random Forest model and activation maps for the
Number of Filters: The number of filters in CNN are analyzed to complement the
each convolutional layer is varied from 32 to interpretability assessment.
128.
Dropout Rate: Varied from 0.1 to 0.5 to User Study for Trust Evaluation
To evaluate the trustworthiness of the
prevent overfitting.
XAI-enhanced IDS, a user study is conducted
involving 30 cybersecurity professionals. The
The best-performing hyperparameters are selected
based on the highest F1-Score obtained during participants are provided with a set of predictions
along with the corresponding explanations
cross-validation.
generated by the XAI module. They are asked to
rate their trust in the system’s decisions on a Likert
Explainability Analysis
scale from 1 (low trust) to 5 (high trust).
After training the models, SHAP and LIME are
The results of the user study are analyzed
applied to the trained models to generate
explanations for their predictions. The analysis using statistical methods such as mean trust scores,
standard deviation, and correlation analysis to
focuses on:
assess the relationship between explanation quality
1. Global Explanations: SHAP values are
and trust.
computed across the entire dataset to
Table 4 presents the average trust scores for different types of explanations generated by SHAP and LIME.
Explanation Type Mean Trust Score Standard Deviation
SHAP (Global) 4.2 0.5
SHAP (Local) 4.1 0.6
LIME (Local) 3.8 0.7
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 235
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
Table 5 presents the performance metrics of the proposed model on both the KDD Cup 99 and NSL-KDD
datasets.
Dataset Model Accuracy Precision Recall F1-Score Interpretability
Score
KDD Cup 99 RF 98.4% 97.2% 96.8% 97.0% 8.5
CNN 99.2% 98.5% 98.0% 98.2% 7.8
NSL-KDD RF 97.6% 96.3% 95.9% 96.1% 8.4
CNN 98.8% 97.6% 97.2% 97.4% 7.9
4.4 Case Studies Figure 6 shows the SHAP values for a specific
To validate the effectiveness of the proposed XAI- instance where a SQL injection attack was
enhanced IDS in real-world scenarios, two case detected.
studies were conducted using real network traffic Case Study 2: Healthcare Provider
from a financial institution and a healthcare The second deployment was at a
provider. healthcare provider's network, where the system
Case Study 1: Financial Institution monitored patient data transmissions for potential
In this scenario, the proposed model was breaches. The XAI-enhanced IDS detected an
deployed to monitor network traffic in a large anomalous access pattern that was later confirmed
financial institution. The XAI module provided to be an insider threat. The LIME explanations
clear explanations for each flagged intrusion, were instrumental in tracing the origin of the
helping security analysts quickly identify and breach, and the average trust score was 4.5.
mitigate threats. The average trust score from the The case studies demonstrate that the
analysts was 4.3, reflecting high confidence in the proposed model not only improves detection
system’s decisions. accuracy but also enhances transparency and trust,
making it a valuable tool for real-world
cybersecurity applications.
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 236
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
Figure 4: Confusion Matrix of CNN Model on Figure 6: SHAP Values for SQL Injection
NSL-KDD Dataset Detection
The confusion matrix (Figure 4) for the Figure 7: LIME Explanation for Insider Threat
CNN model on the NSL-KDD dataset highlights its Detection
high performance in distinguishing between attack These findings align with the broader
and normal traffic. The ability to effectively trend in cybersecurity towards incorporating AI
identify intrusions while minimizing false alarms is models that are not only effective but also
critical for the operational effectiveness of IDS. transparent. As cybersecurity threats become more
sophisticated, the need for systems that can explain
5.2 Implications for Cyber Security their decision-making processes becomes
The integration of XAI into IDS has increasingly critical (Zhang et al., 2022).
profound implications for cybersecurity. By
providing interpretable explanations for detection 5.3 Limitations and Future Research
results, XAI facilitates better decision-making and Despite the promising results, several
trust among security analysts. As highlighted by limitations must be acknowledged. Firstly, the
Singh et al. (2021), explainability in AI models can trade-off between model accuracy and
lead to faster identification of threats and more interpretability remains a significant challenge.
efficient response strategies (Singh et al., 2021). In While CNN models provide higher accuracy, their
practical terms, this means that security teams can lower interpretability scores may limit their
more confidently rely on IDS outputs and make practical applicability in scenarios where
informed decisions about mitigating potential explanations are crucial. Future research could
threats. explore hybrid models that aim to combine high
The case studies conducted further validate these accuracy with enhanced interpretability.
benefits. In the financial institution case study, the Additionally, the study was conducted
XAI-enhanced IDS provided clear explanations for using well-established datasets (KDD Cup 99 and
detected intrusions, leading to a high trust score NSL-KDD), which may not fully represent the
from security analysts. Similarly, the healthcare diverse range of modern cyber threats. Future
provider case study demonstrated that XAI can research should consider evaluating the proposed
help in tracing and addressing insider threats more XAI-enhanced IDS on more recent and varied
effectively. datasets to assess its robustness in real-world
scenarios.
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 237
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
Finally, while this study focused on XAI demonstrated that the Convolutional Neural
techniques like SHAP and LIME, there are other Network (CNN) model, while achieving superior
explainability methods that could be investigated. accuracy (99.2% on the KDD Cup 99 dataset)
For instance, integrating model-specific compared to traditional Random Forest (RF)
interpretability techniques with XAI could offer models, presents a trade-off between performance
further insights into model behavior (Doshi-Velez and interpretability. The CNN model achieved
& Kim, 2017). lower interpretability scores (7.8) than the RF
In summary, while the integration of XAI model (8.5), indicating that while it provides more
into IDS represents a significant advancement in accurate intrusion detection, it is less transparent.
improving transparency and trust, ongoing research The application of SHAP and LIME
and development are needed to address existing methods offered valuable insights into the decision-
limitations and enhance the overall effectiveness of making processes of the IDS. Our case studies in
these systems. real-world settings, such as financial institutions
and healthcare providers, validated the practical
VI. CONCLUSION benefits of XAI, showing that interpretable
6.1 Summary of Findings explanations enhance trust and efficiency in threat
This study explored the integration of detection and response. The results emphasize the
Explainable AI (XAI) techniques into Intrusion critical role of XAI in improving the usability of
Detection Systems (IDS) to enhance transparency IDS by providing clear, understandable reasons for
and trust in cybersecurity. Our experiments detected anomalies and threats.
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 238
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 239
International Journal of Advances in Engineering and Management (IJAEM)
Volume 6, Issue 12 Dec. 2024, pp: 229-240 www.ijaem.net ISSN: 2395-5252
DOI: 10.35629/5252-0612229240 |Impact Factorvalue 6.18| ISO 9001: 2008 Certified Journal Page 240