Conceptio › Archive › arXiv CS
arXiv CS open access

Multi-Level Distributional Entropy for Explainable Network Intrusion Detection

2026 · arxiv_cs
arXiv CS · Papers · 2026
Open Source ↗Direct PDF ↓
cryptographycybersecurityprivacysecurity
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

Research Article

Bouke et al., 2026.

Multi-Level Distributional Entropy for Explainable Network Intrusion Detection Mohamed Aly Bouke

#1,*,

Md Shohel Sayeed

#1,

Swee-Huay Heng 2,3 Othman #

# 1,

Azizol Abdullah

# 2,

Mohamed

1 Centre for Intelligent Cloud Computing, CoE for Advanced Cloud,

Faculty of Information Science and Technology, Multimedia University, Jalan Ayer Keroh Lama, Bukit Beruang, 75450, Melaka, Malaysia 2 Department of Communication Technology and Networking, Faculty of Computer Science and Information Technology, Universiti Putra Malaysia, Serdang 43400, Malaysia 3 Laboratory of Computational Science and Mathematical Physics, Institute for Mathematical Research, Universiti Putra Malaysia, Serdang, Malaysia *alybouke@mmu.edu.my, bouke@ieee.org

arXiv:2606.29797v1 [cs.CR] 29 Jun 2026

Research Article, June 30, 2026

Abstract Machine learning network intrusion detection systems (IDS) rely on aggregate flow statistics that discard distributional structure, while established entropy measures require raw packet sequences unavailable in pre-aggregated flow datasets. We propose Multi-Level Distributional Entropy (MDE), an analytical framework that derives interpretable entropy features directly from flow-level summary statistics at three levels: within-flow Gaussian differential entropy, crossdirectional Jensen-Shannon divergence (JSD), and Transmission Control Protocol (TCP) flag-pattern Shannon entropy, without raw packet access or training data. Across four benchmarks (NSL-KDD, CICIDS-2017, CICIDS-2018, UNSW-NB15) under a leakage-free fold-local pipeline, entropy-only features achieve weighted F1 of 0.708–0.989, matching conventional features without degrading performance. Full operational metric reporting then exposes failure modes that aggregate F1 conceals. On CICIDS-2018, F1=0.74 hides a detection rate (DR) of 0.48, and on held-out attack families F1 exceeds 0.998 while DR falls to zero. Under temporal shift, a pseudo-live replay of 703K flows reveals a threshold-ranking divergence in which score ranking is preserved (AUC=0.87) but fixed thresholds collapse (DR=0.082) and recalibration offers no recovery. SHapley Additive exPlanations (SHAP) fold-stability analysis (Spearman ρ = 0.80–0.95) confirms that entropy attributions are reproducible and domain-coherent across heterogeneous environments. Keywords: Intrusion detection systems, Entropy-based feature engineering, Explainable AI, SHAP, Network traffic analysis.

(SampEn) [5] requires ordered sequences of raw packet measurements that are unavailable in pre-aggregated flow datasets, The proliferation of networked infrastructure across enterprise, the dominant format in the IDS benchmark literature [6], [7], [8]. cloud, and embedded environments has made automated intru- No prior work derives entropy analytically from the summary sion detection an operational necessity. Machine learning-based statistics that flow records already contain. IDS have matured substantially over the past decade, with en- Second, interpretability remains limited. High-performing ensemble classifiers, particularly gradient-boosted trees and ran- semble classifiers are opaque, and in operational security endom forests, consistently achieving strong detection accuracy vironments analysts must audit model decisions before acting on standard benchmarks [1], [2]. Despite this progress, three on them; in regulated contexts this opacity creates compliance gaps in current IDS practice constrain broader applicability. obstacles [9], [10]. SHAP provides a theoretically grounded

1

Introduction

First, standard IDS pipelines operate on flow-level feature vectors: packet counts, byte volumes, connection duration, and statistical summaries extracted by tools such as CICFlowMeter. These aggregate descriptors discard the distributional and sequential structure of traffic that is known to differ systematically between benign sessions and attacks [3]. Information-theoretic measures quantify precisely this kind of structural difference, yet their integration into supervised IDS pipelines has been limited by a practical barrier. Classical entropy computation such as approximate entropy (ApEn) [4] and sample entropy

attribution framework [11], [12], but its application to entropyenriched IDS pipelines has not been studied, leaving open whether entropy features receive domain-coherent SHAP explanations or produce consistent attributions across environments. Third, entropy-based detectors are typically evaluated on a single dataset, so the cross-dataset transferability of entropy signatures and the factors governing it remain unstudied. This paper addresses these gaps through the MDE framework. The statistics already present in flow records (means, standard

Page 1 of 20

Research Article

Bouke et al., 2026.

deviations, minima, maxima, and packet counts) implicitly characterize the underlying distributions of packet sizes and interarrival times; MDE computes entropy analytically from those statistics, eliminating the need for raw packet access while producing features grounded in information theory and directly interpretable via SHAP. MDE differs from three categories of related work. Conventional flow statistics (byte counts, packet rates, duration) capture aggregate magnitudes but not distributional structure, and are susceptible to the labeling artifacts documented by Engelen et al. [13]. Statistical feature engineering approaches (e.g. skewness, kurtosis, higher-order moments) are empirically motivated but lack a principled basis for feature selection; MDE features are grounded in information theory with analytic definitions and known ranges (Propositions 1 and 2). Representation learning methods (convolutional neural networks (CNNs), long shortterm memory networks (LSTMs), autoencoders) extract features through training and produce non-interpretable representations; MDE features require no training data, apply to any flow-level schema, and are natively interpretable via SHAP. The main contributions of this paper are as follows: 1. We propose MDE, a method that constructs 7–12 interpretable entropy features analytically from pre-aggregated network flow statistics at three complementary levels, within-flow Gaussian differential entropy (L1), crossdirectional JSD (L2), and flag-pattern Shannon entropy (L3), requiring no raw packet access or training data for feature construction. 2. We develop a leakage-free, fold-local protocol that reports the full operational metric suite (DR, false alarm rate (FAR), Matthews Correlation Coefficient (MCC), and precision-recall AUC (PR-AUC) alongside F1) and applies it across cross-validation, temporal-split, pseudo-live replay, cross-dataset transfer, and unseen-attack-family settings, designed to surface failure modes that aggregate scores conceal. 3. We analyze SHAP attributions for MDE-augmented classifiers across five cross-validation folds, quantifying the rank-stability and domain-coherence of analytical differential entropy (ADE) and JSD attributions across structurally distinct environments. The remainder is organized as follows. Section 2 reviews related work. Section 3 covers entropy and SHAP foundations. Section 4 presents the MDE framework. Section 5 describes the experimental setup. Section 6 reports the results. Sections 7 and 8 discuss and conclude.

2

Related Work

2.1

ML-Based IDS: Recent Advances

ML-based IDS has evolved from early shallow classifiers through gradient-boosted ensembles to transformer, graph neural network (GNN), and federated architectures [1], [14], [15]. Gradient-boosted trees and random forests remain consistently dominant on tabular flow data [14], while deep learning adds value in sequential and raw-packet settings. Transformer archi-

tectures have been applied to flow-level sequences [16], and a recent comprehensive survey covering attention-based and large language model approaches [17] identifies cross-dataset generalization as the principal unsolved challenge. GNN-based approaches model network topology explicitly and show promise for lateral-movement and Advanced Persistent Threat (APT) detection [18], though they require graph construction infrastructure absent in standard flow deployments. Federated IDS [19] address cross-organizational data-sharing constraints, achieving near-centralized accuracy while preserving local privacy, which is an increasingly important practical requirement. Despite these architectural advances, the literature consistently relies on the same families of aggregate flow statistics (packet counts, byte volumes, flow duration) without principled informationtheoretic enrichment [2], [20]. Tama and Rhee [21] and Faker and Dogdu [22] establish strong baselines on NSL-KDD with XGBoost and deep learning respectively, but both operate on entirely conventional feature sets. The recurring limitation is therefore one of representation rather than architecture. Effort has concentrated on the classifier, while the input feature space has remained aggregate and blind to the distributional structure of traffic. Beyond representation, the reliability of IDS evaluation is itself contested. Engelen et al. [13] audited CICIDS-2017 and found labeling artifacts making some attack categories trivially separable by a single feature (e.g. Flow Duration= 0). Ring et al. [2] surveyed 34 IDS datasets and concluded that most published accuracy figures are inflated by dataset-specific artifacts. Sarhan et al. [23] showed that cross-dataset transfer typically collapses to near-chance performance. Recent work on standardized dataset evaluation frameworks [24] proposes MITRE ATT&CK-aligned metrics for assessing dataset relevance to real threat scenarios, reinforcing that single-dataset evaluations are insufficient for claiming generalization. Taken together, these findings indicate that single-dataset, within-distribution cross-validation (CV) evaluations reported through aggregate scores systematically overstate operational performance, yet such protocols remain the field norm.

2.2

Entropy-Based Feature Engineering

Information-theoretic measures have a foundational history in network anomaly detection. Wagner and Plattner [25] showed that Shannon entropy of packet-size and source-address distributions detects worm propagation and Denial-of-Service (DoS) floods, establishing that entropy captures the structural regularity of benign traffic more robustly than absolute counts. Nychis et al. [26] confirmed empirically that header-field entropy is an effective anomaly indicator across multiple operational networks. Xu et al. [27] showed that flooding attacks collapse destination-port entropy while benign traffic maintains it across all dimensions. Recent work continues to advance this direction: Kenyon [28] characterizes payload entropy profiles across flow types, confirming that entropy measurements reliably distinguish attack and benign flows even without payload decryption; Yu et al. [29] propose Rényi-entropy-driven anomaly detection with dynamic thresholding, achieving lower false-alarm rates than fixed-threshold Shannon-entropy detectors. Sequential complexity measures such as ApEn [4] and SampEn [5] require ordered packet sequences that are incompatible with

Page 2 of 20

Research Article

Bouke et al., 2026.

pre-aggregated CICFlowMeter output [7], [23]. A gap therefore persists between the well-documented discriminative value of entropy and the pre-aggregated flow formats that dominate practical IDS pipelines, for which no existing estimator derives entropy from the summary statistics the records already contain.

2.3

Explainability in IDS

Explainability has become an operational requirement for IDS in high-stakes and regulated environments. Mahbooba et al. [30] showed that rule-based explanations raise analyst alertvalidation rates from 61% to 94%. Patil et al. [31] demonstrated that SHAP attribution improves analyst trust in cloud-based IDS. A recent systematic review [32] covering explainable AI (XAI) methods applied to IDS (2020–2024) concludes that TreeSHAP is the dominant explanation approach for ensemble classifiers in industrial deployments, valued for its exact computation and consistency guarantees [12]. Bouke et al. [9], [10], [33] have applied SHAP to spam detection and IDS, confirming that treeensemble attributions are stable across folds and align with domain-expert intuition. These studies, however, attribute exclusively over conventional flow features; whether informationtheoretic features receive coherent attributions, and whether those attributions remain consistent across heterogeneous environments, has not been examined.

2.4

ous random variable X ∼ N (µ, σ 2 ), the differential entropy is h(X) = 21 ln(2πe σ 2 ), where e ≈ 2.718 is Euler’s number, µ is the mean, and σ 2 is the variance. h(X) is a monotone increasing function of σ , and is independent of µ. Definition 3 (Jensen-Shannon divergence [36]). For distributions P and Q with mixture M = 21 (P + Q), the Jensen-Shannon divergence is JSD(P∥Q) = 12 KL(P∥M) + 1 2 KL(Q∥M) ∈ [0, ln 2], where KL(P∥Q) is the Kullback-Leibler divergence. JSD is symmetric and bounded, making it a wellsuited measure of distributional asymmetry between forward and backward traffic.

3.2

SHAP [11] assigns each feature i a value φi satisfying fˆ(x) = p φ0 + ∑i=1 φi , where x ∈ R p is an input instance with p features, ˆf (x) is the model’s scalar output for that instance, φ0 = E[ fˆ] is the expected model output over the training set (the baseline prediction), and φi is the Shapley value from cooperative game theory, measuring the average marginal contribution of feature i across all possible feature subsets. TreeSHAP [12] computes exact Shapley values for tree ensembles in polynomial time, enabling efficient attribution across large feature sets.

4

Synthesis and Positioning

