Graph Convolution Neural Network and Deep Q-Network Optimization-Based Intrusion Detection with Explainability Analysis
Abstract
1. Introduction
- We introduce a hybrid architecture that combines GCN, attention mechanisms, and DQN to create optimal adaptive performance through reinforcement learning, enhancing real-time threat detection accuracy. DQN adaptively optimizes attention weights to optimize GCN attention model training.
- A unified approach framework is developed to enhance the performance of the network intrusion detection model through adaptive prioritization of features.
- The Explainable AI (XAI) concept is implemented to identify the most influential features and assess their impact on model detection performance using LIME and SHAP techniques. XAI offers transparency into how the GCN-based IDS makes decisions by revealing the role of each feature and its contribution to the final prediction.
2. Related Works
2.1. Machine Learning-Based Intrusion Detection Methods
2.2. Deep Learning-Based Intrusion Detection Methods
2.3. Malicious Detection Methods Based on Graph Neural Networks
3. The Proposed Model
3.1. Data Preprocessing and Feature Engineering
3.2. Graph Construction Using Euclidean Distance-Based Adjacency Matrix
3.3. Graph Embeddings Creation
3.4. Attention Weights Calculation
3.5. Model Classification and Loss Value Calculation
3.6. Optimizing Attention Weights via Deep Q-Learning
3.6.1. RL State Representation
- —the current attention weight matrix. This matrix determines how strongly each neighbouring node contributes to the node update function.
- —the mean of the node embeddings output by the GCN. It reflects the centre of the latent graph representation.
- —the variance of the node embeddings. It indicates how diverse or homogeneous the node representations are within the graph.
- —the current cross-entropy classification loss.
3.6.2. Action Space for Attention Adjustment
- (increase attention weights);
- (decrease attention weights);
- (reset to baseline);
- (no change).
3.6.3. The Reward Function
- Positive reward if the new loss is smaller → beneficial attention adjustment.
- Negative reward if the loss increases → harmful adjustment.
- Zero reward if the loss remains unchanged → neutral adjustment.
3.6.4. State Transition Dynamics
- The application of updated attention in the attention-weighted GCN layer.
- The forward pass through the classification head.
- The computation of new loss .
3.6.5. GCN Forward Pass Under Attention Control
3.6.6. Deep Q-Learning Update
4. Experimental Test Results and Discussion
4.1. Datasets
4.1.1. UNSW NB15
4.1.2. CIC-IDS2017
4.2. Metrics for Evaluation
4.3. Experimental Settings
4.4. Experimental Results
4.4.1. The Evaluation of Binary Classification Performance
4.4.2. The Analysis of Multi-Classification’s Performance
4.5. Time and Memory Consumption
4.6. Comparison Analysis
4.7. XAI Analysis Based on SHAP-LIME
5. Discussion
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Abdelkhalek, A.; Mashaly, M. Addressing the class imbalance problem in network intrusion detection systems using data resampling and deep learning. J. Supercomput. 2023, 79, 10611–10644. [Google Scholar] [CrossRef]
- Farag, W.; Wu, X.W.; Ezekiel, S.; Rado, D.; Lassinger, J. Development and Evaluation of a Novel IoT Testbed for Enhancing Security with Machine Learning-Based Threat Detection. Sensors 2025, 25, 5870. [Google Scholar] [CrossRef] [PubMed]
- Sarker, I.H. AI-Driven Cybersecurity and Threat Intelligence: Cyber Automation, Intelligent Decision-Making and Explainability; Springer Nature: Cham, Switzerland, 2024. [Google Scholar]
- Bilot, T.; El Madhoun, N.; Al Agha, K.; Zouaoui, A. Graph neural networks for intrusion detection: A survey. IEEE Access 2023, 11, 49114–49139. [Google Scholar] [CrossRef]
- Kim, H.; Lee, B.S.; Shin, W.Y.; Lim, S. Graph anomaly detection with graph neural networks: Current status and challenges. IEEE Access 2022, 10, 111820–111829. [Google Scholar] [CrossRef]
- Norouzian, M.R.; Xu, P.; Eckert, C.; Zarras, A. Hybroid: Toward android malware detection and categorization with program code and network traffic. In Proceedings of the Information Security: 24th International Conference, ISC 2021, Virtual Event, 10–12 November 2021; Proceedings 24. Springer: Berlin/Heidelberg, Germany, 2021; pp. 259–278. [Google Scholar]
- Zhang, Y.; Yang, C.; Huang, K.; Li, Y. Intrusion detection of industrial internet-of-things based on reconstructed graph neural networks. IEEE Trans. Netw. Sci. Eng. 2022, 10, 2894–2905. [Google Scholar] [CrossRef]
- Nguyen, V.A.; Nguyen, D.Q.; Nguyen, V.; Le, T.; Tran, Q.H.; Phung, D. ReGVD: Revisiting graph neural networks for vulnerability detection. In Proceedings of the ACM/IEEE 44th International Conference on Software Engineering: Companion Proceedings; Association for Computing Machinery: New York, NY, USA, 2022; pp. 178–182. [Google Scholar]
- Innan, N.; Sawaika, A.; Dhor, A.; Dutta, S.; Thota, S.; Gokal, H.; Patel, N.; Khan, M.A.Z.; Theodonis, I.; Bennai, M. Financial fraud detection using quantum graph neural networks. Quantum Mach. Intell. 2024, 6, 7. [Google Scholar] [CrossRef]
- Zhao, Q.; Zhang, Y.; Feng, X. Joint learning of structural and textual information on propagation network by graph attention networks for rumor detection. Appl. Intell. 2024, 54, 2851–2866. [Google Scholar] [CrossRef]
- Asif, M.; Al-Razgan, M.; Ali, Y.A.; Yunrong, L. Graph convolution networks for social media trolls detection use deep feature extraction. J. Cloud Comput. 2024, 13, 33. [Google Scholar] [CrossRef]
- Yin, Y.; Jang-Jaccard, J.; Xu, W.; Singh, A.; Zhu, J.; Sabrina, F.; Kwak, J. IGRF-RFE: A hybrid feature selection method for MLP-based network intrusion detection on UNSW-NB15 dataset. J. Big Data 2023, 10, 15. [Google Scholar] [CrossRef]
- Ahmed, H.A.; Hameed, A.; Bawany, N.Z. Network intrusion detection using oversampling technique and machine learning algorithms. PeerJ Comput. Sci. 2022, 8, e820. [Google Scholar] [CrossRef] [PubMed]
- Wang, C.; Sun, Y.; Lv, S.; Wang, C.; Liu, H.; Wang, B. Intrusion detection system based on one-class support vector machine and gaussian mixture model. Electronics 2023, 12, 930. [Google Scholar] [CrossRef]
- Prasad, M.; Gupta, R.K.; Tripathi, S. A multi-level correlation-based feature selection for intrusion detection. Arab. J. Sci. Eng. 2022, 47, 10719–10729. [Google Scholar] [CrossRef]
- Azam, Z.; Islam, M.M.; Huda, M.N. Comparative analysis of intrusion detection systems and machine learning-based model analysis through decision tree. IEEE Access 2023, 11, 80348–80391. [Google Scholar] [CrossRef]
- Sun, P.; Liu, P.; Li, Q.; Liu, C.; Lu, X.; Hao, R.; Chen, J. DL-IDS: Extracting features using CNN-LSTM hybrid network for intrusion detection system. Secur. Commun. Netw. 2020, 2020, 8890306. [Google Scholar] [CrossRef]
- Zheng, H.; Lin, F.; Feng, X.; Chen, Y. A hybrid deep learning model with attention-based conv-LSTM networks for short-term traffic flow prediction. IEEE Trans. Intell. Transp. Syst. 2020, 22, 6910–6920. [Google Scholar] [CrossRef]
- Keshk, M.; Koroniotis, N.; Pham, N.; Moustafa, N.; Turnbull, B.; Zomaya, A.Y. An explainable deep learning-enabled intrusion detection framework in IoT networks. Inf. Sci. 2023, 639, 119000. [Google Scholar] [CrossRef]
- Mohsin, A.; Janicke, H.; Ibrahim, A.; Sarker, I.H.; Camtepe, S. A Unified Framework for Human AI Collaboration in Security Operations Centers with Trusted Autonomy. arXiv 2025, arXiv:2505.23397. [Google Scholar] [CrossRef]
- Kipf, T.N.; Welling, M. Semi-supervised classification with graph convolutional networks. arXiv 2016, arXiv:1609.02907. [Google Scholar]
- Guo, J.-Y.; Li, R.; Zhang, Y.; Wang, G. Graph neural network based anomaly detectionin dynamic networks. J. Softw. 2020, 31, 748–762. [Google Scholar]
- Lan, J.; Lu, J.Z.; Wan, G.G.; Wang, Y.Y.; Huang, C.Y.; Zhang, S.B.; Huang, Y.Y.; Ma, J.N. E-minBatch GraphSAGE: An Industrial Internet Attack Detection Model. Secur. Commun. Netw. 2022, 2022, 5363764. [Google Scholar] [CrossRef]
- Niu, Z.; Xue, J.; Qu, D.; Wang, Y.; Zheng, J.; Zhu, H. A novel approach based on adaptive online analysis of encrypted traffic for identifying Malware in IIoT. Inf. Sci. 2022, 601, 162–174. [Google Scholar] [CrossRef]
- Diao, C.; Zhang, D.; Liang, W.; Li, K.C.; Hong, Y.; Gaudiot, J.L. A novel spatial-temporal multi-scale alignment graph neural network security model for vehicles prediction. IEEE Trans. Intell. Transp. Syst. 2022, 24, 904–914. [Google Scholar] [CrossRef]
- Batista, G.E.; Prati, R.C.; Monard, M.C. A study of the behavior of several methods for balancing machine learning training data. ACM SIGKDD Explor. Newsl. 2004, 6, 20–29. [Google Scholar] [CrossRef]
- Doquire, G.; Verleysen, M. Mutual information-based feature selection for multilabel classification. Neurocomputing 2013, 122, 148–155. [Google Scholar] [CrossRef]
- Malkauthekar, M. Analysis of euclidean distance and manhattan distance measure in face recognition. In Proceedings of the Third International Conference on Computational Intelligence and Information Technology (CIIT 2013); IET: London, UK, 2013; pp. 503–507. [Google Scholar]
- Chen, J.; Xie, H.; Cai, S.; Song, L.; Geng, B.; Guo, W. GCN-MHSA: A novel malicious traffic detection method based on graph convolutional neural network and multi-head self-attention mechanism. Comput. Secur. 2024, 147, 104083. [Google Scholar] [CrossRef]
- Nguyen, T.T.; Park, M. EL-GNN: A Continual-Learning-Based Graph Neural Network for Task-Incremental Intrusion Detection Systems. Electronics 2025, 14, 2756. [Google Scholar] [CrossRef]
- Vaswani, A. Attention is all you need. In Advances in Neural Information Processing Systems; Curran Associates, Inc.: Red Hook, NY, USA, 2017. [Google Scholar]
- Alkasassbeh, M.; Omoush, E.; Almseidin, M.; Aldweesh, A. A Self-Adaptive Intrusion Detection System for Zero-Day Attacks Using Deep Q-Networks. IEEE Access 2025, 13, 174296. [Google Scholar] [CrossRef]
- Deisenroth, M.; Brundage, M.; Bharath, A. Deep reinforcement learning: A brief survey. IEEE Signal Process. Mag. 2017, 22, 26–38. [Google Scholar] [CrossRef]
- Moustafa, N.; Slay, J. UNSW-NB15: A comprehensive data set for network intrusion detection systems (UNSW-NB15 network data set). In Proceedings of the 2015 Military Communications and Information Systems Conference (MilCIS), Canberra, ACT, Australia, 10–12 November 2015; pp. 1–6. [Google Scholar] [CrossRef]
- Canadian Institute for Cybersecurity. Intrusion Detection Evaluation Dataset (CIC-IDS2017). 2017. Available online: https://www.unb.ca/cic/datasets/ids-2017.html (accessed on 9 May 2025).
- Kabir, M.H.; Rajib, M.S.; Rahman, A.S.M.T.; Rahman, M.M.; Dey, S.K. Network intrusion detection using UNSW-NB15 dataset: Stacking machine learning based approach. In Proceedings of the 2022 International Conference on Advancement in Electrical and Electronic Engineering (ICAEEE), Gazipur, Bangladesh, 24–26 February 2022; pp. 1–6. [Google Scholar]
- Zhao, J.; Liu, Y.; Zhang, Q.; Zheng, X. CNN-AttBiLSTM mechanism: A DDoS attack detection method based on attention mechanism and CNN-BiLSTM. IEEE Access 2023, 11, 136308–136317. [Google Scholar] [CrossRef]
- Tran, D.H.; Park, M. Graph Embedding for Graph Neural Network in Intrusion Detection System. In Proceedings of the 2024 International Conference on Information Networking (ICOIN), Ho Chi Minh City, Vietnam, 17–19 January 2024; pp. 395–397. [Google Scholar]
- Umer, M.; Tahir, M.; Sardaraz, M.; Sharif, M.; Elmannai, H.; Algarni, A.D. Network intrusion detection model using wrapper based feature selection and multi head attention transformers. Sci. Rep. 2025, 15, 28718. [Google Scholar] [CrossRef]
- Liu, W. Dynamic Network Intrusion Detection Model Based on Transformer and Adversarial Autoencoder. Int. J. Intell. Netw. 2025; in press. [Google Scholar] [CrossRef]
- Alicioglu, G.; Sun, B. A survey of visual analytics for explainable artificial intelligence methods. Comput. Graph. 2022, 102, 502–520. [Google Scholar] [CrossRef]
- Sahakyan, M.; Aung, Z.; Rahwan, T. Explainable artificial intelligence for tabular data: A survey. IEEE Access 2021, 9, 135392–135422. [Google Scholar] [CrossRef]
- Sarker, I.H.; Janicke, H.; Mohsin, A.; Gill, A.; Maglaras, L. Explainable AI for cybersecurity automation, intelligence and trustworthiness in digital twin: Methods, taxonomy, challenges and prospects. ICT Express 2024, 10, 935–958. [Google Scholar] [CrossRef]
- Alabbadi, A.; Bajaber, F. An Intrusion Detection System over the IoT Data Streams Using eXplainable Artificial Intelligence (XAI). Sensors 2025, 25, 847. [Google Scholar] [CrossRef] [PubMed]
- Ogunseyi, T.B.; Thiyagarajan, G. An Explainable LSTM-Based Intrusion Detection System Optimized by Firefly Algorithm for IoT Networks. Sensors 2025, 25, 2288. [Google Scholar] [CrossRef]
- Sarker, I.H.; Janicke, H.; Mohsin, A.; Maglaras, L. SME-TEAM: Leveraging trust and ethics for secure and responsible use of AI and LLMs in SMEs. npj Artif. Intell. 2026, 2, 12. [Google Scholar] [CrossRef]







| UNSW-NB15 | CIC-IDS2017 | ||
|---|---|---|---|
| Parameter | Value | Parameter | Value |
| num_epochs | 250 | num_epochs | 250 |
| learning rate | learning rate | ||
| batch_size | 128 | batch_size | 128 |
| dropout_rate | 0.1 | dropout_rate | 0.3 |
| num_heads | 4 | num_heads | 4 |
| gamma (DQN) | 0.99 | gamma (DQN) | 0.99 |
| epsilon (DQN) | 1.0 | epsilon (DQN) | 1.0 |
| epsilon_decay (DQN) | 0.995 | epsilon_decay (DQN) | 0.995 |
| epsilon_min (DQN) | 0.01 | epsilon_min (DQN) | 0.01 |
| weight_decay | weight_decay | ||
| label_smoothing | 0.1 | label_smoothing | 0.1 |
| early_stopping_patience | 20 | early_stopping_patience | 20 |
| gradient_clip_norm | 1.0 | gradient_clip_norm | 1.0 |
| optimizer | AdamW | optimizer | AdamW |
| Class | Baseline Model | GCN-DQN | ||||||
|---|---|---|---|---|---|---|---|---|
| Normal | 92.00 | 95.00 | 88.00 | 91.00 | 97.00 | 98.00 | 94.00 | 96.00 |
| Attack | 92.00 | 89.00 | 96.00 | 92.00 | 97.00 | 96.00 | 98.00 | 97.00 |
| Class | Baseline Model | GCN-DQN | ||||||
|---|---|---|---|---|---|---|---|---|
| Normal | 92.27 | 81.00 | 99.00 | 89.00 | 99.02 | 99.00 | 99.00 | 99.00 |
| DoS hulk | 92.27 | 99.00 | 79.00 | 88.00 | 99.02 | 99.00 | 99.00 | 99.00 |
| Portscan | 92.27 | 99.00 | 99.00 | 99.00 | 99.02 | 99.00 | 99.00 | 99.00 |
| Reference | Dataset | Approach | Acc% | XAI |
|---|---|---|---|---|
| [13] | UNSW NB15 | SMOTE, Random Forest | 95.1 | × |
| [12] | UNSW NB15 | IGRF-RFE, MLP | 84.24 | × |
| [36] | UNSW NB15 | Stack Model [XGBoost KNN + XGBoost NN KNN] | 96.2 | × |
| [37] | CIC-IDS2017 | CNN-BiLSTM-Attention | 88.83 | × |
| [30] | CIC-IDS2017 | GNN, Continual learning (CL) | 95.9 | × |
| UNSW NB15 | GNN, Continual learning (CL) | 96.4 | × | |
| [38] | UNSW NB15 | GCN | 96.40 | × |
| CIC-IDS2017 | GCN | 94.00 | × | |
| [39] | UNSW NB15 | Wrapper-base feature selection, Multi-Head Attention-transformer | 93.00 | × |
| [40] | CIC-IDS2017 | Transformer, Adversarial Autoencoder | 97.3 | × |
| Our Study | UNSW NB15 | GCN-Multi-head attention, DQN | 97.00 | ✓ |
| CIC-IDS2017 | GCN-Multi-head attention, DQN | 99.82 | ✓ |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Mwiga, K.; Dida, M.; Maglaras, L.; Mohsin, A.; Janicke, H.; Sarker, I.H. Graph Convolution Neural Network and Deep Q-Network Optimization-Based Intrusion Detection with Explainability Analysis. Sensors 2026, 26, 1421. https://doi.org/10.3390/s26051421
Mwiga K, Dida M, Maglaras L, Mohsin A, Janicke H, Sarker IH. Graph Convolution Neural Network and Deep Q-Network Optimization-Based Intrusion Detection with Explainability Analysis. Sensors. 2026; 26(5):1421. https://doi.org/10.3390/s26051421
Chicago/Turabian StyleMwiga, Kelvin, Mussa Dida, Leandros Maglaras, Ahmad Mohsin, Helge Janicke, and Iqbal H. Sarker. 2026. "Graph Convolution Neural Network and Deep Q-Network Optimization-Based Intrusion Detection with Explainability Analysis" Sensors 26, no. 5: 1421. https://doi.org/10.3390/s26051421
APA StyleMwiga, K., Dida, M., Maglaras, L., Mohsin, A., Janicke, H., & Sarker, I. H. (2026). Graph Convolution Neural Network and Deep Q-Network Optimization-Based Intrusion Detection with Explainability Analysis. Sensors, 26(5), 1421. https://doi.org/10.3390/s26051421

