Javascript is required
@article{1, author = {Megantara, A. A. and Ahmad, T.}, title = {A hybrid machine learning method for increasing the performance of network intrusion detection systems}, journal = {J. Big Data}, volume = {8}, pages = {142}, year = {2021}, doi = {10.1186/s40537-021-00531-w}, url = {},}. [Crossref]
@article{2, author = {Babaey, V. and Faragardi, H. R.}, title = {Detecting zero-day web attacks with an ensemble of {LSTM}, {GRU}, and stacked autoencoders}, journal = {Computers}, volume = {14}, number = {6}, pages = {205}, year = {2025}, doi = {10.3390/computers14060205}, url = {},}. [Crossref]
@article{3, author = {Torabi, H. and Mirtaheri, S. L. and Greco, S.}, title = {Practical autoencoder based anomaly detection by using vector reconstruction error}, journal = {Cybersecurity}, volume = {6}, pages = {1}, year = {2023}, doi = {10.1186/s42400-022-00134-9}, url = {},}. [Crossref]
@article{4, author = {Elshewey, A. M. and Abbas, S. and Osman, A. M. and Aldakheel, E. A. and Fouad, Y.}, title = {{DDoS} classification of network traffic in software defined networking {SDN} using a hybrid convolutional and gated recurrent neural network}, journal = {Sci. Rep.}, volume = {15}, pages = {29122}, year = {2025}, doi = {10.1038/s41598-025-13754-1}, url = {},}. [Crossref]
@article{5, author = {Alashjaee, A. M.}, title = {Deep learning for network security: An attention-{CNN}-{LSTM} model for accurate intrusion detection}, journal = {Sci. Rep.}, volume = {15}, pages = {21856}, year = {2025}, doi = {10.1038/s41598-025-07706-y}, url = {},}. [Crossref]
@article{6, author = {Xue, Y. and Kang, C. and Yu, H.}, title = {{HAE-HRL}: A network intrusion detection system utilizing a novel autoencoder and a hybrid enhanced {LSTM}-{CNN}-based residual network}, journal = {Comput. Secur.}, volume = {151}, pages = {104328}, year = {2025}, doi = {10.1016/j.cose.2025.104328}, url = {},}. [Crossref]
@article{7, author = {Rao, K. N. and Rao, K. V. and PVGD, P. R.}, title = {A hybrid intrusion detection system based on sparse autoencoder and deep neural network}, journal = {Comput. Commun.}, volume = {180}, pages = {77-88}, year = {2021}, doi = {10.1016/j.comcom.2021.08.026}, url = {},}. [Crossref]
@article{8, author = {Kamble, R. and Rajarajeswari, P.}, title = {Revealing hidden patterns: A deep learning approach to camouflage detection}, journal = {Int. J. Comput. Methods Exp. Meas.}, volume = {12}, number = {1}, pages = {97-105}, year = {2024}, doi = {10.18280/ijcmem.120111}, url = {},}. [Crossref]
@article{9, author = {Fatchan, M. and Andono, P. N. and Affandy, A. and Fanani, A. Z.}, title = {Hybrid deep autoencoder and {AdaBoost} for robust facial expression recognition}, journal = {Int. J. Comput. Methods Exp. Meas.}, volume = {13}, number = {1}, pages = {141-147}, year = {2025}, doi = {10.18280/ijcmem.130115}, url = {},}. [Crossref]
@article{10, author = {Arreche, O. and Guntur, T. R. and Roberts, J. W. and Abdallah, M.}, title = {{E-XAI}: Evaluating black-box explainable {AI} frameworks for network intrusion detection}, journal = {IEEE Access}, volume = {12}, pages = {23954-23988}, year = {2024}, doi = {10.1109/ACCESS.2024.3365140}, url = {},}. [Crossref]
@article{11, author = {Bouke, M. A. and Abdullah, A.}, title = {An empirical study of pattern leakage impact during data preprocessing on machine learning-based intrusion detection models reliability}, journal = {Expert Syst. Appl.}, volume = {230}, pages = {120715}, year = {2023}, doi = {10.1016/j.eswa.2023.120715}, url = {},}. [Crossref]
@article{12, author = {Sun, Y. and Wang, Z.}, title = {Intrusion detection in {IoT} and wireless networks using image-based neural network classification}, journal = {Appl. Soft Comput.}, volume = {177}, pages = {113236}, year = {2025}, doi = {10.1016/j.asoc.2025.113236}, url = {},}@inproceedings{13, author = {Dasari, K. B. and Devarakonda, N.}, title = {{SynFlood} {DDoS} attack detection with {SVM} kernels using uncorrelated feature subsets selected by {Pearson}, {Spearman} and {Kendall} correlation methods}, booktitle = {Proceedings of 2022 Second International Conference on Computer Science, Engineering and Applications (ICCSEA)}, address = {Gunupur, India}, pages = {1-6}, year = {2022}, doi = {10.1109/ICCSEA54677.2022.9936114}, url = {https://doi.org/10.1109/ICCSEA54677.2022.9936114},}. [Crossref]
@article{14, author = {Dasari, K. B. and Devarakonda, N.}, title = {Detection of {DDoS} attacks using machine learning classification algorithms}, journal = {Int. J. Comput. Netw. Inf. Secur.}, volume = {14}, number = {6}, pages = {89-97}, year = {2022}, doi = {10.5815/ijcnis.2022.06.07}, url = {},}. [Crossref]
@article{15, author = {Dai, Z. and Por, L. Y. and Chen, Y. L. and Yang, J. and Ku, C. S. and Alizadehsani, R. and {Plawiak}, P.}, title = {An intrusion detection model to detect zero-day attacks in unseen data using machine learning}, journal = {PLOS ONE}, volume = {19}, number = {9}, pages = {e0308469}, year = {2024}, doi = {10.1371/journal.pone.0308469}, url = {},}. [Crossref]
@article{16, author = {Lifandali, O. and Abghour, N. and Chiba, Z.}, title = {Feature selection using a combination of ant colony optimization and {Random Forest} algorithms applied to isolation forest based intrusion detection system}, journal = {Procedia Comput. Sci.}, volume = {220}, pages = {796-805}, year = {2023}, doi = {10.1016/j.procs.2023.03.106}, url = {},}. [Crossref]
@article{17, author = {Rabih, R. and Vahdat-Nejad, H. and Mansoor, W. and Joloudari, J. H.}, title = {Highly accurate anomaly based intrusion detection through integration of the local outlier factor and convolutional neural network}, journal = {Sci. Rep.}, volume = {15}, pages = {21147}, year = {2025}, doi = {10.1038/s41598-025-08175-z}, url = {},}. [Crossref]
@article{18, author = {Wang, C. and Sun, Y. and Lv, S. and Wang, C. and Liu, H. and Wang, B.}, title = {Intrusion detection system based on one-class support vector machine and gaussian mixture model}, journal = {Electronics}, volume = {12}, number = {4}, pages = {930}, year = {2023}, doi = {10.3390/electronics12040930}, url = {},}. [Crossref]
@article{19, author = {Vishwakarma, M. and Kesswani, N.}, title = {A new two-phase intrusion detection system with {Na\"ive Bayes} machine learning for data classification and elliptic envelope method for anomaly detection}, journal = {Decis. Anal. J.}, volume = {7}, pages = {100233}, year = {2023}, doi = {10.1016/j.dajour.2023.100233}, url = {},}@inproceedings{20, author = {Sharafaldin, I. and Lashkari, A. H. and Ghorbani, A. A.}, title = {Toward generating a new intrusion detection dataset and intrusion traffic characterization}, booktitle = {Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP)}, address = {Funchal, Madeira, Portugal}, pages = {108-116}, year = {2018}, doi = {10.5220/0006639801080116}, url = {https://doi.org/10.5220/0006639801080116},}. [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 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, CNN-GRU-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.

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 \% \cdot \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.

Figure 1
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.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)
Figure 2
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.

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

$F_{\text {selected}}=\text{Top}_k\left(\text{RF}-\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 GPU (24 GB Video Random-Access Memory (VRAM)) with mixed 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-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
ModelZ-DR (\%)FPR (\%)AUROCDoS SlowhttptestHeartbleedInfiltration
Hybrid CNN-GRU + AE (Ours)97.484.20.95697.71100.061.11
Isolation Forest25.463.750.91824.97100.077.78
LOF16.055.580.83916.029.0922.22
Elliptic Envelope60.015.100.94259.92100.061.11
SGD-OCSVM85.455.000.94385.60100.058.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\_estimators = 200, contamination = 0.05; LOF–n\_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)–nu = 0.05, Nystroem radial basis function (RBF) kernel (gamma = scale, n\_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: Stochastic Gradient Descent-optimized One-Class Support Vector Machine (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

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$).

The CNN-GRU Binary alone achieves the lowest FPR (2.74\%) but misses Heartbleed almost entirely (9.09\%); AE alone detects Heartbleed at 100\% but underperforms on DoS Slowhttptest (44.74\%). The full hybrid achieves the best overall Z-DR at the cost of a modest FPR increase.

The CNN-GRU Binary alone achieves 79.23\% overall Z-DR at the lowest FPR (2.74\%), but critically fails on Heartbleed (9.09\%), indicating that the CNN's binary output does not generalise to this attack's feature profile. The AE v2 alone detects Heartbleed at 100\% but achieves only 44.74\% on DoS Slowhttptest, reflecting the AE's sensitivity to structural outliers rather than the behavioural anomalies the CNN captures. The full hybrid ( Figure 3) via OR fusion yields 97.48\% overall Z-DR–an 18.25 pp gain over the CNN alone and a 52.56 pp gain over the AE alone–at the cost of a modest FPR increase from 2.74\% to 4.20\%.

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.

Table 2. Ablation study
ConfigurationFPR (\%)DoS SlowhttptestHeartbleedInfiltrationOverall Z-DR (\%)
CNN-GRU Binary (alone)2.7479.809.0913.8979.23
AE v2 (alone)2.0844.74100.055.5644.92
Hybrid CNN + AE v2 (Ours)4.2097.71100.061.1197.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.
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.
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 $\rightarrow$ 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.

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; CPU-only inference is estimated at 3–5 $\times$ slower.

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.

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.

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. (\%)
p880.019760.0040312.7198.1498.20100.088.9
p900.019910.0046710.9398.1498.20100.088.9
p910.019990.005149.8898.1498.20100.088.9
p920.020060.005618.9598.1498.20100.088.9
p930.020140.006308.1798.1498.20100.088.9
p940.020290.007117.2798.1498.20100.088.9
p950.020450.007996.4398.1298.20100.086.1
p960.020690.009025.3597.7897.90100.077.8
p97 $\bigstar$0.021040.011044.2097.4897.71100.061.11
p980.021450.013863.2144.9744.80100.058.3
p990.022410.020331.7043.2943.10100.055.6
Note: $\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.
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.
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.

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, R.B. and B.S.; methodology, R.B. and B.S.; validation, S.M.; formal analysis, R.B. and B.S; investigation, B.S.; resources, R.B.; data curation, B.S. and R.B.; writing—original draft preparation, R.B and B.S.; writing—review and editing, B.S and R.B.; visualization, R.B.; supervision, S.M.; project administration, S.M. 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.

Acknowledgments

This work was supported by the Department of Mathematics, College of Science, University of Baghdad, Baghdad, Iraq.

Conflicts of Interest

The authors declare no conflicts of interest.

References
@article{1, author = {Megantara, A. A. and Ahmad, T.}, title = {A hybrid machine learning method for increasing the performance of network intrusion detection systems}, journal = {J. Big Data}, volume = {8}, pages = {142}, year = {2021}, doi = {10.1186/s40537-021-00531-w}, url = {},}. [Crossref]
@article{2, author = {Babaey, V. and Faragardi, H. R.}, title = {Detecting zero-day web attacks with an ensemble of {LSTM}, {GRU}, and stacked autoencoders}, journal = {Computers}, volume = {14}, number = {6}, pages = {205}, year = {2025}, doi = {10.3390/computers14060205}, url = {},}. [Crossref]
@article{3, author = {Torabi, H. and Mirtaheri, S. L. and Greco, S.}, title = {Practical autoencoder based anomaly detection by using vector reconstruction error}, journal = {Cybersecurity}, volume = {6}, pages = {1}, year = {2023}, doi = {10.1186/s42400-022-00134-9}, url = {},}. [Crossref]
@article{4, author = {Elshewey, A. M. and Abbas, S. and Osman, A. M. and Aldakheel, E. A. and Fouad, Y.}, title = {{DDoS} classification of network traffic in software defined networking {SDN} using a hybrid convolutional and gated recurrent neural network}, journal = {Sci. Rep.}, volume = {15}, pages = {29122}, year = {2025}, doi = {10.1038/s41598-025-13754-1}, url = {},}. [Crossref]
@article{5, author = {Alashjaee, A. M.}, title = {Deep learning for network security: An attention-{CNN}-{LSTM} model for accurate intrusion detection}, journal = {Sci. Rep.}, volume = {15}, pages = {21856}, year = {2025}, doi = {10.1038/s41598-025-07706-y}, url = {},}. [Crossref]
@article{6, author = {Xue, Y. and Kang, C. and Yu, H.}, title = {{HAE-HRL}: A network intrusion detection system utilizing a novel autoencoder and a hybrid enhanced {LSTM}-{CNN}-based residual network}, journal = {Comput. Secur.}, volume = {151}, pages = {104328}, year = {2025}, doi = {10.1016/j.cose.2025.104328}, url = {},}. [Crossref]
@article{7, author = {Rao, K. N. and Rao, K. V. and PVGD, P. R.}, title = {A hybrid intrusion detection system based on sparse autoencoder and deep neural network}, journal = {Comput. Commun.}, volume = {180}, pages = {77-88}, year = {2021}, doi = {10.1016/j.comcom.2021.08.026}, url = {},}. [Crossref]
@article{8, author = {Kamble, R. and Rajarajeswari, P.}, title = {Revealing hidden patterns: A deep learning approach to camouflage detection}, journal = {Int. J. Comput. Methods Exp. Meas.}, volume = {12}, number = {1}, pages = {97-105}, year = {2024}, doi = {10.18280/ijcmem.120111}, url = {},}. [Crossref]
@article{9, author = {Fatchan, M. and Andono, P. N. and Affandy, A. and Fanani, A. Z.}, title = {Hybrid deep autoencoder and {AdaBoost} for robust facial expression recognition}, journal = {Int. J. Comput. Methods Exp. Meas.}, volume = {13}, number = {1}, pages = {141-147}, year = {2025}, doi = {10.18280/ijcmem.130115}, url = {},}. [Crossref]
@article{10, author = {Arreche, O. and Guntur, T. R. and Roberts, J. W. and Abdallah, M.}, title = {{E-XAI}: Evaluating black-box explainable {AI} frameworks for network intrusion detection}, journal = {IEEE Access}, volume = {12}, pages = {23954-23988}, year = {2024}, doi = {10.1109/ACCESS.2024.3365140}, url = {},}. [Crossref]
@article{11, author = {Bouke, M. A. and Abdullah, A.}, title = {An empirical study of pattern leakage impact during data preprocessing on machine learning-based intrusion detection models reliability}, journal = {Expert Syst. Appl.}, volume = {230}, pages = {120715}, year = {2023}, doi = {10.1016/j.eswa.2023.120715}, url = {},}. [Crossref]
@article{12, author = {Sun, Y. and Wang, Z.}, title = {Intrusion detection in {IoT} and wireless networks using image-based neural network classification}, journal = {Appl. Soft Comput.}, volume = {177}, pages = {113236}, year = {2025}, doi = {10.1016/j.asoc.2025.113236}, url = {},}@inproceedings{13, author = {Dasari, K. B. and Devarakonda, N.}, title = {{SynFlood} {DDoS} attack detection with {SVM} kernels using uncorrelated feature subsets selected by {Pearson}, {Spearman} and {Kendall} correlation methods}, booktitle = {Proceedings of 2022 Second International Conference on Computer Science, Engineering and Applications (ICCSEA)}, address = {Gunupur, India}, pages = {1-6}, year = {2022}, doi = {10.1109/ICCSEA54677.2022.9936114}, url = {https://doi.org/10.1109/ICCSEA54677.2022.9936114},}. [Crossref]
@article{14, author = {Dasari, K. B. and Devarakonda, N.}, title = {Detection of {DDoS} attacks using machine learning classification algorithms}, journal = {Int. J. Comput. Netw. Inf. Secur.}, volume = {14}, number = {6}, pages = {89-97}, year = {2022}, doi = {10.5815/ijcnis.2022.06.07}, url = {},}. [Crossref]
@article{15, author = {Dai, Z. and Por, L. Y. and Chen, Y. L. and Yang, J. and Ku, C. S. and Alizadehsani, R. and {Plawiak}, P.}, title = {An intrusion detection model to detect zero-day attacks in unseen data using machine learning}, journal = {PLOS ONE}, volume = {19}, number = {9}, pages = {e0308469}, year = {2024}, doi = {10.1371/journal.pone.0308469}, url = {},}. [Crossref]
@article{16, author = {Lifandali, O. and Abghour, N. and Chiba, Z.}, title = {Feature selection using a combination of ant colony optimization and {Random Forest} algorithms applied to isolation forest based intrusion detection system}, journal = {Procedia Comput. Sci.}, volume = {220}, pages = {796-805}, year = {2023}, doi = {10.1016/j.procs.2023.03.106}, url = {},}. [Crossref]
@article{17, author = {Rabih, R. and Vahdat-Nejad, H. and Mansoor, W. and Joloudari, J. H.}, title = {Highly accurate anomaly based intrusion detection through integration of the local outlier factor and convolutional neural network}, journal = {Sci. Rep.}, volume = {15}, pages = {21147}, year = {2025}, doi = {10.1038/s41598-025-08175-z}, url = {},}. [Crossref]
@article{18, author = {Wang, C. and Sun, Y. and Lv, S. and Wang, C. and Liu, H. and Wang, B.}, title = {Intrusion detection system based on one-class support vector machine and gaussian mixture model}, journal = {Electronics}, volume = {12}, number = {4}, pages = {930}, year = {2023}, doi = {10.3390/electronics12040930}, url = {},}. [Crossref]
@article{19, author = {Vishwakarma, M. and Kesswani, N.}, title = {A new two-phase intrusion detection system with {Na\"ive Bayes} machine learning for data classification and elliptic envelope method for anomaly detection}, journal = {Decis. Anal. J.}, volume = {7}, pages = {100233}, year = {2023}, doi = {10.1016/j.dajour.2023.100233}, url = {},}@inproceedings{20, author = {Sharafaldin, I. and Lashkari, A. H. and Ghorbani, A. A.}, title = {Toward generating a new intrusion detection dataset and intrusion traffic characterization}, booktitle = {Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP)}, address = {Funchal, Madeira, Portugal}, pages = {108-116}, year = {2018}, doi = {10.5220/0006639801080116}, url = {https://doi.org/10.5220/0006639801080116},}. [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.