The threads above converge on a single under-addressed need. Architectural innovation in ML-based IDS has outpaced innovation in feature representation, which remains aggregate and structure-agnostic; entropy captures the distributional structure that aggregate statistics discard, but its established estimators are incompatible with the pre-aggregated datasets that dominate the field; explainability is now an operational requirement, yet entropy-derived features have never been subjected to attribution analysis; and prevailing single-dataset, aggregate-metric protocols overstate generalization.

SHAP Attribution

The MDE Framework

MDE is defined through four sub-sections: the design rationale (Section 4.1), theoretical propositions (Section 4.2), the three analytical entropy levels (L1–L3), and the composite score and dataset adaptation steps.

4.1

Behavioral Representation

MDE is a compact analytical feature construction method, not a feature selection method. Feature selection identifies which features within an existing set are most discriminative and discards the rest; the underlying feature pool is unchanged. MDE does not rank, filter, or reweight any existing flow feature. Instead, it constructs a small set of new features (entropy and divergence values) that are not present in any standard flow record and that did not exist before the transformation is applied. The inputs are the summary statistics already present in the record (means, standard deviations, packet counts, flag counts); the outputs are information-theoretic quantities grounded in a behavioral hypothesis about the structural difference between attack and benign traffic.

The present work is positioned precisely at this intersection. It derives entropy analytically from the summary statistics already present in flow records, removing the raw-packet barrier while preserving the distributional sensitivity that motivates entropy. Its closed-form features are natively interpretable, enabling a SHAP fold-stability analysis of entropy attributions. It is then evaluated under a leakage-free, multi-dataset protocol with full operational metrics that exposes the failure modes aggregate single-dataset scores conceal. The following sections formalize this framework (Section 4) and evaluate it (Section 6). MDE is also distinct from general-purpose feature transformation approaches such as principal component analysis or 3 Background kernel mappings. Those methods transform feature geometry without grounding the transformation in a domain theory. The MDE framework is grounded in three information-theoretic Each MDE feature corresponds to a specific, formalized behavconstructs and one attribution framework. This section defines ioral claim: L1 captures within-flow distributional complexity each in the precise form used throughout the paper. (Proposition 1); L2 captures directional asymmetry between source-to-destination and destination-to-source traffic (Propo3.1 Entropy Foundations sition 2); L3 captures protocol-flag diversity. These are closedDefinition 1 (Shannon entropy [34]). For a discrete random form information-theoretic expressions, not learned represenvariable X with probability mass function p, the Shannon en- tations, and their expected behavior under attack and benign tropy is H(X) = − ∑x p(x) log p(x), where log denotes the nat- conditions is analytically derivable from the underlying distriural logarithm throughout this paper (units: nats); H(X) ≥ 0 butional assumptions. with equality only when X is deterministic. Definition 2 (Gaussian differential entropy [35]). For a continuPage 3 of 20

Research Article

4.1.1

Bouke et al., 2026.

Feature Set Size and Behavioral Coverage

The feature count follows directly from the three-level hierarchy applied to whichever directional statistics are available in each dataset schema. For each available direction (forward, backward) and signal type (packet size, inter-arrival time), one ADE value is computed wherever the required mean and standard deviation are present. One JSD value is computed for each directional pair whose marginal distributions can be parameterised from available statistics. One flag-entropy value is computed where per-flow flag counts are recorded. This yields 7 features on schemas with minimal directional statistics (NSL-KDD) and up to 12 on richer CICFlowMeter-format datasets. The count is not tuned to optimize any classification metric. It reflects the three behavioral dimensions (distributional complexity, directional asymmetry, and protocol irregularity) with minimal redundancy. Adding further features within the same hierarchy would introduce correlated quantities computed from the same input statistics. 4.1.2

Analytical Properties of MDE Features

The compact analytical design provides four concrete properties. First, portability: the formulas apply to any flow record containing means, standard deviations, and packet counts, without retraining or dataset-specific engineering, enabling consistent application across NSL-KDD, CICIDS-2017/2018, and UNSWNB15 under a single analytical definition. Second, interpretability: each feature has a closed-form expression and a direct theoretical connection to traffic behavior, so SHAP attributions reflect genuinely domain-relevant quantities rather than opaque numerical artifacts. Third, analytical tractability: Propositions 1 and 2 provide closed-form bounds that predict when the features will and will not be discriminative, enabling a priori reasoning about expected behavior before any model is trained. Fourth, low inference overhead: computing 7–12 entropy values per flow adds negligible cost over conventional feature extraction. 4.1.3

Predictive Scope and Contribution Boundaries

MDE does not claim predictive uplift over conventional flow statistics. As Tables 2 and 3 confirm, combined and conventional conditions achieve statistically indistinguishable withindistribution F1 on all tested datasets. The contribution is one of representation, providing compact, theoretically grounded entropy features with schema-independent construction, native SHAP interpretability, and full operational metric reporting, as evaluated in Section 6.

4.2

Theoretical Foundations

Let D = {( fi , yi )}Ni=1 be a labeled IDS dataset where each flow fi ∈ Rd is a vector of pre-aggregated statistics and yi ∈ {0, 1} is a binary label (yi =1: attack, yi =0: benign). The MDE transformation is a deterministic map φ : Rd → Rk with k ≪ d that derives k entropy-valued features directly from the statistics already present in fi . The classifier operates on the full augmented space Rd+k (combined condition) or on Rk alone (entropy-only condition).

driven applications. Automated tools (scanners, Distributed Denial-of-Service (DDoS) agents, bots) operate under programmatic constraints. They generate packets of fixed or narrowly bounded size, fire probes at regular intervals, and produce nearunidirectional flows. Human-driven sessions (browsing, Voice over Internet Protocol (VoIP), streaming) exhibit natural variability in packet sizes, irregular inter-arrival timing, and bidirectional data exchange. This asymmetry motivates three entropybased discriminators: within-flow variance (L1), directional distributional asymmetry (L2), and protocol-flag diversity (L3). Proposition 1 (Regularity–Entropy Correspondence). Let Xa ∼ N (µa , σa2 ) and Xb ∼ N (µb , σb2 ) model the packet-size distributions of an attack flow a and a benign flow b respectively. If the attack tool imposes tighter size constraints than natural application traffic, then σa < σb , and h(Xa ) = 12 ln(2πe σa2 ) < 12 ln(2πe σb2 ) = h(Xb ).

(1)

Proof. increasing in σ 2 since  1 h(X) 2is strictly d 1 ln(2πe σ ) = 2σ 2 > 0. Therefore σa < σb ⇒ dσ 2 2 h(Xa ) < h(Xb ). Remark 1. Even when the true packet-size distribution is nonGaussian, the Gaussian differential entropy serves as a conservative lower bound. By the maximum-entropy principle, the Gaussian maximises entropy for a given variance. Hence any positive entropy gap between attack and benign flows under the Gaussian model implies a gap of at least equal magnitude under the true distribution. Remark 2 (Scope and limitations of the Gaussian approximation). The Gaussian ADE (Eq. 2) is an approximation and not a claim that network packet-size distributions are Gaussian. Real traffic exhibits heavy tails (skewness 1.5–9.7, excess kurtosis 0.9–110 across benchmarks) and may be multimodal (e.g. mixed HTTP/HTTPS flows). In such cases ADE underestimates the true differential entropy and the approximation may fail for flows whose classification relies on distributional shape rather than variance contrast. Three settings where the Gaussian assumption is expected to degrade: (1) multimodal traffic mixtures within a single flow, (2) datasets where attack and benign traffic share similar variance but differ in higher-order moments, and (3) encrypted traffic where packet payloads are padded to fixed sizes. Non-parametric alternatives (kernel-density entropy, Rényi/Tsallis entropy, histogram-based estimators) could address these cases but require design choices (bandwidth, order α) that introduce their own model assumptions; we regard this as important future work. Proposition 2 (Unidirectionality and Maximum JSD). Let P = N (µ f , σ 2f ) and Qε = N (ε µ f , ε 2 σ 2f ) for ε ∈ (0, 1], modeling backward traffic scaled to fraction ε of the forward flow. Then: (i) JSD(P∥Q1 ) = 0 (symmetric bidirectional flow), (ii) lim JSD(P∥Qε ) = ln 2 ≈ 0.693 (unidirectional ε→0+

flow).

Proof sketch. (i) is immediate since P = Q1 . For (ii), let Mε = 1 + The discriminative power of MDE rests on a fundamental gen- 2 (P + Qε ). As ε →0 , Qε concentrates near zero while P’s sup1 erative difference between automated attack tools and human- port is bounded away from zero, so Mε (x) → 2 P(x) P-almost

Page 4 of 20

Research Article

35

Empirical JSD: attack flows concentrate near ln2 0.693 nats

4.5

CICIDS-2017

A structural asymmetry between forward (source-to-destination) and backward (destination-to-source) traffic is a key characteristic of many attack types: DDoS floods are almost entirely unidirectional; port scans generate probes in one direction with negligible responses; legitimate sessions tend to be bidirectional and more balanced. MDE captures this via the JSD between the approximate forward and backward packet-length distributions:  JSDpkt = JSD N (µ f , σ 2f ) ∥ N (µb , σb2 ) . (3)

UNSW-NB15 14 12 10 8 6 4 2 0

Benign Attack ln2

30 25

Density

Bouke et al., 2026.

20 15 10 5 0 0.0

0.1

0.2

0.3

0.4

0.5

jsd_pkt_len (nats)

0.6

0.7

Benign Attack ln2

0.0

0.1

0.2

0.3

0.4

0.5

jsd_pkt_sz (nats)

0.6

0.7

L2: Cross-Directional JSD

Figure 1:

Empirical JSD distributions for attack and benign flows (kernel density estimate, KDE). Attack flows in CICIDS-2017 (jsd_pkt_len) and UNSW-NB15 (jsd_pkt_sz) concentrate near the theoretical upper bound ln 2 ≈ 0.693 nats (dashed), while benign flows cluster near zero, validating Proposition 2 empirically.

Since the JSD between two Gaussians has no closed form, it is approximated by fitting a moment-matched Gaussian to the mixture M = 21 (P + Q): the mixture mean and variance 2 = 1 (σ 2 + σ 2 ) + 1 (µ − µ )2 , and are µM = 12 (µ f + µb ), σM f b f b 2 4 everywhere, giving KL(P∥Mε ) → KL(P∥ 12 P) = ln 2. Symmet- JSD is evaluated using these parameters in the KL divergence rically, near zero Mε (x) ≈ 12 Qε (x), giving KL(Qε ∥Mε ) → ln 2. formula from Definition 3. A directional balance entropy Hdir = −r log r − (1 − r) log(1 − r), where r ∈ [0, 1] is the fracSince JSD = 12 KL(P∥M) + 12 KL(Q∥M), the limit is 12 ln 2 + tion of packets (or bytes) in the forward direction, provides a 1 2 ln 2 = ln 2. complementary measure of traffic symmetry independent of the Gaussian approximation. The analytical upper bound ln 2 corresponds closely to the maximum SHAP-attributed JSD value (0.693 nats) observed for 4.6 L3: Flag-Pattern Entropy DDoS and port-scan flows in Section 6, suggesting that the TCP control flags (FIN, SYN, RST, PSH, ACK, URG) carry theoretical maximum is approached for strongly unidirectional protocol-level intent. Benign connections exhibit diverse flag attack flows. sequences over their lifetime; attacks often manipulate a narrow subset of flags (e.g. SYN-only for SYN floods, RSTFig. 1 shows that attack flows in both CICIDS-2017 and UNSWheavy for reset injections). Given the per-flow flag counts ck NB15 concentrate near ln 2, while benign flows cluster near for k ∈ {FIN,SYN,RST,PSH,ACK,URG} and total flag count zero, as expected for unidirectional attack bursts approaching C = ∑k ck , the flag-pattern entropy is: maximum directional asymmetry (Proposition 2). ck ck 4.3 Overview Hflags = − ∑ log . (4) C C k MDE computes entropy analytically from the statistical summaries already present in pre-aggregated flow records, without Here ck /C is the empirical probability of flag type k within the requiring raw packet sequences. Fig. 2 shows the end-to-end flow. Hflags = 0 when a single flag dominates (ck = C for one k); pipeline. Raw flow statistics feed three independent entropy Hflags = ln 6 at maximum when all six flag types occur equally. levels (L1–L3), whose outputs are concatenated into a feature Low flag entropy identifies flows dominated by a single flag matrix that is passed to a tree-based classifier, with SHAP protype, a strong indicator of specific attack patterns such as SYN viding post-hoc per-prediction explanations. The framework flooding or reset injection. is also dataset-aware. The specific feature columns used at each level adapt to the schema of each benchmark, while the 4.7 Composite MDE Score underlying analytical definitions stay uniform across all of them. A composite score aggregates across levels by normalizing each entropy feature to [0, 1] using training-set statistics and averag4.4 L1: Differential Entropy (ADE) ing: For a network flow with forward packet length mean µ f and h f − minT h f 1 sMDE = , (5) standard deviation σ f , we approximate the within-flow packet ∑ |F | f ∈F maxT h f − minT h f size distribution as Gaussian and compute: where F is the set of entropy features available for the given 2 1 (2) dataset schema, h f is the value of entropy feature f for the hADE fwd = 2 ln(2πe σ f ). current flow, and minT h f , maxT h f are the minimum and maxThe same is computed for the backward direction (hADE bwd ) and imum of feature f over the training set T . For temporal and for inter-arrival times. Where minimum and maximum packet hold-out experiments, normalization statistics are computed on lengths are available, a complementary uniform range entropy the historical training corpus and applied unchanged to held-out hrange = ln(max − min) is also computed. High differential flows. For cross-validation experiments, LightGBM and Ranentropy in packet sizes indicates variable, structurally complex dom Forest are invariant to monotonic feature rescaling, so the traffic; attack flows such as scanning or DDoS typically exhibit normalization choice does not affect any reported metric; s MDE low variance in packet size (all probes or all flood packets are serves as an interpretability summary in that context. This score identical), producing low ADE values. provides a single interpretable summary of the overall distributional complexity of a flow, ranging from 0 (maximally regular) to 1 (maximally entropic relative to the training distribution).

Page 5 of 20

Research Article

Bouke et al., 2026.

Figure 2: MDE four-stage pipeline. Stage 1 (Input): pre-aggregated flow statistics (means, standard deviations, packet counts, flag counts). Stage 2 (Entropy feature construction): three levels computed analytically without raw packet access: L1 Gaussian differential ADE per traffic direction, L2 cross-directional Jensen-Shannon divergence, L3 Shannon entropy over TCP flag counts. Stage 3 (Feature assembly): the 7–12 MDE entropy features are concatenated with 41–78 conventional flow features to form the combined input; entropy-only and conventional ablations use each branch independently. Stage 4 (Output): binary attack/benign prediction and per-instance SHAP attribution from a LightGBM or random forest classifier.

2018), (ii) attack taxonomy breadth (binary to 12 categories), and (iii) feature schema heterogeneity (NSL-KDD connection records to CICFlowMeter packet statistics). Class imbalance 5.1 Datasets ranges from near-balanced (NSL-KDD 43/57) to moderate Four publicly available benchmark datasets are selected to span (CICIDS-2018 72/28) and heavy (UNSW-NB15 93/7). This three structural dimensions: (i) traffic generation era (1999–

5

Experimental Setup

Page 6 of 20

Research Article

Bouke et al., 2026.

&ODVV'LVWULEXWLRQSHU'DWDVHW

0'(6FRUH'LVWULEXWLRQ%HQLJQYV$WWDFN &,&,'6

0'(6FRUH

   

&,&,'6























$WWDFN

%HQLJQ

$WWDFN











 %HQLJQ

16/.''









816:1%



&RXQW

16/.''

%HQLJQ

$WWDFN









%HQLJQ



%HQLJQ

$WWDFN



816:1%



 

 



 

&,&,'6





 

&,&,'6













%HQLJQ

$WWDFN



 



%HQLJQ

$WWDFN



%HQLJQ

$WWDFN

$WWDFN

Figure 3: MDE score distributions (Benign vs. Attack) across all four benchmark datasets. The degree of class separation varies by dataset, reflecting each dataset’s attack structure.

Figure 4: Class distribution (Benign vs. Attack) across all four benchmark datasets after stratified sampling.

Known artifact: the dataset uses pre-encoded binary labels Table 1: Dataset summary. #Feat: number of numerical features after (class=0/1), and the original label column must be carefully excluded from features to prevent trivial leakage (Section 5.6). cleaning. Imbal.: benign : attack ratio (approximate).

Dataset

Flows #Feat Atk types Imbal.

NSL-KDD 22,544 CICIDS-2017 250,000 CICIDS-2018 150,000 UNSW-NB15 200,000

41 78 78 41

4 12 2 9

43:57 80:20 72:28 93:7

diversity is necessary to test whether the analytical MDE framework, which adapts its entropy computations to each schema, produces consistent, interpretable signals across structurally distinct environments. Table 1 provides a structured summary; key properties are elaborated below. NSL-KDD [6] is selected as the canonical baseline for IDS research. NSL-KDD is a curated refinement of KDD Cup 1999 that removes duplicate records present in the original dataset, yielding 22,544 flows with 41 connection-level features covering SYN flood, probing, R2L, and U2R attack categories. Its balanced class distribution (43% benign, 57% attack) and wellcharacterized properties make it the standard reproducibility anchor against which new approaches are benchmarked. Known artifact: the KDD feature set includes high-level connection summaries (e.g., serror_rate, same_srv_rate) that encode attack context implicitly, contributing to high conventionalfeature separability.

UNSW-NB15 [8] is selected for its modern attack categories and rich feature schema. Collected at the Cyber Range Lab of UNSW Canberra using the IXIA PerfectStorm tool, UNSWNB15 contains 9 attack types (Fuzzers, DoS, Exploits, Generic, Reconnaissance, Shellcode, Worms, Backdoors, Analysis) against realistic background traffic. Its 41 features include network-level statistics not present in CICFlowMeter datasets: jitter, connection load, time-to-live (TTL) asymmetry, and service type, which provide richer proxies for L1 ADE and L3 entropy computation. A 200K stratified sample is used. Known artifact: moderate class imbalance (93% benign, 7% attack) is addressed via balanced class weights. Fig. 4 shows the class distributions. All datasets are partitioned using stratified sampling to maintain class proportions across training, validation, and test folds.

5.2

Dataset Adaptation

Because the four benchmarks use different feature schemas, the MDE computation is adapted per dataset. For CICIDS2017/2018, all three levels are computed from packet length statistics, inter-arrival time (IAT) statistics, and TCP flag counts directly. For UNSW-NB15, jitter values serve as inter-arrival standard deviation proxies at L1, and TTL asymmetry replaces flag entropy at L3. For NSL-KDD, the rate-based features (serror_rate, rerror_rate, same_srv_rate) are treated as a probability vector over connection outcomes, and their Shannon entropy constitutes the primary L1/L2 signal. In all cases, the directional balance entropy (L2) is universally computable from byte and packet counts. This adaptation strategy is the enabling design choice that allows MDE to operate across heterogeneous flow schemas under a consistent analytical framework.

CICIDS-2017 [7] is selected for its multi-attack breadth and temporal structure. Generated over five days by the Canadian Institute for Cybersecurity using real traffic replayed through a controlled network, CICIDS-2017 contains 12 attack categories including DDoS, port scanning, brute-force, web attacks, infiltration, and Heartbleed, covering the broadest attack taxonomy of the four evaluated benchmarks. The temporal day-by-day 5.3 Feature Construction and Ablation structure enables the time-based generalization experiment of For each dataset, three feature matrices are constructed to isolate Section 6.4. A 250K stratified sample is used for CV experi- the contribution of MDE features: ments. Known artifact: Engelen et al. [13] document labeling (i) Conventional: original numerical flow features only inconsistencies and near-constant features for certain attack (no entropy). classes; some categories are separable by a single CICFlowMe(ii) Entropy-only: MDE features only (7–12 features deter statistic (e.g., Flow Duration= 0), which contributes to pending on dataset schema). near-saturated conventional-feature F1. (iii) Combined: concatenation of conventional and MDE features. CICIDS-2018 [7] is selected as a harder contemporary counterpart to CICIDS-2017. Generated independently in 2018 This three-way ablation isolates the marginal contribution of under a partially overlapping attack taxonomy, CICIDS-2018 entropy features and establishes whether they can serve as stanexhibits substantially higher intra-class distributional overlap dalone representations. than CICIDS-2017, yielding a genuine classification challenge that stress-tests the entropy framework under conditions closer to operational complexity. A 150K stratified sample is used.

Page 7 of 20

Research Article

5.4

Bouke et al., 2026.

Classifiers and Training

Our experiments rely on two tree-ensemble classifiers, LightGBM [37] and Random Forest [38]. LightGBM is configured with 300 estimators, a learning rate of 0.05, 63 leaves, and balanced class weights, while Random Forest uses 200 estimators, a maximum depth of 20, and balanced class weights. Both are trained under stratified 5-fold cross-validation using a fold-local preprocessing pipeline. Within each fold, a SimpleImputer(strategy=median) is fitted on the training split and applied to both training and test splits, followed by a PercentileClipper (99.9th percentile) fitted and applied in the same fold-local manner. This prevents any crossfold leakage from preprocessing statistics. MDE features are computed from a separate globally-imputed copy of the data (for numerical stability of entropy formulas); since MDE features are deterministic closed-form functions of individual flow records and contain no target information, this does not introduce cross-fold leakage. Evaluation metrics are defined formally in Section 5.5. Class imbalance is handled via the class_weight=‘balanced’ setting in both classifiers. Infinite values, arising from division by zero in flow feature computation, are replaced by column medians; values exceeding the 99.9th percentile are clipped.

5.5

Evaluation Metrics

Let TP, TN, FP, and FN denote true positives, true negatives, false positives, and false negatives at the binary (attack/benign) decision boundary. We report the following metrics, selected to reflect both detection capability and operational cost in IDS deployment: TP Precision = TP + FP TP Recall (DR) = TP + FN FP FAR (FPR) = FP + TN 2 · Precision · Recall F1 = Precision + Recall TP · TN − FP · FN MCC = p (TP + FP)(TP + FN)(TN + FP)(TN + FN)

particularly informative under distribution shift (Section 6.4), where per-threshold metrics conflate threshold selection with model quality. PR-AUC (area under the precision-recall curve) is the preferred discrimination metric under heavy class imbalance [41], reported in Tables 3, 4, and 6. The 5-fold CV ablation (Table 2) reports weighted F1 , Precision, and Recall for each condition and classifier. The full 9-metric suite (F1, Precision, Recall, DR, FAR, Accuracy, MCC, AUC, PR-AUC) for the combined condition is in Table 3. Per-class attack-type breakdown is in Section 6.12.

5.6

Leakage Prevention

Reproducible IDS evaluation requires deliberate protocol choices to prevent data contamination. We address four sources of leakage. First, preprocessing (median imputation, 99.9thpercentile clipping) is applied fold-locally inside a Pipeline. The imputer and clipper are fitted only on each training fold and then applied to the corresponding validation fold, so no global statistics cross the fold boundary. Second, MDE features are deterministic closed-form functions of each flow’s own statistics (Eqs. 2–4) with no label dependence, so their computation introduces no leakage pathway. Third, all identifier columns (IP addresses, ports, timestamps, flow IDs) are removed before feature matrix construction. Fourth, the original label column is used only to derive binary targets and is then dropped, ensuring it cannot enter any feature set in encoded form. Without this correction, the encoded label would make several CICIDS-2018 attack categories trivially separable and inflate the measured scores, masking the genuine distributional overlap that makes the dataset a meaningful stress test.

Campaign-level correlation remains an important caveat. Stratified random CV allows flows from the same attack campaign to (6) appear in both train and test folds, inflating performance relative to real deployment. The temporal split (Section 6.4) is designed (7) to quantify this optimism on CICIDS-2017. Host-based and session-level isolation would offer stricter guarantees and are (8) recommended as evaluation standards for future work. (9)

6

Results

(10) 6.1 Ablation Study Table 2 reports weighted F1, Precision, and Recall for each feature condition; Table 3 adds DR, FAR, Acc, MCC, AUC, Each metric serves a distinct diagnostic purpose. Precision and PR-AUC for the combined condition. On CICIDS-2018, (Eq. 6) measures alert reliability. Low precision means many combined F1≈0.74 masks a DR of only 0.43 to 0.48 with FAR false alarms that burden analyst triage. Recall/DR (Eq. 7) mea- between 0.12 and 0.15, meaning fewer than half of attacks sures attack coverage. Low recall means missed intrusions with are detected; none of this is visible from the aggregate score potentially severe consequences. FAR/FPR (Eq. 8) quantifies alone. On CICIDS-2017 entropy-only, DR=0.984 comes at the false-alarm operational burden directly relevant to security FAR=0.054, flagging 5.4% of benign flows. This precisionoperations center (SOC) workload [30]. F1 (Eq. 9) balances recall trade-off is absorbed without trace by the aggregate precision and recall, making it the primary aggregate metric for F1 score. On UNSW-NB15, multi-layer perceptron (MLP) imbalanced IDS datasets [1]. Weighted F1 accounts for class- achieves F1=0.940 but DR=0.561 (Table 6), inflated by the size differences across the multi-class setting. MCC (Eq. 10) 92.6% benign majority. These three cases motivate the full is a correlation coefficient that provides a single balanced sum- metric disclosure used throughout. mary even under extreme class imbalance [39]; it is reported 6.2 Statistical Significance for multi-class aggregation where weighted F1 may be domiTo quantify whether observed F1 differences are statistically nated by the majority class. ROC-AUC is the area under the reliable, we compute 95% confidence intervals from the 5-fold receiver operating characteristic curve, measuring rank discrimCV scores using the t-distribution (t4,0.025 = 2.776) and apination independent of a classification threshold [40]. AUC is Page 8 of 20

Research Article

Bouke et al., 2026.

Table 2: Ablation results: weighted F1 , Precision (P), and Recall (R) for each feature condition, 5-fold stratified CV. Bold: best F1 per dataset. n f : feature counts (conv/ent/comb). Full 9-metric results (DR, FAR, Acc, MCC, AUC, PR-AUC) for the combined condition appear in Table 3.

Conventional Dataset

Model

NSL-KDD

LightGBM RandomForest

F1

nf

Entropy-only

P

R

F1

P

Combined R

F1

P

R

41/7/48 0.9873 0.9873 0.9873 0.9788 0.9788 0.9788 0.9875 0.9875 0.9875 0.9851 0.9852 0.9851 0.9758 0.9759 0.9758 0.9857 0.9858 0.9857

CICIDS-2017 LightGBM 78/12/90 0.9989 0.9989 0.9989 0.9551 0.9607 0.9536 0.9989 0.9989 0.9989 RandomForest 0.9977 0.9977 0.9977 0.9463 0.9535 0.9442 0.9977 0.9977 0.9977 CICIDS-2018 LightGBM 78/12/90 0.7396 0.7359 0.7461 0.7084 0.7035 0.7171 0.7405 0.7368 0.7467 RandomForest 0.7442 0.7413 0.7567 0.6973 0.6947 0.7002 0.7443 0.7415 0.7571 UNSW-NB15 LightGBM 41/11/52 0.9926 0.9930 0.9925 0.9887 0.9896 0.9883 0.9927 0.9930 0.9926 RandomForest 0.9898 0.9907 0.9895 0.9875 0.9888 0.9871 0.9900 0.9909 0.9897 Table 3: Full operational metrics for the combined feature set (5-fold stratified CV, fold-local pipeline). DR = TP/(TP+FN); FAR = FP/(FP+TN); MCC = Matthews Correlation Coefficient. Bold: best F1 per dataset. CICIDS-2018 is the critical case: F1≈0.74 conceals DR≈0.48, meaning fewer than half of all attacks are detected. Dataset

Model

NSL-KDD

LightGBM 0.9875 0.9875 0.9875 0.9883 0.0136 0.9875 0.9745 0.9996 RandomForest 0.9857 0.9858 0.9857 0.9844 0.0126 0.9857 0.9709 0.9994

0.9997 0.9995

CICIDS-2017 LightGBM 0.9989 0.9989 0.9989 0.9983 0.0010 0.9989 0.9964 0.9999 RandomForest 0.9977 0.9977 0.9977 0.9953 0.0017 0.9977 0.9929 0.9998

0.9997 0.9993

CICIDS-2018 LightGBM 0.7405 0.7368 0.7467 0.4784 0.1483 0.7467 0.3470 0.7342 RandomForest 0.7443 0.7415 0.7571 0.4334 0.1163 0.7571 0.3529 0.7231

0.6107 0.5999

UNSW-NB15 LightGBM 0.9927 0.9930 0.9926 0.9895 0.0072 0.9926 0.9484 0.9996 RandomForest 0.9900 0.9909 0.9897 0.9971 0.0108 0.9897 0.9317 0.9995

0.9950 0.9933

Prec

Rec

DR

FAR

Acc

MCC

AUC PR-AUC

ROC Curves Four Datasets and Feature Conditions (LightGBM, 5-fold CV)

NSL-KDD

True Positive Rate

F1

CICIDS-2017

CICIDS-2018

UNSW-NB15

1.0

1.0

1.0

1.0

0.8

0.8

0.8

0.8

0.6

0.6

0.6

0.6

0.4

0.4

0.4

0.4

0.2 0.0

Conventional (AUC=0.9996) Entropy-only (AUC=0.9973) Combined (AUC=0.9996)

0.0

0.2

0.4

0.6

False Positive Rate

0.8

1.0

0.2 0.0

Conventional (AUC=0.9999) Entropy-only (AUC=0.9936) Combined (AUC=0.9999)

0.0

0.2

0.4

0.6

False Positive Rate

0.8

1.0

0.2 0.0

Conventional (AUC=0.7346) Entropy-only (AUC=0.6614) Combined (AUC=0.7342)

0.0

0.2

0.4

0.6

False Positive Rate

0.8

1.0

0.2 0.0

Conventional (AUC=0.9996) Entropy-only (AUC=0.9990) Combined (AUC=0.9996)

0.0

0.2

0.4

0.6

False Positive Rate

0.8

1.0

Figure 5: ROC curves for all four datasets across three feature conditions (LightGBM, 5-fold CV). Solid blue: conventional; dashed amber: entropy-only; dash-dot green: combined. AUC values are means over folds. CICIDS-2018 shows the lowest AUC (≈0.73), consistent with genuine feature-space ambiguity between attack categories. Combined condition matches or exceeds conventional on all datasets, confirming entropy features add discriminative ranking ability without degradation.

ply Wilcoxon signed-rank tests [42] for paired comparisons. With k = 5 folds, the minimum achievable Wilcoxon p-value is 1/24 = 0.0625; we adopt a one-sided significance criterion of p ≤ 0.0625 for this sample size.

p = 0.0625, the minimum achievable value, indicating a consistent directional difference). 95% CIs: NSL-KDD entropy [0.977, 0.980] vs. conventional [0.985, 0.990]; CICIDS-2017 entropy [0.954, 0.956] vs. conventional [0.999, 0.999]; UNSWNB15 entropy [0.988, 0.989] vs. conventional [0.992, 0.993]. The gap is smallest on UNSW-NB15 (0.4 percentage points) and largest on CICIDS-2017 (4.4 pp), consistent with the known artifact-driven separability of CICIDS-2017 by packet-volume features.

Combining MDE entropy with conventional features produces no statistically significant F1 change on any tested dataset (p ≥ 0.625, confidence intervals overlap). 95% CIs for conventional and combined conditions are: NSL-KDD [0.985, 0.990] / [0.985, 0.990]; CICIDS-2017 [0.999, 0.999] / [0.999, 0.999]; UNSW-NB15 [0.992, 0.993] / [0.992, 0.993]. Entropy features 6.3 Entropy-Only Results do not degrade conventional performance. The significance tests above establish that entropy features neiIn contrast, the entropy-only condition achieves lower F1 than ther improve nor degrade combined F1 relative to conventional conventional on all three tested datasets in every fold (Wilcoxon features. The entropy-only condition, though weaker in absolute F1, is more revealing. Its per-dataset variation exposes where Page 9 of 20

Research Article

Bouke et al., 2026.

$EODWLRQ6WXG\)E\)HDWXUH6HWDQG'DWDVHW

encouraging finding is that entropy features preserve discrimination at the score level. Combined LightGBM achieves AUC = 0.8716 and PR-AUC = 0.8066 versus 0.8435/0.7810 for conventional, confirming that entropy scores retain relative ordering ability under shift even when fixed classification thresholds break down. This divergence between threshold performance (DR, MCC) and ranking performance (AUC) indicates that enFigure 6: Ablation study: weighted F1-score per feature set and tropy score ordering is partially preserved under shift even when dataset. Gray: conventional features; amber: entropy-only (MDE); navy: fixed classification thresholds fail. /LJKW*%0

5DQGRP)RUHVW



:HLJKWHG)VFRUH

   

FRQYHQWLRQDO HQWURS\BRQO\ FRPELQHG



.''

16/

'6 &,&,



FRQYHQWLRQDO HQWURS\BRQO\ FRPELQHG



'6 &,&,

 1% 816:

.'' 16/

combined.

 '6 &,&,

 '6 &,&,

 1% 816:

6.5

Pseudo-Live Temporal Replay

Table 4: CICIDS-2017 temporal evaluation: Mon–Thu training (150K, The batch temporal evaluation (Section 6.4) characterizes aggredebiased), Friday test (100K). All metrics weighted except DR = gate performance after training. To assess operational behavior TP/(TP+FN) and FAR = FP/(FP+TN). Bold: best per column.

under a realistic inference scenario, we implement a pseudolive temporal replay. The complete pipeline (imputer, clipper, Model Ablation F1 Prec Rec DR FAR MCC AUC PR-AUC LightGBM) is trained once on Monday–Thursday traffic (150K LightGBM conventional 0.5082 0.7684 0.6226 0.0816 0.0002 0.2220 0.8435 0.7810 entropy_only 0.5364 0.6934 0.6289 0.1280 0.0218 0.2112 0.7324 0.6290 flows), all parameters are frozen, and the full Friday traffic combined 0.5080 0.7685 0.6225 0.0814 0.0002 0.2218 0.8716 0.8066 (703K flows) is then replayed chronologically without labels, reRandomForest conventional 0.6498 0.8017 0.7035 0.2790 0.0005 0.4296 0.8106 0.7665 entropy_only 0.4311 0.3460 0.5767 0.0001 0.0212 −0.0931 0.6133 0.5854 training, or threshold adaptation. Friday flows are sorted by their combined 0.6514 0.8021 0.7045 0.2815 0.0006 0.4317 0.8184 0.7703 original timestamps and divided into N = 20 equal windows; the MDE signal is strong and where it is limited by dataset metrics are computed retrospectively in each window using ground-truth labels only after replay completes. We compare structure. Fig. 6 visualises the full ablation comparison. two threshold strategies: fixed (θ = 0.5) and Youden’s-J optimal UNSW-NB15 yields the strongest entropy-only performance threshold derived from training-set predicted probabilities. (F1 = 0.9887/0.9875, DR = 0.989/0.991), attributable to its rich jitter, load, and TTL diversity features that map directly to Table 5 summarizes overall results across feature conditions. L1 ADE and L2 JSD. NSL-KDD achieves F1 = 0.9788/0.9758 DR collapses to 0.08–0.13 across all conditions, consistent with (DR = 0.977/0.974), where MDE’s connection-state entropy the batch evaluation, while AUC remains 0.73–0.87. Critically, captures the structured probe-and-scan signatures characteris- threshold recalibration provides no improvement. The Youden tic of KDD-style attacks. CICIDS-2018 entropy-only F1 = threshold (0.716 for combined) is derived from a training dis0.708/0.697 with DR = 0.41–0.44 reflects a genuine dataset tribution where attacks receive high probabilities, but under property. Multiple attack categories share nearly identical flow- temporal shift the score distribution drifts downward, placing level distributional profiles, differing primarily in absolute mag- attack flows below any reasonable decision boundary regardless nitude rather than structural shape. Entropy features respond to of threshold choice. DR with θYouden is within 0.001 of fixed distributional structure, not magnitude, so they cannot resolve θ = 0.5 in every condition. categories whose discriminative signal lies elsewhere. The com- Table 5: Pseudo-live temporal replay summary: LightGBM, full Friday bined condition improves only marginally (F1 = 0.740/0.744), traffic (703K flows, 20 windows). DR and FAR under fixed θ = 0.5 and and neither feature family alone nor their combination over- Youden’s-J threshold. AUC is threshold-independent. comes this intra-class ambiguity. It is a dataset property, not a Feature set θYouden DRθ =0.5 DRθY FARθ =0.5 MCC AUC modeling failure.

6.4

Temporal Generalization

