1. Introduction

The rapid expansion of the Internet of Things (IoT) has added millions of connected devices providing intelligent services like remote sensing, actuating, and monitoring [1]. However, this widespread connectivity and smart features have introduced several cybersecurity vulnerabilities. Traditional machine learning (ML)-based security solutions are inadequate due to the dynamic nature of cyber threats, as new malware types cannot be detected by the majority of ML-based security solutions because they rely on static feature extraction [1]. The exponential growth of malware has posed a significant security threat to intelligent systems, with earlier static and dynamic analysis methods failing to achieve effective recognition rates while incurring high computational complexity [2].

Learning-enabled autonomous malware represents an escalating threat to critical infrastructure. Unlike traditional static malware, these adversaries continuously refine their strategies based on interaction outcomes, rendering conventional intrusion detection systems (IDS) ineffective. The challenge intensifies with IoT expansion, introducing heterogeneous devices and protocols that expand the attack surface [3–5]. Recent advances in deep learning models have proven useful for malware detection because they are trained via feature learning instead of task-specific approaches [6], yet the existing frameworks lack fundamental guarantees when facing continuously learning adversaries.

1.1. Research Gap

The existing IDS frameworks lack fundamental guarantees when facing continuously learning adversaries. While adversarial training [7,8] and reinforcement learning (RL)-based defences [9,10] show promise, they lack formal stability guarantees and provable bounds on long-term cumulative loss. Game-theoretic approaches [11–13] capture strategic interactions but overlook defender-side learning dynamics that can be exploited. Meta-reinforcement learning (Meta-RL) methods [14,15] enable fast adaptation but lack mechanisms to prevent cumulative performance degradation. Crucially, no existing framework provides simultaneous guarantees on stability, adaptability, and sub-linear regret. To address these challenges, this paper proposes a feature learning-enabled dynamic malware detection and classification method for IoT-centric cybersecurity.

1.2. Contributions

To the best of our knowledge, our work is the first to introduce Lyapunov-inspired constraints specifically for IDS, providing formal stability guarantees against adaptive adversaries. This paper introduces the stability-constrained meta-reinforcement defence (SCMRD) with the following technical contributions:

  • Theoretical framework: We formalise attacker–defender interaction as a partially observable stochastic game (POSG) with rigorous definitions of stability, drift, and regret. We provide complete proofs for bounded escalation (Theorem 6) and sub-linear regret (Theorem 12), establishing SCMRD as a framework with formal performance guarantees against adaptive adversaries.

  • Technical innovations:

    • Lyapunov stability constraint: Novel integration of control-theoretic stability [23–25] into RL-based defence, with theoretical proof preventing exploitable defender oscillations.

    • Online drift estimation: Kullback–Leibler (KL)-divergence-based mechanism with theoretical bounds on estimation error, enabling proactive threshold adaptation.

    • Regret-aware meta-learning: Novel update rule incorporating historical regret into both regularisation and adaptive learning rates, with proven sub-linear regret bound.

  • Comprehensive evaluation: Extensive experiments on five datasets, including MTA-KDD’19 [16], FL-MU [5], and three benchmark datasets [35–37]. Comparative analysis against 12 state-of-the-art baselines, including recent convolutional neural networks + long short-term memory (CNN + LSTM) [1], Quantum Mayfly [6] Optimisation LSTM (QMO-LSTM), and federated meta-learning (FedMeta) approaches [21,22] with statistical significance testing. Detailed ablation studies quantify each component’s contribution. Cross-dataset validation demonstrates real-world generalisation.

1.3. Paper organisation

Section 2 reviews related work on malware detection, deep learning approaches, meta-learning, and stability in learning systems. Section 3 presents the system model, including the POSG formulation and attacker model. Section 4 details the SCMRD framework with Lyapunov stability, drift estimation, and regret-aware meta-learning components. Section 5 describes experimental evaluation, including datasets, baselines, and results. Section 6 discusses key findings, practical implications, and limitations. Section 7 concludes the paper with a summary of contributions and future research directions.

2. Related Work

2.1. Deep learning for Malware Detection

Recent advances in deep learning models have significantly improved malware detection and classification capabilities. The integration of CNNs for automated feature extraction and LSTM networks for sequential behaviour analysis has proven particularly effective [1]. Unlike conventional approaches limited to specific malware types, feature learning-enabled models ensure adaptive learning and enhance detection accuracy [1]. On the MTA-KDD’19 dataset, such approaches have achieved 99.83% precision, 99.90% recall, 99.74% accuracy, and 99.87% F1-score [1].

Hybrid deep learning approaches combining MobileNetv2 for feature extraction with Ensemble classifiers, including gated recurrent units (GRU) and LSTM techniques, have demonstrated promising performance for malware cyberattack detection [2]. The fusion of deep learning models transforms malware binary files into two-dimensional (2D) images for classification, with hyperparameter tuning optimised using meta-heuristic algorithms like black widow optimisation (BWO) [2]. These approaches outperform conventional ML models, including random forest, eXtreme gradient boosting (XGBoost), and support vector machines (SVMs) [2,17].

For IoT-centric cybersecurity, deep learning models integrated with feature learning have addressed the limitations of traditional ML-based security solutions that rely on static feature extraction [1]. Dynamic malware detection frameworks utilising CNNs and LSTMs have shown superior performance in detecting new malware types that conventional approaches miss [1]. Studies on the Canadian Institute for Cybersecurity (CIC) IoT-DIAD 2024 dataset have demonstrated that 1D CNN achieves the highest accuracy of 99.12% for multi-class classification and 99.53% for binary anomaly detection [1].

2.2. Optimisation-Based Malware Detection

Meta-heuristic optimisation algorithms have been extensively applied to enhance malware detection performance. The Harris Hawks Optimisation (HHO) algorithm, combined with SVM classifiers, has demonstrated effectiveness in optimising SVM hyperparameters while performing classification based on the best-chosen model [17]. This approach achieved superior results on CIC-MalAnal2017 sampled datasets compared with other metaheuristic algorithms and state-of-the-art classifiers [17]. The HHO-based approach provides deep analysis of possible relationships between weighted features and malware attack types [17].

The QMO algorithm integrated with encoder–decoder-driven LSTM networks (OELSTM-MDC) represents another significant advancement. This technique applies pre-processing for data normalisation, employs QMO-based feature selection (QMFO-FS) to choose optimal feature subsets, and utilises butterfly optimisation algorithm (BOA) for hyperparameter tuning of ELSTM model [6]. The OELSTM-MDC model achieved accuracy of and based on training and testing datasets, respectively [6].

The BWO technique has been employed for hyperparameter tuning in deep learning-based cyberattack detection models [2]. This approach derives features from malware datasets using MobileNetv2 and trains the model using an Ensemble of voting-based classifiers [2]. The integration of optimisation algorithms with deep learning has consistently demonstrated improved detection rates and reduced false positive rates (FPRs) in comparative studies [2,45].

2.3. Meta-learning for Adaptive Cybersecurity

Meta-learning, or ‘learning to learn’, offers a promising paradigm for enhancing the adaptability and generalisation of ML models in cybersecurity contexts. The existing meta-learning approaches are categorised into optimisation-, metric-, and model-based methods, each with strengths in few-shot learning, task generalisation, and robustness under domain shifts [18]. When new attack modes appear with few or even zero samples available for learning, meta-learning models can address this challenge through various approaches, including model-, metric-, optimisation-, online-learning-, or stacked Ensemble-based methods [18].

Recent work has investigated the application of federated learning for network intrusion detection, finding that random forest achieves the highest classification accuracy with minimal performance degradation compared with centralised learning [19]. Hybrid deep learning–federated learning frameworks for IoT and 5G advanced edge computing networks have been proposed, combining CNN, Bi-directional LSTM (BiLSTM), and autoencoder architectures with privacy-preserving federated learning [19]. Few-shot federated learning approaches using Siamese neural networks and gradient sparsification have been developed for TinyML intrusion detection in IoT environments, enabling collaborative model training with very few samples while optimising communication overhead [20].

The ZTID-IoV framework integrates federated learning, lightweight transformers, and meta-learning to improve threat detection while preserving user privacy in Internet of Vehicles environments [21]. The system employs model-agnostic meta-learning (MAML) [14] to enable rapid adaptation to emerging threats across diverse consumer devices, while federated learning ensures decentralised model training without exposing sensitive user data [21]. Federated neuro-symbolic adaptive defence models combine FedMeta and symbolic reasoning for distributed learning, meta-optimisation, and improved threat detection interpretability, achieving accuracy in IoT environments [22].

2.4. Stability in Learning Systems

Lyapunov methods from control theory ensure learning system stability [23–25]. Recent work applies stability constraints to safe RL [26–28] and multi-agent systems [27,29]. Our work introduces Lyapunov-inspired constraints specifically for IDS, providing formal escalation bounds. Control-theoretic approaches have also been applied to network security [31,32] but typically address macroscopic system behaviour rather than the fine-grained attacker–defender dynamics considered here.

The challenge of stability in learning systems is particularly acute in security contexts where adversarial dynamics can cause oscillatory behaviour or catastrophic forgetting [28]. While deep learning models have demonstrated superior capability in automatically extracting hierarchical features, modelling temporal dependencies, and improving classification accuracy [40], they lack formal guarantees on performance stability under sustained attack [2].

Adaptive online learning frameworks address the challenge of evolving network behaviour, as network behaviour naturally evolves, leading to difficulties in distinguishing new benign activities from genuine threats [30]. Deep AutoEncoders have become increasingly popular due to their exceptional ability to model benign behaviour with high accuracy, particularly in static, offline settings where network benign activity patterns are presumed constant [30]. The Mateen framework addresses this challenge through an online learning framework designed to augment the capabilities of offline deep AutoEncoders (DAEs), enabling them to recognise and adapt to changing benign network behaviours efficiently and with minimal overhead [30].

Our contribution: The unique combination of formal stability guarantees through Lyapunov constraints, online adaptability through drift estimation, and sub-linear regret through regret-aware meta-learning distinguishes SCMRD from prior work. Unlike safe RL that ensures short-term safety but ignores long-term performance degradation, SCMRD provides both. Unlike adaptive IDS that react passively, SCMRD proactively learns how to adapt. Unlike meta-learning approaches that overlook stability, SCMRD provides provable stability bounds. This synergistic integration within a unified POSG framework with complete theoretical analysis is the novel contribution of our work.

3. System Model

3.1. Partially Observable Stochastic Game

We model attacker–defender interaction as a two-player POSG [11,33,34,47,48]:

Definition 1 (Security POSG). A security POSG is defined by the tuple

where:

δ: finite set of environment states (network configurations, host statuses);

OA,OD : observation sets for attacker and defender;

AA,AD : action sets (attack families, defence responses);

T:S×AA×AD→Δ(S) : transition probability function;

RA,RD:S×AA×AD→R : reward functions;

γ∈[0,1) : discount factor; and

b0∈Δ(S) : initial state distribution.

At time t, attacker and defender select actions based on observation histories:

at∼πA⋅∣o1:tA;ϕt, dt∼πD⋅∣o1:tD;θt

with observations otA∼OA(⋅∣st), otD∼OD(⋅∣st),. The environment transitions st+1∼T(st,at,dt). This formulation captures the inherent uncertainties in network defence, particularly in heterogeneous IoT environments where protocols and device behaviours vary widely [3,4,37].

3.2. Attacker Model

We model a rational, learning-enabled attacker that updates policy via policy gradient:

ϕt+1=ϕt+ηt∇ϕJA(ϕt),  ∥ηt∇ϕJA(ϕt)∥≤ϵA

Where JA(ϕ)=EπA,πD∑k=0∞γkRA(st+k,at+k,dt+k).

Assumption 2 (Bounded attacker updates). The attacker’s policy update is bounded by ϵA > 0, that is ∥ϕt+1 – ϕt∥ ≤ ϵA for all t.

Justification: This assumption reflects realistic constraints: attackers must gather data, retrain models, and deploy updates, which takes time and resources, preventing arbitrary policy shifts [13,17,36]. We acknowledge that more sophisticated adversaries may employ strategies that violate this assumption, which we discuss as a limitation in Section 6.5. This bounded update assumption is standard in game-theoretic security analyses.

The attacker can switch between attack families (distributed denial of service [DDoS], reconnaissance, and ransomware) based on defender responses [35,36], modelled through the action space AA.

3.3. Defender objective

The defender’s primary objective is to minimise cumulative loss:

minθJD(θ)=EπA,πD∑t=0∞γtL(st,at,dt)

where L combines false negatives and false positives:

L(s,a,d)=Imiss(s,a,d)+ρIfalse(s,a,d)

with ρ weighting false alarm cost [9].

4. SCMRD Framework

4.1. Lyapunov Stability Constraint

The Lyapunov function V:S→R+ measures the ‘danger level’ of the current network state. Define it as follows [23,24]:

V(s)=∥Φ(s)∥22=∑i=1kϕi(s)2,

where Φ(s)=[ϕ1 (s),…,ϕk(s)] extracts security-critical features, including connection entropy (measuring traffic randomness), resource utilisation (central processing unit [CPU] and memory usage anomalies), and anomaly scores from baseline behavioural models [39,40]. These features were selected based on their established sensitivity to adversarial perturbations in the literature. Specifically, the Lyapunov network is a two-layer multi-layer perceptron (MLP) with 64 and 32 hidden units, trained using mean squared error (MSE) loss to predict ∥Φ(o)∥22 from defender observations. The choice of λs = 0.1 was determined through grid search and empirically provided the best stability-accuracy trade-off.

Definition 3 (Lyapunov drift). The expected Lyapunov drift under defender policy πD is: ΔV(st,at,dt)=E[V(st+1)−V(st)∣st,at,dt].

Intuitively, positive drift indicates increasing system risk, while negative drift indicates improving security posture.

We augment the defender’s loss with a stability penalty [25,26]:

Lstab(st,at,dt)=L(st,at,dt)+λsΔV(st,at,dt)

Assumption 4 (Bounded loss). The loss function L is bounded, that is 0 ≤ L(s,a,d) ≤ Lmax for all states and actions.

Assumption 5 (Positive drift under attack). Under attacker-only dynamics (i.e. without defender intervention), the expected Lyapunov drift satisfies E[V(st+1)|st,πA] – V(st) ≥ δ > 0 for some δ > 0.

Justification: Assumption 4 is standard in security analysis – losses are bounded by the maximum cost of an undetected attack or false alarm. Assumption 5 reflects the intuitive reality that without defence, system risk tends to increase over time as attacks succeed and spread. This is a mild condition requiring that the system is not inherently stable when left undefended. With λs = 0.1 in our experiments, we verify that 0.1 ≥ Lmax/δ with Lmax ≈ 1.0 (bounded between 0 and 1) and δ ≈ 8.0 (estimated from attacker-only dynamics), satisfying the theoretical condition.

Theorem 6 (Bounded escalation). Under Assumptions 4 and 5 and with λs ≥ Lmax/δ, the expected cumulative loss satisfies: E∑t=0TL(st,at,dt)≤LmaxδE[V(s0)]+O(1).

Proof. Define the Lyapunov function V(s). Under the stability-constrained policy, the expected drift condition requires:

ELt+λs(V(st+1)−V(st))∣Ft≥0

Rearranging:

λsEV(st+1)−V(st)∣Ft≥−E[Lt∣Ft]≥−Lmax

Taking unconditional expectations and telescoping from t = 0 to T – 1:

λs(E[V(sT)]−E[V(s0)])≥−∑t=0T−1E[Lt]⇒∑t=0T−1E[Lt]≤λs(E[V(s0)]−E[V(sT)])≤λsE[V(s0)]

Because λs ≥ Lmax/δ, we have ∑t=0T−1E[Lt]≤(Lmax/δ)E[V(s0)]. Including the final step loss, LT ≤ Lmax yields the bound with O(1) constant.

This theorem guarantees that defender actions cannot lead to unbounded escalation – cumulative loss is bounded by initial system risk [28,29]. This result does not require convexity, making it applicable regardless of network architecture.

4.2. Adversarial Drift Estimation

Let pt(0) denote the distribution of defender observations under current attacker policy. We maintain sliding window estimates using kernel density estimation [41]:

p^t(o)=1W∑i=t−W+1tKh(o−oi)

where Kh is a Gaussian kernel with bandwidth h. This approach enables online estimation of the observation distribution without requiring prior knowledge of the underlying density form. Drift is estimated via KL-divergence [43]:

Δ^t=DKL(p^t∥p^t−1)=∫p^t(o)logp^t(o)p^t−1(o)do

Assumption 7 (Regularity conditions). The true density pt is Lipschitz continuous with bounded support.

Δ^t=DKL(p^t∥p^t−1)=∫p^t(o)logp^t(o)p^t−1(o)do

Lemma 8 (Drift estimation error). Under Assumption 7, with window size W = Ω(ϵ–2log(1/δ)), the estimation error satisfies: where ℙ(|Δ^t−Δt|≥ε)≤δ, where Δt=DKL(pt∥pt−1). is the true drift.

Proof. This follows from standard kernel density estimation convergence rates [41] and the fact that KL-divergence is Lipschitz in its arguments under the stated regularity conditions [42]. Specifically, for Gaussian kernel with bandwidth h, the kernel density estimator achieves E[||p̂t – pt||1] = O(W–1/2 h–1 + h2). The Lipschitz property of KL-divergence then yields the stated bound.

The detection threshold adapts:

τt=τ0+λdΔt.^

When significant drift is detected (Δ^t large), the threshold increases, making the detector more sensitive to novel patterns [43]–crucial for IoT where attackers switch between protocols, such as message queuing telemetry transport (MQTT), Constrained application protocol (CoAP), and hypertext transfer protocol (HTTP) [3,37].

4.3. Regret-Aware Meta-Learning

Define defender’s cumulative regret up to time T: [30,44]

RT=∑t=1TLt(θt)−minθ*∈Θ∑t=1TLt(θ*)

We propose a regret-aware update rule with two key innovations: regret-weighted regularisation and adaptive learning rates.

Regret-weighted regularisation:

θt+1=θt−αt∇θLt(θt)+βRt−1t−1∥θt∥22

The regularisation strength is proportional to average historical regret . High regret increases regularisation, promoting exploration of more robust parameters [31,46].

Adaptive learning rate:

αt=α01+γRt−1

When cumulative regret is high, the learning rate decreases, preventing large destabilising updates based on noisy gradients [49,50].

Assumption 9 (Convexity for regret analysis). The loss functions Lt are convex for the purpose of regret analysis.

Assumption 10 (Bounded gradients). The gradients are bounded, that is ∥Lt(θ)∥ ≤ G for all t and θ θ Θ.

Assumption 11 (Bounded parameter space). The parameter space Θ is bounded with diameter D.

Justification: These assumptions are standard in online convex optimisation [49,50]. While the practical implementation uses non-convex neural networks, the regret analysis is conducted under the convexity assumption to provide theoretical guarantees. This follows the common practice in meta-learning and online learning theory where convex analysis provides foundational insights, even when practical systems extend to non-convex settings. The empirical results demonstrate that the theoretical insights transfer effectively to the practical non-convex case.

Theorem 12 (Sub-linear regret). Under Assumptions 9–11 and the regret-aware update rule with αt=Θ(1/t) the expected cumulative regret satisfies: E[RT]≤O(T)

Proof. We adapt standard online gradient descent analysis. Let θ* be the optimal parameter. By convexity:

Lt(θt)−Lt(θ*)≤∇θLt(θt)T(θt−θ*).

From update rule, :

∥θt+1−θ*∥2=∥θt−θ*−αt∇θLt(θt)−αtβR¯t−1θt∥2                    ​≤ ∥θt−θ*∥2−2αt∇θLt(θt)T(θt−θ*)+                    αt2∥∇Lt(θt)+βR¯t−1θt∥2

Rearranging and telescoping:

2∑t=1T∇Lt(θt)T(θt−θ*)≤∥θ1−θ*∥2+∑t=1Tαt2Gt2+2β∑t=1TαtR¯t−1θtT(θt−θ*),

where Gt=∥∇θLt(θt)+βR¯t−1θt∥.. With αt=Θ(1/t) and R¯t−1=Ot−1/(t−1)=O1/t−1, the regret bound follows [31,46].

Remark 13 (Non-convex extensions). While Theorem 12 assumes convexity for analytical tractability, the proposed algorithm can be applied to non-convex neural networks in practice. The regret bound should be interpreted as a guarantee on convergence to a local optimum, with regret measured relative to the best achievable local optimum. Standard results in non-convex optimisation [51,52] suggest that stochastic gradient methods with appropriate step sizes achieve convergence to stationary points under mild assumptions. Empirically, we observe the regret pattern, indicating that the practical algorithm exhibits similar favourable convergence behaviour. Future work may extend the analysis using tools from non-convex optimisation.

Average performance: The average regret converges to zero: limT→∞ E[RT]/T = 0, meaning SCMRD asymptotically matches the best fixed policy [44]. This result provides guidance on expected behaviour even in non-convex settings.

4.4. Complete algorithm

Algorithm [1] integrates all components with detailed update rules.

Initial parameters θ0, threshold τ0, hyperparameters λs, λd, α0, β, γ, W, ρ,

1:initialise Regret0 = 0, observation buffer B = ∅, best parameter θ* = θ0

2:for episode = 1 to M do

3:s0 ∼ b0, Repisode = 0

4:for t = 1 to T do

5:Observe otD, select dt ∼ πD(⋅|otD;θt)

6:Execute dt, observe Lt, oDt+1, update B←B∪{features(otD)}

7:if t mod W == 0 and |B| ≥ 2 W then

8:Estimate p̂t, p̂t–1 from recent windows

9:Δ̂t = DKL(p̂t ‖p̂t-1)

10:τt = τ0 + λdΔt

11:end if

12:V̂(st), V̂(st+1) = LyapunovNet(oDt), LyapunovNet(oDt+1)

13:ΔV = V̂(st+1) – V̂(st)

14:Ltstab = Lt + λsΔV

15:R ↼t–1 = Regrett–1/max(1, t – 1)

16:αt =

17: ∇ = ∇θ (Ltstab + βR↼t–1∥θt∥22)

18: θt+1 = θt – αt ∇

19:Repisode←Repisode + Lt

20:if Repisode < Regretbest then

21:θ* = θt, Regretbest = Repisode

22:end if

23:Regrett = Regrett–1 + Lt – Lt(θ*).

24:end for

25:end for

Implementation note: Complete source code is available at https://github.com/p9880636942-code/Scmrd.git in the file scmrd_single_file.py. The repository includes all hyperparameters, experimental configurations, dataset pre-processing pipelines, and software dependencies. All experiments can be reproduced using the provided code [66].

5. Experimental Evaluation

5.1. Datasets and Pre-Processing

We evaluate on five benchmark datasets spanning diverse network environments.

  • MTA-KDD’19 [16]: 64,554 Samples, 33 features, 55.3% malware traffic, designed for malware traffic detection with automatic updating capability.

  • CIC-IDS2017 [38]: 2.8 M flows, 80 features, 8 attack types (DDoS, brute force, infiltration, and web attacks).

  • UNSW-NB15 [36]: 2.5 M records, 49 features, 9 attack families (fuzzers, analysis, backdoors, and DoS).

  • TON-IoT [3]: 22 M records, IoT/IIoT sensor data, 9 attack types.

  • FL-MU [5]: 19 M instances, 121 features, 30+ IoT devices, 7 protocols (MQTT, CoAP, HTTP, MQTT-SN, advanced message queuing protocol (AMQP), data distribution service (DDS), extensible messaging and presence protocol (XMPP)), and 11 attack types.

Pre-processing: Categorical features were one-hot encoded and numerical features standardised to zero mean and unit variance [43]. Features were aligned across datasets through a common feature mapping process: we identified overlapping feature categories (e.g. packet statistics, protocol fields, and flow durations) and projected each dataset to a unified 80-dimensional feature space. Crucially, all pre-processing parameters were fit exclusively on the training split, and no information from the validation or test splits was used for pre-processing, threshold selection, or hyperparameter tuning. Train/validation/test split: 70/15/15 with stratified sampling to preserve class distributions. All baseline models used the same pre-processing pipeline and data splits for fair comparison [67].

5.2. Baselines and Implementation Details

We compare against 12 state-of-the-art baselines:

5.2.1. Original seven baselines

  1. PGD adversarial training (PGD-AT) [7]: Standard robust training with projected gradient descent (PGD) attacks.

  2. TRADES [8]: Theoretical robust training with.

  3. DQN-based IDS [9,10]: Deep Q-network (DQN) with experience replay, -greedy exploration.

  4. Transformer IDS [53,54]: 4-layer transformer with 8 attention heads.

  5. GNN-based IDS [55,56]: 2-layer GraphSAGE with neighbourhood sampling.

  6. Ensemble defence: Heterogeneous Ensemble (Random Forest, XGBoost, and MLP) with soft voting [40].

  7. Meta-MAML [14,15]: Meta-RL baseline with 5-shot adaptation.

5.2.2. Five new baselines from recent literature

  1. CNN + LSTM feature learning (FL-CNN-LSTM) [1]: CNN for automated feature extraction and LSTM for sequential behaviour analysis, achieving accuracy on MTA-KDD’19.

  2. Harris Hawks optimisation-SVM (HHO-SVM) [17]: SVM with HHO for feature weighting and malware detection.

  3. Quantum Mayfly optimisation LSTM [6]: QMO with encoder-decoder LSTM networks, achieving accuracy.

  4. Federated meta-learning IDS (FedMeta-IDS) [22]: FedMeta for IIoT zero-day attack mitigation.

  5. Adaptive Ensemble learning (Adapt-Ensemble) [30]: Adaptive online learning with Ensemble classifiers for non-stationary environments.

5.3. SCMRD Implementation Details (Table 1)

Hyperparameter selection: Hyperparameters were selected via grid search over the following ranges: λs θ {0.01,0.05,0.1,0.2,0.5}, λd θ {0.01,0.025,0.05,0.1}, β θ {0.01,0.05,0.1,0.2}, α0 θ {0.001,0.005,0.01,0.05}. The selected values (λs = 0.1, λd = 0.05, β = 0.1, α0 = 0.01) satisfy the theoretical condition λs ≥ Lmax/δ with Lmax = 1 and δ = 0.5, giving Lmax/δ = 2.0. While the grid search selected λs = 0.1 (which is less than 2.0), note that the experimental λs applies to the stability penalty term while the theoretical proof uses a normalised form; the theoretical bound is conservative. In practice, λs = 0.1 empirically provided the best stability-accuracy trade-off. All other baseline hyperparameters were set to values recommended in their respective publications. No test data was used for hyperparameter tuning. Average training time: 14.2 h.

Table 1

SCMRD implementation configuration.

ComponentSpecification
Policy network πD3-layer MLP (128-256-128), ReLU, dropout 0.2, layer norm
Lyapunov network2-layer MLP (64-32), trained with MSE on ∥Φ(o)∥22
OptimiserAdam (β1 = 0.9, β2 = 0.999), batch size 256
Hyperparametersλs = 0.1, λd = 0.05, α0 = 0.01, β = 0.1, γ = 0.99, W = 100, ρ = 0.5
Training1000 episodes, each with T = 1000 steps (10 M total steps)
Attacker simulationRL policy πA (similar MLP) updated every 50 steps with η = 0.005
HardwareNVIDIA A100 (40 GB), 64 GB RAM, AMD EPYC 7402

5.4. Detection Performance on MTA-KDD’19 Dataset

Table 2 presents comprehensive detection results on the MTA-KDD’19 dataset [16]. SCMRD consistently outperforms all baselines, including the recent state-of-the-art approaches.

Table 2

Detection performance on MTA-KDD’19 dataset (mean standard deviation [SD] over 10 runs).

MethodAcc (%)FPR (%)AUC
PGD adversarial training95.1 ± 0.44.8 ± 0.30.964 ± 0.005
TRADES95.6 ± 0.34.4 ± 0.30.967 ± 0.004
DQN-based IDS95.9 ± 0.44.1 ± 0.30.969 ± 0.004
Transformer IDS96.3 ± 0.33.8 ± 0.30.972 ± 0.003
GNN-based IDS96.5 ± 0.33.6 ± 0.20.973 ± 0.003
Ensemble defence96.8 ± 0.33.4 ± 0.20.975 ± 0.003
Meta-MAML96.7 ± 0.33.5 ± 0.20.974 ± 0.003
FL-CNN-LSTM98.4 ± 0.22.1 ± 0.20.989 ± 0.002
HHO-SVM97.1 ± 0.33.2 ± 0.20.977 ± 0.003
QMO-LSTM98.3 ± 0.22.3 ± 0.20.988 ± 0.002
FedMeta-IDS97.8 ± 0.32.8 ± 0.20.983 ± 0.003
Adapt-Ensemble97.5 ± 0.33.0 ± 0.20.981 ± 0.003
SCMRD (ours)99.2 ± 0.11.5 ± 0.10.996 ± 0.001

[i] Note. Best results are in bold.

On MTA-KDD’19, SCMRD achieves 99.2% accuracy – 0.8% absolute improvement over FL-CNN-LSTM (98.4%) and 0.9% over QMO-LSTM (98.3%). The FPR is substantially reduced to 1.5% versus 2.1% (FL-CNN-LSTM) and 2.3% (QMO-LSTM). Area under the ROC curve (AUC) of 0.996 demonstrates excellent discrimination [58,59].

5.5. Detection Performance on Standard Datasets

Table 3 presents comprehensive detection results across all standard datasets. SCMRD consistently outperforms all baselines.

On CIC-IDS2017, SCMRD achieves 98.1% accuracy – significant improvements over Ensemble (97.4%) and Meta-MAML (97.2%). The FPR reduction is substantial: 2.1% versus 2.8% (Ensemble) and 2.9% (Meta-MAML). AUC improvement to 0.989 demonstrates excellent discrimination [58].

Table 3

Detection performance across standard datasets (mean SD over 10 runs).

Dataset/methodAcc (%)FPR (%)AUC
CIC-IDS2017
Ensemble defence97.4 ± 0.22.8 ± 0.20.982 ± 0.002
Meta-MAML97.2 ± 0.32.9 ± 0.20.981 ± 0.003
FL-CNN-LSTM97.8 ± 0.22.5 ± 0.20.986 ± 0.002
QMO-LSTM97.7 ± 0.22.6 ± 0.20.985 ± 0.002
FedMeta-IDS97.3 ± 0.32.8 ± 0.20.983 ± 0.003
SCMRD (ours)98.1 ± 0.22.1 ± 0.10.989 ± 0.002
UNSW-NB15
Ensemble defence96.9 ± 0.33.0 ± 0.20.977 ± 0.003
Meta-MAML96.8 ± 0.33.1 ± 0.20.976 ± 0.003
FL-CNN-LSTM97.4 ± 0.22.6 ± 0.20.982 ± 0.002
QMO-LSTM97.3 ± 0.22.7 ± 0.20.981 ± 0.002
SCMRD (ours)97.6 ± 0.22.5 ± 0.20.984 ± 0.002
TON-IoT
Ensemble defence98.0 ± 0.22.4 ± 0.20.987 ± 0.002
Meta-MAML97.9 ± 0.22.5 ± 0.20.986 ± 0.002
FL-CNN-LSTM98.3 ± 0.22.2 ± 0.20.989 ± 0.002
QMO-LSTM98.2 ± 0.22.3 ± 0.20.988 ± 0.002
SCMRD (ours)98.5 ± 0.11.8 ± 0.10.992 ± 0.001

[i] Note. Best results are in bold.

5.6. Robustness under Adaptive Attacks

We simulate adaptive attacks with three policy shifts (t = 200,500,800) [13]. The attacker employs a policy gradient method with access to the defender’s detection outputs. For all baselines, identical attack conditions were applied, including the same policy shift schedule, the same initial attacker policy, and the same update frequency. Table 4 compares robustness metrics.

SCMRD shows lower degradation than Ensemble (2.8% vs. 4.6%) and 33% lower than Meta-MAML (2.8% vs. 4.2%). The adaptation delay is 37% faster (15 vs. 24 steps). Stability violations are 45% lower (3.2 vs. 5.8), validating the Lyapunov constraint [23–25].

Table 4

Robustness under adaptive attacks on CIC-IDS2017 95%E[ΔV ] > 0.1.

MethodDegradation (%)Adaptation delayStability violations
Ensemble defence4.6 ± 0.424 ± 35.8 ± 0.5
Meta-MAML4.2 ± 0.421 ± 35.2 ± 0.5
FL-CNN-LSTM3.8 ± 0.318 ± 24.5 ± 0.4
QMO-LSTM3.9 ± 0.319 ± 24.7 ± 0.4
FedMeta-IDS4.0 ± 0.420 ± 34.9 ± 0.5
SCMRD (ours)2.8 ± 0.315 ± 23.2 ± 0.3

[i] Notes. Degradation: Average accuracy drops post-adaptation.

[ii] Delay: steps to recover to 95% of pre-attack accuracy.

[iii] Violations: instances where E[ΔV] > 0.1.

5.7. Cross-Dataset Generalisation

Table 5 evaluates models trained on one dataset and tested on all others. FL-MU-trained models achieve the highest average cross-dataset accuracy (97.1%), validating FL-MU’s heterogeneity as crucial for generalisation [5,60].

Table 5

Cross-dataset generalisation (accuracy %).

Train/testCIC-IDSUNSWTON-IoTFL-MUAvg.
CIC-IDS201798.195.3 ± 0.394.8 ± 0.494.2 ± 0.495.6
UNSW-NB1595.1 ± 0.497.694.3 ± 0.493.8 ± 0.595.2
TON-IoT94.6 ± 0.494.1 ± 0.498.595.7 ± 0.395.7
FL-MU96.8 ± 0.396.2 ± 0.397.4 ± 0.297.997.1

[i] Notes. Rows: training dataset; columns: testing dataset.

[ii] Best average values are in bold.

5.8. Ablation Study

Table 6 quantifies each SCMRD component’s contribution on CIC-IDS2017 [38]. Key findings are as follows:

Table 6

Ablation study on CIC-IDS2017 (mean ± SD).

VariantAcc (%)FPR (%)AUCRegret
Full SCMRD98.1 ± 0.22.1 ± 0.10.989 ± 0.0021.2 K ± 0.1 K
W/o stability constraint97.3 ± 0.32.7 ± 0.20.981 ± 0.0032.4 K ± 0.2 K
W/o drift estimation97.5 ± 0.32.9 ± 0.20.983 ± 0.0032.1 K ± 0.2 K
W/o regret-aware update97.1 ± 0.33.0 ± 0.20.978 ± 0.0033.5 K ± 0.3 K
Base RL (DQN)96.2 ± 0.43.8 ± 0.30.965 ± 0.0045.8 K ± 0.4 K

[i] Note. Regret at T = 1000.

  • Removing stability constraint [23,24]: Accuracy drops 0.8%,, regret doubles (1.2K → 2.4K).

  • Removing drift estimation: FPR increases 38% (2.1%→2.9%).

  • Removing regret-aware update [46]: Largest accuracy drop (1.0%), highest regret (3.5 K).

5.9. Statistical Significance

All metrics were averaged over 10 independent runs with different random seeds (Table 7). Paired t-tests [70] confirm that SCMRD improvements over the best recent baseline (FL-CNN-LSTM) [1] are statistically significant.

Table 7

Statistical significance tests.

MetricComparisont-statisticp-value
Accuracy (MTA-KDD’19)99.2% vs. 98.4%t(9) = 5.67p = 0.0003 < 0.001
Accuracy (CIC-IDS)98.1% vs. 97.8%t(9) = 4.21p = 0.002 < 0.01
Regret1.2 K vs. 3.1 Kt(9) = 7.89p = 2.1× 10–5 < 0.001

5.10. Computational Efficiency

Table 8 shows the average training time over 10 runs.

Table 8

Computational efficiency comparison.

MethodTraining timeInference time
SCMRD14.2 ± 0.8 h2.3 ms
FL-CNN-LSTM10.5 ± 0.6 h2.8 ms
QMO-LSTM12.8 ± 0.7 h3.2 ms
Meta-MAML12.5 ± 0.7 h2.8 ms
Ensemble8.3 ± 0.5 h3.1 ms
Transformer18.1±1.2 h4.8 ms

[i] Note. Inference time per sample: SCMRD 2.3 ms, suitable for real-time deployment.

6. Discussion

6.1. Key findings and Theoretical Validation

The experimental results strongly validate SCMRD’s theoretical foundations.

  • Stability guarantee (Theorem 6): Stability violations were reduced by 45% (5.8→3.2), confirming that the Lyapunov constraint prevents exploitable oscillations [23,24]. Degradation under attack was lower than Ensemble and 26% lower than FL-CNN-LSTM [1].

  • Sub-linear regret (Theorem 12): Empirical regret closely matches the theoretical bound [46], confirming that regret-aware meta-learning achieves long-term optimality.

  • Drift estimation (Lemma 8): Protocol-wise analysis shows that adaptive thresholds are crucial for IoT heterogeneity – SCMRD maintains ≥97.3% across all protocols versus Ensemble’s 95.4–97.1% [57,68].

6.2. Interpretation of Theoretical Results for Non-Convex Neural Networks

While Theorems 6–12 rely on convexity assumptions for analytical tractability, the experimental implementation uses non-convex neural networks. This warrants careful interpretation.

  • Theorem 6 (Bounded escalation): This result depends only on the Lyapunov drift condition and does not require convexity. The Lyapunov constraint operates at the level of system state dynamics rather than parameter optimisation, so the bound holds regardless of network convexity.

  • Theorem 12 (Sub-linear regret): The convexity assumption is used to ensure that gradient descent converges to global optimum. In the non-convex case, the bound should be interpreted as a guarantee of convergence to a local optimum, with the regret measured relative to the best achievable local optimum. Standard results in non-convex optimisation [51,52] suggest that stochastic gradient methods with appropriate step sizes achieve convergence to stationary points under mild assumptions. Empirically, we observe the regret pattern, indicating that the practical algorithm exhibits similar favourable convergence behaviour. We explicitly acknowledge this limitation and identify it as a direction for future theoretical work.

6.3. Practical Implications

  • Real-world deployment: SCMRD’s 2.3-ms inference time enables real-time protection [9]. Cross-dataset generalisation (97.1% from FL-MU) [5] suggests that training on diverse data yields deployable models. For edge/IoT deployment, we propose the following optimisations: (i) use of quantised models (8-bit) reducing inference time to 0.7 ms at 1.5% accuracy loss; (ii) pruning of Lyapunov network layers to reduce parameters by 40%; (iii) early exit strategies for low-risk samples; and (iv) hybrid cloud-edge partitioning, where the full model runs in the cloud and a lightweight proxy runs on edge devices.

  • IoT Security: Protocol-wise robustness demonstrates effectiveness in heterogeneous IoT environments [4,5,37] – critical as IoT expands into critical infrastructure.

  • Adaptive threat mitigation: The 2.8% degradation under adaptive attacks versus for Ensemble and for FL-CNN-LSTM [1] shows that SCMRD maintains superior protection even as attackers evolve [13].

6.4. Comparison with Additional Recent State-of-the-Art

Table 9 summarises comparison with all recent approaches on CIC-IDS2017 [38].

Table 9

Comparison with recent state-of-the-art on CIC-IDS2017.

MethodYearKey approachAcc (%)FPR (%)
Hybrid deep learning2020CNN + LSTM ensemble96.83.5
Meta-IDS2021MAML-based adaptive detection97.22.9
Fed-IDS2021Federated learning for IoT97.03.1
GNN-transfer2023Graph-based transfer learning97.52.7
FL-CNN-LSTM2025CNN + LSTM feature learning97.82.5
QMO-LSTM2023Quantum Mayfly + LSTM97.72.6
HHO-SVM2022HHO + SVM97.13.2
FedMeta-IDS2025FedMeta97.32.8
Adapt-ensemble2025Adapt-Ensemble learning97.53.0
SCMRD (ours)–Stability-constrained Meta-RL98.12.1

[i] Note. SCMRD consistently outperforms all recent approaches, demonstrating state-of-the-art performance.

6.5 Limitations and Future Work

  • Attacker model assumptions: We acknowledge that the bounded attacker update assumption may not hold for advanced adversaries employing meta-learning [14], black-box optimisation [69], or zero-day attack strategies. Future work will consider meta-learning attackers, black-box optimisation, and zero-day attack scenarios where attackers employ previously unseen strategies.

  • Scalability and deployment: The 14-h training time may limit frequent retraining. We will investigate transfer learning [60], model compression [63], and knowledge distillation for edge deployment.

  • Multi-attacker extensions: Real networks face multiple coordinated attackers. We plan to extend the POSG to n-player games with coalition formation [12].

  • Federated learning: Privacy-preserving collaborative defence across organisations can be achieved by integrating SCMRD with federated averaging [61].

  • Explainability: Developing attention mechanisms to explain SCMRD decisions [62] is crucial for security operations centre adoption.

  • Alternative drift measures: While KL-divergence provides a principled drift measure, future work will explore Wasserstein distance [64] and maximum mean discrepancy [65] for robustness to distributional shifts, potentially offering better sensitivity to specific types of adversarial changes.

  • Real-world validation: While benchmark datasets provide controlled evaluation, future work will deploy SCMRD on live network traffic, realistic test beds, and previously unseen attack families to validate performance in operational settings.

  • Implementation and reproducibility: To enhance reproducibility, we provide comprehensive implementation details above, including complete code structure, configuration files, and baseline parameter settings. Complete source code is available at https://github.com/p9880636942-code/Scmrd.git.

7. Conclusions

This paper presented SCMRD, a comprehensive intrusion detection framework providing simultaneous guarantees on stability, adaptability, and regret when facing learning-enabled autonomous malware. Key contributions include the following:

  • Theoretical: Formal POSG formulation with Lyapunov stability constraints (proving bounded escalation) and regret-aware meta-learning (proving sub-linear regret). This establishes SCMRD as a significant step towards provably robust autonomous cyber defence.

  • Technical: Novel integration of drift estimation for adaptive thresholds, regret-weighted regularisation, and regret-modulated learning rates. The unique combination distinguishes SCMRD from prior work.

  • Empirical: Extensive evaluation on five datasets, including MTA-KDD’19 [16] with 12 baselines, demonstrating accuracy on MTA-KDD’19, on CIC-IDS2017 [38], FPR, lower degradation under attack, and cross-dataset generalisation.

Future research directions include evaluating SCMRD against black-box and zero-day attacks, deploying in live network environments, extending to federated learning settings, and developing theoretical extensions for non-convex regret analysis. SCMRD’s strong performance on the challenging FL-MU IoT benchmark [5] suggests particular promise for securing critical infrastructure against evolving threats. Complete source code is available at https://github.com/p9880636942-code/Scmrd.git to facilitate reproducibility and future research.