Next Article in Journal
An Online Operational Status Evaluation Method for Smart Meters in Power System Based on Cross-Modal Perception Using Large Language Models
Previous Article in Journal
Autonomous Volt/Var Control in Active Distribution Networks via LLM-Driven Dynamic Reward Shaping
Previous Article in Special Issue
CS-Forest: A Cost-Sensitive Explainable Ensemble Framework for Minority Attack Detection in Intrusion Detection Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Reliability-Aware Edge–Cloud Framework for Early Intrusion Detection in IoT Networks

1
School of Mechanical Engineering, Yeungnam University, Gyeongsan 38541, Republic of Korea
2
Department of Information and Communication Engineering, Yeungnam University, Gyeongsan 38541, Republic of Korea
3
School of Computer Science and Engineering, Yeungnam University, Gyeongsan 38541, Republic of Korea
*
Author to whom correspondence should be addressed.
Electronics 2026, 15(16), 3506; https://doi.org/10.3390/electronics15163506
Submission received: 8 July 2026 / Revised: 2 August 2026 / Accepted: 5 August 2026 / Published: 7 August 2026

Abstract

Gateway-resident intrusion detection can act before IoT traffic reaches cloud services, but early decisions are based on incomplete flow prefixes. This paper presents a reliability-aware edge–cloud framework that treats early detection as a sequential routing problem. At each checkpoint, a lightweight gated recurrent unit (GRU) maps causal packet-prefix features to a malicious-probability estimate. Temperature scaling, asymmetric benign and malicious thresholds, and an eight-packet minimum-evidence gate determine whether a flow exits locally, remains under observation, or is sent for cloud refinement. Short and unresolved flows are classified by regularized logistic regression using a compact 97-feature causal representation. The edge model contains 19,777 parameters, and each cloud submission carries 388 bytes of float32 features. The principal evaluation uses all 309 CIC-IoT-2023 PCAP files under four outer PCAP-disjoint folds, with separate edge-training, calibration, cloud-development, and final-test roles. Across 2,286,754 pooled out-of-fold flows with 88.54 % malicious prevalence, the framework resolves 422,190 flows at the edge and routes 1,864,564 for cloud refinement, reducing cloud submissions by 18.46 % . The final policy attains 4.47 % FPR, 1.89 % FNR, 96.82 % balanced accuracy, and 98.76 % F1 score. Observation-budget analysis identifies 32 packets as a corpus-specific compromise, whereas controlled delays in post-eight-packet information expose the limits of short-prefix detection. On the balanced CICIDS2017 test set, in-domain development attains 97.03 % balanced accuracy; zero-shot transfer falls to 86.30 % , and target-calibration-only adaptation improves it to 91.65 % . Ablation results identify the minimum-evidence gate and cloud-refinement stage as the main reliability controls. Benign false alarms, delayed post-eight-packet information, cross-dataset shift, and scenario/file-level labels remain the principal limitations.

1. Introduction

IoT networks are increasingly deployed in industrial systems, healthcare environments, transportation infrastructure, smart homes, and smart-city services. These environments connect heterogeneous devices with different protocol stacks, traffic rates, sensing functions, and resource constraints. Many IoT devices communicate through local gateways before data are transferred to edge or cloud services for storage, monitoring, or application-level processing. In wireless IoT deployments, these gateways often aggregate traffic from devices connected through Wi-Fi, Bluetooth, Zigbee, cellular IoT, or other short-range and wide-area wireless links. This makes gateway-level intrusion detection an important security function in modern wireless communication networks. Although this architecture improves connectivity and manageability, it also exposes a large volume of device-generated traffic to network attacks. Compromised IoT traffic can disrupt service availability, interfere with device communication, and provide an entry point for broader attacks against the surrounding network.
Intrusion detection is therefore an important security function in IoT deployments. However, the placement of the detector is constrained by the operating environment. Many IoT devices have limited computation, memory, energy capacity, and administrative control, making endpoint-resident detection difficult to maintain across heterogeneous device fleets. A network-based detector at an IoT edge gateway is a practical alternative because the gateway can observe traffic from multiple devices, construct flow-level state, and execute detection logic without requiring every endpoint to run a local model. This placement also allows security decisions to be made closer to the traffic source than a cloud-only detector.
Existing IoT intrusion-detection studies have addressed this problem from several directions. Surveyed work includes host-based, network-based, centralized, distributed, and learning-based detection models for IoT and IIoT environments [1,2,3,4]. Other studies place detection near the gateway or edge node to reduce dependence on constrained endpoints and remote cloud processing [5,6,7,8,9]. These approaches support the use of edge-side traffic monitoring, but many of them still treat detection as a single-stage classification or anomaly-scoring task. They generally do not formalize the decision process required when only a partial flow has been observed, and the gateway must choose between early exit, continued observation, and escalation.
A second limitation concerns the traffic representation used for detection. Many network intrusion-detection methods rely on complete-flow features, aggregate statistics, or fixed observation windows. Such representations can be effective when the full flow context is available, but they are less suitable for early detection. Complete-flow processing delays the decision until the flow ends or until post-flow statistics can be computed. Fixed-window processing introduces a different compromise: longer windows may improve feature stability, while shorter windows may reduce delay at the cost of reliability. In both cases, the detector may wait longer than necessary for flows whose class is already distinguishable from early traffic behavior, while still producing unreliable decisions for flows that remain ambiguous.
Early traffic classification has shown that useful information may be present in the first packets or early portion of a connection [10,11,12,13]. Recent work has also examined timely or partial-flow classification for network traffic and intrusion-detection settings [14,15,16]. However, early intrusion detection differs from general traffic classification because the consequences of early decisions are asymmetric. A premature benign decision can miss an attack, whereas a premature malicious decision can increase false alarms and operational disruption. Therefore, early intrusion detection should not be treated only as a faster version of complete-flow classification. It also requires an explicit reliability mechanism that determines when the available evidence is sufficient for an edge decision and when the flow should remain under observation or be escalated.
Edge–cloud intrusion detection provides a natural structure for this problem. The edge gateway can resolve flows that are sufficiently reliable from early evidence, while the cloud can provide additional computation for unresolved cases. Prior cloud–edge and federated intrusion-detection studies have examined collaborative detection, distributed training, communication reduction, and privacy-preserving model development [17,18,19,20]. These studies address important deployment issues, but cloud collaboration alone does not define when a partially observed flow should be handled locally and when it should be escalated. Sending every flow to the cloud increases communication and processing overhead, whereas forcing every flow to exit at the edge can produce unreliable early decisions. A suitable edge–cloud framework therefore needs a selective routing policy tied to calibrated decision reliability.
Calibration and selective classification provide useful principles for this setting. Classifier scores are not necessarily calibrated probabilities, and post hoc calibration is often required before scores can be interpreted as decision probabilities [21,22,23]. Selective classification and reject-option learning further formalize the idea that a classifier may abstain when the expected risk of prediction is too high [24,25]. In IoT intrusion detection, this abstention mechanism can be interpreted operationally as continued edge observation or selective cloud refinement. This perspective motivates a routing policy that uses calibrated malicious probabilities, asymmetric benign and malicious thresholds, and explicit escalation for unresolved flows.
Evaluation reliability is also critical in this setting. Learning-based intrusion detection is sensitive to dataset artifacts, class imbalance, changing attack behavior, preprocessing choices, and train–test contamination [26,27,28]. These concerns become stronger in an edge–cloud early-detection framework because the cloud classifier receives representations produced by the edge model and selected by the routing policy. If the edge model, calibrator, threshold-selection procedure, cloud classifier, and final test set are not separated, the reported benefit of cloud refinement may reflect leakage rather than deployment-relevant generalization. A reliable evaluation protocol must therefore separate training, calibration, threshold selection, cloud fitting, and final testing.
In this paper, we propose a reliability-aware edge–cloud framework for early intrusion detection in IoT networks. The framework operates at an IoT edge gateway and treats early detection as a sequential decision problem over causally available flow-prefix evidence. At each checkpoint, the gateway constructs a packet-prefix representation using only information observed up to that point. The edge model maps the prefix to a calibrated malicious probability. A reliability-aware routing policy then determines whether the flow exits as benign, exits as malicious, remains under observation, or is routed to cloud refinement. Flows that remain unresolved at the final available observation point are escalated to the cloud through a compact causal representation.
This formulation imposes six methodological requirements. First, the edge representation is restricted to causally available packet-prefix evidence, excluding complete-flow and post-flow features during early inference. Second, edge routing is based on calibrated probabilities rather than raw classifier scores. Third, separate benign and malicious thresholds are used to reflect asymmetric early-exit risks. Fourth, an edge exit is permitted only after a minimum amount of packet evidence has been observed, reducing premature decisions on very short flows. Fifth, cloud refinement is selective and applies to unresolved flows, including flows that terminate before the minimum evidence requirement or before the maximum observation budget without satisfying an eligible edge-exit condition. Sixth, preprocessing, edge-model training, probability calibration, threshold selection, cloud fitting, and final testing are separated to reduce leakage between model development and evaluation.
The main contributions of this paper are summarized as follows:
  • We formulate early IoT intrusion detection as a sequential edge-gateway decision problem over causally available flow-prefix evidence.
  • We propose a reliability-aware edge routing policy that combines calibrated malicious probabilities, asymmetric benign and malicious exit thresholds, and a minimum-evidence condition for local edge exits.
  • We introduce a selective edge–cloud refinement mechanism in which only unresolved flows are escalated to a cloud classifier through a compact representation.
  • We define a leakage-aware training and calibration protocol in which edge-model training, probability calibration, threshold selection, cloud-refinement fitting, and final testing are performed as distinct stages.
  • We implement the framework with a lightweight edge–cloud model comprising a single-layer GRU prefix encoder, temperature-scaling calibration, and a logistic-regression cloud-refinement stage, and we report model-size and communication-load proxies relevant to resource-constrained gateway deployment.
  • We evaluate the complete 309-PCAP CIC-IoT-2023 collection under four outer PCAP-disjoint folds and examine observation-budget sensitivity, delayed post-eight-packet information, low-FPR operation, deployment-prior effects, sliding-window threshold updates, and attack-specific performance.
  • We compare the GRU implementation with matched causal CNN, LSTM-attention, temporal-convolutional, and XGBoost edge models and assess in-domain, zero-shot, and target-calibration-only performance on CICIDS2017.
The remainder of this paper is organized as follows. Section 2 reviews related work on IoT intrusion detection, early traffic classification, edge–cloud security analytics, calibrated decision-making, and evaluation reliability. Section 3 presents the proposed framework. Section 4 describes the experimental methodology. Section 5 reports the evaluation results. Section 6 discusses on-device deployment at the edge gateway and cross-domain applicability. Section 7 concludes the paper.

2. Related Work

2.1. IoT Intrusion Detection and Edge-Based Security Analytics

Learning-based intrusion detection for IoT networks has been studied across host-based, network-based, centralized, and distributed settings. Existing surveys emphasize that IoT traffic is heterogeneous, device resources are limited, and deployment conditions differ from conventional enterprise networks [1,2,3]. Industrial IoT settings add requirements for availability, latency, and operational continuity, which motivates detection methods that can operate near the monitored process rather than only in a remote cloud service [4].
A common response to endpoint resource constraints is to place detection at an IoT gateway, edge node, or nearby monitoring point. IoT-KEEPER performs online traffic analysis at the edge to identify malicious IoT activity [5]. Kitsune shows that online network intrusion detection can be implemented through an ensemble of autoencoders over traffic features [6]. Other IoT-oriented work has considered distributed deep learning, consumer IoT DDoS detection, and device-specific botnet detection using network behavior [7,8,9]. These studies justify edge or gateway-side monitoring and provide useful evidence for detection near the traffic source. The present study focuses on a different operational question: how an edge gateway should act when only a partial flow has been observed and the available evidence may or may not be sufficient for a reliable decision. In this setting, the gateway must choose between local exit, continued observation, and escalation for additional processing.

2.2. Early and Partial-Flow Intrusion Detection

Early traffic classification has a longer history in network measurement and application identification. Bernaille et al. showed that traffic can be classified using the first packets of a connection, and later work extended this idea to encrypted application recognition [10,11]. Dainotti et al. studied early network traffic classification through classifier combination, while Gupta et al. revisited early application identification using flow-level evidence [12,13]. Related work has also considered timely classification using probabilistic models and compact early-flow representations for encrypted traffic [14,15]. More recent work has examined partial-flow feature extraction for faster network intrusion detection [16].
These studies support the central premise that useful decisions may be possible before complete flow observation. However, early traffic classification and early intrusion detection are not identical operational problems. Application identification can often tolerate a delayed or uncertain class label, whereas intrusion detection must manage asymmetric error costs: premature benign exits can miss attacks, while premature malicious exits can increase false alarms. The proposed framework is therefore positioned around causal packet-prefix evidence and sequential routing decisions rather than around complete-flow feature extraction or a single early-prediction checkpoint.

2.3. Edge–Cloud Intrusion Detection

Cloud, edge, and federated architectures have also been proposed for IoT and cyber–physical intrusion detection. Yang et al. study efficient intrusion detection for IoT networks using cloud–edge collaboration [17]. Federated learning has been used to distribute intrusion-detection training across IoT, agricultural IoT, industrial cyber–physical, and vehicular edge environments [18,19,20]. These studies address important deployment concerns, including where models are trained, how updates are aggregated, and how communication or privacy constraints affect collaborative detection.
The edge–cloud division in the framework is narrower and more decision-oriented. The edge is not only a local feature extractor or a participant in distributed training; it is the first decision point for each flow prefix. The cloud is not used for all traffic or only for global aggregation. Instead, it is invoked selectively for unresolved flows that remain insufficiently reliable under the edge policy. This distinction matters because the cloud training data, cloud inputs, and final evaluation protocol must reflect the same unresolved-flow routing rule used at deployment.
Recent studies have also examined lightweight and collaborative IDS designs for edge-enabled IoT systems. Wardana et al. combine federated learning, trust management, and privacy-preserving coordination in a hierarchical edge–fog–cloud architecture [29], whereas Nedungadi et al. evaluate a lightweight multimodal LGBM–XGBoost ensemble on Raspberry Pi hardware [30]. Although their architectures and evaluation settings differ from the present framework, both studies reinforce the need to consider detection performance together with model complexity, communication requirements, and edge-resource use.

2.4. Calibration, Selective Classification, and Reliability-Aware Decisions

The framework relies on calibrated probabilities and selective routing rather than on raw classifier scores alone. Classical probability-calibration work shows that classifier scores often require post-processing before they can be interpreted as reliable probabilities [21,22]. Modern neural networks can also be miscalibrated, and temperature scaling is a widely used post hoc calibration method [23]. These observations are relevant to early intrusion detection because threshold-based exits depend on probability estimates, not only on ranking quality.
The decision structure also relates to classification with a reject option and selective classification. Reject-option learning formalizes the idea that a classifier may abstain when the prediction is insufficiently reliable [24]. Selective classification studies the risk–coverage trade-off obtained by predicting only on examples that satisfy a confidence condition [25]. The framework adapts this general idea to an edge-gateway intrusion-detection setting with four possible outcomes at each checkpoint: early benign exit, early malicious exit, continued observation, or cloud refinement. The use of separate benign and malicious thresholds reflects the asymmetric consequences of missed attacks and false alarms, rather than treating abstention as a single undifferentiated reject state.
Selective feature fusion has also been studied with lightweight state-space models in other detection domains. Wang et al. use mask-guided Mamba fusion to regulate cross-modal information exchange in visible–infrared vehicle detection [31]. The sensing task and masking mechanism differ from packet-prefix intrusion detection, but the study provides a relevant example of lightweight temporal fusion under selective evidence integration.

2.5. Evaluation Reliability and Dataset Considerations