Conventional Entropy-only Combined

0.716 0.504 0.714

0.081 0.081 0.125 0.125 0.081 0.081

0.000 0.221 0.842 0.022 0.208 0.732 0.000 0.221 0.871

To evaluate temporal generalization, we train on Monday– Thursday files (150K stratified sample, 12 attack types) and test on the Friday files (100K stratified sample), which con- The window-by-window breakdown (Figure 7) reveals a pattern tain DDoS and PortScan, attack types that were only partially invisible in aggregate results. Windows 3–8 correspond to a DDoS surge period in which 50–99% of flows are attacks. In represented in the training period. Table 4 reports the results. these windows, DR falls to zero across all conditions while AUC Table 4 shows that all models fail to detect the majority of at- remains 0.70–0.95: the classifier correctly ranks attacks above tacks under distribution shift, and F1 substantially overstates benign flows in relative terms, but the absolute predicted scores operational utility. LightGBM’s DR collapses to 0.082 under shift below the decision boundary, causing complete operational shift despite weighted F1≈0.51, because the model defaults failure. Windows 9–14, dominated by PortScan traffic with to predicting benign. It detects fewer than 1 in 12 attacks. a more heterogeneous attack signature, show partial recovery The best result comes from Random Forest (RF) combined (DR 0.09–0.36, AUC 0.82–0.99). This two-phase structure il(DR = 0.2815, MCC = 0.4317, FAR = 0.0006), which still lustrates that the AUC-DR divergence identified in Section 6.4 misses more than 70% of attacks while keeping false alarms is not a global averaging artifact but a flow-period-specific colnear zero. RF entropy-only is the clearest failure: DR≈0.000, lapse. During high-volume homogeneous attack bursts, score MCC = −0.093 (below-random correlation), and FAR = 0.021, calibration degrades while discrimination is preserved. a situation where the model generates false alarms on benign traffic while detecting almost no attacks, a catastrophic inversion that would be invisible if only F1 = 0.43 were reported. The one

Page 10 of 20

Research Article

Bouke et al., 2026.

Detection Rate (DR)

0.35 0.30 0.25 0.20 0.15 0.10 0.05 0.00

False Alarm Rate (FAR)

Pseudo-Live Temporal Replay CICIDS-2017 Mon Thu Friday Operational Metrics over 20 Chronological Windows (Fixed vs Youden Threshold)

0.16 0.14 0.12 0.10 0.08 0.06 0.04 0.02 0.00

Solid=fixed thr Dashed=Youden thr

Conventional Entropy Only Combined

0.4

MCC

0.2 0.0 0.2

ROC-AUC

0.4

1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 2.5

5.0

7.5

10.0

12.5

Replay Window (chronological order)

15.0

17.5

20.0

Figure 7: Pseudo-live temporal replay: operational metrics over 20 chronological Friday windows (CICIDS-2017). Solid lines: fixed threshold (θ = 0.5); dashed lines: Youden’s-J threshold. Windows 3–8 correspond to the DDoS surge period; windows 9–14 to PortScan. DR collapses to zero during the surge while AUC reaches 0.95, demonstrating that score calibration fails before discrimination does.

6.6

Baseline Comparison

Table 6 situates within-distribution performance of MDE against a broad set of classifiers. A fair comparison requires identical train/test splits, identical preprocessing, and identical metrics. Table 6 reports 5-fold CV results for seven classifiers on the com-

bined MDE feature set across all four datasets: three gradientboosted tree methods (LightGBM, Random Forest, XGBoost), CatBoost [43], and three neural approaches (MLP, TabNet [44], FT-Transformer [45]). MLP, TabNet, and FT-Transformer use a stratified 30K-sample subset for computational feasibility; tree-

Page 11 of 20

Research Article

Bouke et al., 2026.

based classifiers run on full data. All models use the identical leakage-free pipeline (fold-local imputation and percentile clipping). Reporting the full suite of operational metrics, including DR, FAR, MCC, and F1, exposes critical gaps that aggregate scores alone would conceal. On UNSW-NB15, MLP achieves F1 = 0.9417 but DR = 0.5809, inflated by the heavily benign majority; TabNet (DR = 0.9747) and FT-Transformer (DR = 0.9997) recover substantially through their attention mechanisms on this dataset. Gradient-boosted classifiers (LightGBM, XGBoost, CatBoost) consistently achieve DR ≥ 0.96 on NSLKDD, CICIDS-2017, and UNSW-NB15, with MCC ≥ 0.93 on those three datasets. CICIDS-2018 is the critical stress test. Its genuine intra-class ambiguity exposes the limits of every approach. No classifier achieves DR above 0.48, MCC falls below 0.43 for all models, and deep learning methods (MLP DR = 0.1688, TabNet DR = 0.2178) underperforming treebased methods on detection rate under this harder distribution. XGBoost achieves the highest F1 on CICIDS-2018 (0.7467), NSL-KDD (0.9878, tied with CatBoost), and UNSW-NB15 (0.9935), while LightGBM leads on CICIDS-2017 (0.9989). FT-Transformer [45] and TabNet [44] are competitive on wellbalanced datasets but require substantially more computation for modest F1 gains over gradient-boosted trees on tabular network flow data. The consistent dominance of gradient-boosted trees (GBTs) observed here reflects structural properties of pre-aggregated flow records [46]. Network flow features are heterogeneous in scale and heavily skewed; GBTs handle this natively through recursive splitting that is invariant to monotone transformations, requiring no normalization beyond the fold-local percentile clipping applied here. High-order feature interactions (e.g. joint packet-size and direction signals) are captured greedily without manual feature construction. Deep architectures benefit most when inputs exhibit local correlations, spatial regularity, or smooth temporal structure, and none of these properties hold for flow-level statistical summaries. Attention-based models (FTTransformer, TabNet) address some of these limitations through learned per-feature embeddings and attention over feature tokens, narrowing the gap on balanced, well-structured datasets (NSL-KDD, UNSW-NB15 in Table 6), but have not consistently surpassed GBTs on datasets with fewer than 106 samples and strong class imbalance [46]. The CICIDS-2018 results are illustrative. No deep model improves on F1 or DR relative to the best tree-based classifier, and MLP degrades substantially (DR=0.169 vs. 0.478 for LightGBM).

All SHAP figures were generated from the leakage-free pipeline (label column removed from feature matrices before SHAP computation). Feature name audits confirmed that no labelrelated column appears in any SHAP plot. Each dataset passed a programmatic check verifying that no feature name contains the strings label, class, attack, binary, or multi. Formal cross-dataset Spearman correlation is not feasible because each dataset’s conventional features carry schema-specific column names (e.g., Total_Length_of_Fwd_Packets in CICIDS vs. src_bytes in NSL-KDD), leaving fewer than three features in common by name across any pair. We therefore assess stability via the MDE top-10 fraction: the proportion of the top-10 SHAP features (by mean absolute SHAP value on the full training set) that are MDE-type (L1 ADE, L2 JSD, or L3 flag entropy). Across four datasets: Dataset CICIDS-2017 UNSW-NB15 NSL-KDD CICIDS-2018

MDE in top-10

Fraction

4/10 5/10 3/10 3/10

40% 50% 30% 30%

The MDE fraction ranges 30–50% across all four environments, despite heterogeneous feature schemas and attack taxonomies. Given that MDE contributes only 7–12 features out of 41–90 total (8–29% by count), a consistent 30–50% share of top-10 attributions indicates that entropy features are disproportionately represented in SHAP importance rankings across structurally distinct environments. Fig. 9 shows the SHAP waterfall plot for the most confidently classified attack instance in CICIDS-2017 (LightGBM, combined features). A waterfall plot decomposes the model output for a single instance. Starting from the expected model output E[ f (X)] (base value), each bar shows how a specific feature’s value pushes the prediction upward (toward attack) or downward (toward benign), arriving at the final model output f (x). The cross-directional JSD (jsd_pkt_len = 0.693, the maximum possible, indicating fully unidirectional traffic) contributes the largest positive SHAP value, identifying a near-zero backward traffic volume, a signature consistent with DDoS or port-scan activity. The directional balance entropy (dir_entropy_pkts ≈ 0) and flag entropy (flag_entropy) both push the prediction toward attack, while conventional features such as Flow Duration and packet length statistics provide complementary marginal contributions.

Fig. 10 shows the corresponding waterfall for UNSW-NB15. The ade_src_iat feature (Gaussian differential entropy of source inter-arrival times) dominates. A low value indicates highly regular, periodic packet timing typical of automated attack tools such as scanners and bots, whereas human-driven sessions exhibit higher IAT variability. The jsd_pkt_sz feature (cross-directional size JSD) further confirms that the flagged flow has structurally different source and destination packet 6.7 SHAP Waterfall Analysis The attribution structure of MDE features (which entropy fea- distributions, consistent with a probe-response asymmetry. tures drive predictions and whether attributions are consistent 6.8 Cross-Dataset Entropy Analysis across datasets) is examined below. We first verify leakage-free The waterfall plots above show attribution patterns for individattribution, then assess cross-dataset rank stability, and finally ual instances. To characterize the direction and magnitude of the examine instance-level waterfall plots. entropy signal at the dataset level, Fig. 11 presents the entropy Table 7 situates MDE-IDS against published methods. Because those studies use different datasets, preprocessing pipelines, and evaluation protocols, the comparison is indicative only; the inpipeline Table 6 is the scientifically fair reference. MDE-IDS provides SHAP-based explainability, which is not reported by any baseline method.

Page 12 of 20

Research Article

Bouke et al., 2026.

Table 6: Classifier comparison: seven models on the combined MDE feature set, identical 5-fold stratified CV, leakage-free fold-local pipeline. MLP, TabNet, FT-Transformer use 30K stratified subsample (†). DR = TP/(TP+FN); FAR = FP/(FP+TN). Bold: best F1 per dataset. Gradientboosted trees run on full dataset; deep models on 30K subsample for computational feasibility.

Dataset

Classifier

NSL-KDD

LightGBM 0.9875 0.9875 0.9875 0.9883 0.0136 0.9875 0.9745 Random Forest 0.9857 0.9858 0.9857 0.9844 0.0126 0.9857 0.9709 XGBoost 0.9878 0.9878 0.9878 0.9890 0.0138 0.9878 0.9751 CatBoost 0.9878 0.9878 0.9878 0.9873 0.0116 0.9878 0.9751 † MLP 0.9697 0.9698 0.9697 0.9766 0.0393 0.9697 0.9384 † TabNet 0.9705 0.9705 0.9705 0.9750 0.0355 0.9705 0.9398 † FT-Transformer 0.9818 0.9818 0.9818 0.9836 0.0206 0.9818 0.9629

0.9997 0.9995 0.9997 0.9996 0.9813 0.9967 0.9989

CICIDS-2017 LightGBM 0.9989 0.9989 0.9989 0.9983 0.0010 0.9989 0.9964 Random Forest 0.9977 0.9977 0.9977 0.9953 0.0017 0.9977 0.9929 XGBoost 0.9987 0.9987 0.9987 0.9975 0.0011 0.9987 0.9958 CatBoost 0.9982 0.9983 0.9982 0.9986 0.0018 0.9982 0.9945 † MLP 0.9369 0.9382 0.9362 0.8710 0.0478 0.9362 0.8040 † TabNet 0.9687 0.9693 0.9692 0.8861 0.0104 0.9692 0.9012 FT-Transformer† 0.9728 0.9746 0.9723 0.9832 0.0304 0.9723 0.9177

0.9997 0.9993 0.9997 0.9994 0.7816 0.9711 0.9899

CICIDS-2018 LightGBM 0.7405 0.7368 0.7467 0.4784 0.1483 0.7467 0.3470 Random Forest 0.7443 0.7415 0.7571 0.4334 0.1163 0.7571 0.3529 XGBoost 0.7467 0.8064 0.7881 0.2867 0.0159 0.7881 0.4212 CatBoost 0.7429 0.7397 0.7551 0.4355 0.1199 0.7551 0.3492 † MLP 0.6795 0.7121 0.7401 0.1688 0.0364 0.7401 0.2203 TabNet† 0.7134 0.7825 0.7668 0.2178 0.0184 0.7668 0.3435 † FT-Transformer 0.7190 0.7241 0.7392 0.3624 0.1135 0.7392 0.2975

0.6107 0.5999 0.6092 0.6000 0.4309 0.5111 0.5067

UNSW-NB15 LightGBM 0.9927 0.9930 0.9926 0.9895 0.0072 0.9926 0.9484 Random Forest 0.9900 0.9909 0.9897 0.9971 0.0108 0.9897 0.9317 XGBoost 0.9935 0.9936 0.9935 0.9626 0.0040 0.9935 0.9531 CatBoost 0.9897 0.9906 0.9893 0.9984 0.0114 0.9893 0.9293 MLP† 0.9417 0.9410 0.9426 0.5809 0.0285 0.9426 0.5693 † TabNet 0.9867 0.9877 0.9863 0.9747 0.0128 0.9863 0.9082 † FT-Transformer 0.9881 0.9894 0.9876 0.9997 0.0133 0.9876 0.9194

0.9950 0.9933 0.9942 0.9933 0.3940 0.9393 0.9858

F1

Prec

delta heatmap. It is the difference in mean MDE score between attack and benign traffic per dataset. Positive delta (attack > benign) indicates that attack flows exhibit higher overall distributional entropy; negative delta indicates the reverse. The sign of the delta differs across datasets, reflecting fundamentally different attack structures. Modern multi-vector attacks (UNSW-NB15) and volumetric attacks (CICIDS-2017) produce flows with higher entropy than benign traffic, while classical probe and scan attacks in NSL-KDD tend toward lower entropy (structured, repetitive patterns).

6.9

Cross-Dataset Transfer

To evaluate whether MDE entropy signatures generalize beyond their training distribution, we conduct a zero-shot crossdataset transfer experiment using the two CIC-FlowMeterformat datasets (CICIDS-2017 and CICIDS-2018), which share an identical entropy feature schema (12 common MDE features).

Rec

DR

FAR

Acc

MCC PR-AUC

A LightGBM model trained on one dataset’s entropy-only features is applied directly to the other dataset, without retraining or fine-tuning. Table 8 presents results alongside in-distribution hold-out baselines. The results reveal an expected but informative transfer gap. CICIDS-2017 trains a model attuned to the entropy signatures of DDoS, port-scan, and brute-force attacks, which differ structurally from the web-layer and brute-force profile of CICIDS-2018; the zero-shot F1 drops from 0.955 to 0.591. In the reverse direction, the CICIDS-2018 model, which was itself trained on a harder entropy classification problem (indistribution F1=0.718), achieves F1=0.743 on CICIDS-2017, partially because its attacks produce entropy patterns that overlap with a subset of CICIDS-2017 categories. The AUC=0.31 in the CICIDS-2018→2017 direction indicates near-random class ordering for certain attack sub-types, indicating that entropy

Page 13 of 20

Research Article

Bouke et al., 2026.

Confusion Matrices Four Datasets, Combined Features, LightGBM (5-fold CV, Normalised by Row) NSL-KDD 0.986 (9,579)

Benign

CICIDS-2017

1.0 0.014 (132)

0.8

Benign

0.999 (181,995)

0.8

0.001 (182)

True

0.6

0.988 (12,683)

ign

c Atta

Predicted

0.852 (91,835)

0.148 (15,996)

0.002 (75)

ign Ben

0.998 (44,610)

0.2

Predicted

0.993 (183,855)

Benign

0.8

0.007 (1,335)

0.6

0.4 Attack

0.522 (21,994)

0.478 (20,174)

ign

c Atta

0.0

k

c Atta

0.8

1.0

0.6

0.4 Attack

0.0

k

Ben

0.2

Benign

UNSW-NB15

1.0

0.6

0.4 0.012 (150)

Attack

CICIDS-2018

1.0

Ben

k

Predicted

0.4 0.010 (155)

0.990 (14,655)

ign

c Atta

Attack

0.2 0.0

0.2 0.0

k

Ben

Predicted

Figure 8: Normalized confusion matrices (rows = true label, columns = predicted label) for four datasets using LightGBM with combined features (5-fold CV, pooled predictions). Cell values show row-normalized proportion and raw count. Diagonal dominance confirms high accuracy on NSL-KDD, CICIDS-2017, and UNSW-NB15. CICIDS-2018 shows the most off-diagonal mass, with approximately 52% of attacks (class 1) misclassified as benign, which aligns with the DR ≈ 0.48 reported in Table 2. SHAP Waterfall (Attack) CICIDS-2017

Table 7: Cross-literature context (indicative only; different protocols). MDE-IDS (LGB) = LightGBM combined; Met. = reported metric.

Dataset

Method

Met.

Score

NSL-KDD NSL-KDD NSL-KDD

XGBoost [21] Deep NN [22] MDE-IDS (LGB)

F1 Acc F1

0.9884 0.9910 0.9875

CIC-2017 CIC-2017 CIC-2017

CNN-LSTM [47] RF [13] MDE-IDS (LGB)

F1 Acc F1

0.9780 0.9997 0.9989

UNSW-NB15 Wrap-NN [48] UNSW-NB15 Transformer [16] UNSW-NB15 MDE-IDS (LGB)

Acc F1 F1

0.9750 0.9812 0.9927

f(x) = 14.494

+7.69

2429.119 = Bwd Packet Length Std +3.25

0 = flag_entropy 235 = Init_Win_bytes_backward

+3.14

0 = Init_Win_bytes_forward

+2.15 +1.49

1 = FIN Flag Count 1656.429 = Bwd Packet Length Mean

+1.13

101000000 = Fwd IAT Max

+0.52

101000000 = Fwd IAT Total

+0.46

101000000 = Idle Max

+0.45

3643942.5 = Packet Length Variance

+0.43

0 = Bwd Packet Length Min

+0.4

Table 8: Zero-shot cross-dataset transfer (entropy-only features, Light-

153.871 = Fwd Packet Length Std 0.36

GBM). Hold-out: 80/20 in-distribution split; Transfer : model applied to a different dataset without retraining.

1908.911 = Packet Length Std

+0.32

0.69 = mde_score 0.27 Source

Target

CIC-2017 CIC-2017 (hold-out) 0.955 0.994 CIC-2017 CIC-2018 (transfer) 0.591 0.538 CIC-2018 CIC-2018 (hold-out) 0.718 0.669 CIC-2018 CIC-2017 (transfer) 0.743 0.309

+1.62

76 other features

F1 AUC

10

5

0

E[f(X)] = 7.905

5

10

15

Figure 9: SHAP waterfall plot for a representative attack instance in CICIDS-2017 (LightGBM, combined features). Each bar shows the

signatures are attack-family-specific within the tested environ- SHAP contribution of one feature; MDE features (jsd_pkt_len, ments. These results confirm that entropy-based features, like dir_entropy_pkts, flag_entropy) rank among the strongest all discriminative representations, require domain adaptation drivers of the attack prediction. when the attack taxonomy changes. discriminative power throughout all tested noise levels. This 6.10 Noise Robustness graceful degradation behavior is consistent with the informationWe evaluate the resilience of MDE entropy features to mea- theoretic nature of the features. Entropy is a smooth function of surement uncertainty by adding zero-mean Gaussian noise distribution parameters, so small perturbations produce bounded N (0, ε 2 σ̂ 2j ) to each feature j at inference time, where σ̂ j entropy changes. A 25% noise injection corresponds to a severe is the per-feature standard deviation of the training set and degradation scenario that substantially exceeds typical measureε ∈ {0.05, 0.10, 0.25} is the noise fraction. Models are trained ment variability in flow-record generation tools. on clean data; noise is injected only at test time to simulate 6.11 Entropy vs. Simple Statistics sensor degradation or measurement error. A necessary test of whether MDE features add genuine informaUNSW-NB15 shows the strongest robustness: F1 degrades tion is to compare them against the raw numerical statistics from by only ∆ = 0.049 at ε = 0.25, reflecting that the IAT reg- which they are derived. Table 10 compares LightGBM with ularity and directional asymmetry signals in this dataset are entropy-only MDE features against a simple-statistics baseline large-magnitude relative to noise. NSL-KDD and CICIDS-2017 that uses the corresponding raw columns directly (packet-length exhibit moderate degradation (∆ = 0.160 and ∆ = 0.207 respec- means/stds, IAT means/stds, flow rates, byte counts) without tively), with no catastrophic failure. The entropy features retain Page 14 of 20

Research Article

Bouke et al., 2026.

SHAP Waterfall (Attack) UNSW-NB15

+12.84

2 = ct_state_ttl

17 = ct_srv_dst

+0.25

0 = synack

+0.2

7 = ct_src_ ltm

+0.14

114 = sbytes

+0.11



&,&,'6

'DWDVHW

2 = service

+1.01

 

16/.''



816:1%





0.11 +0.08

0.693 = jsd_iat 0.07



+0.07

7 = ct_dst_ltm

+0.07

0 = is_sm_ips_ports 0 = dmeansz



+1.74

4 = ct_dst_sport_ltm

0 = dbytes





&,&,'6

+6.95

254 = sttl

17 = ct_srv_src

0'(6FRUH  $WWDFN %HQLJQ SHU'DWDVHW

f(x) = 12.439

PGHBVFRUH

)HDWXUH

0.06 +0.09

38 other features

10

5

E[f(X)] = 10.883

0

5

Figure 11: MDE score delta (Attack − Benign mean) per dataset. The

10

sign reversal between environments reveals that attack entropy signatures are environment-dependent, motivating cross-dataset evaluation.

Figure 10: SHAP waterfall plot for a representative attack instance in UNSW-NB15 (LightGBM, combined features). Low ade_src_iat (highly regular inter-arrival timing) and asymmetric jsd_pkt_sz are the primary attack drivers, consistent with automated scanner behavior.

Table 9: Entropy-only LightGBM F1-score under additive Gaussian noise (ε = fraction of per-feature std). Clean baseline (ε = 0) shown for

Table 10: Entropy-only MDE vs. raw simple-statistics baseline (LightGBM, 5-fold CV, comparable feature count). Simple statistics for each dataset are the raw numerical columns from which MDE entropy values are derived (packet-length means/stds, IAT stds, packet counts, byte rates). ∆F1 = MDE − simple.

reference. Dataset

ε =0

ε = 0.05

ε = 0.10

ε = 0.25

NSL-KDD CIC-2017 UNSW-NB15

0.979 0.955 0.989

0.890 0.818 0.967

0.859 0.784 0.959

0.819 0.748 0.940

any entropy transformation. The number of features in both conditions is comparable (≤12).

Dataset

Feature set

NSL-KDD

Simple statistics 10 0.983 −0.004 Entropy-only (MDE) 7 0.979

CIC-2017

Simple statistics 12 0.982 −0.027 Entropy-only (MDE) 12 0.955

nf

F1

∆F1

UNSW-NB15 Simple statistics 10 0.988 <0.001 Entropy-only (MDE) 11 0.988

FAR=0.013, consistent with aggregate F1=0.987. CICIDSSimple statistics achieve comparable or slightly higher stan- 2018 is considerably harder: DR=0.498 and FAR=0.172 align dalone F1 on NSL-KDD and CICIDS-2017, where raw packet- with aggregate F1=0.74, reflecting class ambiguity as a genuine count and byte-rate features are direct discriminators for volume- dataset-level property rather than an evaluation artifact. based attacks. On UNSW-NB15, both feature sets are equiv- The temporal evaluation on CICIDS-2017 reveals the most inalent, indicating that the entropy transformation captures the formative failure pattern: Bot traffic (n=329) is completely same discriminative information as the raw jitter and load fea- undetected (DR=0.000) because no Bot flows appear in Mon– tures. The entropy transformation does not consistently improve Thu training; DDoS achieves only DR=0.182 because Friday’s standalone F1 over raw input statistics. The contribution is DDoS tool profile differs from Mon–Thu DoS attacks; PortScan in representation grounding. Each MDE feature is defined by is essentially missed (DR=0.001) for the same reason. The an information-theoretic formula (Propositions 1–2), applies benign FAR remains very low (0.000), indicating the model uniformly across heterogeneous schemas, and receives domain- defaults to predicting benign when no matching pattern is found interpretable SHAP attributions with cross-fold rank stability, in training, rather than generating false alarms. This pattern is as shown in Section 6.14. a textbook example of distribution shift between training and deployment traffic, and motivates domain-adaptive recalibration 6.12 Per-Class Detection as future work. Table 11 reports per-category DR and FAR for LightGBM on the combined feature set across three evaluation conditions: (i) 6.13 Unseen Attack Families random 20% hold-out on NSL-KDD and CICIDS-2018, and (ii) To test MDE beyond random stratified CV, we conduct an the CICIDS-2017 temporal split (Mon–Thu train, Friday test). unseen-attack-family evaluation on CICIDS-2017. A LightThese conditions reveal meaningfully different failure profiles. GBM and Random Forest model are trained on all attack famUnder random hold-out, NSL-KDD achieves DR=0.986, ilies except two held-out families (Infiltration and Bot), then Page 15 of 20

Research Article

Bouke et al., 2026.

Table 11: Per-category detection rates (LightGBM, combined MDE features). NSL-KDD and CICIDS-2018 use a random stratified 20% hold-out; CICIDS-2017 uses the temporal split (Mon–Thu train → Friday test). DR = fraction of attack flows correctly predicted as attack; FAR = fraction of benign flows incorrectly predicted as attack. Dataset / Split

Category

ntest

NSL-KDD (random)

Attack (binary) Benign

2,567 1,942

DR

FAR

0.986 n/a n/a 0.013

6.15

Computational Profiling

Table 14 reports training time and per-sample inference latency for LightGBM and Random Forest on the combined MDE feature set. All measurements use a single CPU core (n_jobs=1) on an Intel-class processor. Inference latency is reported in microseconds per sample to assess real-time viability. A threshold of 100 µs/sample (10K flows/second) is considered acceptable for network monitoring appliances.

LightGBM inference latency ranges from 4.9–5.9 µs/sample across all four datasets (single-threaded), corresponding to a CIC-2017 (temporal) DDoS 18,888 0.182 n/a throughput of 169K–205K flows/second, which is well within PortScan 18,480 0.001 n/a real-time requirements for network monitoring appliances. Bot 329 0.000 n/a Training time scales with dataset size as expected (0.45–11.69 Benign 62,303 n/a 0.000 seconds for LightGBM; 1.58–100 seconds for RF at 265K trainevaluated on flows from only those two families plus a matched ing samples). The compact MDE feature set (7–12 entropy benign set. This simulates the operationally realistic scenario features vs. 42–79 for full CICFlowMeter) contributes to the where a deployed IDS encounters attack types not seen during low inference latency since each MDE feature is a closed-form formula computed from existing flow statistics without additraining. tional feature extraction overhead. DR=0.000 for all conventional and combined models on heldout Infiltration and Bot traffic, while weighted F1 remains above 7 Discussion 0.998, driven entirely by the 99.9% benign majority. No feature engineering approach generalizes to structurally novel fami- The results are interpreted across four dimensions: the nature lies without retraining. Infiltration (n=2) mimics legitimate of MDE’s contribution relative to conventional features, the HTTP sessions; Bot (n=157) uses low-frequency C&C chan- operational failure patterns exposed by full metric reporting, the nels; both are structurally unlike the DoS and scan traffic in train- consistency of entropy-feature attributions, and the approximaing. The entropy-only condition recovers marginal detection tion boundaries that govern when MDE is and is not applicable. (DR=0.0063) at FAR=0.053–0.061, insufficient for operational use. LightGBM conventional achieves AUC=0.755 versus RF’s 7.1 What MDE Actually Contributes 0.431, showing that the ranking function retains partial ordering Combined and conventional conditions achieve comparable even when threshold-level decisions fail completely. This gap within-distribution F1 across all datasets (Table 2); the entropy between DR and AUC is a methodological caution. High AUC transformation does not consistently improve discriminative does not imply operational detection capability when novel power over conventional features. The contribution is therefore in representation quality and evaluation methodology. Entropy attack families are present. features are grounded in specific behavioral claims (Propo6.14 SHAP Fold Stability sitions 1–2), apply uniformly across heterogeneous schemas To quantify the consistency of SHAP attributions across cross- without retraining, and receive reproducible SHAP attributions validation folds (rather than relying solely on qualitative visual (ρ = 0.80–0.95) that align with those propositions. The leakageinspection), we compute, for each of the 5 CV folds: (i) the free fold-local protocol with full operational metrics (DR, FAR, mean absolute SHAP value per feature on the held-out test fold, MCC, PR-AUC) surfaces failure modes that aggregate F1 alone (ii) the Spearman rank correlation between each pair of folds, would conceal. and (iii) the Kendall τ for robustness. Table 13 reports results for three representative datasets (NSL-KDD, CICIDS-2017, 7.2 Operational Realism The temporal and unseen-family evaluations reveal two failure UNSW-NB15). patterns that aggregate F1 conceals. Under temporal distribution All-feature SHAP rankings are moderately to strongly consistent shift, discriminative score ordering is preserved (AUC=0.87) across folds: Spearman ρ = 0.95 (NSL-KDD), 0.93 (CICIDSwhile fixed thresholds collapse (DR=0.082), a pattern termed 2017), and 0.80 (UNSW-NB15). MDE-only rankings are more threshold-ranking divergence, which points to adaptive recalvariable (ρ = 0.26–0.69), reflecting the small feature count ibration as the practical path forward. Under unseen attack (n = 7–12) and the sensitivity of pairwise Spearman correlation families, DR=0 for all feature conditions regardless of model; to rank swaps among similarly-valued features. The MDE rank F1>0.998 is driven entirely by the majority-class prior. Neistd (4.2–8.2 positions) quantifies this within-dataset variability. ther failure is MDE-specific. Conventional features fail identiThe aggregate MDE contribution to SHAP is stable, but finecally [23]. The implication is that any discriminative representagrained ordering among individual MDE features varies, as tion requires domain-matched training and periodic threshold expected when correlated entropy features (ADE and JSD share recalibration. MDE’s compact feature set (7–12 features vs. packet-size inputs) exchange rank positions without materially 42–79 conventional) reduces the cost of both. changing the overall importance profile. CICIDS-2018 (random)

Attack (binary) 8,434 Benign 21,566

0.498 n/a n/a 0.172

7.3

Stability and Interpretability

The fold-stability analysis (Section 6.14) shows that SHAP rankings are reproducible across data splits: Spearman ρ = 0.80–

Page 16 of 20

Research Article

Bouke et al., 2026.

Table 12: Unseen-attack-family evaluation: trained on CICIDS-2017 without Infiltration and Bot, tested on those held-out families plus matched benign (nattack =159, nbenign =182,177). Prec/Rec are weighted; DR is computed on held-out attacks, FAR on benign. All conventional and combined models achieve DR=0.000, confirming genuine distribution shift. Model

Ablation

LightGBM

conventional entropy_only combined

0.9984 0.9983 0.9985 0.7553 0.0000 0.0006 0.9715 0.9982 0.9462 0.5547 0.0063 0.0530 0.9984 0.9983 0.9985 0.7494 0.0000 0.0006

F1

RandomForest

conventional entropy_only combined

0.9981 0.9983 0.9979 0.4307 0.0000 0.0013 0.9673 0.9982 0.9382 0.3825 0.0063 0.0610 0.9981 0.9983 0.9979 0.6829 0.0000 0.0012

Table 13: SHAP rank stability across 5 CV folds (LightGBM, combined features). ρall / ρMDE = Spearman rank correlation over all features  / MDE-only features, mean ± std across 52 =10 fold pairs. τK = Kendall’s τ (all features). MDE σr = mean rank-position std of MDE features across folds. Dataset NSL-KDD CICIDS-2017 UNSW-NB15

ρMDE

τK

MDE σr

0.950 ± 0.015 0.257 ± 0.265 0.927 ± 0.022 0.690 ± 0.200 0.800 ± 0.052 0.413 ± 0.353

0.853 ± 0.014 0.814 ± 0.022 0.649 ± 0.052

4.24 8.18 6.98

ρall

Prec

Rec

AUC

DR

FAR

is preserved. The noise robustness experiments support this. At ε = 0.25 (25% Gaussian noise), F1 remains above 0.82 across all datasets, indicating that inter-class entropy margins are substantially larger than the approximation error. The cross-dataset transfer gap (CIC-2017 to CIC-2018: F1 drops from 0.955 to 0.591) reflects attack-family-specific entropy signatures and appears equally for conventional features [23]. This behavior is a property of discriminative representations generally, not a limitation unique to entropy.

Table 14: Computational profiling: training time and per-sample in-

7.5

ference latency (combined MDE features, single-threaded CPU, 80/20 stratified split). A threshold of 100 µ s/sample (10K flows/s) is used as a deployment viability criterion. All results are well below this threshold.

The Gaussian ADE approximation underestimates entropy for multimodal flows and encrypted traffic; non-parametric estimators (kernel density, Rényi) are natural successors. Entropy signatures require recalibration when attack taxonomies change. Zero-shot F1 drops to 0.59–0.74 and unseen-family DR=0, as shown by the transfer and unseen-family evaluations. Standard stratified CV allows campaign-correlated flows across train and test folds; host-based or session-level isolation would offer stricter distribution guarantees than temporal splits alone. All results are specific to four controlled benchmark datasets; validation on live organizational traffic is required before any operational deployment claim can be made.

Dataset

Model

ntrain Train (s) Infer (µs/flow)

NSL-KDD

LightGBM RandomForest

18,035 18,035

0.45 1.58

4.85 12.25

CIC-2017

LightGBM 181,489 RandomForest 181,489

8.13 56.05

5.93 13.85

CIC-2018

LightGBM 264,900 RandomForest 264,900

11.69 100.11

5.80 19.34

UNSW-NB15 LightGBM 239,999 RandomForest 239,999

6.71 35.51

5.33 5.61

0.95 for all-feature models, Kendall τ = 0.65–0.85. JSD features rank among the top-3 contributors on CICIDS-2017, UNSW-NB15, and NSL-KDD; ADE features appear in the top-5 across all three datasets. This is consistent with the behavioralasymmetry propositions (Propositions 1–2) and with the waterfall analysis showing jsd_pkt_len=0.693 as the primary driver for highly unidirectional attack flows. Stable attribution confirms that the model consistently relies on JSD features, though SHAP does not independently verify the Gaussian distributional assumptions. The MDE-only rankings show higher variance (ρMDE = 0.26–0.69), expected given the small feature count and correlation structure (ADE and JSD share packet-size inputs).

7.4

Approximation Limits and Transfer Gap

The stable attributions in Section 7 above are predicated on the Gaussian approximation underlying ADE and JSD. This subsection examines when that approximation is adequate and where it breaks down. Flow statistics exhibit substantial nonGaussianity (skewness 1.5–9.7, excess kurtosis 0.9–110.2), so ADE is a Gaussian lower bound on true entropy rather than an exact estimate. For discriminative use this is acceptable as long as monotone ordering is preserved: ADE consistently underestimates entropy, but because the bias applies in the same direction across flows, the relative gap between attack and benign clusters

8

Limitations

Conclusion

MDE derives 7–12 interpretable entropy features analytically from pre-aggregated flow statistics, requiring no raw packet access, training data, or architecture choices. Within-distribution cross-validation performance is statistically indistinguishable between combined and conventional features, confirming that the entropy transformation does not degrade aggregate discriminative power; its contribution is in representation grounding and evaluation methodology. Three evaluation protocols expose failure modes that aggregate F1 structurally cannot reveal. First, full operational metric reporting shows that CICIDS-2018 F1=0.74 masks a DR of only 0.48, so fewer than half of attacks are detected, a gap that F1 alone hides under class imbalance. Second, an unseenattack-family experiment on CICIDS-2017 demonstrates that F1 exceeds 0.998 while DR=0 for held-out Infiltration and Bot families; the aggregate score is driven entirely by the 99.9% benign majority and provides no signal about detection capability on novel threats. Third, a pseudo-live temporal replay evaluation, in which the trained pipeline is frozen and 703K Friday flows are replayed chronologically without retraining, identifies threshold-ranking divergence: AUC remains 0.73–0.87 while DR collapses to 0.08–0.13 across all feature conditions,

Page 17 of 20

Research Article

Bouke et al., 2026.

and Youden’s-J threshold recalibration provides no recovery because the full attack score distribution shifts below any threshold derived from training data. Window-level analysis reveals that during DDoS surge periods, DR reaches zero while AUC reaches 0.95, confirming that score calibration fails independently of score discrimination. SHAP fold-stability analysis (Spearman ρ = 0.80–0.95) confirms that JSD and ADE features receive reproducible, domaincoherent attributions across heterogeneous environments. Future directions include non-parametric entropy estimation for heavy-tailed and encrypted flows, learned threshold recalibration for taxonomy-adaptive deployment, campaign-aware cross-validation, and validation on live organizational traffic.

Declarations

[7]

[8]

[9]

[10]

• Funding: Not applicable. • Conflict of Interest: The authors declare no competing interests. • Availability of Data and Materials: All four datasets are [11] publicly available (NSL-KDD, CICIDS-2017, CICIDS2018, UNSW-NB15). The full experimental pipeline, including preprocessing, MDE feature extraction, model training, and SHAP analysis, is available as open-source [12] code at https://github.com/drbouke/mde. • Ethics Approval: Not applicable. [13]

References [1]

[2]

[3]

[4]

[5]

[6]

A. Khraisat, I. Gondal, P. Vamplew, and J. Kamruzzaman, “Survey of intrusion detection systems: Techniques, [14] datasets and challenges,” Cybersecurity, vol. 2, no. 1, p. 20, 2019. DOI: 10.1186/s42400-019-0038-7 M. Ring, S. Wunderlich, D. Scheuring, D. Landes, and A. Hotho, “A survey of network-based intrusion detection data sets,” Computers & Security, vol. 86, pp. 147–167, 2019. DOI: 10.1016/j.cose.2019.06.005 [15] M. A. Bouke, O. I. Alramli, and A. Abdullah, “Entropy mixing networks: Enhancing pseudorandom number generators with lightweight dynamic entropy injection,” Journal of Security and Privacy, vol. 9, no. 1, e70172, 2026. DOI : 10.1002/spy2.70172 [16] S. M. Pincus, “Approximate entropy as a measure of system complexity,” Proceedings of the National Academy of Sciences USA, vol. 88, no. 6, pp. 2297–2301, 1991. DOI : 10.1073/pnas.88.6.2297 [17] J. S. Richman and J. R. Moorman, “Physiological timeseries analysis using approximate entropy and sample entropy,” American Journal of Physiology: Heart and Circulatory Physiology, vol. 278, no. 6, H2039–H2049, [18] 2000. DOI: 10 . 1152 / ajpheart . 2000 . 278 . 6 . H2039 M. Tavallaee, E. Bagheri, W. Lu, and A. A. Ghorbani, “A detailed analysis of the KDD CUP 99 data set,” in Proceedings of the 2nd IEEE Symposium on Computational [19] Intelligence for Security and Defence Applications, 2009, pp. 1–6. DOI: 10.1109/CISDA.2009.5356528

Page 18 of 20

I. Sharafaldin, A. H. Lashkari, and A. A. Ghorbani, “Toward generating a new intrusion detection dataset and intrusion traffic characterization,” in Proceedings of the 4th International Conference on Information Systems Security and Privacy, 2018, pp. 108–116. DOI: 10.5220/ 0006639801080116 N. Moustafa and J. Slay, “UNSW-NB15: A comprehensive data set for network intrusion detection systems,” in Proceedings of the Military Communications and Information Systems Conference, 2015, pp. 1–6. DOI: 10. 1109/MilCIS.2015.7348942 M. A. Bouke, O. I. Alramli, and A. Abdullah, “XAIRFWFP: A novel XAI-based random forest classifier for advanced email spam detection,” International Journal of Information Security, vol. 24, no. 1, p. 5, 2025. DOI: 10.1007/s10207-024-00920-1 M. A. Bouke et al., “A novel LightGBM model for Arabic spam detection integrated with XAI for enhanced explainability,” Computers and Electrical Engineering, vol. 133, p. 111 032, 2026. DOI: 10.1016/j.compeleceng. 2026.111032 S. M. Lundberg and S.-I. Lee, “A unified approach to interpreting model predictions,” in Advances in Neural Information Processing Systems, vol. 30, 2017, pp. 4766– 4777. S. M. Lundberg, G. G. Erion, and S.-I. Lee, “Consistent individualized feature attribution for tree ensembles,” in arXiv preprint arXiv:1802.03888, 2018. G. Engelen, V. Rimmer, and W. Joosen, “Troubleshooting an intrusion detection dataset: The CICIDS2017 case study,” IEEE Security & Privacy, vol. 19, no. 4, pp. 26– 35, 2021. DOI: 10.1109/MSEC.2021.3068460 A. Thakkar and R. Lohiya, “A survey on intrusion detection system: Feature selection, model, performance measures, application perspective, challenges, and future research directions,” Artificial Intelligence Review, vol. 55, pp. 453–563, 2022. DOI: 10.1007/s10462021-10037-9 O. H. Abdulganiyu, T. A. Tchakoucht, and Y. K. Saheed, “A systematic literature review for network intrusion detection system (IDS),” International Journal of Information Security, vol. 22, pp. 1125–1162, 2023. DOI: 10.1007/s10207-023-00682-2 P. Wu and H. Guo, “RTIDS: A robust transformer-based approach for intrusion detection system,” IEEE Access, vol. 10, pp. 65 259–65 270, 2022. DOI: 10 . 1109 / ACCESS.2022.3184120 H. Kheddar et al., “Transformers and large language models for efficient intrusion detection systems: A comprehensive survey,” Information Fusion, vol. 124, p. 102 820, 2025. DOI: 10.1016/j.inffus.2025.102820 Z. Zhong, S. Chen, J. Qiu, et al., “A survey on graph neural networks for intrusion detection systems: Methods, trends and challenges,” Computers & Security, vol. 141, p. 103 821, 2024. DOI: 10 . 1016 / j . cose . 2024 . 103821 O. E. Buyuktanir et al., “Federated learning in intrusion detection: Advancements, applications, and future direc-

Research Article

[20]

[21]

[22]

[23]

[24]

[25]

[26]

[27]

[28]

[29]

[30]

[31]

[32]

Bouke et al., 2026.

tions,” Cluster Computing, vol. 28, p. 473, 2025. DOI: 10.1007/s10586-025-05325-w G. Apruzzese, P. Laskov, and J. Schneider, “Sok: The [33] impact of unlabelled data in cyberthreat detection,” IEEE Security & Privacy, vol. 21, no. 5, pp. 52–61, 2023. DOI: 10.1109/MSEC.2022.3165612 B. A. Tama and K.-H. Rhee, “An in-depth experimen- [34] tal study of anomaly detection using gradient boosted machine,” Neural Computing and Applications, vol. 31, pp. 955–965, 2019. DOI: 10.1007/s00521- 017[35] 3128-z O. Faker and E. Dogdu, “Intrusion detection using big data and deep learning techniques,” Proceedings of the 2019 ACM Southeast Conference, pp. 86–93, 2019. DOI: [36] 10.1145/3299815.3314439 M. Sarhan, S. Layeghy, N. Moustafa, and M. Portmann, “Netflow datasets for machine learning-based network in- [37] trusion detection systems,” in Proceedings of the 10th International Conference on Big Data Technologies, 2021, pp. 9–21. DOI: 10.1007/978-3-030-96566-2_2 [38] A. Tori et al., “An evaluation framework for network intrusion detection datasets: Leveraging MITRE ATT&CK and industry relevance metrics,” Computers & Security, [39] p. 104 663, 2025. DOI: 10 . 1016 / j . cose . 2025 . 104663 A. Wagner and B. Plattner, “Entropy based worm and anomaly detection in fast IP networks,” in Proceedings of the 14th IEEE International Workshops on Enabling Tech- [40] nologies, 2005, pp. 172–177. DOI: 10.1109/WETICE. 2005.35 G. Nychis, V. Sekar, D. G. Andersen, H. Kim, and H. [41] Zhang, “An empirical evaluation of entropy-based traffic anomaly detection,” in Proceedings of the 8th ACM SIGCOMM Conference on Internet Measurement, 2008, pp. 151–156. DOI: 10.1145/1452520.1452539 K. Xu, Z.-L. Zhang, and S. Bhattacharyya, “Profiling [42] internet backbone traffic: Behavior models and applications,” in Proceedings of ACM SIGCOMM, 2005, [43] pp. 169–180. DOI: 10.1145/1080091.1080112 A. Kenyon et al., “Characterising payload entropy in packet flows: Baseline entropy analysis for network anomaly detection,” Future Internet, vol. 16, no. 12, p. 470, 2024. DOI: 10.3390/fi16120470 [44] X. Yu et al., “Renyi entropy-driven network traffic anomaly detection with dynamic threshold,” Cybersecurity, vol. 7, p. 64, 2024. DOI: 10.1186/s42400- [45] 024-00249-1 B. Mahbooba, M. Timilsina, R. Sahal, and M. Serrano, “Explainable artificial intelligence (XAI) to enhance trust management in intrusion detection systems using deci- [46] sion tree model,” Complexity, vol. 2021, p. 6 634 811, 2021. DOI: 10.1155/2021/6634811 R. Patil, G. Dudeja, and C. Modi, “Designing an efficient security framework for detecting intrusions in virtual [47] network of cloud computing,” Computers & Security, vol. 113, p. 102 537, 2022. DOI: 10.1016/j.cose. 2021.102537 S. U. Khan et al., “Explainable AI-based intrusion de- [48] tection systems for Industry 5.0 and adversarial XAI: A

Page 19 of 20

systematic review,” Information, vol. 16, no. 12, p. 1036, 2025. DOI: 10.3390/info16121036 M. A. Bouke et al., “Application of BukaGini algorithm for enhanced feature interaction analysis in intrusion detection systems,” PeerJ Computer Science, vol. 10, e2043, 2024. DOI: 10.7717/peerj-cs.2043 C. E. Shannon, “A mathematical theory of communication,” The Bell System Technical Journal, vol. 27, no. 3, pp. 379–423, 1948. DOI: 10.1002/j.1538-7305. 1948.tb01338.x T. M. Cover and J. A. Thomas, “Elements of information theory,” Wiley-Interscience, 1991. DOI: 10.1002/ 047174882X J. Lin, “Divergence measures based on the Shannon entropy,” IEEE Transactions on Information Theory, vol. 37, no. 1, pp. 145–151, 1991. DOI: 10.1109/18.61115 G. Ke et al., “LightGBM: A highly efficient gradient boosting decision tree,” in Advances in Neural Information Processing Systems, vol. 30, 2017, pp. 3149–3157. L. Breiman, “Random forests,” Machine Learning, vol. 45, no. 1, pp. 5–32, 2001. DOI: 10 . 1023 / A : 1010933404324 D. Chicco and G. Jurman, “The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation,” BMC Genomics, vol. 21, no. 1, p. 6, 2020. DOI: 10.1186/ s12864-019-6413-7 T. Fawcett, “An introduction to ROC analysis,” Pattern Recognition Letters, vol. 27, no. 8, pp. 861–874, 2006. DOI: 10.1016/j.patrec.2005.10.010 T. Saito and M. Rehmsmeier, “The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets,” in PLOS ONE, vol. 10, 2015, e0118432. DOI: 10.1371/journal. pone.0118432 F. Wilcoxon, “Individual comparisons by ranking methods,” Biometrics Bulletin, vol. 1, no. 6, pp. 80–83, 1945. DOI: 10.2307/3001968 L. Prokhorenkova, G. Gusev, A. Vorobev, A. V. Dorogush, and A. Gulin, “CatBoost: Unbiased boosting with categorical features,” in Advances in Neural Information Processing Systems (NeurIPS), vol. 31, 2018. S. Ö. Arik and T. Pfister, “TabNet: Attentive interpretable tabular learning,” in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 35, 2021, pp. 6679–6687. Y. Gorishniy, I. Rubachev, V. Khrulkov, and A. Babenko, “Revisiting deep learning models for tabular data,” in Advances in Neural Information Processing Systems (NeurIPS), vol. 34, 2021, pp. 18 932–18 943. L. Grinsztajn, E. Oyallon, and G. Varoquaux, “Why treebased models still outperform deep learning on tabular data,” in Advances in Neural Information Processing Systems (NeurIPS), vol. 35, 2022, pp. 507–520. H. Liu and B. Lang, “Machine learning and deep learning methods for intrusion detection systems: A survey,” Applied Sciences, vol. 9, no. 20, p. 4396, 2019. DOI: 10.3390/app9204396 S. M. Kasongo and Y. Sun, “A deep learning method with wrapper based feature extraction for wireless intru-

Research Article

Bouke et al., 2026.

sion detection system,” Computers & Security, vol. 92, p. 101 752, 2020. DOI: 10 . 1016 / j . cose . 2020 . 101752

Page 20 of 20

Related documents

Record · ID 321756 · SHA-256 6e418a6285de20fb
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive