A3-ENDS: An Adaptive Adversarial-Aware Explainable Framework for Intelligent Network Intrusion Detection and Autonomous Response
DOI:
https://doi.org/10.59461/ijdiic.v5i4.320Keywords:
Network Intrusion Detection, Artificial Intelligence, Sparse Autoencoder, Concept Drift, Adaptive Cyber DefenseAbstract
Network intrusion detection systems face persistent challenges associated with evolving attack patterns, limited model interpretability, false alarms, and automated security response. This study proposes A3-ENDS, an adaptive, adversarial-aware, and explainable network defense framework integrating Sparse Autoencoder-based anomaly detection, XGBoost classification, SHAP explainability, human-in-the-loop decision support, ADWIN-based concept drift monitoring, Q-learning-based response adaptation, and LLM-assisted forensic reporting. The framework was implemented using Python and FastAPI and evaluated using the CICIDS2017 dataset and a GNS3-simulated enterprise network. Among five evaluated classifiers, XGBoost achieved the highest accuracy of 99.86%, with macro-precision, macro-recall, macro-F1, and ROC-AUC of 83.00%, 84.45%, 82.77%, and 0.9752, respectively. The Sparse Autoencoder achieved an anomaly detection F1-score of 52.92%. Adversarial evaluation revealed a decline in macro-F1 from 67.95% under clean traffic to 24.78% under high-budget perturbations, highlighting the model's vulnerability to adversarial manipulation. The Q-learning response strategy achieved a containment rate of 18.50%, compared with 95.75% for the rule-based approach, despite its shorter reported response time. Furthermore, LLM-assisted forensic reporting achieved 84.51% factual correctness, 47.62% report completeness, and 100% response-action consistency. These findings demonstrate the feasibility of integrating intelligent detection, explainability, adaptive monitoring, and security response within a unified architecture. However, further refinement of adversarial defenses, response policies, and forensic reporting mechanisms, alongside independent validation under realistic network conditions, remains necessary for reliable operational deployment.
Published
Issue
Section
License
Copyright (c) 2026 Oluwaseun Adeniyi Ojerinde, Triumph Unim-Ashipu Aleken, Ramatu Abubakar, Ramatu Abubakar, Joseph Adebayo Ojeniyi

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
How to Cite
Share
1. INTRODUCTION
Digital infrastructure, at the heart of modern economies, governments, and organizations, has grown much faster than the security tooling that protects it. New technologies such as cloud computing, mobile connectivity, and the Internet of Things (IoT) have overcome the traditional network perimeter and shifted cybersecurity from a technical to a strategic operational challenge [1]. A signature-based IDS was the most dominant form of IDS in the 1990s and early 2000s, as it used to find threats by comparing traffic against a database of known attack signatures [1][2]. While this strategy works against attacks that have already been cataloged, it cannot structurally recognize zero-day attacks, polymorphic malware, or traffic that is specifically designed to bypass an attack signature database, which gives well-resourced attackers plenty of time to do their damage. The machine-learning era brought anomaly-based and classification-based detectors that learn a model of normal or malicious behavior, rather than using fixed rules, which, in theory, enable the detection of attacks previously unknown as statistical outliers [3]. However, in the real world this transition comes with its own challenges: models that are successful on the benchmark data set often produce an unacceptable number of false positive alerts in practice, leading to analyst "alarm fatigue"; many of the more powerful models, especially the deep learning architectures, are black box machines that provide no rationale for detection to the security team; and models trained with a fixed historical data set quickly lose their ability to detect new trends as traffic patterns change over time, a phenomenon referred to as concept drift [4]. While recent work has led to increasingly refined point solutions to these individual problems, lightweight architectures for constrained hardware [5], explainable AI techniques like SHAP and counterfactual explanation [6], adaptive streaming-learning systems [7], and autonomous response agents [8] have been created; no system has been created that combines detection, explanation, adaptation, and controlled autonomous response in a single framework. This gap between the integration of the two forces is what encourages the present study.
This paper is devoted to the problem, which can be summarized in four parts. Traditional intrusion detection architectures tend to either (i) rely on static signatures or models that need to be trained once and then stored; (ii) be unable to explain why an event is being detected, which reduces the trust that analysts place in the system and makes validation of the events slower; (iii) separate explanation from response, meaning that a system that can explain an event is unlikely to also respond to it under the proper guidance of an analyst. Most of the existing Network Intrusion Detection Systems (NIDS) tend to consider specific features like detection, explainability, adaptation, or response, leading to the development of non-sustainable solutions to be implemented in practical conditions. Recognizing this limitation, this paper introduces the Adaptive Adversarial-Aware Explainable Network Defense System (A3-ENDS), a single framework that combines unsupervised learning anomaly detection using a Sparse Autoencoder, supervised learning attack classification by XGBoost, explainability with SHAP, the Human-in-the-Loop (HITL) decision-making process based on the attack severity, concept drift detection using an unsupervised algorithm (ADWIN), and an adaptive response optimization algorithm (Q-learning), as well as automated MITRE ATT&CK-mapped forensic reporting with OpenRouter. The framework aims to offer adaptive network protection that is explainable and operational for organizations lacking cybersecurity expertise. It is confirmed in experiments using the CICIDS2017 benchmark dataset and a simulated enterprise network using GNS3 that the characteristics include accurate attack detection, low-latency attack response capability, adaptive learning capability, and practical deployment.
1.1. Research Gap and Original Contributions
Despite significant advances in machine-learning-based network intrusion detection, several challenges remain in translating accurate detection models into operational security systems. Existing approaches have investigated anomaly detection, supervised attack classification, explainable artificial intelligence, concept-drift monitoring, and automated response. However, these capabilities are often evaluated separately, making it difficult to determine how their integration affects detection reliability, analyst oversight, computational efficiency, and response effectiveness.
The research problem addressed in this study is the limited integration of interpretable intrusion detection and controlled response within a unified operational workflow. In particular, the relationship between anomaly detection, attack classification, explanation generation, adaptive monitoring, and human-governed response requires clearer architectural specification and systematic evaluation.
To address this problem, A3-ENDS proposes an integrated network defense architecture combining a Sparse Autoencoder, XGBoost classification, SHAP explanations, severity-based human-in-the-loop governance, ADWIN drift monitoring, Q-learning response-policy adaptation, and automated forensic reporting.
The contributions of this study are as follows:
- The design of an integrated intrusion detection and response architecture that combines anomaly-based screening with supervised attack classification.
- The incorporation of feature-level explanations and severity-based human oversight into the response decision-making process.
- The specification of an adaptive monitoring and response workflow incorporating ADWIN and Q-learning.
- The integration of structured incident records and language-model-assisted forensic reporting into the security monitoring workflow.
- The implementation of a prototype and comparative evaluation of five classification algorithms using CICIDS2017, complemented by a simulated enterprise network environment.
The principal contribution of A3-ENDS lies in its architectural integration and operational coordination of established techniques rather than the introduction of a fundamentally new machine-learning algorithm. The experimental findings establish the comparative performance of the evaluated classifiers, while further validation is required to quantify the independent benefits of the remaining framework components.
1.2. Research Questions
The study is guided by the following research questions:
- RQ1: How do the evaluated machine-learning classifiers compare in terms of classification accuracy, macro-precision, macro-recall, macro-F1, ROC-AUC, training time, and memory consumption on CICIDS2017?
- RQ2: How can anomaly detection, supervised classification, explainability, and human-in-the-loop governance be integrated into a coherent intrusion detection and response architecture?
- RQ3: What additional experimental evidence is required to establish the effectiveness of the proposed framework under previously unseen attacks, adversarial perturbations, and changing network traffic conditions?
- RQ4: How can the operational effectiveness of the proposed adaptive response and forensic reporting components be assessed in terms of response reliability, computational overhead, and analyst decision support?
2. RELATED WORK AND RESEARCH GAP
Following a design-science perspective on systems research, the review is structured around two complementary domains: the problem domain is represented by literature regarding the shortcomings of existing network intrusion detection solutions in providing adaptive, explainable, and governable defense, and the solution domain is represented by literature in the domain of machine learning, explainability, and adaptive learning, which provides the components for the construction of A3-ENDS.
2.1. Problem Domain: Detection, Trust and Adaptation Deficits in Network Defense
The three primary limitations with current Network Intrusion Detection Systems (NIDS) are: limits on detection, lack of explainability, and poor adaptability. Although signature-based techniques have good accuracy in detecting existing attacks, they fail to catch zero-day attacks, while anomaly-based techniques have high false alarm rates and are less reliable due to different network activities over a period of time [2][4]. In addition, many machine learning models that perform at high levels are known as black-box models that do not allow the auditor to easily explain the model's predictions: this does not build trust and transparency, and makes it impossible to determine post-incident accountability [6][9][10]. Moreover, the degradation in network change of concept drift for detection over time is not as much periodic retraining as continuous adaptation [4][11]. While some major strides have been achieved in each of the three areas individually (detection, explainability, and adaptive learning), these three have not been combined together in an integrated, resource-efficient framework with meaningful human oversight in existing research.
False-positive alerts remain an important operational challenge in network intrusion detection because excessive alerts can increase the workload of security analysts and reduce the efficiency of incident investigation. Adaptive false-alert filtering has been investigated as a mechanism for reducing unnecessary security notifications [12]. However, false-alert reduction alone does not address the broader requirements of interpretable classification, concept-drift monitoring, and governed security response considered in the proposed A3-ENDS framework.
2.2. Solution Domain: Machine Learning, Explainability and Adaptive-Learning Technologies
Research published recently shows the power of the synergy between machine learning, explainable Artificial Intelligence (XAI), and adaptive learning to increase network defense. Ensemble classifiers like XGBoost offer reliable detection accuracy, and feature-level interpretations using SHAP have boosted analyst confidence and contributed to their decision-making [5][6][13][14]. While supervised classification works well to identify attacks that were known beforehand, anomaly detection can identify attacks that have not been seen before, but most of the existing methods do not perform attack categorization [3] or [15]. Finally, reinforcement learning can support cyber defense by generating adaptive response policies that adapt to emerging attack behaviors, and Human-in-the-loop (HITL) approaches will guarantee that critical decisions are monitored by a human analyst [8][16][17]. All of these technologies serve as the basis for the proposed A3-ENDS (Adaptive Adversarial-Aware Explainable Network Defense System) framework, leading to a coherent operational network defense integrated network solution that enables accurate detection, predictable explainable action, action that adapts to conditions, and guided decisions.
2.3. Comparative Synthesis and Research Gap
Table 1 synthesizes a representative subset of the reviewed literature against the proposed A3-ENDS framework along four dimensions: detection approach, explainability, adaptive learning, and human-governed autonomous response.
| Study | Focus / Method | Key Finding | Limitation |
|---|---|---|---|
| [2] | ML/DL comparison with feature selection for IDS on TON_IoT | Decision Tree and MLP gave best accuracy with fewest false alarms | Single dataset; generalisation untested |
| [3] | Autoencoder + triplet network for deep metric learning | Improved separation of normal/malicious traffic in latent space | Anomaly detection only; no classification |
| [4] | Conformal-prediction framework for concept drift | Enables rejection of uncertain predictions under drift | Does not improve base accuracy; adds latency |
| [7] | Streaming ML with ADWIN/EDDM drift detection (River) | Supports continuous learning and adaptation | Limited model complexity vs. batch learning |
| [6] | Taxonomy and review of explainable-AI methods | Establishes ante-hoc vs. post-hoc conceptual framework | Survey-focused; no IDS-specific evaluation |
| [18] | Two-stage IDS + SHAP explanations (XI2S-IDS) | Reduced false negatives for rare attacks | SHAP computational overhead |
| [5] | XGBoost compressed into a shallow decision tree (GlassBoost) | 98.35% accuracy with depth-4 tree, 8 features | Possible loss of fine-grained decision boundaries |
| [8] | Hierarchical deep RL for incident response (ARCS) | 27.3% faster resolution; 31.2% better effectiveness | Complex training; limited explainability |
| [19] | Lightweight SARSA-based RL (LightRL-AD) | Efficient real-time adaptation against slow-rate DDoS | Simulated SDN only; may sacrifice optimality |
| [20] | Survey of Human-in-the-Loop ML paradigms | Highlights need for structured human oversight | No direct implementation |
| [17] | Survey of concept drift and feature dynamics in machine-learning intrusion detection | Synthesizes methods for identifying and adapting to changing network traffic | Survey-based evidence; does not experimentally validate the proposed A3-ENDS architecture |
| [21] | LLMs as detectors vs. explanation/response agents | Weak as standalone detectors; strong for narrative explanation | Not yet viable as a standalone detector |
| Proposed A3-ENDS | Sparse Autoencoder + XGBoost + SHAP + severity-tiered HITL + ADWIN + Q-learning + LLM reporting | XGBoost achieved 99.86% accuracy and 82.77% macro-F1 in the reported classifier benchmark. The prototype integrates anomaly detection, supervised classification, SHAP explanations, human oversight, adaptive monitoring, response-policy processing, and forensic reporting. | Evaluation relies on a random dataset split and a simulated network environment. Independent validation of zero-day detection, adversarial robustness, adaptation effectiveness, and end-to-end latency remains necessary. |
The reviewed literature demonstrates substantial progress in anomaly-based intrusion detection, supervised classification, explainable machine learning, adaptive monitoring, and automated response. Nevertheless, the studies differ considerably in their architectural scope, experimental environments, evaluation metrics, and degree of human oversight. These differences limit direct comparisons and make it difficult to determine the operational benefits of integrating the individual capabilities. The research gap addressed by A3-ENDS therefore concerns the design and evaluation of a coordinated intrusion detection and response workflow in which detection, explanation, risk assessment, adaptive monitoring, and governed response operate within a common architecture. Although the proposed integration offers a basis for investigating these interactions, its effectiveness must be established through controlled component-level and end-to-end evaluation rather than inferred from the presence of individual algorithms.
3. PROPOSED APPROACH: THE A3-ENDS FRAMEWORK
3.1. Overview of System Design
The A3-ENDS (Adaptive Adversarial-Aware Explainable Network Defense System) pipeline is implemented in ten stages with a Python FastAPI backend and a PyQt6 desktop GUI to continue packet capture, detection, and response activities without the GUI, even if it is not available. Detection, explainability, adaptive learning, and governed response are all combined within the framework to address the failings of traditional NIDS technologies, which tend to have these functions as distinct. It constantly evaluates concept drift, applies response policies, and utilizes the Human in the Loop (HiL) with time bounds instead of full automation to achieve a balance between automation and analyst supervision.
3.2. System Actors
Figure 1 illustrates the use case diagram of the proposed A3-ENDS framework, highlighting the interactions among its three principal system actors: the Network Sensor, Realtime Runner Engine, and Security Analyst. These actors collectively support network traffic acquisition, intelligent threat detection, controlled response execution, and forensic investigation. The roles of the three principal actors are described as follows:
- Network Sensor: external real-time source of traffic that is pulled from the host network interface and fed into the analysis pipeline.
- Realtime Runner Engine: The autonomous system component that runs the entire capture-to-response workflow, ingestion, anomaly gating, attack classification, explainability, drift monitoring, incident synthesis, and forensic reporting without requiring ongoing human involvement.
- Security Analyst: A human being who logs on to the dashboard to review system metrics, approves or rejects Medium-severity and High-severity Human-in-the-Loop response recommendations in the governance window, and reviews the forensic report.
Figure 1.Use Case Diagram
3.3. Conceptual Pipeline
Figure 2 illustrates the conceptual framework of the proposed A3-ENDS architecture, which comprises ten interconnected processing stages that transform raw network traffic into actionable, explainable, and governed security responses. The framework integrates traffic acquisition, feature extraction, anomaly detection, attack classification, explainability, risk assessment, human-in-the-loop governance, response execution, adaptive learning, and forensic reporting. In Stage 1, Packet Capture is performed on the host network interface (NI) using raw sockets in the Scapy program. The packets are aggregated into flows by the 5-tuples (source_ip, source_port, destination_ip, destination_port, protocol) in Stage 2, Flow Aggregation and Feature Extraction, where six different statistical features of each flow are computed 5 seconds after capturing the first packet in a flow. The Anomaly Gate (Stage 3) is a Sparse Autoencoder that reconstructs each standardized feature vector and marks a flow as anomalous if the reconstruction error is above some dynamically calculated threshold. The attacks in Stage 4 are passed to an XGBoost ensemble that performs classification of attacks into one of eight classes: Benign/Zero-Day, DoS, DDoSing, PortScan, BruteForce, Botnet, Web Attack, Infiltration. Explainability is introduced at Stage 5, where the model employed is the TreeExplainer, a new model that makes use of SHAP's explainability API. Each of the 6 input features contributes to the classification in a different manner, and their contribution is explained here. In Stage 6, a Risk Severity Score (RSS) is computed to derive the rank of the classifier's predicted attack class from 0 to 100, based on a given amount of severity weight for an attack class. In stage 7, the Human-in-the-Loop Queue (Media-High) alerts will appear in a persistent queue, with its own bounded-time-backend timer creating a mechanism to ensure the alert is routed to some analyst or automatically acted upon in due course. The execution of a Response is accomplished by MONITOR, NOTIFY, BLOCK, or QUARANTINE, all of which are in Stage 8. As per Stage 9, the adaptation will be performed continually using Drift Detection and Policy Update, where, while watching the stream of risk scores, the policy (the recommended response) for the stream is continuously updated by a tabular Q agent. If possible, Forensic Reports, a large language model additionally composed by OpenRouter-routed data and styled into structured detection and audit information as a narrative Incident Report, is exported to PDF during Stage 10. There are two feedback loops for the pipeline, where a policy update is made at Stage 9 when a drift is detected, and an analytic Reject at the stage is recorded as a false positive and fed back to the Q-learning agent, which is used to steer Q-inspect towards policies targeting new traffic patterns.
Figure 2.Conceptual Framework Diagram
The A3-ENDS architecture operates through a coordinated sequence of traffic acquisition, feature extraction, anomaly detection, supervised attack classification, explanation generation, risk assessment, drift monitoring, and response-policy processing. The framework assumes that network traffic can be observed and converted into suitable flow-level features, while security events and model outputs are available to the decision-support components. The primary threat considered is malicious network activity generated by external attackers or compromised hosts. Attackers may attempt to evade detection by modifying observable traffic characteristics, but direct access to the defender's trained model parameters and administrative controls is not assumed. The architecture distinguishes between detection decisions, response recommendations, and actions requiring human authorization. Although the design incorporates mechanisms intended to support adversarial awareness and adaptation, their effectiveness under deliberate attacker manipulation requires separate experimental validation.
3.4. Formal Detection and Adaptation Model
The A3-ENDS framework processes network traffic as flow-level observations. For a flow consisting of n packets, let pᵢ denote the size of packet i and tᵢ its arrival time. The mean packet size is defined in Equation (1).
\(p̄ = (1/n) ∑ᵢ₌₁ⁿ pᵢ\)(1)
Equation (1) characterizes the average packet size in a flow. Packet-size dispersion is represented by the standard deviation in Equation (2), where p̄ is the mean defined above.
\(σₚ = √[(1/n) ∑ᵢ₌₁ⁿ (pᵢ - p̄)²]\) (2)
The temporal spacing between consecutive packets is summarized by the mean inter-arrival time in Equation (3). This feature is defined for flows containing at least two packets; the implementation must specify how shorter flows are handled.
\(Δt̄ = [1/(n - 1)] ∑ᵢ₌₂ⁿ (tᵢ - tᵢ₋₁)\)(3)
Each numerical feature is standardized using Equation (4), where xⱼ is the original feature value, μⱼ and σⱼ are its training-set mean and standard deviation, and ε is a small positive constant. Training-set statistics must be reused for validation and test observations to avoid information leakage.
\(zⱼ = (xⱼ - μⱼ)/(σⱼ + ε)\)(4)
The Sparse Autoencoder maps the standardized feature vector z to a latent representation h and reconstructs it as ẑ, as shown in Equation (5). Here fθ and gφ denote the encoder and decoder functions. This representation is intended to capture regularities in the traffic observations used for training.
\(h = fθ(z), ẑ = gφ(h)\)(5)
Reconstruction discrepancy is measured by the mean squared error in Equation (6), where d is the dimensionality of the autoencoder input. The anomaly score is evaluated against a predefined threshold in Equation (7).
\(E(z) = (1/d) ∑ⱼ₌₁ᵈ (zⱼ - ẑⱼ)²\)(6)
\(A(z) = 1 if E(z) > τ; otherwise A(z) = 0\)(7)
In Equation (7), A(z) is the binary anomaly indicator and τ is the anomaly threshold. The reported experiment used τ = 2.5907 × 10⁻⁵. The manuscript must additionally state how this value was selected from training or validation data; the numerical value alone does not establish a reproducible selection procedure.
For a flow submitted to supervised classification, the XGBoost model assigns the class with the greatest estimated probability, as expressed in Equation (8). Here K is the number of trained classes, and it must agree with the class labels used in the confusion matrices and evaluation tables.
\(ŷ = arg maxₖ P(y = k | z), k ∈ {1,…,K}\)(8)
The SHAP module expresses a selected model output as an additive decomposition in Equation (9). The baseline φ₀ and feature attributions φⱼ must be interpreted on the specific output scale used by the explainer; these contributions do not by themselves demonstrate causal effects.
\(f(z) = φ₀ + ∑ⱼ₌₁ᵈ φⱼ\)(9)
A severity-weighted risk score can be formed as in Equation (10), where wŷ is a predefined weight in the interval [0, 1] associated with the predicted class. This equation is a proposed formalization: the authors should retain it only if it matches the actual implementation and document the weights and action thresholds.
\(R = 100 × wŷ × P(y = ŷ | z)\)(10)
The ADWIN component monitors a chronologically ordered observation stream for changes in its statistical properties. Equation (11) illustrates the comparison of two candidate subwindows W₀ and W₁ using their respective means and a decision threshold εADWIN. The full ADWIN procedure additionally specifies how its threshold and windows are updated; the monitored variable and configured parameters should be reported.
\(Dₜ = 1[|mean(W₀) - mean(W₁)| > εADWIN]\)(11)
The adaptive-response component uses the Q-learning update in Equation (12), where sₜ is the current state, aₜ is the selected response, rₜ is the reward, α is the learning rate, and γ is the discount factor. The available actions are MONITOR, NOTIFY, BLOCK, and QUARANTINE, subject to human authorization rules. The manuscript must define the implemented state variables, reward function, learning parameters, and authorization logic.
\(Q(sₜ,aₜ)← Q(sₜ,aₜ)+ α[rₜ + γ maxₐ Q(sₜ(+1),a)- Q(sₜ,aₜ)]\)(12)
3.5. Algorithm 1: A3-ENDS Intrusion Detection and Response Procedure
Algorithm 1 summarises the end-to-end decision logic by which an incoming packet is captured, gated for anomaly, classified, explained, scored, governed by human oversight, and used to update the system's adaptive policy and forensic record.
Input: Network traffic stream, trained detection models, anomaly threshold, response-policy configuration.
Output: Traffic classification, explanation, alert, and authorized response.
1. Capture incoming network traffic and aggregate it into flow records.
2. Extract the selected network-flow features.
3. Apply the preprocessing transformations obtained from training data.
4. Evaluate each flow using the Sparse Autoencoder.
5. Compare the reconstruction error with the configured anomaly threshold.
6. Forward anomalous flows to the supervised classifier.
7. Predict the attack category and obtain the classification confidence.
8. Generate SHAP-based feature explanations for relevant predictions.
9. Determine the event severity and applicable response constraints.
10. Update the drift-monitoring component with the configured observation signal.
11. Obtain a response recommendation from the response-policy component.
12. Request analyst approval where required.
13. Execute only authorized response actions.
14. Record the detection outcome, explanation, response decision, and relevant audit information.
15. Continue monitoring subsequent network flows.
3.6. Component Design
The proposed Adaptive Adversarial-Aware Explainable Network Defense System (A3-ENDS) brings all six functional components together in a single cybersecurity system. The Sparse Autoencoder neural network is trained using only normal network traffic, other than attacks, trained via the Anomaly Detection Engine, to learn the sparse representation of the network traffic; if an attack occurs and has not been encountered during training, it can be detected by how well the neural network reconstructs the network traffic. The suspicious flows will be sent to the Attack Classification Engine, where they will be classified in a predefined list of attack classes using an XGBoost classifier. The XGBoost model was chosen, as it achieved a better classification result when tested against Decision Tree, Random Forest, LightGBM, and CatBoost models, and was also the least complex model from the perspective of computational resource consumption as well as its ability to use SHAP for explainability and/or interpretability. The Explainability Engine uses the SHAP TreeExplainer algorithm to provide the exact feature-level explanations for each prediction, helping analysts understand the most influential feature belonging to the network flow in the classification and promoting the transparency and trust of the detection process.
For each threat detected, the Risk, Governance and Response engine allocates a severity score and uses a Human-in-the-Loop decision mechanism that lets medium- and high-severity threats be reviewed by analysts within a set time limit before triggering automated actions if the threat is deemed to be a serious security problem. The feedback from the analyst and the concept drift detected in the system are fed to the Adaptive Learning Engine, which uses a lightweight Q-learning agent to continually adapt response policies as the network behavior changes. Lastly, structured forensic reports, including a summary of audit logs, are automatically created when incidents are submitted through the Forensic Reporting Engine periodically via the OpenRouter API to a large language model, and then exported as PDF reports that also include recommendations for user-friendly mitigation and MITRE ATT&CK techniques applicable to indicated incidents. Together, these coupled elements form an adaptive, explainable, and actionable framework to handle network intrusion detection and response in real-time.
3.6.1. Sparse Autoencoder-Based Anomaly Detection
The anomaly-detection component employs a Sparse Autoencoder to identify network flows that differ from the patterns represented during training. The model receives six network-flow features: flow duration, packet count, mean packet size, packet-size standard deviation, total transmitted bytes, and mean packet inter-arrival time.
The encoder transforms the standardized input features into a latent representation, while the decoder reconstructs the original feature vector. The reconstruction error provides an anomaly score, with higher errors indicating greater deviation from the learned traffic representation. The reported experiment used a reconstruction-error threshold of 2.5907 × 10⁻⁵ and achieved precision of 65.75%, recall of 44.28%, and F1-score of 52.92%. However, the encoder and decoder dimensions, activation functions, sparsity constraint, optimizer, learning rate, batch size, training epochs, and threshold-selection procedure must be verified from the original implementation to ensure reproducibility. The anomaly detector operates before the supervised classification stage. Consequently, malicious flows incorrectly classified as non-anomalous may not reach XGBoost. The standalone performance of the supervised classifier must therefore be distinguished from the end-to-end performance of the complete detection pipeline.
3.6.2. LLM-Assisted Forensic Reporting and Security Controls
The forensic reporting component of A3-ENDS uses a Large Language Model accessed through OpenRouter to generate human-readable summaries of detected security incidents. The reporting process is intended to transform structured detection outputs into concise descriptions that can assist security analysts during incident investigation. The information supplied to the reporting component may include the predicted attack category, classification confidence, relevant network-flow characteristics, SHAP feature attributions, estimated threat severity, and recorded response decisions. These inputs should be derived from the detection pipeline and stored incident records rather than generated independently by the language model.
The LLM is treated as a reporting assistant rather than an authoritative source of forensic evidence. Its generated statements should be checked against the underlying incident records before they are accepted as factual. In particular, the reporting component must not independently invent source addresses, attack outcomes, affected systems, or containment actions. Where MITRE ATT&CK techniques are included, mappings should be established using documented relationships between observed behavior and relevant techniques. A predicted attack category alone may be insufficient to justify a specific ATT&CK technique assignment. Unsupported mappings should be omitted or explicitly marked as uncertain.
The reporting process also introduces data confidentiality considerations because incident information may be transmitted to an externally hosted language-model service. Sensitive identifiers and unnecessary network details should therefore be removed or minimized before transmission. Access to generated reports should be restricted according to the applicable security policy, and reporting requests should be logged for auditing. The current prototype demonstrates the integration of LLM-assisted reporting. However, the factual accuracy, consistency, security, and operational usefulness of generated reports require separate evaluation before the component can be considered reliable for production forensic investigations.
To reduce the security risks associated with external language-model processing, the reporting workflow should implement data minimization, removal or masking of sensitive identifiers, controlled access to reporting functions, and audit logging. Untrusted network content should be treated as data rather than executable instructions, and generated recommendations should not be permitted to invoke BLOCK or QUARANTINE actions directly. Any suggested response must pass through the existing policy and human-authorization controls. These safeguards are design requirements and should not be described as implemented security controls unless confirmed by the prototype configuration and source code.
4. PROTOTYPE IMPLEMENTATION AND EXPERIMENTAL SETUP
The A3-ENDS prototype consisted of a distributed system using Python/FastAPI as the back-end server, running on an Ubuntu Server Operating System, a PyQt6 graphical dashboard on an Ubuntu Desktop OS, an SQLite database that provided audit logging via SQLAlchemy, and an OpenRouter-integrated LLM for automated forensic reporting. Network traffic was captured in real time with Scapy in a GNS3 simulated enterprise network with an attacker, target, and defense host, all running on VirtualBox. The CICIDS2017 dataset was employed to evaluate the intrusion detection models. Following data cleaning and preprocessing, approximately 1.8 million valid network-flow records were retained, with approximately 1.4 million representative records used for classifier benchmarking. The initial experiment employed a stratified random 80/20 training–testing split to preserve the relative distribution of traffic categories. However, random partitioning may introduce information leakage when temporally related or highly correlated network flows occur in both partitions. Consequently, the reported classification results are interpreted within the limitations of this evaluation protocol. A complementary temporal or group-based evaluation is required to establish generalization to independent traffic. Under such an evaluation, preprocessing transformations must be fitted exclusively on the training partition, hyperparameters must be selected using separate validation data, and the test partition must remain isolated until final assessment. The reported classifier results were obtained using a random stratified training and testing split. Although this procedure preserves the relative representation of attack categories, it may allow temporally related or otherwise correlated network flows to appear in both subsets, potentially producing optimistic estimates of generalization performance. Consequently, the reported metrics should be interpreted as preliminary benchmark results rather than evidence of performance on independent future traffic. A more rigorous evaluation should preserve chronological separation or group related traffic by an appropriate capture or host identifier, fit preprocessing transformations exclusively on training data, and reserve an independent test set for final assessment. Such experiments are necessary to establish the extent to which the reported classification performance generalizes beyond the original random-split setting. A subset of representative flows, namely 1.4 million, was used for benchmarking candidate classifiers. A set of measures- accuracy, precision, recall, F1 score, ROC-AUC, training time, and peak memory usage was evaluated to assess not only predictive performance but also deployment efficiency. Furthermore, the Sparse Autoencoder model trained only with benign traffic was used to detect zero-day anomalies with an adaptable reconstruction error threshold of 2.5907 × 10⁻⁵ and a precision of 65.75%, a recall of 44.28%, and an F1-score of 52.92%. The performance was not as high as the supervised classifiers, but the autoencoder proved to be a valuable addition to the classification stage, correctly identifying attack patterns that didn't exist in the training set and sending these patterns for a second stage of risk assessment and classification.
4.1. Classifier Selection and Benchmarking.
Five tree-based classifiers, Decision Tree, Random Forest, XGBoost, LightGBM, and CatBoost, were trained and evaluated with the sampled 1.4-million-flow dataset, both in terms of detection capability and system efficiency. Comparison is summarised in Table 2.
| Model | Accuracy | Precision (Macro) | Recall (Macro) | F1-Score (Macro) | ROC-AUC | Training Time (s) | Peak Memory (MB) |
|---|---|---|---|---|---|---|---|
| Decision Tree | 99.82% | 86.38% | 87.09% | 86.06% | 0.935 | 83.19 | 1009.74 |
| Random Forest | 99.83% | 85.70% | 83.28% | 84.34% | 0.990 | 123.94 | 1098.66 |
| XGBoost | 99.86% | 83.00% | 84.45% | 82.77% | 0.975 | 116.10 | 233.18 |
| LightGBM | 75.38% | 13.76% | 12.94% | 12.64% | 0.544 | 67.30 | 690.47 |
| CatBoost | 99.80% | 83.15% | 81.88% | 81.67% | 0.996 | 392.63 | 0.08 |
The comparative evaluation indicates that XGBoost achieved the highest overall classification accuracy of 99.86%, with macro-precision of 83.00%, macro-recall of 84.45%, macro-F1 of 82.77%, and ROC-AUC of 0.9752. However, the Decision Tree classifier recorded a higher macro-F1 score of 86.06%, despite achieving a slightly lower accuracy of 99.82%. This discrepancy highlights the importance of distinguishing overall classification correctness from performance across individual attack categories. Accuracy is influenced by the relative frequency of observations in each class, whereas macro-F1 assigns equal importance to the F1 score of each class. Consequently, strong overall accuracy can coexist with weaker detection performance for less frequent attack categories. Although XGBoost achieved the highest accuracy and comparatively low reported memory consumption, its lower macro-F1 indicates that its selection should be evaluated against the operational importance of minority-class detection and the computational requirements of the proposed framework.
To provide a more comprehensive assessment of multiclass intrusion detection performance, the evaluation should report precision, recall, F1-score, and support for each attack category. This analysis is particularly important because aggregate accuracy can conceal classification weaknesses affecting less frequent attacks. Per-class recall indicates the proportion of actual attacks within each category that are correctly identified, while per-class precision reflects the reliability of predictions assigned to that category. The resulting classification report should be interpreted alongside the confusion matrix to identify attack classes associated with missed detections or incorrect classifications. The per-class results must be calculated from the original test labels and model predictions rather than inferred from aggregate performance metrics.
4.2. Performance Visualization
The confusion matrices in Figures 3 through 7 compare the classification behavior of each of the five candidate models across the evaluated attack classes. Most Decision Tree predictions fall along the main diagonal, indicating accurate discrimination between normal traffic and individual attack categories, with a relatively small number of off-diagonal misclassifications. Because the model consists of a single tree, however, it remains more susceptible to overfitting than an ensemble approach shown in Figure 3.
Random Forest produced fewer classification errors than the single Decision Tree by combining the predictions of multiple trees, concentrating correctly classified samples along the diagonal and reducing overfitting, at the cost of increased training time and memory consumption, as represented in Figure 4. Figure 5, XGBoost achieved the highest reported overall accuracy among the evaluated models, correctly assigning nearly all samples to their respective classes and confirming its ability to learn complex decision boundaries. Although its macro precision and F1-score were marginally lower than the Decision Tree's, its higher overall accuracy and the balance it strikes with computational efficiency make it the most suitable classifier for the A3-ENDS pipeline.
LightGBM produced noticeably more classification errors than the other four models, visible in the increased number of off-diagonal values, consistent with its considerably lower precision, recall, F1-score, and ROC-AUC. This confirms that LightGBM generalized poorly on the selected dataset and feature representation and was not suitable for integration into the proposed framework, as shown in Figure 6.
Figure 3.Confusion matrix of the Decision Tree classifier.
Figure 4.Confusion matrix of the Random Forest classifier.
Figure 5.Confusion matrix of the XGBoost classifier.
Figure 6.Confusion matrix of the LightGBM classifier.
Figure 7.Confusion matrix of the CatBoost classifier.
CatBoost correctly classified, in Figure 7, the majority of network traffic samples and achieved the highest ROC-AUC of all five models, indicating excellent class discrimination. Its considerably longer training time, however, makes it less practical for a system that depends on frequent model retraining. Figure 8 presents the precision–recall curves of the five evaluated classifiers, illustrating the trade-off between precision and recall across different classification thresholds. This comparison is particularly important for assessing intrusion detection performance under imbalanced traffic distributions.
Figure 8.Precision-Recall curve comparison across the five evaluated classifiers.
The Precision-Recall comparison shows that XGBoost, Random Forest, Decision Tree, and CatBoost all maintained consistently high precision across varying recall levels, with curves remaining close to the upper-right corner, while LightGBM showed comparatively weaker performance throughout. Figure 9 presents the Receiver Operating Characteristic (ROC) curves of the five evaluated classifiers, illustrating their discrimination capabilities through the relationship between the true-positive rate and false-positive rate across different decision thresholds. CatBoost achieved the highest ROC-AUC of the five models, followed closely by Random Forest and XGBoost, while LightGBM recorded the lowest overall discrimination capability.
Figure 9.ROC-AUC curve comparison across the five evaluated classifiers.
Figure 10 compares the computational requirements of the five evaluated classifiers in terms of training time and reported peak memory consumption. These measures provide insight into the resource requirements and practical considerations associated with integrating the classifiers into the proposed A3-ENDS framework.
Figure 10.Training time and peak memory comparison across the five evaluated classifiers.
Figure 10 presents the computational performance of the five evaluated classifiers in terms of training time and reported peak memory consumption. CatBoost recorded the lowest measured memory consumption of 0.08 MB despite having the longest training time of 392.63 seconds. XGBoost achieved the highest classification accuracy of 99.86%, while CatBoost achieved the highest ROC-AUC of 0.9956. These findings demonstrate the trade-offs between predictive performance, training time, and memory efficiency among the evaluated classifiers.
Figure 11 presents a comparative visualization of the five classifiers based on accuracy, macro-precision, macro-recall, macro-F1, and ROC-AUC. The comparison highlights differences in predictive performance and supports a multidimensional assessment of the suitability of each classifier for network intrusion detection.
Figure 11.Comparative visualization of accuracy, precision, recall, F1-score, and ROC-AUC across the five evaluated classifiers.
Viewed together, these comparative visualizations confirm that while most of the evaluated models achieved strong overall performance, XGBoost provided the most balanced combination of detection accuracy, computational efficiency, and robustness, supporting its selection as the attack-classification model integrated into the A3-ENDS framework.
4.3. Explainability Analysis and SHAP Interpretation
The explainability component of A3-ENDS employs SHapley Additive exPlanations (SHAP) to provide feature-level interpretations of the predictions generated by the XGBoost classifier. The purpose of this component is to support the examination of model decisions and provide security analysts with information about the network-flow characteristics influencing individual classifications. The XGBoost classifier uses six flow-level features: flow duration, packet count, mean inter-arrival time, total bytes, standard deviation of packet size, and mean packet size. SHAP assigns an attribution value to each feature, indicating its contribution to a particular model output relative to a reference prediction. Positive and negative attribution values represent the direction of a feature's contribution within the selected explanation scale and target class.
Figure 12 presents a representative SHAP waterfall plot illustrating how individual network-flow features contribute to a classification outcome. The visualization provides a means of examining the factors associated with a model prediction. However, feature attribution should not be interpreted as evidence that a particular feature caused the underlying network attack.
Although the prototype demonstrates the generation and presentation of SHAP explanations, the existing results do not establish the stability of these explanations under small changes in input features. Furthermore, the availability of explanations does not independently demonstrate improvements in analyst accuracy, decision time, or trust. A more comprehensive evaluation should therefore examine explanation consistency across comparable network flows and measure the stability of feature rankings under controlled input perturbations. The practical usefulness of the explanations should also be assessed through a structured analyst evaluation comparing alert review with and without SHAP information. Accordingly, the current findings support the technical integration of SHAP into the detection pipeline, while its reliability and operational benefits require further quantitative validation.
.
Figure 12.SHAP local waterfall plot for a classified network attack.
Figure 12 illustrates a representative local SHAP explanation for a network-flow classification. The waterfall plot shows how the selected flow features contribute to the model output relative to its reference value. Features with positive contributions increase the selected output, whereas negative contributions decrease it. The interpretation depends on the target class and output scale used by the SHAP explainer. Although the visualization supports inspection of the classifier's decision, it does not independently establish explanation stability, causal relationships, or improved analyst performance.
4.3.1. SHAP Explanation Stability and Consistency
The reliability of feature-level explanations is an important consideration in security-sensitive applications because inconsistent explanations may reduce confidence in model-assisted decisions. For A3-ENDS, explanation stability refers to the extent to which SHAP feature attributions remain consistent when a network-flow observation undergoes small, feasible modifications that do not materially alter its security characteristics. A controlled stability evaluation should be conducted using representative samples from the independent test set. For each selected observation, SHAP values should be calculated for the original input and for a set of minimally perturbed observations. Perturbations must respect the valid ranges and dependencies of the underlying network-flow features.
Explanation consistency may be evaluated by comparing the rankings of influential features before and after perturbation. Rank correlation and top-feature overlap provide complementary measures of whether the explanation remains consistent under minor input changes. The evaluation should distinguish between observations for which the classifier prediction remains unchanged and those for which the prediction changes. Attribution differences associated with a change in predicted attack category should not automatically be interpreted as explanation instability.
The analysis should report the average explanation-stability score, its variability across evaluated observations, and differences between attack categories. Such measurements would provide stronger evidence regarding the reliability of the explanations presented to security analysts. Consequently, explanation consistency remains an outstanding validation requirement rather than an experimentally established property of the framework.
Table 3 summarizes the reported SHAP explanation stability measures, including Spearman rank correlation, top-three feature overlap, mean attribution difference, and explanation-generation time. These measures provide a basis for assessing the consistency of feature-level explanations and the computational overhead associated with their generation.
| Evaluation metric | Purpose | Result |
|---|---|---|
| Spearman rank correlation | Consistency of feature rankings | 0.9657 ± 0.0280 |
| Top 3 feature overlap | Agreement among the most influential features | 100.00% ± 0.00% |
| Mean attribution difference | Magnitude of changes in SHAP values | 75.8251 ± 34.3008 |
| Explanation generation time | Computational overhead | 0.2806 ± 0.0324 ms |
| Stability by attack class | Differences across attack categories | Evaluated across 8 classes |
4.3.2. Practical Usefulness of SHAP Explanations
Beyond explanation stability, the practical usefulness of SHAP should be evaluated in relation to the security analyst's decision-making process. A feature-attribution visualization may provide additional information about a classifier's prediction, but its operational value depends on whether the information helps analysts interpret alerts accurately and efficiently. A controlled evaluation should compare two alert-review conditions: one presenting the predicted attack category and confidence score without feature explanations, and another presenting the same information with SHAP explanations. Both conditions should use comparable security incidents and consistent decision requirements.
The evaluation should measure analyst decision accuracy, alert-review time, agreement between analysts, and the proportion of inappropriate response recommendations. Participant experience and familiarity with machine-learning explanations should also be considered when interpreting the findings. The existing prototype demonstrates the presentation of SHAP explanations within the analyst interface. However, no controlled analyst study is reported. Therefore, claims that SHAP reduces analyst workload, improves decision accuracy, or increases trust should be treated as potential benefits rather than experimentally confirmed outcomes.
4.4. Real-Time Detection Latency and Computational Performance
Real-time processing is an important operational requirement for network intrusion detection systems because delays between traffic observation and alert generation may affect the timeliness of security responses. The A3-ENDS prototype integrates traffic capture, flow aggregation, anomaly detection, supervised classification, explanation generation, and alert processing within a coordinated workflow. The prototype was developed using Python-based components, including Scapy for packet acquisition, FastAPI for backend communication, and PyQt6 for the monitoring interface. Network simulation was performed using GNS3 and VirtualBox within an Ubuntu-based environment.
Although the initial prototype description indicated packet-to-alert processing below 100 milliseconds, the available experimental results do not provide a reproducible measurement protocol, hardware specification, workload description, or latency distribution sufficient to substantiate this claim. Furthermore, the system uses flow aggregation, which introduces an observation window before a flow becomes available for classification. Therefore, packet-to-alert latency must be distinguished from model inference time and from alert-generation time measured after flow aggregation.
A comprehensive evaluation should measure the time consumed by traffic acquisition, flow aggregation, feature extraction, anomaly detection, attack classification, SHAP explanation generation, risk assessment, and alert delivery. Response execution latency should be reported separately. Measurements should be conducted under different traffic loads and repeated across multiple experimental runs. The resulting latency distributions should include median, 95th-percentile, and 99th-percentile processing times, together with throughput and resource utilization. Until these measurements are available, the prototype should be described as supporting an intended real-time monitoring workflow rather than as having experimentally demonstrated a guaranteed sub-100-millisecond end-to-end response time.
4.4.1. Latency Measurement Protocol
To assess the operational performance of A3-ENDS, processing timestamps should be recorded at the boundaries of each major pipeline component. The measurement procedure should distinguish three latency categories. Model inference latency represents the elapsed time required for the anomaly detector and supervised classifier to process a prepared feature vector. Alert-processing latency represents the elapsed time between the availability of a completed flow record and the delivery of its corresponding alert to the monitoring interface. Packet-to-alert latency represents the elapsed time between the first relevant packet observation and the delivery of the associated security alert. This measurement includes flow aggregation and subsequent processing. For each category, latency should be measured over repeated observations under low, moderate, and high traffic loads. The experiment should record the number of processed flows, traffic-generation rate, system configuration, and resource utilization.
All measurements should use a monotonic high-resolution clock to avoid errors associated with changes in system time. The analysis should report the median, 95th percentile, and 99th percentile rather than relying exclusively on the average processing time. The evaluation should also distinguish between alerts requiring SHAP explanation generation and those processed without explanations, because explanation computation may introduce additional overhead. The influence of analyst authorization and response execution should be measured separately from automated alert delivery. These measurements are required to determine whether the framework satisfies its intended real-time operational requirements.
4.5. Simulated Network Validation and Previously Unseen Attack Detection
The A3-ENDS prototype was evaluated within a GNS3-simulated enterprise network to examine the integration of traffic capture, anomaly detection, attack classification, and security alert generation. The reported simulation included denial-of-service traffic, reconnaissance activities, and suspicious network behavior. The Sparse Autoencoder was designed to identify traffic patterns that deviate from the benign observations represented during training. This capability provides a basis for detecting anomalous behavior that may not correspond directly to the attack categories learned by the supervised classifier. However, anomaly detection should not be interpreted as conclusive identification of previously unknown attack types.
The prototype evaluation also described an anomalous observation associated with a Heartbleed attack scenario. Although this observation is relevant to the proposed anomaly-detection mechanism, the available experimental evidence does not establish a reproducible zero-day detection rate. In particular, the manuscript does not provide sufficient details concerning the number of Heartbleed samples evaluated, their separation from training data, the resulting detection outcomes, or the associated false-positive rate. A rigorous assessment of previously unseen attack detection requires an attack-family holdout protocol in which the selected attack category is excluded from model training and hyperparameter selection. The withheld attack traffic should then be evaluated independently, with detection recall, false-positive rate, and relevant anomaly-score distributions reported. Such an experiment would provide stronger evidence of generalization to attack categories not encountered during training. Accordingly, the current GNS3 observations are interpreted as preliminary prototype evidence rather than definitive validation of general zero-day attack detection.
4.5.1. Simulation Environment and Experimental Limitations
The GNS3 simulation environment was used to examine the interaction between network traffic generation, packet acquisition, flow processing, intrusion detection, and security monitoring. VirtualBox-supported hosts and an Ubuntu-based implementation environment provided the basis for prototype testing. For reproducibility, the final experimental report should document the host machine's processor, installed memory, operating-system version, virtualization configuration, number of simulated hosts, network topology, traffic-generation tools, and traffic rates.
The evaluation should distinguish between traffic replay, simulated attack generation, and naturally occurring network activity. These conditions may produce different processing characteristics and should not be treated as equivalent evidence of operational performance. The use of GNS3 provides a controlled environment for examining component integration and selected network scenarios. However, simulated traffic may not reproduce the scale, diversity, background activity, or resource constraints of a production enterprise network. Consequently, conclusions drawn from the simulation should be limited to the evaluated configuration. Additional testing with independent network traffic and more realistic deployment conditions is required to establish the generalizability of the framework's latency, detection, and response performance.
4.6. Evaluation of Q-Learning-Based Adaptive Response
The adaptive response component of A3-ENDS employs Q-learning to select among four response actions: MONITOR, NOTIFY, BLOCK, and QUARANTINE. The response policy was evaluated against a conventional rule-based strategy to examine its operational effectiveness, computational efficiency, and compliance with security authorization requirements. Table 4 presents the comparative performance of both response strategies.
| Metric | Rule-based response | Q-learning response |
|---|---|---|
| Successful containment rate (%) | 95.75 | 18.50 |
| Unnecessary intervention rate (%) | 0.75 | 4.94 |
| Mean response time (ms) | 0.0753 | 0.0031 |
| Mean cumulative reward | +0.5783 | +0.2963 |
| Unauthorized actions executed | 0 | 72 |
As presented in Table 4, the rule-based response strategy achieved a successful containment rate of 95.75%, compared with 18.50% for the Q-learning strategy. The rule-based approach also recorded a lower unnecessary intervention rate of 0.75%, compared with 4.94% for Q-learning. However, Q-learning achieved a shorter mean response time of 0.0031 ms, compared with 0.0753 ms for the rule-based approach, indicating lower reported response-selection time under the evaluated conditions.
The rule-based strategy achieved a higher mean cumulative reward of 0.5783, whereas Q-learning recorded 0.2963. Furthermore, 72 unauthorized actions were recorded for Q-learning, while none were recorded for the rule-based strategy. These findings expose limitations in the current learned response policy, particularly in containment effectiveness and compliance with authorization constraints. Although Q-learning provides a mechanism for adapting response decisions to changing network conditions, the experimental findings do not establish its superiority over the rule-based approach. Further refinement of the reward function, state representation, policy training, and enforcement of human authorization constraints is required before autonomous deployment can be considered.
4.7. Evaluation of ADWIN-Based Concept Drift Monitoring
The concept-drift monitoring component of A3-ENDS employs ADWIN to identify statistically significant changes in a monitored network-traffic observation stream. The purpose of this component is to support the identification of changing operating conditions that may require further investigation or model adaptation. The current prototype demonstrates the architectural integration of ADWIN. However, the reported experiments do not provide sufficient quantitative evidence to establish its drift-detection accuracy, detection delay, false-alarm frequency, or contribution to post-drift classification performance. A controlled evaluation should therefore introduce identifiable distribution changes into a chronologically ordered test stream. The experiment should distinguish between naturally occurring temporal changes and deliberately constructed drift scenarios. The location and nature of each controlled change must be documented to support reproducible measurement.
ADWIN should be evaluated using drift-detection delay, false-alarm rate, and the proportion of known drift events successfully detected. Where model adaptation is triggered, classification performance before and after adaptation should also be reported. To determine the benefit of ADWIN, the evaluation should compare a static model with an ADWIN-monitored model under the same data stream. If retraining is enabled, a separate comparison should be performed between fixed-schedule retraining and ADWIN-triggered retraining. All adaptation procedures must use only observations available at the relevant point in time to prevent future-information leakage. The existing results establish the integration of the drift-monitoring component but do not yet demonstrate that ADWIN improves detection performance under concept drift. Its effectiveness therefore remains an experimental question requiring controlled validation.
4.8. Comparison with Comparable Systems in the Literature
The comparative evaluation of A3-ENDS indicates that XGBoost achieved an overall classification accuracy of 99.86%, macro-F1 of 82.77%, and ROC-AUC of 0.9752 under the reported random stratified evaluation protocol. These findings provide evidence of strong aggregate classification performance but do not establish superiority over other intrusion detection frameworks evaluated using different datasets or experimental conditions. The proposed framework also integrates explainability, drift monitoring, and adaptive response components; however, the independent operational benefits of these components require controlled evaluation. Accordingly, comparisons with existing studies are interpreted in terms of architectural characteristics and reported experimental conditions rather than direct claims of superior end-to-end performance.
4.9. Adversarial Robustness Evaluation
Adversarial robustness is an important requirement for intelligent network intrusion detection systems because attackers may deliberately manipulate observable network traffic characteristics to evade detection. The adversarial evaluation of A3-ENDS examined the sensitivity of the detection model to different levels of input perturbation. Classification accuracy, macro-F1, attack recall, and attack success rate were used as evaluation metrics. Table 5 presents the reported model performance under clean and adversarial traffic conditions.
| Evaluation condition | Accuracy (%) | Macro-F1 (%) | Attack recall (%) | Attack success rate (%) |
|---|---|---|---|---|
| Clean test traffic | 99.1328 | 67.9465 | 97.5471 | 2.4529 |
| Low-budget perturbation | 97.3390 | 49.2656 | 90.4501 | 9.5499 |
| Medium-budget perturbation | 92.3113 | 29.4283 | 73.1503 | 26.8497 |
| High-budget perturbation | 90.0239 | 24.7798 | 67.7209 | 32.2791 |
Under clean traffic conditions, the evaluated model achieved an accuracy of 99.13%, a macro-F1 score of 67.95%, and an attack recall of 97.55%. When low-budget perturbations were introduced, accuracy decreased to 97.34%, while macro-F1 and attack recall declined to 49.27% and 90.45%, respectively. Under medium-budget perturbations, classification accuracy declined to 92.31%, with macro-F1 decreasing to 29.43% and attack recall to 73.15%. The most substantial deterioration was observed under high-budget perturbations, where accuracy decreased to 90.02%, macro-F1 declined to 24.78%, and attack recall dropped to 67.72%. Correspondingly, the attack success rate increased from 2.45% under clean traffic conditions to 32.28% under high-budget perturbations.
These findings demonstrate that increasing perturbation intensity negatively affects the detection performance of the evaluated model. Although the classifier retained relatively high overall accuracy, the substantial decline in macro-F1 indicates weaker performance when individual traffic categories are weighted equally. The results highlight the vulnerability of the current detection model to adversarial manipulation and establish the need for stronger defensive mechanisms, including adversarial training, robust feature representations, and additional security-aware validation.
4.10. Ablation Study of A3-ENDS Components
An ablation study is necessary to determine the contribution of the individual components of A3-ENDS to detection performance and operational functionality. Although the proposed framework integrates anomaly detection, supervised classification, explainability, concept-drift monitoring, and adaptive response, the existing experiments do not isolate the effects of these components. The proposed ablation evaluation will compare the complete framework with configurations in which selected components are disabled or replaced by simpler alternatives. The detection-stage analysis will compare standalone XGBoost classification with the combined Sparse Autoencoder–XGBoost pipeline. This comparison will establish whether anomaly gating improves detection performance or introduces additional missed detections by excluding suspicious flows from the supervised classifier.
The explainability analysis will compare configurations with and without SHAP processing to determine its computational overhead and effect on alert-generation latency. Since SHAP is a post-hoc explanation method, its removal is not expected to change the predictions of an otherwise unchanged XGBoost model. The adaptation analysis will compare fixed detection or response configurations against configurations incorporating ADWIN monitoring and Q-learning-based policy updates. Drift detection and response adaptation will be evaluated using metrics appropriate to their functions, including drift-detection delay, false alarms, response effectiveness, unnecessary interventions, and decision latency.
All ablation configurations should use consistent datasets, preprocessing procedures, experimental environments, and evaluation conditions. This will enable differences in performance to be attributed more reliably to the components under investigation. The existing results establish the performance of selected detection models but do not yet quantify the independent contribution of each framework component. Therefore, conclusions regarding the benefits of the complete integrated architecture remain provisional until the ablation experiments are performed.
Table 6 presents five proposed ablation configurations designed to examine the individual contributions of the Sparse Autoencoder, XGBoost, SHAP, ADWIN, and Q-learning components. The configurations progressively introduce additional framework components, providing a structured basis for evaluating their contributions to detection, explainability, drift monitoring, and adaptive response.
| Configuration | SAE | XGBoost | SHAP | ADWIN | Q-learning |
|---|---|---|---|---|---|
| A1: Classification baseline | No | Yes | No | No | No |
| A2: Two-stage detection | Yes | Yes | No | No | No |
| A3: Explainable detection | Yes | Yes | Yes | No | No |
| A4: Drift-aware monitoring | Yes | Yes | Yes | Yes | No |
| A5: Complete A3-ENDS | Yes | Yes | Yes | Yes | Yes |
4.11. Evaluation of LLM-Assisted Forensic Reporting
The LLM-assisted forensic reporting component of A3-ENDS transforms structured intrusion detection records into human-readable security incident reports. The component was evaluated using factual correctness, report completeness, unsupported-statement rate, MITRE ATT&CK mapping accuracy, response-action consistency, report-generation latency, and sensitive-data exposure. These measures were selected to examine the reliability, efficiency, and security implications of automated forensic reporting. Table 7 summarizes the reported evaluation results.
| Evaluation metric | Measurement | Result |
|---|---|---|
| Factual correctness | Supported claims / assessed claims | 84.51% (60/71) |
| Report completeness | Required evidence fields included | 47.62% (7.14/15 average) |
| Unsupported-statement rate | Unsupported claims / assessed claims | 15.49% (11/71) |
| ATT&CK mapping accuracy | Correct mappings / assessed mappings | 66.67% (2/3) |
| Response-action consistency | Agreement with recorded actions | 100.00% (7/7) |
| Report-generation latency | Median and P95 processing time | 37.46 ms, 64.73 ms |
| Sensitive-data exposure | Privacy/security review | Low-to-Medium Risk |
The evaluation recorded a factual correctness rate of 84.51%, with 60 of the 71 assessed statements supported by the corresponding incident evidence. However, 11 statements could not be verified, resulting in an unsupported-statement rate of 15.49%. Report completeness was 47.62%, indicating that several essential forensic information fields were omitted from the generated reports.
The component achieved a MITRE ATT&CK mapping accuracy of 66.67%, correctly identifying two of the three assessed technique mappings. Response-action consistency reached 100%, with all seven assessed response actions corresponding to the recorded system decisions. The reported median and 95th-percentile processing times were 37.46 ms and 64.73 ms, respectively. The sensitive-data exposure assessment indicated a low-to-medium risk level.
The findings indicate that LLM-assisted reporting has potential to support the documentation and interpretation of detected security incidents. Nevertheless, incomplete evidence coverage, unsupported statements, and incorrect ATT&CK mappings limit its reliability as an independent forensic reporting mechanism. Human verification, structured report templates, evidence-grounded generation, and stronger privacy safeguards are therefore necessary before the generated reports can be relied upon for operational forensic investigations.
5. DISCUSSION
The experimental evaluation of A3-ENDS demonstrates the potential of combining machine-learning-based intrusion detection with explainability and adaptive security management. Previous studies have investigated hybrid anomaly detection, ensemble classification, and explainable intrusion detection, highlighting the relevance of integrating complementary techniques in cybersecurity applications [1][13][18]. The present study extends this architectural approach by coordinating anomaly detection, supervised classification, explanation generation, drift monitoring, and response-policy processing within a unified framework.
Among the five evaluated classifiers, XGBoost achieved the highest overall accuracy of 99.86%, with macro-precision of 83.00%, macro-recall of 84.45%, macro-F1 of 82.77%, and ROC-AUC of 0.9752. However, Decision Tree achieved a higher macro-F1 score of 86.06%, while CatBoost recorded the highest ROC-AUC of 0.9956. These findings demonstrate that classifier selection should consider multiple performance measures rather than overall accuracy alone. This interpretation is consistent with the broader literature emphasizing the importance of evaluating machine-learning-based intrusion detection systems across different performance criteria [2][14][22].
The difference between accuracy and macro-F1 is particularly important when attack categories are unevenly represented. High aggregate accuracy may conceal weaker classification performance for less frequent attacks. Consequently, the reported XGBoost accuracy should not be interpreted as evidence of superior performance across every attack category. More detailed class-level evaluation is necessary to establish the model's reliability for minority attack classes.
The Sparse Autoencoder achieved precision of 65.75%, recall of 44.28%, and F1-score of 52.92%. Although autoencoder-based techniques have been investigated for identifying anomalous network behavior [3][15], the present results reveal limitations in the anomaly-detection stage. In particular, malicious flows that are not identified as anomalous may fail to reach the subsequent supervised classifier. Therefore, the performance of the complete two-stage detection pipeline should be evaluated independently of the standalone XGBoost results.
The incorporation of SHAP provides feature-level explanations intended to support the interpretation of classification decisions. Explainable artificial intelligence has been identified as an important consideration in the development of interpretable machine-learning systems [6][23], while previous intrusion detection studies have explored explainability techniques for improving the transparency of security models [13][18][24]. Nevertheless, the generation of SHAP explanations does not independently establish explanation stability or improved analyst decision-making. Further experiments are required to evaluate attribution consistency, computational overhead, and practical usefulness.
The ADWIN and Q-learning components are intended to support the identification of changing traffic conditions and the adaptation of security responses. Previous research has demonstrated the relevance of streaming machine learning, concept-drift analysis, and reinforcement learning in dynamic security environments [16][19]. However, the present study does not provide controlled experimental evidence that the integrated adaptive components outperform static monitoring or rule-based response strategies. Their effectiveness must therefore be established through comparative evaluation.
Human-in-the-loop governance provides a mechanism for maintaining analyst oversight of potentially disruptive security actions. This design is consistent with research emphasizing human participation in machine-learning workflows [20]. Similarly, the integration of LLM-assisted forensic reporting reflects growing interest in applying language models to explainable intrusion detection [21]. However, the reliability of generated reports, the accuracy of incident interpretations, and the protection of sensitive network information require independent validation. Overall, the findings support the feasibility of integrating detection, explanation, monitoring, and response functions within a common architecture. Nevertheless, the current experimental evidence primarily establishes classifier performance and prototype integration. Further investigation is required to determine the framework's adversarial robustness, generalization to previously unseen attacks, adaptive-response effectiveness, and operational performance under realistic network conditions
5.1. Limitation of the Study
Despite the promising classification results, several limitations must be considered when interpreting the findings. First, the experimental evaluation relied on a stratified random training–testing split of CICIDS2017. Although this approach preserves class proportions, it may not adequately prevent information leakage between related network flows. Previous research has emphasized the challenges associated with evaluating machine-learning systems under changing data distributions and evolving security conditions [4][11]. Consequently, temporal or group-based evaluation is necessary to provide stronger evidence of generalization to independent network traffic.
Second, the study employed a single benchmark dataset. Although CICIDS2017 provides a useful foundation for evaluating intrusion detection algorithms, reliance on one dataset limits the extent to which the findings can be generalized to other network environments. The broader intrusion detection literature demonstrates that model performance depends on experimental conditions, feature representations, and the characteristics of evaluated traffic [1][2][14]. Additional datasets and independent network environments are therefore required.
Third, the Sparse Autoencoder demonstrated moderate anomaly-detection performance, with precision of 65.75%, recall of 44.28%, and F1-score of 52.92%. Although autoencoder-based methods have been investigated for network anomaly detection [3][15], the present results indicate that the anomaly gate may fail to identify some malicious observations. Because the architecture uses anomaly screening before supervised classification, this limitation may reduce the effectiveness of the complete detection pipeline.
Fourth, the study does not include controlled adversarial robustness experiments, systematic attack-family holdout testing, or comprehensive component ablation studies. Consequently, the current findings do not establish resistance to adversarial evasion, general zero-day detection effectiveness, or the independent contribution of each architectural component. These concerns are relevant to the broader challenge of maintaining reliable machine-learning performance in evolving cybersecurity environments [1][4][11].
Fifth, the ADWIN and Q-learning components have not been quantitatively evaluated against conventional drift-monitoring and rule-based response alternatives. Although streaming learning and reinforcement learning provide established approaches for adaptation and sequential decision-making [8][16], their integration does not automatically guarantee improved performance. Controlled experiments are required to assess drift-detection delay, false alarms, containment effectiveness, and unnecessary response actions.
Sixth, the GNS3-based simulation provides a controlled environment for prototype evaluation but does not reproduce every characteristic of operational enterprise networks. The current results also lack reproducible end-to-end latency distributions under varying traffic loads. Consequently, the framework's scalability and real-time operational effectiveness remain insufficiently established.
Finally, the SHAP explanation and LLM-assisted forensic reporting components require additional validation. Explainability research has highlighted the importance of interpreting model behavior carefully [6][9] while human-in-the-loop and language-model-assisted security approaches introduce further considerations concerning oversight and reliability [20][21]. Explanation stability, analyst usefulness, forensic accuracy, confidentiality, and computational overhead therefore remain important areas for future investigation.
6. CONCLUSION AND FUTURE WORK
This study presented A3-ENDS, an integrated network intrusion detection and response framework combining Sparse Autoencoder-based anomaly detection, XGBoost classification, SHAP explainability, ADWIN-based concept drift monitoring, Q-learning-based response adaptation, human-in-the-loop governance, and LLM-assisted forensic reporting. The framework builds on established developments in explainable intrusion detection, streaming machine learning, and adaptive cybersecurity response.
Experimental evaluation using CICIDS2017 revealed that XGBoost achieved the highest classification accuracy of 99.86%, with macro-precision of 83.00%, macro-recall of 84.45%, macro-F1 of 82.77%, and ROC-AUC of 0.9752. Decision Tree achieved the highest macro-F1 of 86.06%, while CatBoost recorded the highest ROC-AUC of 0.9956. The Sparse Autoencoder achieved precision, recall, and F1-score of 65.75%, 44.28%, and 52.92%, respectively. Adversarial evaluation revealed a decline in macro-F1 from 67.95% to 24.78% under high-budget perturbations, indicating the need for stronger adversarial defenses. Similarly, the Q-learning response strategy achieved a containment rate of 18.50%, compared with 95.75% for the rule-based approach, highlighting limitations in the learned response policy. The LLM-assisted forensic reporting component achieved 84.51% factual correctness, 47.62% report completeness, and 100% response-action consistency, demonstrating its potential while emphasizing the importance of human verification.
Overall, A3-ENDS demonstrates the feasibility of integrating intelligent detection, explainability, adaptive monitoring, and governed security response within a unified architecture. However, the preliminary findings reveal limitations in adversarial resilience, anomaly detection, response-policy effectiveness, and forensic reporting reliability. Future research will focus on adversarial training, leakage-resistant evaluation, independent attack-family testing, reward-function optimization, stricter response authorization, quantitative concept drift evaluation, component ablation, and evidence-grounded forensic reporting. Further investigation of end-to-end latency and scalability under realistic network conditions is also necessary. These research directions align with ongoing developments in trustworthy and adaptive machine-learning-based cybersecurity systems.
Data Availability
The data supporting the findings of this study are available from the corresponding author upon reasonable request.
Conflict of Interest
The authors declare that they have no conflict of interest.
Copyright & License
© Oluwaseun Adeniyi Ojerinde, Triumph Unim-Ashipu Aleken, Ramatu Abubakar, Ramatu Abubakar, Joseph Adebayo Ojeniyi.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

References
[1] G. Apruzzese et al., “The Role of Machine Learning in Cybersecurity,” Digit. Threat. Res. Pract., vol. 4, no. 1, pp. 1–38, Mar. 2023, doi: 10.1145/3545574.
[2] I. Hidayat, M. Z. Ali, and A. Arshad, “Machine Learning-Based Intrusion Detection System: An Experimental Comparison,” J. Comput. Cogn. Eng., vol. 2, no. 2, pp. 88–97, Jul. 2022, doi: 10.47852/bonviewJCCE2202270.
[3] G. Andresini, A. Appice, and D. Malerba, “Autoencoder-based deep metric learning for network intrusion detection,” Inf. Sci. (Ny)., vol. 569, pp. 706–727, Aug. 2021, doi: 10.1016/j.ins.2021.05.016.
[4] F. Barbero, F. Pendlebury, F. Pierazzi, and L. Cavallaro, “Transcending TRANSCEND: Revisiting Malware Classification in the Presence of Concept Drift,” in 2022 IEEE Symposium on Security and Privacy (SP), IEEE, May 2022, pp. 805–823. doi: 10.1109/SP46214.2022.9833659.
[5] E. Namjoo, A. N. O’Connor, J. Buckley, and C. Ryan, “GlassBoost: A Lightweight and Explainable Classification Framework for Tabular Datasets,” Appl. Sci., vol. 15, no. 12, p. 6931, Jun. 2025, doi: 10.3390/app15126931.
[6] P. Linardatos, V. Papastefanopoulos, and S. Kotsiantis, “Explainable AI: A Review of Machine Learning Interpretability Methods,” Entropy, vol. 23, no. 1, p. 18, Dec. 2020, doi: 10.3390/e23010018.
[7] H. Zhang, X. Li, Y. Bai, and M. Liu, “Understanding and Optimizing Database Pushdown on Disaggregated Storage,” in Proceedings of the 31st ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2, New York, NY, USA: ACM, Mar. 2026, pp. 2141–2158. doi: 10.1145/3779212.3790243.
[8] S. Ren, J. Jin, G. Niu, and Y. Liu, “ARCS: Adaptive Reinforcement Learning Framework for Automated Cybersecurity Incident Response Strategy Optimization,” Appl. Sci., vol. 15, no. 2, p. 951, Jan. 2025, doi: 10.3390/app15020951.
[9] I. Stepin, J. M. Alonso, A. Catala, and M. Pereira-Farina, “A Survey of Contrastive and Counterfactual Explanation Generation Methods for Explainable Artificial Intelligence,” IEEE Access, vol. 9, pp. 11974–12001, 2021, doi: 10.1109/ACCESS.2021.3051315.
[10] N. Khan, K. Ahmad, A. Al Tamimi, M. M. Alani, A. Bermak, and I. Khalil, “Explainable AI-Based Intrusion Detection Systems for Industry 5.0 and Adversarial XAI: A Systematic Review,” Information, vol. 16, no. 12, p. 1036, Nov. 2025, doi: 10.3390/info16121036.
[11] A. Kuppa and N.-A. Le-Khac, “Learn to adapt: Robust drift detection in security domain,” Comput. Electr. Eng., vol. 102, p. 108239, Sep. 2022, doi: 10.1016/j.compeleceng.2022.108239.
[12] Y.-H. Su, M. C. Y. Cho, and H.-C. Huang, “False Alert Buster,” in Proceedings of the 2nd International Conference on Computing and Big Data, New York, NY, USA: ACM, Oct. 2019, pp. 58–62. doi: 10.1145/3366650.3366657.
[13] U. Ahmed et al., “Hybrid bagging and boosting with SHAP based feature selection for enhanced predictive modeling in intrusion detection systems,” Sci. Rep., vol. 14, no. 1, p. 30532, Dec. 2024, doi: 10.1038/s41598-024-81151-1.
[14] M. K. Hooshmand, M. D. Huchaiah, A. R. Alzighaibi, H. Hashim, E.-S. Atlam, and I. Gad, “Robust network anomaly detection using ensemble learning approach and explainable artificial intelligence (XAI),” Alexandria Eng. J., vol. 94, pp. 120–130, May 2024, doi: 10.1016/j.aej.2024.03.041.
[15] A. Yehezkel, E. Elyashiv, and O. Soffer, “Network Anomaly Detection Using Transfer Learning Based on Auto-Encoders Loss Normalization,” in Proceedings of the 14th ACM Workshop on Artificial Intelligence and Security, New York, NY, USA: ACM, Nov. 2021, pp. 61–71. doi: 10.1145/3474369.3486869.
[16] T. T. Nguyen and V. J. Reddi, “Deep Reinforcement Learning for Cyber Security,” IEEE Trans. Neural Networks Learn. Syst., vol. 34, no. 8, pp. 3779–3795, Aug. 2023, doi: 10.1109/TNNLS.2021.3121870.
[17] M. A. Shyaa, N. F. Ibrahim, Z. Zainol, R. Abdullah, M. Anbar, and L. Alzubaidi, “Evolving cybersecurity frontiers: A comprehensive survey on concept drift and feature dynamics aware machine and deep learning in intrusion detection systems,” Eng. Appl. Artif. Intell., vol. 137, p. 109143, Nov. 2024, doi: 10.1016/j.engappai.2024.109143.
[18] M. M. Mahmoud, Y. O. Youssef, and A. A. Abdel-Hamid, “XI2S-IDS: An Explainable Intelligent 2-Stage Intrusion Detection System,” Futur. Internet, vol. 17, no. 1, p. 25, Jan. 2025, doi: 10.3390/fi17010025.
[19] F. Shi et al., “LightRL-AD: A Lightweight Online Reinforcement Learning Approach for Autonomous Defense against Network Attacks,” in 2024 IEEE 23rd International Conference on Trust, Security and Privacy in Computing and Communications (TrustCom), IEEE, Dec. 2024, pp. 1614–1621. doi: 10.1109/TrustCom63139.2024.00222.
[20] E. Mosqueira-Rey, E. Hernández-Pereira, D. Alonso-Ríos, J. Bobes-Bascarán, and Á. Fernández-Leal, “Human-in-the-loop machine learning: a state of the art,” Artif. Intell. Rev., vol. 56, no. 4, pp. 3005–3054, Apr. 2023, doi: 10.1007/s10462-022-10246-w.
[21] P. R. B. Houssel, P. Singh, S. Layeghy, and M. Portmann, “Towards Explainable Network Intrusion Detection using Large Language Models,” in 2024 IEEE/ACM International Conference on Big Data Computing, Applications and Technologies (BDCAT), IEEE, Dec. 2024, pp. 67–72. doi: 10.1109/BDCAT63179.2024.00021.
[22] P. Hermosilla, S. Berríos, and H. Allende-Cid, “Explainable AI for Forensic Analysis: A Comparative Study of SHAP and LIME in Intrusion Detection Models,” Appl. Sci., vol. 15, no. 13, p. 7329, Jun. 2025, doi: 10.3390/app15137329.
[23] Y. Gao, L. Yang, R. Zhu, Y. Wu, F. Yang, and Y. Cao, “IR-IDS: A network intrusion detection method based on causal feature selection and explainable model optimization,” Comput. Secur., vol. 155, p. 104496, Aug. 2025, doi: 10.1016/j.cose.2025.104496.
[24] A. Alabdulatif, “A Novel Ensemble of Deep Learning Approach for Cybersecurity Intrusion Detection with Explainable Artificial Intelligence,” Appl. Sci., vol. 15, no. 14, p. 7984, Jul. 2025, doi: 10.3390/app15147984.