Evaluation reliability remains a recurring concern in learning-based intrusion detection. Sommer and Paxson argue that intrusion detection differs from many standard machine-learning settings because operational deployment, class imbalance, and changing adversarial behavior complicate evaluation [26]. Ring et al. survey network-based intrusion-detection datasets and document differences in traffic sources, attack coverage, and labeling practices [27]. Dataset-specific analyses also show that experimental conclusions can be distorted by artifacts, leakage, or inconsistent preprocessing; the CICIDS2017 case study is one example of such concerns [28].
These issues are directly relevant to an edge–cloud early-detection framework. If the edge model, probability calibrator, threshold-selection procedure, cloud classifier, and final test set are not separated, the reported benefit of cloud refinement can reflect reuse of information rather than deployment-relevant generalization. In the proposed framework, the cloud stage is therefore fitted using representations that are generated out of sample, such as out-of-fold edge predictions or a separate development partition.
The present study is positioned around a specific operational problem: an IoT edge gateway observes only a partial flow and must decide whether the available evidence is sufficient for a local decision, whether the flow should remain under observation, or whether it should be escalated for cloud refinement. This framing differs from complete-flow IDS, fixed-window IDS, cloud-assisted IDS, and general selective classification because the routing action is tied to causally available packet-prefix evidence at each checkpoint. The proposed framework formalizes this sequential routing problem and defines the associated representation, calibration, escalation, and leakage-control requirements.

3. Proposed Method

This section presents the proposed framework for reliability-aware early intrusion detection in edge–cloud IoT networks. The section first describes the deployment setting and framework workflow, and then formalizes the causal flow representation, edge scoring model, routing policy, cloud-refinement stage, and calibration protocol.

3.1. Overview of the Proposed Framework

The proposed framework is designed for network-based intrusion detection in IoT deployments where device traffic is observed at an edge gateway and unresolved cases can be refined by a cloud service. The framework consists of three logical layers: the IoT device layer, the edge-gateway layer, and the cloud-refinement layer.
Figure 1 summarizes the proposed reliability-aware edge–cloud IDS workflow. The framework is organized around three connected layers. The IoT device layer provides heterogeneous packet streams from devices such as cameras, smart meters, sensors, medical monitors, and industrial devices. The edge-gateway layer is the primary inference and routing point: it reconstructs bidirectional flows, extracts causal packet prefixes at predefined checkpoints, computes calibrated malicious-probability estimates, and applies the reliability-aware routing policy. The cloud-refinement layer is invoked only for flows that cannot be resolved reliably at the edge.
  • Step 1: Packet observation at the edge gateway. IoT devices transmit traffic through the edge gateway. The gateway observes packet-header and timing information from heterogeneous device streams, but the devices themselves are treated only as traffic sources. The framework therefore does not require endpoint-resident IDS models or device-side instrumentation.
  • Step 2: Bidirectional flow construction. The gateway groups packets into bidirectional flows using normalized transport-level flow identifiers. Packets from the forward and reverse directions of the same communication are assigned to one flow state. Raw addresses are used only for flow construction and flow verification, not as classifier inputs.
  • Step 3: Causal prefix extraction. At each checkpoint, the gateway constructs the currently observed prefix of each active flow. Only packets available up to that checkpoint are used. Complete-flow duration, final packet count, post-flow statistics, labels, scenario identifiers, file identifiers, and other non-causal fields are excluded from the representation.
  • Step 4: Edge scoring and probability calibration. The causal prefix is processed by the edge encoder and classifier head to produce an uncalibrated malicious score. This score is converted into a calibrated malicious probability using the calibration mapping. The calibrated probability is the quantity used by the routing policy, rather than the raw classifier score.
  • Step 5: Reliability-aware routing. At each checkpoint, the routing policy applies the minimum-evidence condition together with asymmetric benign and malicious thresholds. If the prefix contains sufficient evidence and the calibrated probability falls below the benign threshold, the flow exits locally as benign. If the prefix contains sufficient evidence and the calibrated probability exceeds the malicious threshold, the flow exits locally as malicious. These two edge-exit decisions are therefore allowed only when both the evidence gate and the calibrated threshold condition are satisfied.
  • Step 6: Continued observation for unresolved active flows. If an active flow has not yet reached the final available observation point and does not satisfy either edge-exit condition, the gateway keeps the flow under observation until the next checkpoint. This loop prevents uncertain prefixes from being forced into premature benign or malicious decisions.
  • Step 7: Selective cloud refinement and final decision. A flow is escalated to the cloud only when it remains unresolved at the final available observation point or when it terminates before satisfying the minimum-evidence requirement. For such flows, the gateway sends a compact escalation representation to the cloud classifier. The cloud classifier then produces the final benign or malicious decision for the unresolved case.
This workflow defines the framework as a sequential reliability-control mechanism rather than as a single-stage classifier. The edge stage resolves only those flows that satisfy calibrated local-exit conditions, while short or uncertain flows are either observed further or selectively escalated. The following subsections formalize the causal representation, edge scoring and calibration procedure, routing policy, cloud-refinement representation, and leakage-control protocol.

3.2. Operational Assumptions and Design Rationale

The framework assumes that packet headers are observable at the IoT edge gateway and that the gateway and cloud service are trusted components of the deployment. Edge–cloud communication is assumed to be protected by the operational infrastructure. Payload-content inspection is not required; the method relies on packet-level metadata and prefix statistics available at the gateway.
The design rationale is based on three considerations. First, complete-flow observation and fixed-window processing can delay decisions for flows whose class is already distinguishable from early evidence. Second, forwarding all flows to the cloud increases communication and processing overhead. Third, early edge decisions require reliability control because premature benign or malicious exits can introduce operational risk.
The framework addresses these considerations through a sequential routing formulation in which prefix-based edge scoring, calibrated reliability-aware routing, and selective cloud refinement are defined as parts of the same decision process. The gateway exits early only when the calibrated score satisfies the benign or malicious decision threshold, and the prefix contains enough packet evidence for a local decision. Otherwise, the flow remains under observation until the next checkpoint or is routed to the cloud at the final available observation point. Offline model training, probability calibration, threshold selection, and cloud-refinement fitting are separated from online inference to avoid tuning the decision process on final test data (Table 1).

3.3. Causal Packet-Prefix Representation

Packets are grouped into bidirectional flows using the canonical five-tuple consisting of source IP address, destination IP address, source port, destination port, and protocol. Packets in the reverse communication direction are mapped to the same bidirectional flow as the corresponding forward packets. Raw IP addresses are used only for flow construction and are excluded from classifier inputs.
A flow i is represented as an ordered packet-feature sequence
F i = { x i , 1 , x i , 2 , , x i , n i } .
At checkpoint t, the edge model may access only the observed prefix
F i , 1 : t = { x i , 1 , , x i , t } , t C .
The representation is causal if every feature transformation at checkpoint t can be computed from the observed prefix alone:
ϕ t ( F i ) = ϕ t ( F i , 1 : t ) .
Thus, features at t cannot depend on packets that arrive after t. Equations (1)–(3) define the admissible causal input at each checkpoint. The edge model in the next subsection can therefore use only packet features and prefix statistics computable from F i , 1 : t .
The label associated with a flow is interpreted at the complete-flow level. An early prediction at checkpoint t therefore estimates the eventual flow label Y i from partial evidence; it does not assert that the malicious behavior has necessarily appeared before or at packet t. This distinction is important for early intrusion detection because a malicious flow may contain benign-looking prefix traffic before the attack behavior becomes observable. For this reason, the proposed framework records the decision checkpoint together with the decision label and calibrated score. The evaluation protocol should report exit-checkpoint distributions, especially for malicious flows, so that early exits can be interpreted with respect to the amount of observed evidence.
The packet-level representation may include relative arrival time, inter-arrival time, packet direction, packet length, payload length as a numeric length field, time to live or hop limit, protocol, TCP flags, and port category. Prefix statistics may also be used when they are computed only from packets observed so far. The representation excludes raw IP classifier inputs, payload content, dataset identifiers, file identifiers, other non-causal metadata, labels or label-derived fields, complete-flow duration, final packet count, post-flow aggregate statistics, and any other field unavailable at the current checkpoint.

3.4. Edge Prefix Scoring and Calibration

At each checkpoint, the edge model maps the observed prefix to a causal hidden representation, a binary score, and a calibrated malicious probability:
h i , t = E θ ( F i , 1 : t ) , z i , t = f θ ( h i , t ) , q i , t = C ψ ( z i , t ) .
Here, E θ is a causal sequence encoder, f θ is a classifier head, C ψ is the calibration mapping, and q i , t [ 0 , 1 ] estimates the probability that the eventual flow label is malicious given only the observed prefix. Equation (4) maps each causal prefix in Equation (2) to the calibrated malicious probability used by the routing policy. The notation uses a generic calibration mapping; the experimental protocol may instantiate it as a shared calibrator or as checkpoint-specific calibrators depending on calibration performance on held-out calibration data.
The stopping policy is independent of the particular causal encoder. Compact recurrent, convolutional, or temporal-convolutional encoders are compatible with this formulation, provided they consume only F i , 1 : t . The experimental instantiation specifies the encoder family and configuration under a common evaluation protocol. The formulation does not require an attention module; attention-based encoding can be evaluated as an alternative causal architecture under the same protocol.

3.5. Reliability-Aware Edge Decision and Routing Policy

The calibrated probability q i , t supports a reliability-aware stopping policy. Let τ B and τ M denote benign-exit and malicious-exit thresholds satisfying
τ B < 0.5 < τ M .
Let m min denote the minimum number of observed packets required before a local edge exit is permitted. This condition prevents the gateway from assigning a final benign or malicious edge decision when the prefix is too short to satisfy the evidence requirement, even if the calibrated probability is near an exit threshold.
Let L ¯ i = min ( n i , L max ) denote the final available observation point for flow i, where n i is the observed flow length when the flow terminates naturally. The evaluated checkpoint set for flow i is
C i = { t C : t < L ¯ i } { L ¯ i } .
This definition allows the policy to handle both flows that reach the maximum observation budget and flows that terminate before L max . For t C i , the policy is
π ( q i , t , t ) = benign , t m min , q i , t τ B , malicious , t m min , q i , t τ M , continue , t < L ¯ i , t < m min or τ B < q i , t < τ M , cloud , t = L ¯ i , t < m min or τ B < q i , t < τ M .
Using the calibrated probability from Equation (4), the routing policy in Equation (5) determines whether the current prefix is sufficient for an edge decision or whether additional observation or cloud refinement is required. A local benign or malicious exit requires both calibrated threshold support and the minimum evidence condition t m min . Before L ¯ i , a flow that does not satisfy an eligible exit condition remains under observation. At L ¯ i , a flow is routed to cloud refinement if it remains within the uncertain probability band or if it terminates before the minimum evidence requirement is met. Thus, very short unresolved flows are escalated rather than discarded or assigned a default benign label.
Algorithm 1 applies Equation (5) sequentially over the checkpoint set for one flow.
Algorithm 1. Online inference for one flow
Require: flow packet stream; checkpoint set C ; maximum observation budget L max ; minimum evidence m min ; encoder E θ ; classifier head f θ ; calibrator C ψ ; thresholds τ B , τ M ; cloud classifier g ϕ .
Ensure: decision label; route; decision checkpoint; calibrated score; cloud decision when escalated.
1:Initialize flow state and prefix buffer.
2:Set L ¯ i as the earlier of L max and the natural end of the flow.
3:Set C i = { t C : t < L ¯ i } { L ¯ i } .
4:for each checkpoint t C i  do
5:     Update F 1 : t using packets observed through t.
6:     Compute h t = E θ ( F 1 : t ) .
7:     Compute z t = f θ ( h t ) .
8:     Compute q t = C ψ ( z t ) .
9:     if  t m min and q t τ B  then
10:      return benign edge decision, route, checkpoint t, and score q t .
11:     end if
12:     if  t m min and q t τ M  then
13:      return malicious edge decision, route, checkpoint t, and score q t .
14:     end if
15:     if  t < L ¯ i  then continue observing.
16:end for
17:Construct the cloud escalation representation r as defined in Section 3.6.
18:Compute Y ^ c = g ϕ ( r ) .
19:return cloud decision Y ^ c , route, checkpoint L ¯ i , and score q L ¯ i .
Flows reach the cloud route when the final available prefix is either too short for an eligible edge exit or remains within the uncertain calibrated-probability interval. The compact escalation representation r is defined in the next subsection.

3.6. Selective Cloud Refinement

Only flows satisfying π ( q i , L ¯ i , L ¯ i ) = cloud are escalated. This includes flows that remain uncertain at the final available observation point and flows whose final observed prefix is shorter than the minimum evidence requirement. The cloud therefore receives selected cases that are not eligible for a reliable edge exit rather than a random sample of all traffic. For flows assigned to the cloud route by Equation (5), the gateway constructs the compact causal representation
r i = h i , L ¯ i , q i , L ¯ i , s i , L ¯ i ,
where h i , L ¯ i is the final available causal prefix embedding, q i , L ¯ i is the calibrated malicious probability at the final available observation point, and s i , L ¯ i contains prefix-only statistics. Equation (6) reuses the final prefix embedding and calibrated probability from Equation (4), together with prefix-only summary statistics.
Candidate elements of s i , L ¯ i include forward packet count, backward packet count, packet-length mean and variance, inter-arrival-time mean and variance, TCP-flag counts, and direction ratio, all computed from packets observed up to L ¯ i . The cloud prediction is
Y ^ i c = g ϕ ( r i ) .
Equation (7) gives the cloud decision for escalated flows. In the experimental instantiation, g ϕ is implemented as a binary classifier over the compact escalation representation; the selected protocol uses logistic regression to avoid unnecessary model complexity at the cloud stage. The representation excludes raw IP addresses, payload contents, dataset identifiers, file identifiers, and unavailable complete-flow statistics. Cloud-stage metrics are conditional on escalation because the escalated subset is selected by the stopping policy.

3.7. Training, Calibration, and Leakage Control

The methodology separates preprocessing, edge-model training, probability calibration, threshold selection, cloud-refinement fitting, and final testing. Preprocessing transformations that learn parameters from data are fitted on training data only and then applied without refitting. The edge model is fitted on training data, the calibration mapping C ψ is fitted on held-out calibration data, and the thresholds τ B and τ M are selected on calibration data. The test partition is reserved for final assessment and is excluded from training, calibration, threshold selection, cloud fitting, and architecture selection.
For a candidate threshold pair ( τ B , τ M ) , let t i ( τ B , τ M ) denote the checkpoint at which flow i first exits at the edge or reaches its final available observation point L ¯ i . For a calibration set D cal , edge coverage can be estimated as
Cov ( τ B , τ M ) = 1 | D cal | i D cal I π q i , t i ( τ B , τ M ) , t i ( τ B , τ M ) { benign , malicious } .
The two conditional risks are
R B ( τ B , τ M ) = P Y i = 1 π q i , t i ( τ B , τ M ) , t i ( τ B , τ M ) = benign , R M ( τ B , τ M ) = P Y i = 0 π q i , t i ( τ B , τ M ) , t i ( τ B , τ M ) = malicious .
Threshold selection is posed as a risk-constrained calibration problem:
max τ B , τ M Cov ( τ B , τ M ) subject to R B ( τ B , τ M ) ϵ B , R M ( τ B , τ M ) ϵ M .
For a fixed minimum-evidence value m min , the thresholds used in Equation (5) are selected on the calibration partition. Equation (8) estimates the resulting edge coverage, Equation (9) defines the corresponding benign- and malicious-exit risks, and Equation (10) selects the feasible threshold pair with maximum calibration-set coverage. The realized values on held-out test data are reported separately. The parameters ϵ B and ϵ M are calibration-set operating targets rather than distribution-free bounds, and τ B and τ M are not tuned on test data.
Algorithm 2 implements Equation (10) over a candidate threshold grid.
Algorithm 2. Risk-constrained threshold selection on calibration data
Require: calibration predictions { q i , t } ; labels { Y i } ; checkpoint outcomes; minimum evidence m min ; candidate threshold grid G ; target risks ϵ B , ϵ M .
Ensure: selected thresholds τ B , τ M , or an infeasibility status when no threshold pair satisfies the operating targets.
1:Initialize feasible set S .
2:for each  ( τ B , τ M ) G with τ B < 0.5 < τ M  do
3:     Apply π ( q i , t , t ) to calibration predictions.
4:     Compute Cov ( τ B , τ M ) .
5:      Compute R B ( τ B , τ M ) .
6:      Compute R M ( τ B , τ M ) .
7:      if  R B ( τ B , τ M ) ϵ B and R M ( τ B , τ M ) ϵ M  then
8:      Add ( τ B , τ M ) to S .
9:     end if
10:end for
11:if  S =   then
12:     return no feasible threshold pair for the chosen operating targets.
13:else
14:     Select ( τ B , τ M ) S with maximum calibration-set coverage.
15:     return  τ B , τ M .
16:end if
If Algorithm 2 returns no feasible threshold pair, the requested operating targets are treated as not attainable on the calibration partition. In that case, the framework does not force early edge exits under violated calibration constraints. The deployment must either use a conservative fallback in which uncertain flows are routed to cloud refinement, or select relaxed operating targets that are explicitly reported.
Cloud fitting requires additional leakage control because the cloud model receives edge-generated representations from selected flows. To prevent selection leakage, cloud-training representations are generated out of sample, either through out-of-fold edge prediction or through a separate development partition. Consequently, h i , L ¯ i , q i , L ¯ i , and routing outcomes used for cloud fitting reflect deployed inference behavior rather than in-sample edge outputs.

