Javascript is required
1.
A. A. Megantara and T. Ahmad, “A hybrid machine learning method for increasing the performance of network intrusion detection systems,” J. Big Data, vol. 8, p. 142, 2021. [Google Scholar] [Crossref]
2.
V. Babaey and H. R. Faragardi, “Detecting zero-day web attacks with an ensemble of LSTM, GRU, and stacked autoencoders,” Computers, vol. 14, no. 6, p. 205, 2025. [Google Scholar] [Crossref]
3.
H. Torabi, S. L. Mirtaheri, and S. Greco, “Practical autoencoder based anomaly detection by using vector reconstruction error,” Cybersecurity, vol. 6, p. 1, 2023. [Google Scholar] [Crossref]
4.
A. M. Elshewey, S. Abbas, A. M. Osman, E. A. Aldakheel, and Y. Fouad, “DDoS classification of network traffic in software defined networking SDN using a hybrid convolutional and gated recurrent neural network,” Sci. Rep., vol. 15, p. 29122, 2025. [Google Scholar] [Crossref]
5.
A. M. Alashjaee, “Deep learning for network security: An attention-CNN-LSTM model for accurate intrusion detection,” Sci. Rep., vol. 15, p. 21856, 2025. [Google Scholar] [Crossref]
6.
Y. Xue, C. Kang, and H. Yu, “HAE-HRL: A network intrusion detection system utilizing a novel autoencoder and a hybrid enhanced LSTM-CNN-based residual network,” Comput. Secur., vol. 151, p. 104328, 2025. [Google Scholar] [Crossref]
7.
K. N. Rao, K. V. Rao, and P. R. PVGD, “A hybrid intrusion detection system based on sparse autoencoder and deep neural network,” Comput. Commun., vol. 180, pp. 77–88, 2021. [Google Scholar] [Crossref]
8.
R. Kamble and P. Rajarajeswari, “Revealing hidden patterns: A deep learning approach to camouflage detection,” Int. J. Comput. Methods Exp. Meas., vol. 12, no. 1, pp. 97–105, 2024. [Google Scholar] [Crossref]
9.
M. Fatchan, P. N. Andono, A. Affandy, and A. Z. Fanani, “Hybrid deep autoencoder and AdaBoost for robust facial expression recognition,” Int. J. Comput. Methods Exp. Meas., vol. 13, no. 1, pp. 141–147, 2025. [Google Scholar] [Crossref]
10.
O. Arreche, T. R. Guntur, J. W. Roberts, and M. Abdallah, “E-XAI: Evaluating black-box explainable AI frameworks for network intrusion detection,” IEEE Access, vol. 12, pp. 23954–23988, 2024. [Google Scholar] [Crossref]
11.
M. A. Bouke and A. Abdullah, “An empirical study of pattern leakage impact during data preprocessing on machine learning-based intrusion detection models reliability,” Expert Syst. Appl., vol. 230, p. 120715, 2023. [Google Scholar] [Crossref]
12.
Y. Sun and Z. Wang, “Intrusion detection in IoT and wireless networks using image-based neural network classification,” Appl. Soft Comput., vol. 177, p. 113236, 2025. [Google Scholar] [Crossref]
13.
K. B. Dasari and N. Devarakonda, “SynFlood DDoS attack detection with SVM kernels using uncorrelated feature subsets selected by Pearson, Spearman and Kendall correlation methods,” in Proceedings of 2022 Second International Conference on Computer Science, Engineering and Applications (ICCSEA), Gunupur, India, 2022, pp. 1–6. [Google Scholar] [Crossref]
14.
K. B. Dasari and N. Devarakonda, “Detection of DDoS attacks using machine learning classification algorithms,” Int. J. Comput. Netw. Inf. Secur., vol. 14, no. 6, pp. 89–97, 2022. [Google Scholar] [Crossref]
15.
Z. Dai, L. Y. Por, Y. L. Chen, J. Yang, C. S. Ku, R. Alizadehsani, and P. Plawiak, “An intrusion detection model to detect zero-day attacks in unseen data using machine learning,” PLOS ONE, vol. 19, no. 9, p. e0308469, 2024. [Google Scholar] [Crossref]
16.
O. Lifandali, N. Abghour, and Z. Chiba, “Feature selection using a combination of ant colony optimization and Random Forest algorithms applied to isolation forest based intrusion detection system,” Procedia Comput. Sci., vol. 220, pp. 796–805, 2023. [Google Scholar] [Crossref]
17.
R. Rabih, H. Vahdat-Nejad, W. Mansoor, and J. H. Joloudari, “Highly accurate anomaly based intrusion detection through integration of the local outlier factor and convolutional neural network,” Sci. Rep., vol. 15, p. 21147, 2025. [Google Scholar] [Crossref]
18.
C. Wang, Y. Sun, S. Lv, C. Wang, H. Liu, and B. Wang, “Intrusion detection system based on one-class support vector machine and gaussian mixture model,” Electronics, vol. 12, no. 4, p. 930, 2023. [Google Scholar] [Crossref]
19.
M. Vishwakarma and N. Kesswani, “A new two-phase intrusion detection system with Naïve Bayes machine learning for data classification and elliptic envelope method for anomaly detection,” Decis. Anal. J., vol. 7, p. 100233, 2023. [Google Scholar] [Crossref]
20.
I. Sharafaldin, A. H. Lashkari, and A. A. Ghorbani, “Toward generating a new intrusion detection dataset and intrusion traffic characterization,” in Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP), Funchal, Madeira, Portugal, 2018, pp. 108–116. [Google Scholar] [Crossref]
Search
Open Access
Research article

Hybrid Convolutional Neural Network-Gated Recurrent Unit-Attention and Autoencoder Framework for Zero-Day Network Attack Detection: A Computational Approach with Experimental Evaluation on CICIDS2017

Boutaghane Rafika1*,
Mazouzi Smaine1,
Saib Bouthina2
1
Department of Computer Science, Licus Laboratory, Laboratory of Informatics and Communication, University of Skikda 20 August 1955, 21000 Skikda, Algeria
2
Department of Computer Science, Laboratory of Mathematical Sciences, Computer Science, and Engineering Applications, University Center of Barika, 05001 Barika, Algeria
International Journal of Computational Methods and Experimental Measurements
|
Volume 14, Issue 3, 2026
|
Pages 359-368
Received: 04-26-2026,
Revised: 06-12-2026,
Accepted: 06-29-2026,
Available online: 09-21-2026
View Full Article|Download PDF

Abstract:

Zero-day attacks–exploiting unknown vulnerabilities before patches exist–pose a critical threat to modern network infrastructure that signature-based intrusion detection systems cannot address. This paper proposes a hybrid computational framework combining a Convolutional Neural Network (CNN)-Gated Recurrent Unit (GRU)-Attention classifier with a skip-connection convolutional autoencoder (AE) for simultaneous known-attack classification and zero-day anomaly detection. The framework introduces three key computational contributions: (1) deterministic reshaping of 64 Random Forest-selected network flow features into 8 $\times$ 8 spatial images, enabling end-to-end CNN processing without feature engineering; (2) a strict Score-based Label Separation and Ordering (SLSO) data partition enforcing complete information isolation between training, validation, and zero-day evaluation sets; and (3) an OR-fusion hybrid decision rule combining anomaly score and reconstruction error signals. Experimental evaluation on Canadian Institute for Cybersecurity Intrusion Detection System (CICIDS)2017 demonstrates 97.48% zero-day detection rate (Z-DR) (95% confidence interval (CI) [97.1%, 97.9%]) at 4.2% false positive rate (FPR) and Area Under the Receiver Operating Characteristic curve (AUROC) of 0.956 across three held-out zero-day attack families–substantially outperforming all classical baselines (best: Stochastic Gradient Descent-optimized One-Class Support Vector Machine (SGD-OCSVM) at 85.45%). SHapley Additive exPlanations (SHAP) explainability analysis reveals mechanistic complementarity: the CNN captures temporal flow signatures while the AE contributes 1,012 exclusive detections via backward inter-arrival time anomalies. The system operates at 14,201 samples/second on Graphics Processing Unit (GPU), satisfying real-time deployment requirements. These results demonstrate that hybrid supervised-unsupervised fusion with rigorous experimental methodology substantially advances zero-day detection capability for computational network security systems.

Keywords: Zero-day attack detection, Hybrid intrusion detection system, Convolutional Neural Network-Gated Recurrent Unit-Attention, Convolutional autoencoder, Deep learning for network security, SHAP explainability, Computational framework, Experimental evaluation

1. Introduction

Signature-based network intrusion detection systems (NIDS) cannot detect zero-day vulnerabilities–unknown flaws exploited before patches exist [1]. Anomaly-based approaches address this by identifying novel attacks as deviations from learned normal behavior; autoencoders (AEs) detect zero-day attacks without labeled data but suffer elevated false-positive rates that impede security operations center (SOC) deployment [2], [3]. Convolutional Neural Network (CNN)-Gated Recurrent Unit (GRU) hybrids provide effective temporal-spatial feature extraction [4], while attention mechanisms further improve the model's ability to focus on relevant traffic patterns and generalize to unseen attack but fail on out-of-distribution events [5], while hybrid AE-supervised fusion consistently outperforms single-component systems [6], [7]. Recent researches confirm that deep learning architectures excel at complex hidden-pattern detection [8], [9], and SHapley Additive exPlanations (SHAP)-based eXplainable Artificial Intelligence (XAI) translates black-box decisions into interpretable feature attributions for analysts [10].

This paper proposes a hybrid CNN-GRU-Attention and convolutional AE framework for zero-day network attack detection on Canadian Institute for Cybersecurity Intrusion Detection System (CICIDS)2017, with three design contributions: (1) strict data-leakage prevention through temporal-logical dataset separation [11]; (2) deterministic reshaping of 64 selected features into 8 $\times$ 8 spatial images enabling CNN processing without manual feature engineering [12]; and (3) SHAP and reconstruction error explainability [10].

2. Related Work

Elshewey et al. [4] demonstrate that CNN layers for spatial feature extraction combined with GRU layers for temporal modeling achieves near-perfect Distributed Denial-of-Service (DDoS) classification, establishing the core insight motivating our architecture. Alashjaee [5] adds scaled dot-product self-attention to a CNN-Long Short-Term Memory (LSTM) pipeline, improving generalization to unseen patterns. Pearson–Spearman–Kendall (PSK)-based feature selection confirms that correlation-aware dimensionality reduction preserves accuracy while reducing computational load [13], [14].

Xue et al. [6] propose Hybrid AE–Hybrid Resnet-LSTM (HAE-HRL), fusing an AE with a hybrid LSTM-CNN residual network to capture both packet-level and flow-level statistics simultaneously. Torabi et al. [3] introduce feature-wise reconstruction error thresholds, outperforming scalar-threshold alternatives and establishing feature-level anomaly scoring as the preferred zero-day detection technique.

Babaey and Faragardi [2] train LSTM, GRU, and stacked AE ensembles on normal traffic, achieving low false positive rate (FPR) on zero-day web attacks. Megantara and Ahmad [1] combine Decision Tree feature elimination with Local Outlier Factor (LOF) filtering for strong Denial-of-Service (DoS) detection. Hybrid AE-supervised fusion consistently outperforms single-method systems [7], [15], supporting the hybrid fusion strategy.

Rigorous evaluation requires fitting all preprocessing exclusively on training data and transforming validation/test sets using training statistics [11]. Reshaping flow features into 2D spatial images enables CNN processing without manual feature engineering [12]. SHAP-based explainability enables analysts to trace decisions to specific features [10]. Baselines include Isolation Forest [16], LOF [17], One-Class Support Vector Machine (SVM) [18], and Elliptic Envelope [19].

Existing hybrid frameworks lack rigorous leakage prevention, use arbitrary feature engineering, and offer limited interpretability of component interactions. This work addresses these gaps through: strict temporal-logical data separation; 64-feature selection reshaped into 8 $\times$ 8 images; OR-logic fusion with per-pathway attribution; and SHAP explainability with mechanistic decomposition of detection pathways.

3. Methodology

We integrate a binary CNN-GRU-Attention classifier with a skip-connection AE, fused via logical OR: a sample is flagged as zero-day if the CNN anomaly score exceeds $\theta_s$ or reconstruction error exceeds $\theta_a$.

3.1 System Overview

Five phases: (1) Score-based Label Separation and Ordering (SLSO) data splitting; (2) feature selection and 8 $\times$ 8 reshaping on $D_{\text{train}}$; (3) parallel CNN-GRU-Attention and AE training; (4) percentile threshold calibration on $D_{\text{val}}$; (5) OR-fusion inference with SHAP analysis. The component architectures are shown in Figure 1; the full pipeline and hybrid inference logic are shown in Figure 2.

Figure 1. Proposed model architectures: (a) CNN-GRU-Attention classifier with residual blocks, SE attention, and BiGRU layers producing $P$(anomaly); (b) skip-connection AE (1024 $\rightarrow$ 512 $\rightarrow$ 256 $\rightarrow$ 16 $\rightarrow$ 256 $\rightarrow$ 512 $\rightarrow$ 1024) producing reconstruction error $e = \|x - \hat{x}\|^2$ as the zero-day signal
Note: CICIDS = Cybersecurity Intrusion Detection System; SLSO = Score-based Label Separation and Ordering; CNN = Convolutional Neural Network; GRU = Gated Recurrent Unit; XAI = eXplainable Artificial Intelligence; SHAP = SHapley Additive exPlanations; MSE = mean squared error; SE = squeeze-and-excitation; CI = confidence interval; BiGRU = Bidirectional Gated Recurrent Unit; AE = autoencoder.
Figure 2. (a) End-to-end pipeline: SLSO split $\rightarrow$ feature selection $\rightarrow$ 8 $\times$ 8 reshaping $\rightarrow$ parallel CNN-GRU-Attention and AE training $\rightarrow$ threshold calibration on $D_{\text{val}}$ $\rightarrow$ zero-day detection with SHAP analysis; (b) hybrid inference: logical OR of CNN anomaly score $S > \theta_s$ and AE reconstruction error $e > \theta_a$ flags a flow as zero-day
Note: CICIDS = Cybersecurity Intrusion Detection System; SLSO = Score-based Label Separation and Ordering; CNN = Convolutional Neural Network; GRU = Gated Recurrent Unit; XAI = eXplainable Artificial Intelligence; SHAP = SHapley Additive exPlanations; MSE = mean squared error; SE = squeeze-and-excitation; CI = confidence interval; BiGRU = Bidirectional Gated Recurrent Unit; AE = autoencoder.
3.2 Data Preparation and Splitting

To ensure unbiased model evaluation and prevent data leakage, we employ a rigorous splitting strategy with three distinct datasets:

Zero-day dataset. Each attack class $c$ receives a detectability score $S(c)$ (Eq. (1)) measuring its feature-space separation from the known-class manifold relative to its intra-class spread. Classes with $S(c) > 1.0$ are assigned to the zero-day hold-out set: heartbleed (74.6), DoS Slowhttptest (5.09), and infiltration (1.43). Classes with low scores–bot (0.41), DoS Slowloris (0.74), Web Attack–Structured Query Language (SQL) Injection (0.88)–are retained as known, as their feature distributions overlap substantially with already-known attacks; Portscan is excluded due to its degenerate feature structure. The zero-day set is isolated before any normalisation or feature selection, ensuring complete information isolation.

$S(c)=\frac{d_{c o s}\left(\mu_c , \mu_{k^*}\right)}{\left(\sigma_c+\varepsilon\right)}, k^*=\arg \min _k d_{c o s}\left(\mu_c, \mu_k\right), c \notin \mathcal{K}_{\text {known }}$
(1)

where, $\mu_c$ is the centroid of class $c$ in the CNN feature space, $d_{\cos}$ denotes cosine distance, $\sigma_c$ is the mean intra-class cosine spread (compactness), and $\varepsilon = 10^{-9}$ prevents division by zero. A class is assigned to the zero-day hold-out set if $S(c) > 1.0$; otherwise, it is retained as a known class.

The 11 known classes form the training and validation basis (benign + 10 attack families), with a 60/20/20 split ($D_{\text{train}}$/$D_{\text{val}}$/$D_{\text{test}}$ by class-stratified sampling).

$\begin{gathered}D_{\text {train}}: 60 \% \text { of remaining samples }\\D_{\text {val}}: 20 \% \text { of remaining samples }\\D_{\text {test}}: 20 \% \text { of remaining samples }\end{gathered}$
(2)

Data leakage was prevented by fitting all preprocessing (StandardScaler, feature selection) exclusively on $D_{\text{train}}$, calibrating thresholds on $D_{\text{val}}$ only, and isolating $D_{\text{zero}}$ before any preprocessing step; hash-based checks confirmed zero overlap between splits.

3.3 Feature Selection and Spatial Reshaping

Feature selection is performed using a Random Forest classifier (300 trees, max depth 20) fitted exclusively on $D_{\text{train}}$. Gini importance is used rather than permutation importance because of its computational efficiency on large datasets; L2 regularisation ($\lambda = 10^{-4}$) on all dense layers mitigates any residual multicollinearity. A Variance Inflation Factor (VIF) analysis on the 64 selected features confirmed that high-VIF features do not materially degrade zero-day detection rate (Z-DR) when removed ($\Delta$Z-DR $< 3\%$), justifying retention of the full set. We deliberately select exactly $k = 64$ features that naturally reshape into a square grid:

$k=64=8 \times 8$
(3)

This eliminates need for feature engineering, padding, or augmentation. The 64 features are ranked by importance:

$F_{\text {selected}}=\text{Top}_k\left(\text{Random Forest}-\text{ImportanceScore}\left(D_{\text {train}}\right), k=64\right)$
(4)

All samples are normalised using StandardScaler fitted exclusively on $D_{\text{train}}$ (fit_transform) and applied via transform to $D_{\text{val}}$, $D_{\text{test}}$ and $D_{\text{zero}}$ to prevent leakage of test-set statistics:

$x_i^{\prime}=\frac{x_i-\mu_j}{\sigma_j}$
(5)

Each 64-dimensional feature vector is deterministically reshaped into an 8 $\times$ 8 2D spatial image:

$x\in \mathbb{R}^{64} \rightarrow X \in \mathbb{R}^{8 \times 8}$
(6)

This reshaping is bijective–no features are added, removed, or synthesized–and enables efficient power-of-2 pooling (8 $\rightarrow$ 4 $\rightarrow$ 2) with standard CNN kernels.

3.4 Supervised Component: Attack Classification

The architecture uses three residual CNN blocks with squeeze-and-excitation (SE) attention for spatial feature extraction, followed by Bidirectional GRU layers for temporal modelling, trained with Binary Focal Cross-Entropy ($\alpha = 0.25$, $\gamma = 2.0$) and AdamW ($lr$ = 5 $\times$ $10^{-4}$) (Figure 1a).

3.5 Unsupervised Component: Anomaly Detection

The AE uses a skip-connection encoder-decoder (Dense 1024 $\rightarrow$ 512 $\rightarrow$ 256 $\rightarrow$ 16 $\rightarrow$ 256 $\rightarrow$ 512 $\rightarrow$ 1024 $\rightarrow$ 64) with skip connections from encoder to decoder layers, trained on all known classes with mean squared error (MSE) loss and AdamW ($lr$ = 5 $\times$ $10^{-4}$) (Figure 1b). Reconstruction error (Eq. (7)) serves as the zero-day anomaly signal:

$e(x)=\|x-\hat{x}\|^2=\sum_i\left(x_i-\hat{x}_i\right)^2$
(7)
3.6 Hybrid Decision Framework

The final detection decision combines both components through a logical OR rule on two independent thresholds (Figure 2b). A network flow is flagged as a zero-day if either the CNN anomaly score $s$ exceeds threshold $\theta_s$ or the AE reconstruction error $e$ exceeds threshold $\theta_a$:

$y_{\text {pred }}=\left\{\begin{array}{c} \text { Zero }- \text { Day, if } s>\theta s \text { or } e>\theta a \\ \text { Known } / \text { Benign, } \text { if } s \leq \theta s \text { and } e \leq \theta a \end{array}\right.$
(8)

Thresholds $\theta_s$ and $\theta_a$ are calibrated on $D_{\text{val}}$ only, via a percentile grid search (p88–p99) subject to FPR $\le$ 5%, maximising Z-DR on the validation set. $D_{\text{zero}}$ is never accessed during calibration; its role is reporting only. The selected operating point is p97, yielding calibrated values $\theta_s = 0.02104$ and $\theta_a = 0.01104$, chosen as the last stable configuration before a sharp Z-DR cliff at p98. The formal optimisation is:

$\left(\tau_a^*, \tau_c^*\right)=\arg \max _{\theta s, \theta a} F 1\left(y_{\text {val }}, \hat{\mathrm{y}}_{\text {val }}\left(\tau_a, \tau_c\right)\right)$
(9)

SHAP (KernelExplainer, 20-centroid background, 30 zero-day flows) was applied independently to both detection components to produce per-feature importance rankings, enabling comparison of CNN and AE signal drivers and explaining complementary detection coverage.

4. Experimental Setup

All experiments use the CICIDS2017 dataset [20], which contains 3,119,345 labeled network flows across 15 traffic classes generated in a realistic network environment over five days. After removing the degenerate Portscan class and applying the SLSO split (Section 3.2), the partitions contain: $D_{\text{train}}$ = 1,198,586 flows (11 known classes, 60%); $D_{\text{val}}$ = 399,528 flows (20%); $D_{\text{test}}$ = 399,529 flows (20%); $D_{\text{zero}}$ = 5,546 flows (DoS Slowhttptest: 5,499; Heartbleed: 11; Infiltration: 36). All models are implemented in TensorFlow 2.x and trained on an NVIDIA L4 Graphics Processing Unit (GPU) (24 GB Video Random-Access Memory (VRAM)) with mixed 16-bit Floating Point (FP16) precision and Accelerated Linear Algebra (XLA) Just-In-Time (JIT) compilation. CNN-GRU training uses AdamW ($lr$ = 5 $\times$ $10^{-4}$, weight decay = $10^{-4}$), batch size 512, and early stopping (patience = 10) on validation F1. AE training uses AdamW ($lr$ = 5 $\times$ $10^{-4}$), batch size 512, and early stopping on validation MSE. All preprocessing statistics are fitted exclusively on $D_{\text{train}}$.

5. Results and Discussion

5.1 Feature Selection and Preprocessing Validation

Random Forest feature selection (300 trees, Gini importance) on $D_{\text{train}}$ identified 64 features, confirmed non-redundant by VIF analysis ($\Delta$Z-DR $< 3\%$ on high-VIF removal). t-distributed Stochastic Neighbor Embedding (t-SNE) visualization confirms that the three zero-day classes occupy distinct regions relative to known classes (heartbleed: score 74.6, DoS Slowhttptest: 5.09, infiltration: 1.43), validating the SLSO split. StandardScaler fitted on $D_{\text{train}}$ was applied to all sets; hash-based checks confirmed zero sample overlap across all partitions.

5.2 Zero-Day Detection Performance

The hybrid system was evaluated against three held-out zero-day attack classes: DoS Slowhttptest ($n$ = 5,499 flows), Heartbleed ($n$ = 11 flows), and Infiltration ($n$ = 36 flows). Table 1 reports the overall Z-DR, FPR, Area Under the Receiver Operating Characteristic curve (AUROC), and per-class breakdown for the proposed model alongside four classical anomaly detection baselines.

Table 1. Zero-day detection comparison

Model

Z-DR (%)

FPR (%)

AUROC

DoS Slowhttptest

Heartbleed

Infiltration

Hybrid CNN-GRU + AE (Ours)

97.48

4.2

0.956

97.71

100.0

61.11

Isolation Forest

25.46

3.75

0.918

24.97

100.0

77.78

LOF

16.05

5.58

0.839

16.02

9.09

22.22

Elliptic Envelope

60.01

5.10

0.942

59.92

100.0

61.11

SGD-OCSVM

85.45

5.00

0.943

85.60

100.0

58.33

Note: Z-DR = zero-day detection rate; FPR = false positive rate; AUROC = Area Under the Receiver Operating Characteristic curve; DoS = Denial-of-Service; CNN = Convolutional Neural Network; GRU = Gated Recurrent Unit; AE = autoencoder; LOF = Local Outlier Factor; SGD-OCSVM = Stochastic Gradient Descent-optimized One-Class Support Vector Machine. FPR measured on known benign traffic. Best results per column are bold. All baselines trained on the same known-class data distribution as the proposed system.

Baseline hyperparameter settings: Isolation Forest–$n_{\text{estimators}}$ = 200, contamination = 0.05; LOF–$n_{\text{neighbors}}$ = 20, contamination = 0.05, algorithm = ball_tree (novelty = True); Elliptic Envelope–contamination = 0.05, support_fraction = 0.9; Stochastic Gradient Descent-optimized One-Class Support Vector Machine (SGD-OCSVM)–$n_u$ = 0.05, Nystroem radial basis function (RBF) kernel (gamma = scale, $n_{\text{components}}$ = 300), max_iter = 1000. All baselines were fitted on the same training distribution as the AE (all known classes, 1,198,586 flows) and evaluated using the same 95th-percentile threshold on $D_{\text{test}}$ anomaly scores.

The hybrid system achieves 97.48% Z-DR (AUROC 0.956, FPR 4.2%), outperforming all baselines: SGD-OCSVM (85.45%), Elliptic Envelope (60.01%), Isolation Forest (25.46%), and LOF (16.05%). Heartbleed is detected at 100.0%, consistent with its highly distinctive network fingerprint. The Infiltration class presents the most challenging scenario (61.11% Z-DR), attributed to its low anomaly signal (Mean Anomaly Score = 0.014). Bootstrap confidence intervals (CIs) (1,000 iterations, 95% CI) confirm overall robustness [97.1%, 97.9%]; however, the Infiltration class yields a wide CI of [44.4%, 75.0%] (width: 30.6 pp), reflecting its small sample size ($n$ = 36) and representing the primary reliability limitation of this evaluation.

5.3 AUROC Comparison

Receiver Operating Characteristic (ROC) curves were computed for three configurations: AE reconstruction error alone (AUROC = 0.9221), CNN anomaly score alone (AUROC = 0.9556), and the hybrid composite using OR-fusion (AUROC = 0.9560). The hybrid strictly dominates both single-signal configurations. Critically, AUROC does not capture per-class complementarity: the AE alone detects Heartbleed at 100% while CNN alone achieves only 9.09%–a 90.9 pp gap invisible in aggregate ROC curves. The composite score $S = $ max-normalised OR-fusion of CNN anomaly score and AE reconstruction error was used for AUROC computation, consistent with the hybrid decision rule.

5.4 Ablation Study

Table 2 reports ablation results across three configurations under identical thresholds ($\theta_s$, $\theta_a$).

Table 2. Ablation study

Configuration

FPR (%)

DoS Slowhttptest

Heartbleed

Infiltration

Overall Z-DR (%)

CNN-GRU Binary (alone)

2.74

79.80

9.09

13.89

79.23

AE v2 (alone)

2.08

44.74

100.0

55.56

44.92

Hybrid CNN + AE v2 (Ours)

4.20

97.71

100.0

61.11

97.48

Note: Z-DR = zero-day detection rate; FPR = false positive rate; DoS = Denial-of-Service; CNN = Convolutional Neural Network; GRU = Gated Recurrent Unit; AE = autoencoder.

The CNN-GRU Binary alone achieves 79.23% overall Z-DR at the lowest FPR (2.74%), but it critically fails to detect Heartbleed (9.09%), indicating limited generalisation to this attack’s feature profile. In contrast, the AE v2 alone detects Heartbleed at 100% but performs poorly on DoS Slowhttptest (44.74%), reflecting its sensitivity to structural outliers rather than behavioural patterns captured by the CNN. The full hybrid model (Figure 3), using OR fusion of the CNN anomaly score and AE reconstruction error, achieves the highest overall Z-DR of 97.48%, representing an 18.25 percentage-point improvement over the CNN-GRU Binary alone and a 52.56 percentage-point improvement over the AE v2 alone, with only a modest FPR increase from 2.74% to 4.20%.

Figure 3. Ablation study: Overall Z-DR, FPR, and DoS slowhttptest detection rate for CNN-alone, AE-alone, and the hybrid
Note: Z-DR = zero-day detection rate; FPR = false positive rate; DoS = Denial-of-Service; CNN = Convolutional Neural Network; GRU = Gated Recurrent Unit; AE = autoencoder.

Detection pathway analysis on $D_{\text{zero}}$ confirms mechanistic complementarity: 2,915 flows were detected exclusively by the CNN, 1,012 exclusively by the AE (including all Heartbleed flows missed by the CNN), and 1,479 by both components; 140 flows (2.52%) were missed by both. This breakdown confirms that OR-fusion captures 1,012 attacks that the CNN alone would miss entirely.

5.5 Threshold Sensitivity

Threshold calibration across percentiles p88–p99 (Table 3) reveals three operating regions: a stability plateau (p88–p94) where Z-DR holds at 98.14% across a wide FPR range (12.71%–7.27%); a gradual trade-off zone (p94–p97) yielding a 3.07 pp FPR reduction at only 0.66 pp Z-DR cost; and a sharp cliff at p97–p98 where Z-DR collapses by 52.51 pp for a mere 0.99 pp FPR gain–an extremely unfavourable trade-off. Heartbleed remains at 100% throughout; Infiltration degrades steadily from 88.9% to 61.11%, reflecting its low anomaly signal. The selected p97 point ($\theta_s$ = 0.02104, $\theta_a$ = 0.01104) is the last stable configuration before the cliff.

Table 3. Threshold sensitivity across percentiles p88–p99 on $D_{\text{zero}}$ ($n$ = 5,546)

Pct.

$\boldsymbol{\theta_s}$

$\boldsymbol{\theta_a}$

FPR (%)

Z-DR (%)

DoS SH (%)

HB (%)

Inf. (%)

p88

0.01976

0.00403

12.71

98.14

98.20

100.0

88.9

p90

0.01991

0.00467

10.93

98.14

98.20

100.0

88.9

p91

0.01999

0.00514

9.88

98.14

98.20

100.0

88.9

p92

0.02006

0.00561

8.95

98.14

98.20

100.0

88.9

p93

0.02014

0.00630

8.17

98.14

98.20

100.0

88.9

p94

0.02029

0.00711

7.27

98.14

98.20

100.0

88.9

p95

0.02045

0.00799

6.43

98.12

98.20

100.0

86.1

p96

0.02069

0.00902

5.35

97.78

97.90

100.0

77.8

p97 $\bigstar$

0.02104

0.01104

4.20

97.48

97.71

100.0

61.11

p98

0.02145

0.01386

3.21

44.97

44.80

100.0

58.3

p99

0.02241

0.02033

1.70

43.29

43.10

100.0

55.6

Note: Pct. = percentile; $\bigstar$ = selected operating point (p97); bold = selected row; Z-DR = zero-day detection rate; FPR = false positive rate; DoS SH = Denial-of-Service Slowhttptest; HB = Heartbleed; Inf. = Infiltration.
5.6 Inference Efficiency

Real-time deployability requires sub-millisecond per-flow inference latency. Table 4 reports GPU inference throughput for each component. All measurements were taken on an NVIDIA L4 GPU (24 GB VRAM) with mixed FP16 precision and XLA JIT compilation. The hybrid sequential pipeline achieves 14,201 samples/second (0.070 ms/sample), well within real-time requirements for typical enterprise traffic (10K–50K flows/minute). At 1 Gbps line rate (approx. 150K flows/minute), approximately 11 parallel GPU instances would be required; Central Processing Unit (CPU)-only inference is estimated at 3–5 $\times$ slower.

Table 4. Inference timing on GPU
Componentms/SampleSamples/secHardware
CNN-GRU Binary0.03727,342GPU
AE v20.03429,549GPU
Hybrid (sequential)0.07014,201GPU
Note: The hybrid sequential pipeline achieves 14,201 samples/second (0.07 ms/sample), well within real-time requirements for typical enterprise traffic volumes. CNN = Convolutional Neural Network; GRU = Gated Recurrent Unit; AE = autoencoder.
5.7 Explainability Analysis (SHAP)

To interpret the detection decisions of both components, SHAP values were computed for 30 held-out zero-day flows using KernelExplainer. The CNN anomaly score and AE reconstruction error were each treated as scalar black-box functions of the 64 scaled input features, with a 20-centroid k-means background summary derived from 100 known training flows. Figure 4 shows the top-15 most influential features for each signal.

Figure 4. SHAP top-15 feature importance for the CNN anomaly score (left) and AE reconstruction error (right) over 30 zero-day flows
Note: SHAP = SHapley Additive exPlanations; CNN = Convolutional Neural Network; AE = autoencoder; IAT = inter-arrival time; bars show mean absolute SHAP value.

SHAP analysis (Figure 4) shows CNN detections are driven by temporal features (Active Min, Flow Duration, flow inter-arrival time (IAT) Max), while AE detections are driven by backward IAT statistics (backward IAT Mean, backward Packets/s) absent from the CNN top-15–confirming the mechanistic basis for complementary coverage between the two components.

6. Conclusion

This paper presented a hybrid CNN-GRU-Attention and skip-connection AE framework for zero-day attack detection, evaluated on CICIDS2017 under strict data isolation. The system achieves 97.48% zero-day detection rate at 4.2% FPR and AUROC of 0.956, substantially outperforming all single-component and classical baselines (CNN-alone: 79.23%; AE-alone: 44.92%; best baseline SGD-OCSVM: 85.45%). SHAP analysis confirms mechanistic complementarity: CNN detections are driven by temporal flow features, while the AE contributes 1,012 exclusive detections via backward IAT statistics invisible to the supervised component. The 8 $\times$ 8 spatial reshaping of 64 selected features enables efficient CNN processing without arbitrary feature engineering, and the system operates at 14,201 samples/second on GPU, supporting real-time enterprise deployment.

The primary limitation is the Infiltration class detection rate (61.11%, CI [44.4%, 75.0%]), reflecting its small evaluation sample ($n$ = 36) and low anomaly signal. The 4.2% FPR, while operationally acceptable given zero-day prevalence, warrants cost-sensitive threshold tuning for high-volume SOC environments. Generalizability beyond CICIDS2017 and robustness to adversarial evasion remain open questions.

Future work will validate the framework on CICIoT2023 (with adapted feature selection to accommodate different feature spaces), investigate adversarial robustness, and deploy in live SOC environments with telemetry feedback for continuous threshold adaptation.

Author Contributions

Conceptualization, B.R. and S.B.; methodology, B.R. and S.B.; validation, M.S.; formal analysis, B.R. and S.B.; investigation, S.B.; resources, B.R.; data curation, S.B. and B.R.; writing—original draft preparation, B.R. and S.B.; writing—review and editing, S.B. and B.R.; visualization, B.R.; supervision, M.S.; project administration, M.S. All authors have read and agreed to the published version of the manuscript.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare no conflicts of interest.

References
1.
A. A. Megantara and T. Ahmad, “A hybrid machine learning method for increasing the performance of network intrusion detection systems,” J. Big Data, vol. 8, p. 142, 2021. [Google Scholar] [Crossref]
2.
V. Babaey and H. R. Faragardi, “Detecting zero-day web attacks with an ensemble of LSTM, GRU, and stacked autoencoders,” Computers, vol. 14, no. 6, p. 205, 2025. [Google Scholar] [Crossref]
3.
H. Torabi, S. L. Mirtaheri, and S. Greco, “Practical autoencoder based anomaly detection by using vector reconstruction error,” Cybersecurity, vol. 6, p. 1, 2023. [Google Scholar] [Crossref]
4.
A. M. Elshewey, S. Abbas, A. M. Osman, E. A. Aldakheel, and Y. Fouad, “DDoS classification of network traffic in software defined networking SDN using a hybrid convolutional and gated recurrent neural network,” Sci. Rep., vol. 15, p. 29122, 2025. [Google Scholar] [Crossref]
5.
A. M. Alashjaee, “Deep learning for network security: An attention-CNN-LSTM model for accurate intrusion detection,” Sci. Rep., vol. 15, p. 21856, 2025. [Google Scholar] [Crossref]
6.
Y. Xue, C. Kang, and H. Yu, “HAE-HRL: A network intrusion detection system utilizing a novel autoencoder and a hybrid enhanced LSTM-CNN-based residual network,” Comput. Secur., vol. 151, p. 104328, 2025. [Google Scholar] [Crossref]
7.
K. N. Rao, K. V. Rao, and P. R. PVGD, “A hybrid intrusion detection system based on sparse autoencoder and deep neural network,” Comput. Commun., vol. 180, pp. 77–88, 2021. [Google Scholar] [Crossref]
8.
R. Kamble and P. Rajarajeswari, “Revealing hidden patterns: A deep learning approach to camouflage detection,” Int. J. Comput. Methods Exp. Meas., vol. 12, no. 1, pp. 97–105, 2024. [Google Scholar] [Crossref]
9.
M. Fatchan, P. N. Andono, A. Affandy, and A. Z. Fanani, “Hybrid deep autoencoder and AdaBoost for robust facial expression recognition,” Int. J. Comput. Methods Exp. Meas., vol. 13, no. 1, pp. 141–147, 2025. [Google Scholar] [Crossref]
10.
O. Arreche, T. R. Guntur, J. W. Roberts, and M. Abdallah, “E-XAI: Evaluating black-box explainable AI frameworks for network intrusion detection,” IEEE Access, vol. 12, pp. 23954–23988, 2024. [Google Scholar] [Crossref]
11.
M. A. Bouke and A. Abdullah, “An empirical study of pattern leakage impact during data preprocessing on machine learning-based intrusion detection models reliability,” Expert Syst. Appl., vol. 230, p. 120715, 2023. [Google Scholar] [Crossref]
12.
Y. Sun and Z. Wang, “Intrusion detection in IoT and wireless networks using image-based neural network classification,” Appl. Soft Comput., vol. 177, p. 113236, 2025. [Google Scholar] [Crossref]
13.
K. B. Dasari and N. Devarakonda, “SynFlood DDoS attack detection with SVM kernels using uncorrelated feature subsets selected by Pearson, Spearman and Kendall correlation methods,” in Proceedings of 2022 Second International Conference on Computer Science, Engineering and Applications (ICCSEA), Gunupur, India, 2022, pp. 1–6. [Google Scholar] [Crossref]
14.
K. B. Dasari and N. Devarakonda, “Detection of DDoS attacks using machine learning classification algorithms,” Int. J. Comput. Netw. Inf. Secur., vol. 14, no. 6, pp. 89–97, 2022. [Google Scholar] [Crossref]
15.
Z. Dai, L. Y. Por, Y. L. Chen, J. Yang, C. S. Ku, R. Alizadehsani, and P. Plawiak, “An intrusion detection model to detect zero-day attacks in unseen data using machine learning,” PLOS ONE, vol. 19, no. 9, p. e0308469, 2024. [Google Scholar] [Crossref]
16.
O. Lifandali, N. Abghour, and Z. Chiba, “Feature selection using a combination of ant colony optimization and Random Forest algorithms applied to isolation forest based intrusion detection system,” Procedia Comput. Sci., vol. 220, pp. 796–805, 2023. [Google Scholar] [Crossref]
17.
R. Rabih, H. Vahdat-Nejad, W. Mansoor, and J. H. Joloudari, “Highly accurate anomaly based intrusion detection through integration of the local outlier factor and convolutional neural network,” Sci. Rep., vol. 15, p. 21147, 2025. [Google Scholar] [Crossref]
18.
C. Wang, Y. Sun, S. Lv, C. Wang, H. Liu, and B. Wang, “Intrusion detection system based on one-class support vector machine and gaussian mixture model,” Electronics, vol. 12, no. 4, p. 930, 2023. [Google Scholar] [Crossref]
19.
M. Vishwakarma and N. Kesswani, “A new two-phase intrusion detection system with Naïve Bayes machine learning for data classification and elliptic envelope method for anomaly detection,” Decis. Anal. J., vol. 7, p. 100233, 2023. [Google Scholar] [Crossref]
20.
I. Sharafaldin, A. H. Lashkari, and A. A. Ghorbani, “Toward generating a new intrusion detection dataset and intrusion traffic characterization,” in Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP), Funchal, Madeira, Portugal, 2018, pp. 108–116. [Google Scholar] [Crossref]

Cite this:
APA Style
IEEE Style
BibTex Style
MLA Style
Chicago Style
GB-T-7714-2015
Rafika, B., Smaine, M., & Bouthina, S. (2026). Hybrid Convolutional Neural Network-Gated Recurrent Unit-Attention and Autoencoder Framework for Zero-Day Network Attack Detection: A Computational Approach with Experimental Evaluation on CICIDS2017. Int. J. Comput. Methods Exp. Meas., 14(3), 359-368. https://doi.org/10.56578/ijcmem140302
B. Rafika, M. Smaine, and S. Bouthina, "Hybrid Convolutional Neural Network-Gated Recurrent Unit-Attention and Autoencoder Framework for Zero-Day Network Attack Detection: A Computational Approach with Experimental Evaluation on CICIDS2017," Int. J. Comput. Methods Exp. Meas., vol. 14, no. 3, pp. 359-368, 2026. https://doi.org/10.56578/ijcmem140302
@research-article{Rafika2026HybridCN,
title={Hybrid Convolutional Neural Network-Gated Recurrent Unit-Attention and Autoencoder Framework for Zero-Day Network Attack Detection: A Computational Approach with Experimental Evaluation on CICIDS2017},
author={Boutaghane Rafika and Mazouzi Smaine and Saib Bouthina},
journal={International Journal of Computational Methods and Experimental Measurements},
year={2026},
page={359-368},
doi={https://doi.org/10.56578/ijcmem140302}
}
Boutaghane Rafika, et al. "Hybrid Convolutional Neural Network-Gated Recurrent Unit-Attention and Autoencoder Framework for Zero-Day Network Attack Detection: A Computational Approach with Experimental Evaluation on CICIDS2017." International Journal of Computational Methods and Experimental Measurements, v 14, pp 359-368. doi: https://doi.org/10.56578/ijcmem140302
Boutaghane Rafika, Mazouzi Smaine and Saib Bouthina. "Hybrid Convolutional Neural Network-Gated Recurrent Unit-Attention and Autoencoder Framework for Zero-Day Network Attack Detection: A Computational Approach with Experimental Evaluation on CICIDS2017." International Journal of Computational Methods and Experimental Measurements, 14, (2026): 359-368. doi: https://doi.org/10.56578/ijcmem140302
RAFIKA B, SMAINE M, BOUTHINA S. Hybrid Convolutional Neural Network-Gated Recurrent Unit-Attention and Autoencoder Framework for Zero-Day Network Attack Detection: A Computational Approach with Experimental Evaluation on CICIDS2017[J]. International Journal of Computational Methods and Experimental Measurements, 2026, 14(3): 359-368. https://doi.org/10.56578/ijcmem140302
cc
©2026 by the author(s). Published by Acadlore Publishing Services Limited, Hong Kong. This article is available for free download and can be reused and cited, provided that the original published version is credited, under the CC BY 4.0 license.