HARMONI: A Two-Stage Hybrid Learning Framework with Dynamic Metric Learning for Interpretable NIDS
Source abstract
Abstract
The increasing sophistication of cyber attacks has created a growing demand for effective Network Intrusion Detection Systems (NIDSs). Although deep learning has improved NIDS performance, existing models often lack adaptive mechanisms for spatiotemporal feature fusion and struggle with complex traffic distributions characterized by severe intra-class heterogeneity and inter-class overlap. Meanwhile, current interpretability methods mainly rely on feature importance analysis and provide limited insight into the model’s decision process. To address these challenges, we propose HARMONI, a two-stage hybrid learning framework that enhances both detection accuracy and model interpretability. In the first stage, a dual-branch Convolutional Neural Network and Gated Recurrent Unit (CNN-GRU) architecture extracts spatiotemporal features, which are dynamically fused through a lightweight adaptive gating network. The representation learning process is jointly optimized using a Dynamic Class-Center Loss to enforce intra-class compactness and inter-class separability in the latent space. In the second stage, the learned deep representations are concatenated with raw traffic features and fed into an ensemble classifier. This residual-style design mitigates information loss during deep encoding while leveraging the non-linear modeling capability of ensemble learning. We further develop a multi-level interpretability framework based on SHapley Additive exPlanations (SHAP) that analyzes global feature importance, individual feature contributions, and feature interactions to provide quantitative insights into the model’s decision mechanisms. Experiments on four benchmark datasets show that HARMONI consistently outperforms state-of-the-art baselines, achieving 80.19% and 78.24% accuracy on NSL-KDD and UNSW-NB15 respectively, surpassing representative deep learning and ensemble methods.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Network Security and Intrusion Detection · Adversarial Robustness in Machine Learning · Explainable Artificial Intelligence (XAI)
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Cyberspace Institute of Advanced Technology, Huangpu Research School, Guangzhou University, Guangzhou 510006, China
School of Computer Science and Technology, Harbin Institute of Technology (Shenzhen), Shenzhen 518055, China
Department of New Networks, Pengcheng Laboratory, Shenzhen 518000, China
Funding
National Natural Science Foundation of China
References (52)
Show source-provided references
1. LLMGRAPH: Label-free Detection against APTs in Edge Networks via LLM and GCN10.1109/TDSC.2025.3596092 ↗
2. Wide residual quantum dilated convolutional neural network for zero-day attack detection10.1016/j.engappai.2025.113404 ↗
3. Active cybersecurity: Vision, model, and key technologies10.1631/FITEE.2500053 ↗
4. Zhang, C., Hu, P., and Tan, L. (2025). Spatiotemporal Feature Correlation with Feature Space Transformation for Intrusion Detection. Appl. Sci., 15.10.3390/app152011168 ↗
5. Dilini, N., Sun, N., Miao, Y., and Moustafa, N. (2026). A Comprehensive Review on Graph-Based Anomaly Detection: Approaches for Intrusion Detection. Appl. Sci., 16.10.20944/preprints202601.1466.v1 ↗
6. Toward enhancing privacy preservation of a federated learning CNN intrusion detection system in iot: Method and empirical study10.1145/3695998 ↗
7. Intrusion detection system based on RNN classifier for feature reduction10.1007/s42979-021-00991-0 ↗
8. Dugat-LSTM: Deep learning based network intrusion detection system using chaotic optimization strategy10.1016/j.eswa.2023.123027 ↗
9. GRU-based deep learning approach for network intrusion alert prediction10.1016/j.future.2021.09.040 ↗
10. A hybrid CNN-LSTM approach for intelligent cyber intrusion detection system10.1016/j.cose.2024.104146 ↗
11. Flowtransformer: A transformer framework for flow-based network intrusion detection systems10.1016/j.eswa.2023.122564 ↗
12. Transformer based intrusion detection for iot networks10.1109/JIOT.2025.3525494 ↗
13. Liu, Y., and Wu, L. (2023). Intrusion Detection Model Based on Improved Transformer. Appl. Sci., 13.10.3390/app13106251 ↗
14. ROULETTE: A neural attention multi-output model for explainable network intrusion detection10.1016/j.eswa.2022.117144 ↗
15. XMF-GNN: A cross-modality dynamic fusion heterogeneous graph neural network for network intrusion detection10.1016/j.neucom.2025.131285 ↗
16. A novel transformer-based explainable AI approach using SHAP for intrusion detection in vehicular ad hoc networks10.1016/j.comnet.2025.111575 ↗
17. Interpretable Intrusion Detection for IoT Security: A SHAP-Enhanced NGBoost Model10.1016/j.comnet.2025.111937 ↗
18. Gbfkan: An adaptive multi-layer interpretable architecture for intrusion detection in various internet of things scenarios10.1109/JIOT.2025.3570033 ↗
19. STG2P: A two-stage pipeline model for intrusion detection based on improved LightGBM and K-means10.1016/j.simpat.2022.102614 ↗
20. Evolving cybersecurity frontiers: A comprehensive survey on concept drift and feature dynamics aware machine and deep learning in intrusion detection systems10.1016/j.engappai.2024.109143 ↗
21. Deep learning enabled intrusion detection system for Industrial IOT environment10.1016/j.eswa.2024.123808 ↗
22. Explainable deep learning approach for advanced persistent threats (APTs) detection in cybersecurity: A review10.1007/s10462-024-10890-4 ↗
23. A two-stage intrusion detection system with auto-encoder and LSTMs10.1016/j.asoc.2022.108768 ↗
24. Performance analysis of intrusion detection systems using a feature selection method on the UNSW-NB15 dataset10.1186/s40537-020-00379-6 ↗
25. TMG-GAN: Generative adversarial networks-based imbalanced learning for network intrusion detection10.1109/TIFS.2023.3331240 ↗
26. Recent advances in decision trees: An updated survey10.1007/s10462-022-10275-5 ↗
27. Wrapper feature selection method based differential evolution and extreme learning machine for intrusion detection system10.1016/j.patcog.2022.108912 ↗
28. MIM: A multiple integration model for intrusion detection on imbalanced samples10.1007/s11280-024-01285-0 ↗
29. MMM-RF: A novel high accuracy multinomial mixture model for network intrusion detection systems10.1016/j.cose.2022.102777 ↗
30. Deep learning approach for intelligent intrusion detection system10.1109/ACCESS.2019.2895334 ↗
31. Detecting and mitigating DDoS attacks in SDN using spatial-temporal graph convolutional network10.1109/TDSC.2021.3108782 ↗
32. Deep learning for intrusion detection in emerging technologies: A comprehensive survey and new perspectives10.1007/s10462-025-11346-z ↗
33. FIR-GNN: A Graph Neural Network using Flow Interaction Relationships for Intrusion Detection of Consumer Electronics in Smart Home Network10.1109/TCE.2025.3548798 ↗
34. Transformers and large language models for efficient intrusion detection systems: A comprehensive survey10.1016/j.inffus.2025.103347 ↗
35. A network security situation assessment method based on adversarial deep learning10.1016/j.asoc.2021.107096 ↗
36. AI-powered internet traffic classification: Past, present, and future10.1109/MCOM.001.2300361 ↗
37. Explainable artificial intelligence for cybersecurity: A literature survey10.1007/s12243-022-00926-7 ↗
38. An assessment framework for explainable AI with applications to cybersecurity10.1007/s10462-025-11141-w ↗
39. Explainable intrusion detection for cyber defences in the internet of things: Opportunities and solutions10.1109/COMST.2023.3280465 ↗
40. Notions of explainability and evaluation approaches for explainable artificial intelligence10.1016/j.inffus.2021.05.009 ↗
41. Durojaye, H., and Naiseh, M. (2024). Explainable AI for intrusion detection systems: A model development and experts’ evaluation. Proceedings of the Intelligent Systems Conference, Springer.10.1007/978-3-031-66428-1_18 ↗
42. Wen, Y., Zhang, K., Li, Z., and Qiao, Y. (2016). A discriminative feature learning approach for deep face recognition. Proceedings of the European Conference on Computer Vision, Springer.10.1007/978-3-319-46478-7_31 ↗
43. Dimensionality reduction by learning an invariant mapping
44. He, K., Fan, H., Wu, Y., Xie, S., and Girshick, R. (2020, January 13–19). Momentum contrast for unsupervised visual representation learning. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA.10.1109/CVPR42600.2020.00975 ↗
45. He, K., Zhang, X., Ren, S., and Sun, J. (2016, January 27–30). Deep residual learning for image recognition. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA.10.1109/CVPR.2016.90 ↗
46. Chen, T., and Guestrin, C. (2016). XGBoost: A Scalable Tree Boosting System. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, ACM.10.1145/2939672.2939785 ↗
47. Moustafa, N., and Slay, J. (2015). UNSW-NB15: A comprehensive data set for network intrusion detection systems (UNSW-NB15 network data set). Proceedings of the 2015 Military Communications and Information Systems Conference (MilCIS), Canberra, Australia, 10–12 November 2015, IEEE.10.1109/MilCIS.2015.7348942 ↗
48. Tavallaee, M., Bagheri, E., Lu, W., and Ghorbani, A.A. (2009). A detailed analysis of the KDD CUP 99 data set. Proceedings of the 2009 IEEE Symposium on Computational Intelligence for Security and Defense Applications, Ottawa, ON, Canada, 8–10 July 2009, IEEE.10.1109/CISDA.2009.5356528 ↗
49. DDOS attack SDN dataset
50. Sharafaldin, I., Lashkari, A.H., Hakak, S., and Ghorbani, A.A. (2019). Developing realistic distributed denial of service (DDoS) attack dataset and taxonomy. Proceedings of the 2019 International Carnahan Conference on Security Technology (ICCST), Chennai, India, 1–3 October 2019, IEEE.10.1109/CCST.2019.8888419 ↗
51. GAUDI: Interpretable multi-omics integration with UMAP embeddings and density-based clustering10.1038/s41467-025-60822-1 ↗
52. Fusion of linear and non-linear dimensionality reduction techniques for feature reduction in LSTM-based Intrusion Detection System10.1016/j.asoc.2024.111378 ↗