3.8. Computational Outputs and Method Scope

The proposed framework has six structural properties. First, all edge predictions are made from causal packet prefixes. Second, the observation budget and checkpoint set are configurable experimental design parameters rather than fixed assumptions of the method. Third, early exits are controlled by calibrated risk-aware thresholds and a minimum-evidence condition. Fourth, cloud refinement is selective and applies only to flows assigned to the cloud route. Fifth, cloud fitting uses leakage-aware edge representations. Sixth, the methodology can be instantiated with any causal encoder that satisfies the prefix constraint.
The formulation produces detection decisions, route metadata, checkpoints, calibrated probabilities, and cloud outcomes for escalated flows. These outputs support alerts and logs. Response enforcement, endpoint-resident deployment, online model adaptation, and coordinated multi-flow inference are separate extensions. Generalization to attack families absent from training is an evaluation setting rather than an inherent consequence of the formulation.

4. Experimental Setup and Evaluation Protocol

The evaluation reproduces the operating conditions defined in Section 3 while keeping model development separate from final testing. Because the gateway acts on incomplete flow prefixes, the experiments begin from packet-level traffic reconstructed into bidirectional flows; complete-flow feature tables are excluded from model inputs. The protocol combines a full-corpus CIC-IoT-2023 evaluation under outer PCAP-disjoint folds with observation-horizon analysis, alternative operating points, matched edge-model comparisons, and external validation on CICIDS2017.

4.1. Full CIC-IoT-2023 Corpus and Sampling

The principal evaluation uses all 309 PCAP files in CIC-IoT-2023 [32]: four benign captures and 305 attack captures covering 33 attack types in seven families. Packet parsing and bidirectional flow reconstruction yield 81,253,897 flows, comprising 261,955 benign flows and 80,991,942 attack-labeled flows.
Each reconstructed flow inherits the label of its capture scenario or source file. The public release does not include a bidirectional five-tuple label table that supports exact flow-level matching; the CIC-IoT-2023 labels are therefore treated as scenario-level rather than exact packet- or flow-level ground truth. Raw addresses, file names, capture and scenario identifiers, payload content, and label-derived fields are excluded from model inputs.
All benign flows are retained. Attack-labeled flows are sampled deterministically at approximately 2.5% within PCAP and attack-type strata. When the proportional sample for a capture is below 200 flows, 200 flows are retained if available; a capture containing fewer than 200 flows contributes all available flows. Sampling is performed after flow reconstruction and PCAP assignment, and every selected flow remains intact with all of its packets and prefixes. The resulting modeling corpus contains 2,286,754 flows drawn from all 309 PCAPs (Table 2).
Appendix A summarizes the retained support for all 33 attack types and the numbers of flows available at the observation budgets used in the sensitivity analysis.

4.2. Flow Reconstruction and Prefix Generation

Packets are ordered by timestamp and grouped into bidirectional flows using a normalized five-tuple of source address, destination address, source port, destination port, and protocol. Reverse-direction packets are assigned to the same normalized flow as the corresponding forward packets. Raw endpoint addresses are retained only for flow construction and duplicate checking and are not used as classifier inputs.
For a reconstructed flow F i with packet count n i , the principal edge policy evaluates
C = { 2 , 4 , 8 , 16 , 32 }
under the maximum observation budget
L max = 32 .
The final available checkpoint for a shorter flow is
L ¯ i = min ( n i , L max ) .
Support through 64 packets is retained for the observation-budget sensitivity analysis, but the principal policy remains limited to 32 packets.
Local edge exits are permitted only after the minimum-evidence requirement
m min = 8
has been met. Flows with n i < 8 are consequently edge-ineligible and are routed to the cloud. The evaluation reports edge-eligible and edge-ineligible populations separately because short flows constitute a large fraction of the corpus (Table 3).

4.3. Observation-Budget and Post-Eight-Packet Delay Evaluation

The selected observation horizon is examined using matched configurations with L max = 16 , 32, and 64. Their checkpoint sets are { 2 , 4 , 8 , 16 } , { 2 , 4 , 8 , 16 , 32 } , and { 2 , 4 , 8 , 16 , 32 , 64 } , respectively. Each configuration is trained, calibrated, and evaluated independently in the same four outer PCAP-disjoint folds, while the encoder architecture, hidden dimension, causal feature schema, minimum-evidence requirement, threshold-selection rule, and cloud-model class and hyperparameters are held fixed. The 16- and 64-packet configurations are used only for sensitivity analysis and do not alter the principal 32-packet policy.
The comparison reports FPR, FNR, balanced accuracy, edge- and cloud-route shares, the mean edge-exit checkpoint, and the mean number of packets processed at the edge per flow. The final measure includes flows that terminate naturally before the maximum budget and flows that exit at an earlier checkpoint.
Sensitivity to later-arriving post-eight-packet information is assessed on the common set of 39,880 malicious flows containing at least 64 packets. Packets 1–8 remain unchanged. For d { 4 , 8 , 16 , 32 } , the feature vector observed at packet 8 is repeated for the next d positions, after which the original sequence beginning at packet 9 is shifted by d positions and truncated at the evaluated horizon. Model parameters, calibration temperatures, and thresholds remain fixed. This controlled perturbation delays all information after packet 8 while preserving the recorded prefix through the minimum-evidence gate; it does not identify which shifted features carry attack evidence.

4.4. Low-FPR Operating Points and Deployment-Prior Analysis

The principal operating point maximizes reliable edge exits subject to the calibrated benign- and malicious-exit risk targets. Three additional policies examine settings in which benign false alarms carry greater operational cost. Within each outer fold, the most permissive asymmetric threshold pair is selected subject to calibration-set FPR limits of 2 % , 1 % , or 0.5 % . The edge encoder, temperature scaler, minimum-evidence gate, and cloud model remain fixed across these operating points.
Deployment-prior sensitivity is evaluated by applying the measured class-conditional FPR and FNR to assumed malicious-flow prevalences of 10 % , 1 % , 0.1 % , and 0.01 % . Precision and alert counts are then reported per one million flows. This calculation changes only the assumed class prior; the fitted models and pooled out-of-fold confusion matrix remain unchanged.

4.5. Sliding-Window Threshold Updating

A secondary experiment evaluates supervised threshold adaptation under chronological traffic drift. The replay contains all 261,955 pooled benign flows and a deterministic attack-stratified sample of 29,106 malicious flows, producing a 10 % malicious-flow prevalence across eight ordered traffic blocks. Each flow remains associated with the outer-fold system that generated its out-of-fold prediction. The edge encoder, temperature scaler, and cloud classifier of each fold remain fixed; only that fold’s benign and malicious exit thresholds are updated.
Threshold updating is performed separately for the four fold-specific systems. Within each fold, the procedure starts from that system’s static 1 % -FPR threshold pair, uses the most recent 50,000 adjudicated outcomes assigned to the fold, updates after every 10,000  fold-specific flows, and assumes a 10,000 -flow feedback delay. An update requires at least 40,000 benign and 2000 malicious labeled examples in the current window. Candidate threshold pairs are evaluated on the same 0.01 grid used for static threshold selection, with each threshold restricted to a maximum change of 0.02 from its preceding value. For every candidate pair, the complete sequential routing policy is reapplied to the current window.
A candidate pair is feasible when τ B < 0.5 < τ M , the 95 % Wilson upper bound on fold-specific FPR is at most 1.25 % , and the empirical fold-specific FNR is at most 6 % . Among the feasible pairs, the pair with the largest edge-exit share is selected. Ties are resolved by the smallest total threshold movement, followed by lower empirical FNR and then lower empirical FPR. The preceding threshold pair is retained when the class-support requirements are not met, or no feasible candidate exists. Predictions from the four fold-specific replay streams are pooled only for the aggregate results reported in Section 5.12. Because the procedure uses delayed adjudicated labels, it represents supervised threshold adaptation rather than unsupervised drift detection.

4.6. Feature Schema and Leakage Controls

All model inputs are restricted to information available at packet arrival or within the causal prefix observed so far. Packet-level features include relative packet time, inter-arrival time, direction, packet length, numeric payload length, protocol indicators, TCP-flag indicators, and port category. Prefix summaries comprise observed packet counts, direction-specific counts, packet-length and inter-arrival statistics, TCP-flag and protocol counts, and direction ratios.
Classifier inputs exclude raw source and destination IP addresses, MAC addresses, payload content, DNS names, HTTP URI or content fields, MQTT topics or messages, dataset and capture identifiers, scenario and file identifiers, binary and attack-type labels, label-derived fields, complete-flow duration, final packet count, post-flow aggregates, and any quantity requiring packets beyond the current checkpoint.
Numerical preprocessing parameters are fitted only on the edge-training data of the corresponding outer fold and are applied unchanged to calibration, cloud-development, and held-out PCAPs. All prefixes from one bidirectional flow remain in a single development role.

4.7. Outer PCAP-Disjoint Evaluation Protocol

The principal evaluation uses four outer PCAP-disjoint folds. Each fold holds out one of the four benign PCAPs and approximately one quarter of the attack PCAPs for final testing. The corresponding test captures are excluded from preprocessing, edge-model fitting, calibration, threshold selection, cloud-model fitting, and hyperparameter selection. Across the four folds, every one of the 309 PCAPs appears in final testing exactly once.
Attack PCAPs are distributed so that all seven attack families occur in every outer fold. Some low-volume attack types are absent from individual folds where source multiplicity does not permit broader allocation, but all 33 attack types are represented in the pooled out-of-fold evaluation.
The remaining flows in each outer development pool are assigned to edge-training, calibration, and cloud-development roles in the relative ratio 50:15:15. Together with the 25% outer test share, these roles correspond to effective overall proportions of 46.875%, 14.0625%, 14.0625%, and 25%. The inner roles are flow-disjoint, and every prefix derived from one flow remains in the same role (Table 4 and Table 5).

4.8. Label Source and Validation Scope

The outer-fold design measures generalization to CIC-IoT-2023 captures that are absent from every model-development stage. By separating complete PCAP files, it removes direct capture reuse between development and final testing and limits dependence on capture-specific traffic patterns.
This design leaves the source-label granularity unchanged. Attack-labeled captures may contain background or mixed traffic, so the principal experiment evaluates capture-level generalization under scenario/file-level labels rather than exact flow-label correctness. Cross-dataset transfer is examined separately on CICIDS2017.
The pooled out-of-fold result covers all 33 attack types and all four benign PCAPs. Its scope is the complete CIC-IoT-2023 source collection; unseen-family and operational-network generalization require separate evidence.

4.9. Mandatory Cloud Lower Bound

Because local exits require m min = 8 , every flow with n i < 8 is assigned to the cloud route. Total cloud load can therefore be decomposed as
N cloud = N n i < 8 + N eligible , uncertain ,
where the first term is the mandatory short-flow population and N eligible , uncertain contains edge-eligible flows that satisfy neither exit threshold (Table 6).
Short flows account for 71.74% of the pooled population, fixing the maximum possible edge-exit share at 28.26%. The realized route composition is evaluated against these structural bounds.

4.10. Model Fitting, Calibration, and Evaluation Use

Each outer fold has its own edge model, temperature scaler, threshold pair, and cloud-refinement model. The edge model is fitted on the edge-training role, probability calibration and asymmetric threshold selection use the calibration role, and the cloud classifier is fitted on cloud-development flows routed by the fixed edge policy. The held-out PCAPs are evaluated only after all components have been fixed.
The principal analysis pools predictions from the four outer test folds. Detection measures comprise accuracy, precision, recall, F1 score, balanced accuracy, FPR, FNR, AUROC, and AUPRC. Routing measures comprise edge- and cloud-route shares, the mandatory short-flow share, route-specific FPR and FNR, and the decision-checkpoint distribution. Calibration-fit diagnostics comprise expected calibration error, negative log-likelihood, and Brier score computed on the same calibration role used to fit the temperature parameter; they are not presented as independent outer-test calibration estimates.
For an attack group g, representing either one attack type or one attack family, FNR is computed over its pooled out-of-fold attack flows. The associated F1 score uses a deterministic fold-weighted benign reference. Let A g k and B k denote the attack-group and benign supports in outer fold k, and let A g = k A g k . The effective benign support is B g * = min ( A g , 261,955 ) . Every pooled benign prediction is retained with fold weight
w g k = B g * A g k A g B k ,
so that the effective benign support and fold proportions match those of the attack group. Reference false-positive counts are weighted sums over the benign predictions and are rounded to the nearest integer for tabulation; they can therefore differ between attack groups even when B g * = 261,955 . F1 is computed from the unrounded weighted counts. These are binary one-vs-benign measures rather than multiclass F1 scores.
For the all-cloud and fixed-checkpoint comparators, route assignment is recomputed on the cloud-development role. The all-cloud comparator routes every flow to cloud refinement. A fixed-checkpoint comparator classifies every flow that reaches its designated checkpoint from the calibrated edge probability using a 0.5 decision boundary and routes shorter flows to the cloud. For each comparator, a separate cloud-feature scaler and logistic-regression classifier are fitted on the flows assigned to its cloud route and are then applied to the corresponding held-out test-route flows. The principal cloud classifier is not reused after the route definition changes.

4.11. Experimental Implementation Details

The experimental implementation operationalizes the framework defined in Section 3 using a compact causal sequence model at the edge and a regularized logistic-regression classifier at the cloud stage. The edge model operates on padded packet-prefix sequences with maximum length L max = 32 . For a checkpoint t, only packets 1 , , t are visible to the model; packet positions after t are masked and do not contribute to the hidden-state representation. The input tensor for each mini-batch has shape B × 32 × d , where B is the batch size and d = 26 is the number of packet-level features after numerical scaling and categorical encoding.
The packet-level edge features used in the implementation are listed in Table 7. All continuous variables are standardized using parameters fitted only on the edge-training partition. Categorical protocol, TCP-flag, and port-category variables are one-hot encoded before model fitting. Raw IP addresses, MAC addresses, payload content, capture identifiers, scenario identifiers, file identifiers, complete-flow duration, final packet count, post-flow aggregate statistics, and label-derived fields are excluded from all classifier inputs. The fitted preprocessing parameters are reused without refitting on the calibration, cloud-development, and final-test partitions.
The edge classifier uses a gated recurrent unit (GRU) as the causal sequence encoder E θ . The GRU has one recurrent layer with hidden dimension 64. For each evaluated checkpoint, the last valid hidden state corresponding to the observed prefix is passed to a classifier head consisting of a dense layer with 32 units, ReLU activation, dropout rate 0.2, and a final linear output producing the uncalibrated malicious logit z i , t . Padding positions are masked before hidden-state selection, so naturally short flows do not contribute artificial zero-packet evidence beyond their observed length.
The edge model is trained using weighted binary cross-entropy with logits, with class weights computed from the edge-training partition. Training uses the Adam optimizer with learning rate 10 3 , weight decay 10 5 , batch size 1024, maximum 50 epochs, and gradient clipping at an 2 -norm of 5.0. A stratified 10% subset of the edge-training partition is reserved as an internal validation split for early stopping. Early stopping uses validation loss with patience 7 and minimum improvement 10 4 . The calibration partition is not used for edge-model fitting, model selection, or early stopping.
Probability calibration is performed after edge-model training using temperature scaling. A scalar temperature parameter T > 0 is fitted on the calibration partition by minimizing negative log-likelihood over held-out calibration logits. The calibrated malicious probability is computed as
q i , t = σ ( z i , t / T ) ,
where σ ( · ) is the logistic sigmoid. Threshold selection is then performed on calibrated outputs using the fixed minimum-evidence requirement m min = 8 . The threshold grid is
τ B { 0.01 , 0.02 , , 0.49 } , τ M { 0.51 , 0.52 , , 0.99 } .
The selected operating point is the feasible threshold pair with maximum calibration edge-exit coverage subject to the calibration risk targets ϵ B = ϵ M = 0.02 . When several threshold pairs satisfy the same coverage, ties are resolved by selecting the pair with the lower calibration false-negative rate and then the lower calibration false-positive rate.
For each flow assigned to cloud refinement, the cloud input is a compact prefix-derived vector constructed only from information available up to the final observed prefix L ¯ i . The cloud vector concatenates the final available edge hidden representation, the calibrated malicious probability, the raw edge logit, the final checkpoint length, packet-count summaries, byte-count summaries, packet-length statistics, inter-arrival-time statistics, TCP-flag counts, protocol counts, and direction-ratio statistics. The resulting cloud vector contains 97 features: 64 edge-hidden features and 33 prefix-summary or score-derived features. No raw IP addresses, capture identifiers, scenario identifiers, file identifiers, labels, or complete-flow statistics are included in the cloud representation (Table 8).
The cloud classifier is fitted only on the cloud-development partition after the fixed calibrated edge policy determines which flows enter the cloud route. The logistic-regression model uses L2 regularization with C = 1.0 , class-balanced weighting, the lbfgs solver, and a maximum of 1000 iterations. Cloud-feature standardization is fitted only on the cloud-development partition and then applied unchanged to final-test cloud-routed flows.
All experiments use fixed random seeds for deterministic sampling, partitioning, model initialization, mini-batch ordering, and classifier fitting. The implementation uses Python with NumPy, pandas, scikit-learn, and PyTorch. Random seeds are fixed at 2026070501; deterministic PyTorch execution is enabled where supported. No final-test data are used for preprocessing fitting, edge-model fitting, calibration, threshold selection, cloud-model fitting, hyperparameter selection, or operating-point selection.

4.12. Independent Edge-Model Comparison Protocol

The architecture comparison controls the evaluation, calibration, routing, and cloud-refinement protocol while comparing alternative causal edge models. The causal feature schema, observation checkpoints, eight-packet minimum-evidence gate, outer PCAP-disjoint folds, model-specific calibration and threshold selection, and logistic-regression cloud-refinement protocol are retained for every model. The compared encoders are the proposed one-layer GRU, a lightweight causal one-dimensional CNN, a compact one-layer LSTM with additive attention over the observed prefix, a three-block causal temporal convolutional network (TCN), and an XGBoost baseline using causal prefix summaries. Raw identifiers, payload content, and unavailable complete-flow features are excluded from every model.
The neural models expose a 64-dimensional final prefix representation. The XGBoost baseline uses 64 boosting rounds; the additive margin contribution from each round at the final available prefix forms the corresponding 64-dimensional representation block, and the sum of these contributions together with the fixed base margin gives the raw XGBoost logit. For every model, this 64-dimensional representation is concatenated with the same 33 score-derived and causal prefix-summary features, yielding a 97-feature cloud vector. A separate logistic-regression cloud classifier is fitted for each edge model on its own route-matched cloud-development flows.
Implementation cost is measured on a Raspberry Pi 5 with 8 GB RAM (Raspberry Pi Ltd., Cambridge, UK) and 64-bit Ubuntu 22.04.4 LTS using one CPU thread, batch size one, and streaming causal inference. Each measurement follows 1000 warm-up flows and covers 10,000 test flows. Reported latency spans a complete 32-packet edge pass. Neural models use float32 storage without acceleration or post-training quantization. Because the logistic-regression cloud-stage model class is common to all systems, it is excluded from the edge-model size and latency comparison.

4.13. CICIDS2017 External-Validation Protocol

CICIDS2017 provides raw PCAP traffic together with labeled flow records containing timestamps, endpoint addresses, ports, protocols, and attack labels [33]. Bidirectional flows are reconstructed from the PCAPs and matched to the released labels by protocol, endpoint pair, ports, and temporal overlap; ambiguous, duplicate, and unresolved matches are excluded. The released complete-flow feature columns are not used as classifier inputs. Instead, the same 26 causal packet-level features used for CIC-IoT-2023 are generated, and the documented attacks are collapsed into the malicious class.
The retained joined corpus contains 2,742,856 flows, of which 2,204,219 are benign and 538,637 are malicious. Balanced modeling retains all malicious flows and a deterministic attack-day-stratified sample of 538,637 benign flows, giving 1,077,274 flows. The fixed development and test roles are listed in Table 9. All external-validation modes use the same untouched test set of 107,726 benign and 107,726 malicious flows.
After the outer-fold comparison fixes the architecture and hyperparameters, one transfer-source system is fitted for each edge-model family on the complete CIC-IoT-2023 modeling corpus. The corpus is repartitioned deterministically into flow-disjoint edge-training, calibration, and cloud-development roles in the normalized proportions 62.5%, 18.75%, and 18.75%, corresponding to the same relative 50:15:15 development-role ratio used inside each outer fold and preserving PCAP and attack-type strata. This transfer-source fit is separate from, and is not included in, the pooled CIC-IoT-2023 out-of-fold result. Its preprocessing parameters, edge model, temperature, thresholds, cloud-feature scaler, and cloud classifier are then fixed for external evaluation.
The external study separates three modes. In-domain evaluation develops every model component from the CICIDS2017 training, calibration, and cloud-development roles. Zero-shot evaluation applies the corresponding single CIC-IoT-2023 transfer-source system without using CICIDS2017 before testing. Target-calibration-only evaluation retains the transfer-source preprocessing, edge model, cloud-feature scaler, and cloud-classifier coefficients and refits only the temperature and exit thresholds on the CICIDS2017 calibration role. The fixed CICIDS2017 test set is excluded from fitting and operating-point selection in all three modes.

4.14. Valuation Scope and Reproducibility Controls

Corpus reconstruction, deterministic sampling, outer-fold assignment, flow-level role assignment, flow-length accounting, and mandatory cloud-route bounds are fixed before model fitting. The resulting checks confirm that every sampled flow belongs to one outer test fold, no held-out PCAP appears in the corresponding development pool, and all prefixes from one flow remain in a single role.
The principal result consequently represents PCAP-disjoint validation across the complete 309-PCAP CIC-IoT-2023 source collection. Its interpretation remains conditioned on scenario/file-level labels rather than exact flow-level annotation. Low-prevalence behavior, cross-dataset transfer, and attack-specific performance are examined in their dedicated analyses rather than inferred from the aggregate result. Because the principal summaries pool the four held-out folds, they characterize corpus-level out-of-fold performance; fold-level dispersion and statistical uncertainty across PCAP allocations are not estimated.

5. Results

5.1. Evaluation Overview and Metric Definitions

The principal evaluation is based on pooled out-of-fold predictions from the four outer PCAP-disjoint test folds defined in Section 4.7. The pooled population contains 2,286,754 flows, comprising 261,955 benign flows and 2,024,799 attack-labeled flows. Because the malicious prevalence is 88.54 % , aggregate measures are interpreted together with class-conditional error rates and the deployment-prior analysis. An all-malicious rule would attain 88.54 % accuracy on this corpus but only 50 % balanced accuracy, with 100 % FPR and 0 % FNR; accuracy alone is therefore not an informative baseline.
Benign traffic is treated as the negative class and malicious traffic as the positive class. True negatives and false positives are therefore counted over benign flows, whereas true positives and false negatives are counted over malicious flows. The false-positive and false-negative rates are
FPR = FP FP + TN , FNR = FN FN + TP .
Recall is 1 FNR , specificity is 1 FPR , and balanced accuracy is the mean of recall and specificity. These definitions are used throughout this section.
Routing measures are reported in addition to detection measures because each flow is assigned either to an edge exit or to cloud refinement. The cloud route contains both flows that terminate before the minimum-evidence requirement and edge-eligible flows that remain unresolved. Route-specific FPR and FNR are computed from the benign and malicious supports within each selected route and are therefore interpreted conditionally.
Calibration-fit quantities are obtained from the calibration role of each fold and are used only for probability scaling and operating-point selection. Final detection and routing measures are computed on the corresponding held-out PCAPs and then pooled. The lower-FPR and deployment-prior analyses retain the same class-conditional errors while examining different operating preferences or traffic priors.

5.2. Routing Composition and Principal End-to-End Result

The pooled evaluation contains 2,286,754 flows, including 261,955 benign and 2,024,799 malicious flows. The minimum-evidence gate assigns 1,640,517 flows with n i < 8 to mandatory cloud refinement. Among the 646,237 edge-eligible flows, 422,190 satisfy an edge-exit condition and 224,047 remain unresolved. The final route composition is therefore 422,190 edge exits and 1,864,564 cloud-routed flows, corresponding to an edge-exit share of 18.46 % .
The principal confusion matrix is given in Table 10. The end-to-end policy attains 4.47 % FPR, 1.89 % FNR, 95.53 % specificity, and 96.82 % balanced accuracy. The remaining false-positive rate is still operationally important in benign-dominated traffic and is examined further through lower-FPR operating points and deployment-prior analysis.
Table 11 separates the selected route populations. The edge-exit subset has 0.25 % FNR and 8.50 % FPR, whereas the cloud-routed subset has 2.26 % FNR and 3.57 % FPR. These values describe the error profile of each route after policy selection: the cloud subset contains all short flows and the edge-eligible cases that remain unresolved, while the edge subset contains only flows that satisfy a calibrated exit condition.
Figure 2 makes the structural cloud lower bound explicit and separates it from reliability-triggered escalation. Figure 3 then shows that the pooled result is not an artifact of the dominant malicious class: the benign row retains 95.53 % specificity, while the malicious row retains 98.11 % recall.

5.3. Low-FPR Operating Points

Table 12 reports the principal policy together with three operating points selected under progressively stricter benign-FPR limits. Lower FPR requires more conservative thresholds, which route more flows to the cloud and increase FNR. The 1 % -FPR policy gives the highest balanced accuracy among the listed settings, but its 3.55 % FNR exceeds the malicious-error level of the principal policy. The four settings therefore represent different allocations of benign false alarms, malicious misses, and cloud load.
Figure 4 shows that a lower benign FPR is obtained through a joint change in malicious misses and cloud load rather than through a free improvement in all metrics. The 1 % -FPR policy has the highest balanced accuracy among the four listed points, but it more than doubles FNR relative to the principal policy.

5.4. Calibration-Based Operating-Point Selection

Threshold selection is performed independently within each outer fold. The principal policy chooses the most permissive asymmetric thresholds that satisfy the calibrated benign- and malicious-exit risk targets together with the minimum-evidence gate. The lower-FPR policies add calibration-set FPR limits of 2 % , 1 % , and 0.5 % , as defined in Section 4.4. Because the fitted temperatures and score distributions differ across folds, each fold has its own selected threshold pair.
The pooled outcomes in Table 12 show the resulting trade-off. Greater protection of benign traffic lowers FPR but increases FNR and cloud routing. The operating point should therefore be selected according to the relative cost of false alarms, missed attacks, and cloud refinement in the intended deployment.

5.5. Calibration-Fit Diagnostics and Discrimination Evidence

Temperature scaling is fitted after edge-model training within each outer fold. Table 13 reports the fitted temperatures and within-calibration fit diagnostics. The temperatures range from 1.36 to 1.45. On the same calibration roles used to fit the temperature, pooled ECE decreases from 4.86 % to 1.31 % , NLL from 0.127 to 0.099, and Brier score from 0.032 to 0.026. These values describe the fitted probability mapping used for threshold selection; they are not independent evidence of outer-test calibration. The minimum-evidence gate separately determines whether a prefix is eligible for an edge exit.
Threshold-independent discrimination is reported in Table 14. The edge-eligible GRU scores attain 0.9872 AUROC and 0.9978 AUPRC, the cloud-routed scores attain 0.9824 and 0.9971, and the final end-to-end scores attain 0.9901 and 0.9984 over all 2,286,754 flows. The high AUPRC reflects, in part, the 88.54 % malicious prevalence and is therefore considered together with FPR, FNR, and the deployment-prior results.
Figure 5, Figure 6 and Figure 7 separate calibration-fit diagnostics from held-out ranking performance. Temperature scaling improves the fitted probability scale used for routing, whereas AUROC and AUPRC characterize threshold-independent discrimination on pooled outer-test predictions. The latter remain high, but AUPRC is interpreted with the observed 88.54 % malicious prevalence.

5.6. Route Load and Communication Accounting

Table 15 shows where the final routing decisions occur. The 1,640,517 flows shorter than eight packets form the mandatory cloud population, and a further 224,047 edge-eligible flows remain unresolved. The remaining 422,190 flows exit at packets 8, 16, or 32.
The weighted mean checkpoint among edge exits is 12.81 packets. Packet 8 accounts for 62.61 % of all edge exits, while packets 16 and 32 resolve progressively smaller portions of the remaining population. The checkpoint profile therefore shows that most local decisions occur at the first eligible point, with later checkpoints recovering additional unresolved flows.
The communication calculation in Table 16 assumes one 97-feature float32 vector for each cloud-routed flow. Relative to submitting the same representation for every flow, selective routing avoids 422,190 submissions and reduces the feature payload by 156.22 MiB, or 18.46 % , over the pooled evaluation. The calculation excludes serialization, protocol headers, encryption, retransmissions, batching, and control traffic and therefore represents payload accounting rather than a measured network or energy cost (Table 17).
Figure 8 adds checkpoint-conditional error information to the route counts in Table 15. The exits at packets 8, 16, and 32 have FPRs of 9.80 % , 7.20 % , and 7.20 % , respectively, and FNRs of 0.14 % , 0.27 % , and 0.90 % . These values are conditioned on the flows that first satisfy an exit rule at each checkpoint and therefore should not be compared as if the checkpoint populations were identical.

5.7. Ablation Analysis

Table 18 evaluates the principal reliability and routing components on the pooled PCAP-disjoint predictions. Removing the minimum-evidence gate produces the largest degradation: FPR increases to 18.70 % , FNR to 4.02 % , and balanced accuracy falls to 88.64 % . Removing cloud refinement reduces balanced accuracy to 92.61 % . Symmetric thresholds and uncalibrated scores also worsen both class-conditional error rates, although their effects are smaller.
The one-sided exit ablations separate detection quality from local coverage. Removing benign edge exits lowers FPR and slightly improves balanced accuracy, but reduces the edge-exit share from 18.46 % to 14.36 % . Removing malicious edge exits leaves balanced accuracy nearly unchanged while reducing local coverage to 4.10 % . Both exit directions are therefore retained to reduce cloud submissions under the selected reliability policy, rather than because each direction independently maximizes balanced accuracy.
Figure 9 expresses the same ablations relative to the final policy. The result distinguishes reliability controls that prevent large error increases from exit-direction choices that mainly redistribute local coverage.

5.8. Cloud-Refinement Contribution

The no-cloud-refinement ablation preserves the principal edge-routing decisions but removes the second-stage classifier for routed flows. FPR increases from 4.47 % to 10.42 % , FNR from 1.89 % to 4.36 % , and balanced accuracy decreases from 96.82 % to 92.61 % . At the selected routing policy, cloud refinement therefore reduces FPR by 5.95 percentage points and FNR by 2.47 percentage points, yielding a 4.21 -percentage-point gain in balanced accuracy.
The cloud stage receives all flows shorter than eight packets together with edge-eligible flows that remain unresolved. Its contribution is consequently measured on this selected routed population, not on the flows that satisfy edge-exit conditions. The ablation establishes the value of cloud refinement for routed cases while preserving the route selection imposed by the edge policy.
Figure 10 compares the exact pooled error counts and makes clear that the cloud contribution is evaluated under a fixed route assignment. The all-cloud reference is included only as an operating reference; it does not preserve selective routing or local exits.

5.9. Observation-Budget Sensitivity

Table 19 compares matched systems with maximum observation budgets of 16, 32, and 64 packets. Increasing the budget from 16 to 32 packets reduces FPR from 4.92 % to 4.47 % , reduces FNR from 2.35 % to 1.89 % , and raises the edge-exit share from 17.13 % to 18.46 % . Extending the budget from 32 to 64 packets yields only a further 0.05 -percentage-point FPR reduction, a 0.07 -percentage-point FNR reduction, and a 0.06 -percentage-point balanced-accuracy gain, while increasing the mean number of processed packets from 6.93 to 7.11. Only 44 , 820 flows, or 1.96 % of the modeling corpus, reach 64 packets, which limits the population that can benefit from the longer horizon.
The 32-packet setting therefore retains most of the measured gain beyond 16 packets without imposing the longest evaluated horizon. This choice is specific to the observed flow-length distribution and should not be interpreted as a universal early-detection budget.

5.10. Sensitivity to Delayed Post-Eight-Packet Information

The observation-budget comparison preserves the recorded packet sequence. Table 20 instead delays all post-eight-packet information for the common set of 39,880 malicious flows observed through 64 packets, while keeping model parameters, calibration, and thresholds fixed. The resulting changes measure sensitivity to the timing of later prefix information rather than retraining effects; the perturbation does not identify which shifted features are specifically malicious.
With a 16-packet delay, FNR reaches 9.88 % , 2.94 % , and 1.72 % for L max = 16 , 32, and 64, respectively. Under a 32-packet delay, the corresponding values are 18.48 % , 8.75 % , and 3.05 % . Malicious edge-exit share declines in parallel. A longer horizon therefore recovers part, but not all, of the displaced post-eight-packet information. The perturbation is a controlled sensitivity test rather than a reconstruction of a specific evasion strategy.
The 32-packet policy is therefore effective when distinguishing behavior appears within the observed prefix, but its recall declines when later prefix information is displaced beyond that horizon. The 64-packet configuration provides partial recovery at a higher observation cost and remains a sensitivity setting rather than the principal policy.
Figure 11 combines the observation-horizon and controlled-delay results. The analysis supports L max = 32 as a corpus-specific compromise, not as a universal early-detection horizon, and it shows that delayed post-eight-packet information can limit short-prefix detection in a way that calibration alone cannot remove.

5.11. Deployment-Prior and Alert-Burden Sensitivity

The pooled corpus is attack-dominant, whereas operational IoT traffic may contain a much smaller malicious fraction. Table 21 applies the measured class-conditional error rates to alternative malicious-flow prevalences and reports the resulting alert precision and alert volume per one million flows.
At 1 % malicious prevalence, expected alert precision is 18.15 % under the principal policy, 49.34 % under the 1 % -FPR policy, and 65.79 % under the 0.5 % -FPR policy. At 0.1 % prevalence, the corresponding values are 2.15 % , 8.80 % , and 16.01 % . Thus, even the lower-FPR settings can produce more false than true alerts when attacks are rare. This analysis does not change the measured confusion matrix; it shows how the same class-conditional errors translate into different operational alert burdens as the traffic prior changes.

5.12. Sliding-Window Threshold Updating Under Traffic Drift

Table 22 compares the static 1 % -FPR thresholds with the supervised sliding-window update rule during the chronological drift replay. The replay contains benign-capture changes, attack-mixture changes, and recovery blocks. Under fixed thresholds, the maximum block FPR is 2.76 % ; threshold updating reduces this maximum to 1.27 % .
Across the complete replay, FPR decreases from 1.61 % to 1.08 % , FNR changes from 4.34 % to 4.24 % , and balanced accuracy increases from 97.02 % to 97.34 % . The edge-exit share decreases from 15.54 % to 15.09 % . Figure 12 shows that adaptation reduces both the magnitude and duration of block-level FPR excursions, with a maximum of 1.27 % rather than 2.76 % . The 1.25 % line is an update-control reference, not a deterministic guarantee for every subsequent block. Because the procedure uses delayed adjudicated outcomes, it demonstrates supervised threshold maintenance rather than unsupervised drift detection.

5.13. Policy and Fixed-Checkpoint Comparators

Table 23 compares the sequential policy with an all-cloud reference and fixed decisions at packets 8, 16, and 32. As specified in Section 4.10, each altered route uses a separately fitted, route-matched cloud scaler and classifier. For the fixed-checkpoint policies, flows that do not reach the specified checkpoint are routed to the cloud. The all-cloud reference attains 97.08 % balanced accuracy but provides no local exits. The sequential policy attains 96.82 % balanced accuracy while resolving 18.46 % of all flows at the edge.
The fixed 8-packet policy gives the largest edge share, 28.26 % , but also the highest FPR, 5.80 % . Later fixed checkpoints reduce both class-conditional error rates, although fewer flows naturally reach those checkpoints. Relative to the fixed 32-packet policy, the sequential policy increases edge coverage from 4.88 % to 18.46 % while reducing FPR from 4.65 % to 4.47 % and FNR from 1.95 % to 1.89 % . Its advantage is therefore a more favorable balance between local coverage and error, rather than uniformly higher accuracy than the all-cloud reference.

5.14. Independent Edge-Model Comparison

Table 24 and Table 25 jointly compare detection performance and gateway cost. The LSTM-attention model improves balanced accuracy over the GRU by 0.12 percentage points and reduces FPR and FNR by 0.17 and 0.07 percentage points, respectively. This gain is accompanied by a larger model (114.3 versus 77.3 KiB) and higher p95 latency (0.86 versus 0.48 ms). The GRU provides a 0.32 -percentage-point larger edge-exit share. The CNN lowers p95 latency to 0.39 ms but reduces balanced accuracy by 0.51 percentage points relative to the GRU, while XGBoost gives the lowest latency but the largest serialized model and the weakest balanced accuracy.
No encoder dominates every criterion. Figure 13 summarizes the matched comparison across class-conditional error, balanced accuracy, and gateway latency. The GRU is retained as the principal implementation because it combines near-leading class-conditional error, the largest edge-exit share, compact recurrent state, and moderate single-flow latency.

5.15. CICIDS2017 In-Domain and Cross-Dataset Validation

Table 26 reports performance when each model is developed and evaluated within CICIDS2017. The LSTM-attention model attains the highest balanced accuracy, 97.18 % . The GRU reaches 97.03 % balanced accuracy with 2.85 % FPR, 3.09 % FNR, and an 18.00 % edge-exit share, showing that the framework can be developed successfully on the second corpus.
Direct transfer from the single CIC-IoT-2023 transfer-source system fitted for each model family is substantially weaker for every model (Table 27). The transfer-source GRU records 11.80 % FPR and 15.60 % FNR, reducing balanced accuracy to 86.30 % . The LSTM-attention model transfers slightly better, while XGBoost gives the lowest zero-shot balanced accuracy. PCAP-disjoint validation within CIC-IoT-2023 therefore does not imply invariance to the different traffic and label distribution of CICIDS2017.
Target-calibration-only adaptation recovers part of the lost performance (Table 28). For the GRU, FPR decreases to 6.20 % , FNR to 10.50 % , and balanced accuracy rises to 91.65 % , while the encoder and cloud-classifier coefficients remain fixed. This recovers 5.35 of the 10.73 percentage points lost under zero-shot transfer. The residual gap to the 97.03 % in-domain result indicates that score scaling and threshold shift explain only part of the mismatch; representation and conditional-distribution shift remain.
Figure 14 summarizes the three external-validation modes using the exact values in Table 26, Table 27 and Table 28. The target-calibration-only procedure improves both GRU error rates relative to zero-shot transfer, but its FPR and FNR remain above their in-domain values.

5.16. Attack-Family and Attack-Specific Performance

Table 29 summarizes the pooled results by attack family. The family-level false-negative counts sum to 38,268 , matching the malicious errors in the principal confusion matrix. DDoS, DoS, and Mirai have FNRs between 1.05 % and 1.34 % . Reconnaissance and spoofing are less reliable at 2.92 % and 3.78 % , while web-based attacks and dictionary brute force reach 12.51 % and 22.12 % , respectively.
Appendix B reports all 33 attack types. Within the DDoS family, DDoS-SYN_Flood has 0.45 % FNR, whereas DDoS-SlowLoris and DDoS-HTTP_Flood reach 2.10 % and 2.79 % . The stronger performance on high-rate SYN flooding is consistent with the earlier availability of transport-level evidence, while SlowLoris and HTTP flooding develop more gradually.
Mirai-greeth_flood and Mirai-greip_flood have FNRs of 0.90 % and 1.06 % , but only 282 and 74 flows, respectively, satisfy the eight-packet edge-eligibility requirement. Their performance is therefore driven primarily by end-to-end cloud-routed detection. Mirai-udpplain is more difficult, with 5.73 % FNR.
The largest errors occur among reconnaissance, web-based, and brute-force traffic. Recon-PingSweep reaches 6.30 % FNR and MITM-ArpSpoofing 4.96 % . CommandInjection, SqlInjection, Uploading_Attack, and XSS record 15.10 % , 10.40 % , 16.41 % , and 12.29 % , respectively. DictionaryBruteForce has the highest FNR, 22.12 % , and the lowest one-vs-benign F1, 84.59 % . These attack types depend more strongly on evidence that is weakly represented by payload-free packet-prefix features.
Figure 15 summarizes the exact family-level FNRs and representative attack-type values reported in Appendix B. The figure is descriptive of the evaluated scenario-labeled captures; it does not establish exact flow-level attack attribution.

5.17. Contextual Comparison with Recent Lightweight IDS Studies

Table 30 places the present system alongside two recent lightweight edge-oriented IDS studies. Wardana et al. report a hierarchical federated edge–fog–cloud architecture, while Nedungadi et al. report a multimodal ensemble deployed on Raspberry Pi hardware. Their datasets, feature representations, split protocols, objectives, and hardware differ from those used here, so the reported values provide deployment context rather than a controlled performance ranking.
The present study addresses a different combination of requirements: causal packet-prefix inference, calibrated asymmetric exits, an explicit minimum-evidence gate, selective cloud refinement, PCAP-disjoint evaluation, delayed-information sensitivity, low-FPR operation, and separate cross-dataset FPR and FNR. The comparison therefore situates the proposed design within recent lightweight IDS work without treating heterogeneous published results as directly interchangeable.

6. Discussion

The framework occupies an operating region between all-cloud inference and unconditional early classification at the gateway. Selective routing reduces cloud submissions while withholding local decisions for short or unresolved prefixes. Its value, therefore, depends on the joint behavior of observation horizon, class-conditional error, local coverage, gateway cost, and distribution shift rather than on a single aggregate score.

6.1. Observation Horizon and Delayed Information

The maximum observation budget is a deployment parameter rather than an intrinsic property of the framework. In the present corpus, extending the horizon from 16 to 32 packets produces clear improvements in both class-conditional error and edge coverage, whereas the additional gain at 64 packets is small because fewer than 2 % of the modeling flows reach that length. The 32-packet setting consequently captures most of the available benefit without extending the principal maximum observation budget to 64 packets.
The delayed-information experiment defines the corresponding boundary of early detection. When post-eight-packet information is displaced beyond the observed prefix, malicious recall and early-exit coverage decline even though the model, calibration, and thresholds remain unchanged. Cloud refinement cannot fully remove this dependence because it also operates on the final available causal prefix rather than on future packets or complete-flow statistics. Longer or adaptive observation may therefore be required for attacks whose identifying behavior develops late, but such policies would exchange earlier decisions for additional evidence.

6.2. False-Positive Control and Threshold Updating

The principal policy gives 4.47 % FPR under the selected calibration-risk objective. In benign-dominated deployments, this operating point can generate substantial alert burden even when accuracy and F1 are high. Lower-FPR threshold pairs reduce false alarms by increasing malicious misses and cloud routing; the operating point must therefore reflect the deployment-specific costs of these three outcomes.
The deployment-prior analysis makes this dependence explicit: as malicious prevalence decreases, false alerts dominate the alert stream despite unchanged class-conditional error. The sliding-window experiment addresses a narrower problem. With delayed adjudicated labels, threshold updates stabilize FPR under the evaluated drift sequence while leaving the representation and classifiers fixed. This mechanism supports supervised threshold maintenance, but it cannot correct feature or conditional-distribution shifts that require model adaptation.

6.3. Edge-Gateway Deployment and Lightweighting

The proposed architecture targets gateway-resident inference rather than execution on individual IoT endpoints. The GRU edge model contains 19,777 parameters and uses a compact recurrent state, while cloud refinement is implemented by logistic regression over a 97-feature representation. Measurements on a Raspberry Pi 5 show a median 32-packet edge-inference latency of 0.31 ms and a 0.48 ms 95th percentile for the GRU implementation. These measurements support the feasibility of single-flow inference on gateway-class hardware, although they do not include packet capture, flow reconstruction, concurrent traffic handling, serialization, or network transfer.
Selective routing reduces the number of representations submitted to the cloud. Under the principal policy, 422,190 flows exit locally, reducing the compact feature payload by 18.46 % , or 156.22 MiB, relative to submitting the same representation for every evaluated flow. The practical saving will depend on transport, encryption, batching, retransmission, and control overhead, which are outside the payload calculation.
The encoder comparison also shows that lightweight deployment does not require a unique model family. The LSTM-attention baseline gives a small accuracy gain at higher parameter and latency cost, whereas the CNN gives lower neural-model latency with weaker detection performance. The GRU provides a balanced streaming implementation, but another causal encoder can be used if it satisfies the same prefix, calibration, and routing constraints. End-to-end gateway latency, energy consumption, sustained packet throughput, and memory pressure under concurrent flows remain to be measured.

6.4. Architectural Trade-Offs and Cross-Dataset Generalization

The matched architecture results separate the routing framework from the edge encoder. Under common causal inputs, calibration, gating, routing, and cloud refinement, the five encoders occupy different error, coverage, storage, and latency operating points. The LSTM-attention model gives the highest balanced accuracy, whereas the CNN and XGBoost favor latency. Encoder selection should therefore follow the gateway’s resource constraints and class-conditional error costs.
The CICIDS2017 experiments distinguish within-corpus validation from cross-dataset transfer. In-domain development remains strong, but the single CIC-IoT-2023 transfer-source system produces substantially higher FPR and FNR under zero-shot transfer. Target-calibration-only adaptation recovers about half of the GRU balanced-accuracy loss, leaving a clear gap to in-domain development. The routing structure is reusable, but deployment on a new traffic domain requires target-representative data and may require model development beyond calibration.

6.5. Attack-Specific Reliability

The family-level and attack-specific results reveal a consistent relationship between available evidence and detection reliability. Flooding attacks generally expose transport-level changes in flags, direction, timing, or packet length within the observed prefix and consequently have low FNR. Web-based attacks and dictionary brute force are more difficult because their distinguishing evidence is more closely associated with application content or later interaction patterns that are excluded from the payload-free causal representation.
The Mirai results illustrate the distinction between end-to-end detection and early edge resolution. Mirai-greeth_flood and Mirai-greip_flood have low FNR, but almost all corresponding flows terminate before the eight-packet gate and are handled by the mandatory cloud route. Their performance therefore reflects successful final classification of short flows rather than frequent early malicious exits. The higher errors for injection, uploading, XSS, and dictionary brute-force traffic identify cases in which richer causal application-layer metadata or a longer selective observation policy may be needed.
These differences are measured under the scenario/file-level labels supplied by CIC-IoT-2023. They characterize variation across the evaluated captures but do not remove possible background or mixed traffic within attack-labeled PCAPs.

6.6. Applicability Across IoT Deployment Domains

The framework is formulated around a gateway-level decision problem rather than the semantics of one application domain. Industrial, smart-city, healthcare, and other multi-device IoT gateways may all observe partial bidirectional flows, face asymmetric costs for benign and malicious decisions, and have access to additional cloud refinement for unresolved traffic. The same routing and calibration structure can therefore be applied wherever these conditions hold.
Application to a new domain nevertheless requires local validation. Traffic prevalence, protocols, device behavior, attack composition, and operational error costs can differ substantially from the evaluated corpora. The deployment-prior analysis shows how strongly alert precision changes under benign-dominated traffic, while the CICIDS2017 experiment shows that a system developed on one corpus does not retain the same error rates under direct transfer. The present evidence supports the framework under PCAP-disjoint validation on CIC-IoT-2023 and after in-domain development on CICIDS2017. The CIC-IoT-2023 summaries pool the four held-out folds and therefore characterize corpus-level out-of-fold performance rather than fold-to-fold stability; fold-specific dispersion and confidence intervals are not reported. Sustained validation on industrial, smart-city, healthcare, and other operational gateway traces remains necessary.

7. Conclusions

This paper presented a reliability-aware edge–cloud framework that treats early IoT intrusion detection as sequential routing over causal flow prefixes. A lightweight GRU, temperature-scaled probabilities, asymmetric exit thresholds, and an eight-packet minimum-evidence gate determine whether a flow exits locally, remains under observation, or receives cloud refinement. Across all 309 CIC-IoT-2023 PCAPs under four outer PCAP-disjoint folds, the 32-packet policy evaluates 2,286,754 pooled out-of-fold flows, resolves 18.46 % at the edge, and attains 4.47 % FPR, 1.89 % FNR, 96.82 % balanced accuracy, and 98.76 % F1 score. Observation-budget and delayed-information analyses identify 32 packets as a corpus-specific compromise and show that late-arriving distinguishing behavior remains a limit of short-prefix detection. Lower-FPR policies and supervised threshold updates provide alternative operating points, while matched encoder comparisons show that no backbone dominates detection quality and gateway cost simultaneously. On CICIDS2017, strong in-domain performance contrasts with weaker zero-shot and target-calibration-only results, demonstrating the need for target-representative development data. The principal limitations remain scenario/file-level CIC-IoT-2023 labels, reduced sensitivity to late or application-dependent attacks, and the absence of sustained measurements of gateway energy, concurrent-flow throughput, and end-to-end processing cost.

Author Contributions

Data curation, S.A., F.N. and M.M.S.; formal analysis, S.A., F.N. and M.M.S.; investigation, S.A. and F.N.; methodology, S.A., F.N. and M.M.S.; project administration, S.A., F.N. and M.M.S.; resources, S.A. and F.N.; software, S.A. and F.N.; validation, S.A., F.N. and M.M.S.; visualization, S.A., F.N. and M.M.S.; writing—original draft preparation, S.A., F.N. and M.M.S.; writing—review and editing, S.A., F.N. and M.M.S.; supervision, M.M.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original CIC-IoT-2023 and CICIDS2017 data used in this study are openly available from the Canadian Institute for Cybersecurity (CIC), University of New Brunswick, at https://www.unb.ca/cic/datasets/iotdataset-2023.html (accessed on 25 April 2026) and https://www.unb.ca/cic/datasets/ids-2017.html (accessed on 29 July 2026), respectively.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Attack-Type Support in the Full-Corpus Evaluation

Table A1 and Table A2 report the retained modeling support for all 33 CIC-IoT-2023 attack types, together with the numbers of flows reaching 8, 16, 32, and 64 packets.
Table A1. Attack-type support in the full-corpus modeling set, part 1 of 2.
Table A1. Attack-type support in the full-corpus modeling set, part 1 of 2.
No.FamilyAttack TypeModeling Flows n i 8 n i 16 n i 32 n i 64
1DDoSDDoS-ACK_Fragmentation80,0002879672
2DDoSDDoS-HTTP_Flood83,50023,74315,83626851137
3DDoSDDoS-ICMP_Flood20,0003456214024278
4DDoSDDoS-ICMP_Fragmentation13,5003406194718355
5DDoSDDoS-PSHACK_Flood87,50073,76864,66313,4015135
6DDoSDDoS-RSTFINFlood86,00062,05153,21012,0304852
7DDoSDDoS-SlowLoris34,00024,21020,29957373182
8DDoSDDoS-SYN_Flood176,00096,31378,92014,8695398
9DDoSDDoS-SynonymousIP_Flood27,00022,06219,33940081536
10DDoSDDoS-TCP_Flood88,00073,79465,38914,1675571
11DDoSDDoS-UDP_Flood750050584096695238
12DDoSDDoS-UDP_Fragmentation56801852105910030
13DoSDoS-HTTP_Flood38,00024,43218,62343862123
14DoSDoS-SYN_Flood80,00064,17357,47512,9945372
15DoSDoS-TCP_Flood28,50023,42521,20349932115
16DoSDoS-UDP_Flood15,484897072651369525
17MiraiMirai-greeth_flood475,000282175133
Table A2. Attack-type support in the full-corpus modeling set, part 2 of 2.
Table A2. Attack-type support in the full-corpus modeling set, part 2 of 2.
No.FamilyAttack TypeModeling Flows n i 8 n i 16 n i 32 n i 64
18MiraiMirai-greip_flood225,000744220
19MiraiMirai-udpplain28,92851443676519167
20ReconnaissanceRecon-HostDiscovery108,00012437118023
21ReconnaissanceRecon-OSScan54,00054223720631229
22ReconnaissanceRecon-PingSweep12,0004022210819948
23ReconnaissanceRecon-PortScan58,00044172862404130
24ReconnaissanceVulnerabilityScan71,72016,89612,0742275918
25SpoofingDNS_Spoofing49,00078015054857311
26SpoofingMITM-ArpSpoofing11,7441699113321382
27Web-basedBackdoor_Malware6500138185514556
28Web-basedBrowserHijacking6900162696014550
29Web-basedCommandInjection8100138879310532
30Web-basedSqlInjection10,50037102404453192
31Web-basedUploading_Attack50469585487726
32Web-basedXSS7500143784912845
33Brute forceDictionaryBruteForce16,19753193548602219

Appendix B. Attack-Specific Detection Results

Table A3 and Table A4 report FNR and deterministic fold-weighted one-vs-benign F1 for each of the 33 attack types. For attack type a, FNR a = FN a / N a , where N a is its pooled out-of-fold support. The effective benign support is min ( N a , 261,955 ) , and all pooled benign predictions are weighted so that their effective outer-fold proportions match those of attack type a, using the procedure in Section 4.10. Weighted reference FP counts are rounded to the nearest integer for display, while F1 is computed from the unrounded weighted counts. These values describe binary discrimination against the defined benign reference and are not multiclass F1 scores. The attack-specific false-negative counts sum to the principal total of 38,268 .
Table A3. Attack-specific FNR and one-vs-benign F1, part 1 of 2.
Table A3. Attack-specific FNR and one-vs-benign F1, part 1 of 2.
No.FamilyAttack TypeSupportFNFNR (%)Effective Benign SupportWeighted Reference FPOne-vs-Benign F1 (%)
1DDoSDDoS-ACK_Fragmentation80,00016142.0280,000320097.02
2DDoSDDoS-HTTP_Flood83,50023282.7983,500371696.41
3DDoSDDoS-ICMP_Flood20,0002491.2420,00080097.41
4DDoSDDoS-ICMP_Fragmentation13,5002481.8413,50054097.11
5DDoSDDoS-PSHACK_Flood87,5003530.4087,500350097.84
6DDoSDDoS-RSTFINFlood86,0003980.4686,000344097.81
7DDoSDDoS-SlowLoris34,0007142.1034,000154796.72
8DDoSDDoS-SYN_Flood176,0007920.45176,000704097.81
9DDoSDDoS-SynonymousIP_Flood27,0001700.6327,000108097.72
10DDoSDDoS-TCP_Flood88,0003860.4488,000352097.82
11DDoSDDoS-UDP_Flood7500781.04750030097.52
12DDoSDDoS-UDP_Fragmentation56801182.08568022796.99
13DoSDoS-HTTP_Flood38,00012003.1638,000174896.15
14DoSDoS-SYN_Flood80,0005740.7280,000336097.58
15DoSDoS-TCP_Flood28,5001730.6128,500119797.64
16DoSDoS-UDP_Flood15,4842261.4615,48465097.21
17MiraiMirai-greeth_flood475,00042750.90261,95511,70998.33
Table A4. Attack-specific FNR and one-vs-benign F1, part 2 of 2.
Table A4. Attack-specific FNR and one-vs-benign F1, part 2 of 2.
No.FamilyAttack TypeSupportFNFNR (%)Effective Benign SupportWeighted Reference FPOne-vs-Benign F1 (%)
18MiraiMirai-greip_flood225,00023851.06225,00010,05897.28
19MiraiMirai-udpplain28,92816575.7328,928129394.87
20ReconnaissanceRecon-HostDiscovery108,00026452.45108,000545496.30
21ReconnaissanceRecon-OSScan54,00016473.0554,000272795.99
22ReconnaissanceRecon-PingSweep12,0007566.3012,00066094.08
23ReconnaissanceRecon-PortScan58,00018563.2058,000292995.91
24ReconnaissanceVulnerabilityScan71,72019722.7571,720380196.03
25SpoofingDNS_Spoofing49,00017163.5049,000254895.69
26SpoofingMITM-ArpSpoofing11,7445824.9611,74464694.79
27Web-basedBackdoor_Malware650071811.05650038091.33
28Web-basedBrowserHijacking690079011.45690041191.05
29Web-basedCommandInjection8100122315.10810048688.95
30Web-basedSqlInjection10,500109210.4010,50059391.78
31Web-basedUploading_Attack504682816.41504630388.18
32Web-basedXSS750092212.29750044690.58
33Brute forceDictionaryBruteForce16,197358322.1216,197101284.59

References

  1. Zarpelão, B.B.; Miani, R.S.; Kawakani, C.T.; de Alvarenga, S.C. A survey of intrusion detection in Internet of Things. J. Netw. Comput. Appl. 2017, 84, 25–37. [Google Scholar] [CrossRef]
  2. Chaabouni, N.; Mosbah, M.; Zemmari, A.; Sauvignac, C.; Faruki, P. Network Intrusion Detection for IoT Security Based on Learning Techniques. IEEE Commun. Surv. Tutor. 2019, 21, 2671–2701. [Google Scholar] [CrossRef]
  3. Al-Garadi, M.A.; Mohamed, A.; Al-Ali, A.K.; Du, X.; Ali, I.; Guizani, M. A Survey of Machine and Deep Learning Methods for Internet of Things Security. IEEE Commun. Surv. Tutor. 2020, 22, 1646–1685. [Google Scholar] [CrossRef]
  4. Tange, K.P.; De Donno, M.; Fafoutis, X.; Dragoni, N. A Systematic Survey of Industrial Internet of Things Security: Requirements and Fog Computing Opportunities. IEEE Commun. Surv. Tutor. 2020, 22, 2489–2520. [Google Scholar] [CrossRef]
  5. Hafeez, I.; Antikainen, M.; Ding, A.Y.; Tarkoma, S. IoT-KEEPER: Detecting Malicious IoT Network Activity Using Online Traffic Analysis at the Edge. IEEE Trans. Netw. Serv. Manag. 2020, 17, 45–59. [Google Scholar] [CrossRef]
  6. Mirsky, Y.; Doitshman, T.; Elovici, Y.; Shabtai, A. Kitsune: An Ensemble of Autoencoders for Online Network Intrusion Detection. In Proceedings of the Network and Distributed System Security Symposium. Internet Society, San Diego, CA, USA, 18–21 February 2018. [Google Scholar] [CrossRef]
  7. Diro, A.A.; Chilamkurti, N. Distributed attack detection scheme using deep learning approach for Internet of Things. Future Gener. Comput. Syst. 2018, 82, 761–768. [Google Scholar] [CrossRef]
  8. Doshi, R.; Apthorpe, N.; Feamster, N. Machine Learning DDoS Detection for Consumer Internet of Things Devices. In Proceedings of the 2018 IEEE Security and Privacy Workshops; IEEE: New York, NY, USA, 2018; pp. 29–35. [Google Scholar] [CrossRef]
  9. Meidan, Y.; Bohadana, M.; Mathov, Y.; Mirsky, Y.; Shabtai, A.; Breitenbacher, D.; Elovici, Y. N-BaIoT: Network-Based Detection of IoT Botnet Attacks Using Deep Autoencoders. IEEE Pervasive Comput. 2018, 17, 12–22. [Google Scholar] [CrossRef]
  10. Bernaille, L.; Teixeira, R.; Akodkenou, I.; Soule, A.; Salamatian, K. Traffic Classification on the Fly. ACM SIGCOMM Comput. Commun. Rev. 2006, 36, 23–26. [Google Scholar] [CrossRef]
  11. Bernaille, L.; Teixeira, R. Early Recognition of Encrypted Applications. In Passive and Active Network Measurement; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2007; Volume 4427, pp. 165–175. [Google Scholar] [CrossRef]
  12. Dainotti, A.; Pescapè, A.; Sansone, C. Early Classification of Network Traffic through Multi-classification. In Traffic Monitoring and Analysis; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2011; Volume 6613, pp. 122–135. [Google Scholar] [CrossRef] [PubMed]
  13. Gupta, K.; Gupta, A.; Dutta, P. Towards Identifying Internet Applications Using Early Classification of Traffic Flow. In Proceedings of the 2021 IFIP Networking Conference; IEEE: New York, NY, USA, 2021; pp. 1–9. [Google Scholar] [CrossRef]
  14. Alizadeh, H.; Vranken, H.P.E.; Zúquete, A.; Miri, A. Timely Classification and Verification of Network Traffic Using Gaussian Mixture Models. IEEE Access 2020, 8, 91287–91302. [Google Scholar] [CrossRef]
  15. Roy, S.; Shapira, T.; Shavitt, Y. Fast and lean encrypted Internet traffic classification. Comput. Commun. 2022, 186, 166–173. [Google Scholar] [CrossRef]
  16. Wang, T.; Xu, Y.; Tang, Z. Toward fast network intrusion detection for web services: Partial-flow feature extraction and dataset construction. Int. J. Web Inf. Syst. 2025, 21, 77–95. [Google Scholar] [CrossRef]
  17. Yang, R.; He, H.; Xu, Y.; Xin, B.; Wang, Y.; Qu, Y.; Zhang, W. Efficient intrusion detection toward IoT networks using cloud–edge collaboration. Comput. Netw. 2023, 228, 109724. [Google Scholar] [CrossRef]
  18. Friha, O.; Ferrag, M.A.; Shu, L.; Maglaras, L.; Choo, K.K.R.; Nafaa, M. FELIDS: Federated learning-based intrusion detection system for agricultural Internet of Things. J. Parallel Distrib. Comput. 2022, 165, 17–31. [Google Scholar] [CrossRef]
  19. Li, B.; Wu, Y.; Song, J.; Lu, R.; Li, T.; Zhao, L. DeepFed: Federated Deep Learning for Intrusion Detection in Industrial Cyber–Physical Systems. IEEE Trans. Ind. Inform. 2021, 17, 5615–5624. [Google Scholar] [CrossRef]
  20. Liu, H.; Zhang, S.; Zhang, P.; Zhou, X.; Shao, X.; Pu, G.; Zhang, Y. Blockchain and Federated Learning for Collaborative Intrusion Detection in Vehicular Edge Computing. IEEE Trans. Veh. Technol. 2021, 70, 6073–6084. [Google Scholar] [CrossRef]
  21. Zadrozny, B.; Elkan, C. Transforming classifier scores into accurate multiclass probability estimates. In Proceedings of the Eighth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining; ACM: New York, NY, USA, 2002; pp. 694–699. [Google Scholar] [CrossRef]
  22. Niculescu-Mizil, A.; Caruana, R. Predicting Good Probabilities with Supervised Learning. In Proceedings of the 22nd International Conference on Machine Learning; ACM: New York, NY, USA, 2005; pp. 625–632. [Google Scholar] [CrossRef]
  23. Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K.Q. On Calibration of Modern Neural Networks. In Proceedings of the 34th International Conference on Machine Learning; Proceedings of Machine Learning Research; PMLR: Cambridge, MA, USA, 2017; Volume 70, pp. 1321–1330. [Google Scholar]
  24. Bartlett, P.L.; Wegkamp, M.H. Classification with a Reject Option using a Hinge Loss. J. Mach. Learn. Res. 2008, 9, 1823–1840. [Google Scholar]
  25. Geifman, Y.; El-Yaniv, R. Selective Classification for Deep Neural Networks. In Proceedings of the Advances in Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017; Volume 30, pp. 4878–4887. [Google Scholar]
  26. Sommer, R.; Paxson, V. Outside the Closed World: On Using Machine Learning for Network Intrusion Detection. In Proceedings of the 2010 IEEE Symposium on Security and Privacy; IEEE: New York, NY, USA, 2010; pp. 305–316. [Google Scholar] [CrossRef]
  27. Ring, M.; Wunderlich, S.; Scheuring, D.; Landes, D.; Hotho, A. A survey of network-based intrusion detection data sets. Comput. Secur. 2019, 86, 147–167. [Google Scholar] [CrossRef]
  28. Engelen, G.; Rimmer, V.; Joosen, W. Troubleshooting an Intrusion Detection Dataset: The CICIDS2017 Case Study. In Proceedings of the 2021 IEEE Security and Privacy Workshops; IEEE: New York, NY, USA, 2021; pp. 7–12. [Google Scholar] [CrossRef]
  29. Wardana, A.A.; Kołaczek, G.; Sukarno, P. Lightweight, Trust-Managing, and Privacy-Preserving Collaborative Intrusion Detection for Internet of Things. Appl. Sci. 2024, 14, 4109. [Google Scholar] [CrossRef]
  30. Nedungadi, N.; Sankaran, S.; Achuthan, K. Towards a Lightweight Hybrid Multimodal Approach for Intrusion Detection in Edge-Enabled IoT Devices. Clust. Comput. 2025, 28, 1010. [Google Scholar] [CrossRef]
  31. Wang, S.; Wang, C.; Shi, C.; Liu, Y.; Lu, M. Mask-Guided Mamba Fusion for Drone-Based Visible-Infrared Vehicle Detection. IEEE Trans. Geosci. Remote Sens. 2024, 62, 5005712. [Google Scholar] [CrossRef]
  32. Neto, E.C.P.; Dadkhah, S.; Ferreira, R.; Zohourian, A.; Lu, R.; Ghorbani, A.A. CICIoT2023: A Real-Time Dataset and Benchmark for Large-Scale Attacks in IoT Environment. Sensors 2023, 23, 5941. [Google Scholar] [CrossRef] [PubMed]
  33. Sharafaldin, I.; Habibi Lashkari, A.; Ghorbani, A.A. Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization. In Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP); SciTePress: Setubal, Portugal, 2018; pp. 108–116. [Google Scholar] [CrossRef]
Figure 1. Overview of the proposed reliability-aware edge–cloud framework for early IoT intrusion detection. The framework separates causal flow representation, calibrated edge decision-making, and selective cloud refinement for unresolved flows.
Figure 1. Overview of the proposed reliability-aware edge–cloud framework for early IoT intrusion detection. The framework separates causal flow representation, calibrated edge decision-making, and selective cloud refinement for unresolved flows.
Electronics 15 03506 g001
Figure 2. Route composition and route-conditional errors on the pooled PCAP-disjoint predictions. Panel (a) separates mandatory short-flow refinement, unresolved edge-eligible flows, and local exits. Panel (b) reports FPR and FNR for the full policy and the two selected routes; route-specific values are conditional on policy assignment.
Figure 2. Route composition and route-conditional errors on the pooled PCAP-disjoint predictions. Panel (a) separates mandatory short-flow refinement, unresolved edge-eligible flows, and local exits. Panel (b) reports FPR and FNR for the full policy and the two selected routes; route-specific values are conditional on policy assignment.
Electronics 15 03506 g002
Figure 3. Pooled PCAP-disjoint confusion matrix for the final policy. Each cell reports the raw count and row-normalized percentage, making benign and malicious error rates visible despite the 88.54 % malicious prevalence.
Figure 3. Pooled PCAP-disjoint confusion matrix for the final policy. Each cell reports the raw count and row-normalized percentage, making benign and malicious error rates visible despite the 88.54 % malicious prevalence.
Electronics 15 03506 g003
Figure 4. Calibrated operating-point comparison on the pooled PCAP-disjoint predictions. Panel (a) reports the FPR–FNR trade-off. Panel (b) reports balanced accuracy and edge-exit share, with complementary cloud-routing share on the upper axis. Connectors indicate only the ordering of the four evaluated policies.
Figure 4. Calibrated operating-point comparison on the pooled PCAP-disjoint predictions. Panel (a) reports the FPR–FNR trade-off. Panel (b) reports balanced accuracy and edge-exit share, with complementary cloud-routing share on the upper axis. Connectors indicate only the ordering of the four evaluated policies.
Electronics 15 03506 g004
Figure 5. Reliability diagrams used as temperature-scaling fit diagnostics on the calibration roles. Pooled ECE decreases from 4.86 % to 1.31 % on these roles; the diagonal denotes perfect calibration.
Figure 5. Reliability diagrams used as temperature-scaling fit diagnostics on the calibration roles. Pooled ECE decreases from 4.86 % to 1.31 % on these roles; the diagonal denotes perfect calibration.
Electronics 15 03506 g005
Figure 6. Receiver operating characteristic curve for pooled end-to-end test scores. The dashed diagonal is the random baseline; AUROC is 0.9901 .
Figure 6. Receiver operating characteristic curve for pooled end-to-end test scores. The dashed diagonal is the random baseline; AUROC is 0.9901 .
Electronics 15 03506 g006
Figure 7. Precision–recall curve for pooled end-to-end test scores. The dashed line is the malicious-prevalence baseline of 0.8854 ; AUPRC is 0.9984 .
Figure 7. Precision–recall curve for pooled end-to-end test scores. The dashed line is the malicious-prevalence baseline of 0.8854 ; AUPRC is 0.9984 .
Electronics 15 03506 g007
Figure 8. Checkpoint-specific behavior of the principal policy. Panel (a) separates benign and malicious exits at packets 8, 16, and 32. Panel (b) reports error rates and balanced accuracy conditional on the first exit at each checkpoint; earlier exits are absent from later checkpoint populations.
Figure 8. Checkpoint-specific behavior of the principal policy. Panel (a) separates benign and malicious exits at packets 8, 16, and 32. Panel (b) reports error rates and balanced accuracy conditional on the first exit at each checkpoint; earlier exits are absent from later checkpoint populations.
Electronics 15 03506 g008
Figure 9. Ablation effects relative to the final policy on pooled PCAP-disjoint predictions. Panel (a) reports changes in accuracy, balanced accuracy, and F1 score; panel (b) reports changes in FPR and FNR. Removing the minimum-evidence gate causes the largest degradation.
Figure 9. Ablation effects relative to the final policy on pooled PCAP-disjoint predictions. Panel (a) reports changes in accuracy, balanced accuracy, and F1 score; panel (b) reports changes in FPR and FNR. Removing the minimum-evidence gate causes the largest degradation.
Electronics 15 03506 g009
Figure 10. Cloud-refinement contribution under the fixed principal routing policy. Panel (a) compares the final policy, the same routing decisions without cloud refinement, and an all-cloud reference. Panel (b) reports the final policy’s error reductions and metric gains relative to the no-cloud-refinement ablation.
Figure 10. Cloud-refinement contribution under the fixed principal routing policy. Panel (a) compares the final policy, the same routing decisions without cloud refinement, and an all-cloud reference. Panel (b) reports the final policy’s error reductions and metric gains relative to the no-cloud-refinement ablation.
Electronics 15 03506 g010
Figure 11. Observation-horizon and delayed-information sensitivity. Panel (a) compares independently trained and calibrated 16-, 32-, and 64-packet policies. Panel (b) delays all information after packet 8 on 39,880 malicious flows with at least 64 packets; FNR increases for every horizon, most sharply at 16 packets.
Figure 11. Observation-horizon and delayed-information sensitivity. Panel (a) compares independently trained and calibrated 16-, 32-, and 64-packet policies. Panel (b) delays all information after packet 8 on 39,880 malicious flows with at least 64 packets; FNR increases for every horizon, most sharply at 16 packets.
Electronics 15 03506 g011
Figure 12. Supervised threshold adaptation during the chronological drift replay: (a) block-wise FPR under static and sliding-window thresholds, including the 1.25 % control reference; (b) block-wise edge-exit share. Adaptation lowers replay-average FPR from 1.61 % to 1.08 % while reducing edge-exit share from 15.54 % to 15.09 % .
Figure 12. Supervised threshold adaptation during the chronological drift replay: (a) block-wise FPR under static and sliding-window thresholds, including the 1.25 % control reference; (b) block-wise edge-exit share. Adaptation lowers replay-average FPR from 1.61 % to 1.08 % while reducing edge-exit share from 15.54 % to 15.09 % .
Electronics 15 03506 g012
Figure 13. Matched comparison of causal edge backbones under a common feature, calibration, routing, fold, and cloud-refinement protocol. Panel (a) reports the FPR and FNR of the candidate edge models; panel (b) compares balanced accuracy and measured p95 gateway latency using the same model ordering.
Figure 13. Matched comparison of causal edge backbones under a common feature, calibration, routing, fold, and cloud-refinement protocol. Panel (a) reports the FPR and FNR of the candidate edge models; panel (b) compares balanced accuracy and measured p95 gateway latency using the same model ordering.
Electronics 15 03506 g013
Figure 14. CICIDS2017 in-domain and cross-dataset evaluation. Panel (a) compares in-domain development, zero-shot transfer, and target-calibration-only adaptation. Panel (b) reports GRU FPR and FNR. Target-calibration-only adaptation recovers part of the zero-shot loss, but its performance remains below the in-domain result. (a) Balanced accuracy across external-validation modes; (b) GRU FPR and FNR across external-validation modes.
Figure 14. CICIDS2017 in-domain and cross-dataset evaluation. Panel (a) compares in-domain development, zero-shot transfer, and target-calibration-only adaptation. Panel (b) reports GRU FPR and FNR. Target-calibration-only adaptation recovers part of the zero-shot loss, but its performance remains below the in-domain result. (a) Balanced accuracy across external-validation modes; (b) GRU FPR and FNR across external-validation modes.
Electronics 15 03506 g014
Figure 15. Attack-specific FNR on pooled PCAP-disjoint CIC-IoT-2023 predictions. Panel (a) reports the seven attack families; panel (b) highlights representative types from the complete 33-type analysis in Appendix B.
Figure 15. Attack-specific FNR on pooled PCAP-disjoint CIC-IoT-2023 predictions. Panel (a) reports the seven attack families; panel (b) highlights representative types from the complete 33-type analysis in Appendix B.
Electronics 15 03506 g015
Table 1. Main notation used in the proposed framework formulation.
Table 1. Main notation used in the proposed framework formulation.
SymbolDescription
F i Ordered packet-feature sequence representing flow i.
x i , t Packet-level feature vector for the t-th packet of flow i.
n i Observed length of flow i, measured in packets.
F i , 1 : t Prefix of flow i observed up to checkpoint t.
C Set of predefined decision checkpoints.
L max Maximum observation budget for edge inference.
m min Minimum packet-evidence requirement before a local edge exit is permitted.
L ¯ i Final available observation point for flow i, defined as min ( n i , L max ) .
C i Evaluated checkpoint set for flow i, including checkpoints before L ¯ i and the final available observation point.
ϕ t ( · ) Feature-transformation function at checkpoint t.
E θ Causal sequence encoder used by the edge model.
h i , t Hidden representation of flow i at checkpoint t.
f θ Edge classifier head applied to the hidden representation.
z i , t Uncalibrated edge score for flow i at checkpoint t.
C ψ Calibration mapping from edge score to calibrated malicious probability.
q i , t Calibrated probability that the eventual flow label is malicious given prefix F i , 1 : t .
τ B Benign-exit threshold used by the edge routing policy.
τ M Malicious-exit threshold used by the edge routing policy.
π ( q i , t , t ) Routing policy that returns an edge decision, continued observation, or cloud refinement.
r i Compact cloud-escalation representation for flow i.
s i , L ¯ i Prefix-only summary statistics at the final available observation point.
g ϕ Cloud-refinement classifier applied to escalated flows.
Y ^ i c Cloud decision for escalated flow i.
D cal Calibration partition used for calibration and threshold selection.
ϵ B , ϵ M Calibration-set operating targets for benign-exit and malicious-exit risks.
R B , R M Conditional risks associated with benign and malicious early exits.
Table 2. Full CIC-IoT-2023 flow inventory and modeling corpus.
Table 2. Full CIC-IoT-2023 flow inventory and modeling corpus.
ItemFull Reconstructed CorpusModeling Corpus
PCAP files309309
Total flows81,253,8972,286,754
Benign flows261,955261,955
Malicious flows80,991,9422,024,799
Malicious prevalence99.68%88.54%
Flows with n i < 8 58,291,5461,640,517
Flows with n i 8 22,962,351646,237
Flows with n i 16 18,452,760519,322
Flows with n i 32 3,965,190111,594
Flows with n i 64 1,592,57644,820
Table 3. Flow-length and edge-eligibility distribution in the full and modeling corpora.
Table 3. Flow-length and edge-eligibility distribution in the full and modeling corpora.
Flow-Length GroupFull Reconstructed CorpusModeling Corpus
FlowsPercentageFlowsPercentage
n i < 8 58,291,54671.74%1,640,51771.74%
n i 8 22,962,35128.26%646,23728.26%
n i 16 18,452,76022.71%519,32222.71%
n i 32 3,965,1904.88%111,5944.88%
n i 64 1,592,5761.96%44,8201.96%
Table 4. Outer PCAP-disjoint test support.
Table 4. Outer PCAP-disjoint test support.
Outer FoldTest FlowsBenignMaliciousAttack TypesHeld-Out Benign PCAP
Fold 1567,891122,891445,00031BenignTraffic.pcap
Fold 2571,56155,061516,50032BenignTraffic1.pcap
Fold 3571,68858,488513,20031BenignTraffic2.pcap
Fold 4575,61425,515550,09933BenignTraffic3.pcap
Pooled out-of-fold2,286,754261,9552,024,79933All four
Table 5. Development-role support within each outer fold.
Table 5. Development-role support within each outer fold.
Outer FoldEdge TrainingCalibrationCloud DevelopmentOuter Test
Fold 11,074,289322,287322,287567,891
Fold 21,071,996321,598321,599571,561
Fold 31,071,916321,575321,575571,688
Fold 41,069,462320,839320,839575,614
Table 6. Mandatory cloud-route lower bounds in the outer test folds.
Table 6. Mandatory cloud-route lower bounds in the outer test folds.
Outer Fold n i < 8 BenignMaliciousMaximum Edge-Eligible Share
Fold 1397,47577,793319,68230.01%
Fold 2415,53844,523371,01527.30%
Fold 3414,00946,805367,20427.58%
Fold 4413,49520,416393,07928.16%
Pooled out-of-fold1,640,517189,5371,450,98028.26%
Table 7. Packet-level causal feature schema used by the edge model.
Table 7. Packet-level causal feature schema used by the edge model.
Feature GroupImplemented Fields
Timing featuresRelative packet time; inter-arrival time; normalized packet index within the observed prefix.
Size featuresPacket length; payload length as a numeric length field.
Direction featurePacket direction encoded as forward or backward relative to the normalized bidirectional flow.
Header featureTime-to-live or hop-limit value when available; otherwise, a missing-value indicator is used.
Protocol indicatorsOne-hot indicators for TCP, UDP, ICMP, and other protocols.
TCP flag indicatorsBinary indicators for SYN, ACK, FIN, RST, PSH, URG, ECE, and CWR flags.
Port-category indicatorsSource-port and destination-port categories encoded as well-known, registered, ephemeral, or unavailable.
Table 8. Main experimental implementation settings.
Table 8. Main experimental implementation settings.
ComponentSetting
Maximum sequence length L max = 32 packets.
Checkpoint set { 2 , 4 , 8 , 16 , 32 } .
Minimum evidence gate m min = 8 packets.
Edge input tensor B × 32 × 26 .
Edge encoderOne-layer GRU, hidden dimension 64.
Classifier headDense 32, ReLU, dropout 0.2, linear output.
Loss functionWeighted binary cross-entropy with logits.
OptimizerAdam, learning rate 10 3 , weight decay 10 5 .
Batch size1024.
Maximum epochs50.
Early stoppingValidation loss, patience 7, minimum improvement 10 4 .
CalibrationTemperature scaling on the calibration partition.
Threshold grid τ B = 0.01 to 0.49 and τ M = 0.51 to 0.99, step 0.01.
Risk targets ϵ B = ϵ M = 0.02 .
Cloud classifierLogistic regression on compact cloud vector.
Cloud representation97 features: 64 edge-hidden features and 33 prefix-summary or score-derived features.
Cloud regularizationL2 regularization, C = 1.0 .
Cloud solverlbfgs, maximum 1000 iterations, class-balanced weighting.
SoftwarePython (v3.10.12), NumPy (v1.26.4), pandas (v2.2.2), scikit-learn (v1.5.1), PyTorch (v2.3.1), and XGBoost (v2.1.1).
Random seed2026070501.
Table 9. Fixed CICIDS2017 balanced modeling partitions.
Table 9. Fixed CICIDS2017 balanced modeling partitions.
RoleBenignMaliciousTotal
Edge training269,319269,319538,638
Calibration80,79680,796161,592
Cloud development80,79680,796161,592
Fixed test107,726107,726215,452
Table 10. Principal pooled PCAP-disjoint confusion matrix.
Table 10. Principal pooled PCAP-disjoint confusion matrix.
Actual ClassPredicted BenignPredicted MaliciousTotal
Benign250,24711,708261,955
Malicious38,2681,986,5312,024,799
Total288,5151,998,2392,286,754
Table 11. Route-stratified pooled detection results.
Table 11. Route-stratified pooled detection results.
RouteSupportBenignMaliciousTNFPFNTPFPR (%)FNR (%)Bal. Acc. (%)
Edge exit422,19048,000374,19043,9204080936373,2548.500.2595.63
Cloud-routed1,864,564213,9551,650,609206,327762837,3321,613,2773.572.2697.09
All flows2,286,754261,9552,024,799250,24711,70838,2681,986,5314.471.8996.82
Table 12. Static operating points under progressively stricter benign-FPR constraints.
Table 12. Static operating points under progressively stricter benign-FPR constraints.
PolicyFPFNFPR (%)FNR (%)Bal. Acc. (%)Edge Share (%)Cloud Share (%)
Principal static11,70838,2684.471.8996.8218.4681.54
Validation FPR 2 % 523953,6572.002.6597.6816.8983.11
Validation FPR 1 % 262071,8801.003.5597.7215.3784.63
Validation FPR 0.5 % 131097,1900.504.8097.3514.1185.89
Table 13. Fold-specific temperature-scaling fit diagnostics on the calibration roles.
Table 13. Fold-specific temperature-scaling fit diagnostics on the calibration roles.
FoldTemperatureECE Raw (%)ECE Calibrated (%)NLL RawNLL CalibratedBrier RawBrier Calibrated
Fold 11.364.721.280.1240.0970.0310.025
Fold 21.424.951.350.1280.0990.0330.026
Fold 31.394.811.300.1260.0980.0320.026
Fold 41.454.991.330.1290.1000.0330.027
Pooled1.414.861.310.1270.0990.0320.026
Table 14. Threshold-independent discrimination on pooled out-of-fold predictions.
Table 14. Threshold-independent discrimination on pooled out-of-fold predictions.
Evaluation SubsetSupportAUROCAUPRC
Edge GRU, n i 8 646,2370.98720.9978
Cloud-routed flows1,864,5640.98240.9971
Final end-to-end scores2,286,7540.99010.9984
Table 15. Route-load and edge-exit checkpoint profile under the principal policy.
Table 15. Route-load and edge-exit checkpoint profile under the principal policy.
Route ComponentFlowsAll-Flow Share (%)Edge-Exit Share (%)
Edge exit at packet 8264,34811.5662.61
Edge exit at packet 16109,8424.8026.02
Edge exit at packet 3248,0002.1011.37
All edge exits422,19018.46100.00
Mandatory cloud, n i < 8 1,640,51771.74
Unresolved cloud, n i 8 224,0479.80
All cloud-routed flows1,864,56481.54
Table 16. Feature-vector communication accounting under the principal policy.
Table 16. Feature-vector communication accounting under the principal policy.
SettingCloud FlowsFeaturesBytes/FlowPayload
All-cloud submission2,286,75497388846.16 MiB
Selective edge–cloud policy1,864,56497388689.94 MiB
Avoided submissions422,190156.22 MiB
Relative reduction18.46%18.46%
Table 17. Model-size and representation-size proxy for edge and cloud stages. Parameter counts are reported for the implementation described in Section 4.11.
Table 17. Model-size and representation-size proxy for edge and cloud stages. Parameter counts are reported for the implementation described in Section 4.11.
QuantityValueInterpretation
Edge input tensor per flow 32 × 26 Maximum padded packet-prefix tensor
Edge input size, float323328 bytesFull padded edge tensor before batching
Cloud vector length97 featuresCompact representation for escalated flows
Cloud vector size, float32388 bytesPayload proxy per cloud-submitted flow
Edge GRU hidden dimension64Final hidden representation size
Approximate edge-model parameters19,777GRU encoder and classifier head
Cloud-model parameters98Logistic-regression weights and intercept
Table 18. Ablation results for the principal routing and reliability controls.
Table 18. Ablation results for the principal routing and reliability controls.
Policy VariantFPR (%)FNR (%)Bal. Acc. (%)Edge Share (%)
Final policy4.471.8996.8218.46
No minimum-evidence gate18.704.0288.6463.28
No cloud refinement10.424.3692.6118.46
Symmetric thresholds7.683.1894.5720.24
No temperature scaling6.362.5795.5419.11
No benign edge exit3.711.7997.2514.36
No malicious edge exit4.282.0496.844.10
Table 19. Sensitivity to the maximum packet-observation budget.
Table 19. Sensitivity to the maximum packet-observation budget.
L max FPFNFPR (%)FNR (%)Bal. Acc. (%)Edge ExitsEdge Share (%)Mean Exit PacketMean Packets Processed
1612,88947,5814.922.3596.36391,62017.1310.946.47
3211,70838,2684.471.8996.82422,19018.4612.816.93
6411,57836,8514.421.8296.88430,80418.8413.377.11
Table 20. Sensitivity to delayed post-eight-packet information on malicious flows with at least 64 packets.
Table 20. Sensitivity to delayed post-eight-packet information on malicious flows with at least 64 packets.
Delay L max = 16 L max = 32 L max = 64
(Packets)FNR (%)Malicious Edge Exits (%)FNR (%)Malicious Edge Exits (%)FNR (%)Malicious Edge Exits (%)
02.0165.201.0873.801.0175.60
43.1559.101.3369.601.1473.10
84.7250.401.6962.301.2968.40
169.8831.202.9447.101.7259.20
3218.489.808.7523.403.0542.50
Table 21. Expected alert precision and alert burden under alternative malicious-flow prevalences.
Table 21. Expected alert precision and alert burden under alternative malicious-flow prevalences.
Malicious PrevalencePolicyAlert Precision (%)Alerts per 10 6 FlowsFalse Alerts per 10 6 Flows
10%Principal static70.92138,33540,225
10%1% FPR policy91.46105,4529002
10%0.5% FPR policy95.4999,7014501
1%Principal static18.1554,05944,248
1%1% FPR policy49.3419,5479902
1%0.5% FPR policy65.7914,4714951
0.1%Principal static2.1545,63144,650
0.1%1% FPR policy8.8010,9569992
0.1%0.5% FPR policy16.0159484996
0.01%Principal static0.2244,78844,690
0.01%1% FPR policy0.9610,09710,001
0.01%0.5% FPR policy1.8750965000
Table 22. Static and sliding-window threshold performance in the chronological drift replay.
Table 22. Static and sliding-window threshold performance in the chronological drift replay.
PolicyFPFNFPR (%)FNR (%)Bal. Acc. (%)Edge Share (%)
Static 1 % -FPR thresholds423012631.614.3497.0215.54
Sliding-window thresholds283812341.084.2497.3415.09
Table 23. Policy and fixed-checkpoint comparators on the pooled PCAP-disjoint evaluation.
Table 23. Policy and fixed-checkpoint comparators on the pooled PCAP-disjoint evaluation.
MethodFPFNFPR (%)FNR (%)Bal. Acc. (%)Edge Share (%)Cloud Share (%)
All-cloud reference969343,1583.702.1397.080.00100.00
Fixed checkpoint 815,19345,5585.802.2595.9828.2671.74
Fixed checkpoint 1613,41141,5105.122.0596.4222.7177.29
Fixed checkpoint 3212,18139,4834.651.9596.704.8895.12
Sequential principal policy11,70838,2684.471.8996.8218.4681.54
Table 24. Matched end-to-end performance of independent causal edge models on the pooled CIC-IoT-2023 evaluation.
Table 24. Matched end-to-end performance of independent causal edge models on the pooled CIC-IoT-2023 evaluation.
Edge ModelFPFNFPR (%)FNR (%)Bal. Acc. (%)F1 (%)Edge ExitsEdge Share (%)
Proposed GRU11,70838,2684.471.8996.8298.76422,19018.46
Lightweight 1D CNN13,43745,5585.132.2596.3198.53399,80017.48
Compact LSTM-attention11,26336,8514.301.8296.9498.80414,90018.14
Temporal convolutional network12,23441,7124.672.0696.6398.66406,50017.78
XGBoost prefix baseline14,14548,5955.402.4096.1098.44371,70016.25
Table 25. Edge-model implementation cost measured on a Raspberry Pi 5.
Table 25. Edge-model implementation cost measured on a Raspberry Pi 5.
Edge ModelParametersSize (KiB)32-Packet Costp50 (ms)p95 (ms)
Proposed GRU19,77777.30.58 M0.310.48
Lightweight 1D CNN18,91373.90.43 M0.240.39
Compact LSTM-attention29,249114.30.91 M0.550.86
Temporal convolutional network21,34583.40.62 M0.290.46
XGBoost prefix baseline1340.0156 node evaluations0.190.31
Table 26. CICIDS2017 in-domain performance on the fixed balanced test set.
Table 26. CICIDS2017 in-domain performance on the fixed balanced test set.
Edge ModelFPFNFPR (%)FNR (%)Bal. Acc. (%)Edge Share (%)
Proposed GRU307033292.853.0997.0318.00
Lightweight 1D CNN349037393.243.4796.6416.79
Compact LSTM-attention293031352.722.9197.1817.70
Temporal convolutional network325334473.023.2096.8917.20
XGBoost prefix baseline274739972.553.7196.8715.40
Table 27. Zero-shot transfer from the single CIC-IoT-2023 transfer-source systems to the fixed CICIDS2017 test set.
Table 27. Zero-shot transfer from the single CIC-IoT-2023 transfer-source systems to the fixed CICIDS2017 test set.
Edge ModelFPFNFPR (%)FNR (%)Bal. Acc. (%)Edge Share (%)
Proposed GRU12,71316,80711.8015.6086.3011.90
Lightweight 1D CNN14,54318,63713.5017.3084.6010.80
Compact LSTM-attention11,96016,05211.1014.9087.0011.50
Temporal convolutional network13,57417,12912.6015.9085.7511.20
XGBoost prefix baseline17,02220,57515.8019.1082.558.70
Table 28. CICIDS2017 target-calibration-only transfer with frozen CIC-IoT-2023 transfer-source edge models and cloud classifiers.
Table 28. CICIDS2017 target-calibration-only transfer with frozen CIC-IoT-2023 transfer-source edge models and cloud classifiers.
Edge ModelFPFNFPR (%)FNR (%)Bal. Acc. (%)Edge Share (%)
Proposed GRU667911,3116.2010.5091.6514.60
Lightweight 1D CNN764812,3887.1011.5090.7013.40
Compact LSTM-attention624810,5565.809.8092.2014.20
Temporal convolutional network711011,6346.6010.8091.3013.90
XGBoost prefix baseline958814,8668.9013.8088.6511.10
Table 29. Attack-family performance on pooled out-of-fold CIC-IoT-2023 predictions.
Table 29. Attack-family performance on pooled out-of-fold CIC-IoT-2023 predictions.
FamilySupportFNFNR (%)Effective Benign SupportWeighted Reference FPOne-vs.-Benign F1 (%)
DDoS708,68074481.05261,95510,47898.74
DoS161,98421731.34161,984680397.27
Mirai728,92883171.14261,95511,70998.63
Reconnaissance303,72088762.92261,95513,22996.39
Spoofing60,74422983.7860,744315995.54
Web-based44,546557312.5144,546251790.60
Brute force16,197358322.1216,197101284.59
Table 30. Contextual comparison with recent lightweight edge-oriented IDS studies.
Table 30. Contextual comparison with recent lightweight edge-oriented IDS studies.
StudyArchitecture and SettingDatasetReported Result
Wardana et al. [29]Hierarchical edge–fog–cloud federated DNN with trust and privacy mechanismsCIC-IoT-2023 and NF-UNSW-NB15-v2Accuracy 97.65%; precision 97.65%; recall 100%; F1 98.81%
Nedungadi et al. [30]LGBM–XGBoost multimodal ensemble deployed on Raspberry Pi 4Edge-IIoTsetBinary accuracy 98.51%; multiclass accuracy 88.41%; CPU utilization 17–18%
This studyCausal GRU edge exits with selective logistic-regression cloud refinement309-PCAP CIC-IoT-2023 evaluationBalanced accuracy 96.82%; FPR 4.47%; FNR 1.89%; edge exits 18.46%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Azam, S.; Naaz, F.; Salim, M.M. A Reliability-Aware Edge–Cloud Framework for Early Intrusion Detection in IoT Networks. Electronics 2026, 15, 3506. https://doi.org/10.3390/electronics15163506

AMA Style

Azam S, Naaz F, Salim MM. A Reliability-Aware Edge–Cloud Framework for Early Intrusion Detection in IoT Networks. Electronics. 2026; 15(16):3506. https://doi.org/10.3390/electronics15163506

Chicago/Turabian Style

Azam, Siraj, Farheen Naaz, and Mikail Mohammed Salim. 2026. "A Reliability-Aware Edge–Cloud Framework for Early Intrusion Detection in IoT Networks" Electronics 15, no. 16: 3506. https://doi.org/10.3390/electronics15163506

APA Style

Azam, S., Naaz, F., & Salim, M. M. (2026). A Reliability-Aware Edge–Cloud Framework for Early Intrusion Detection in IoT Networks. Electronics, 15(16), 3506. https://doi.org/10.3390/electronics15163506

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop