An Intrusion Detection Model Based on Equalization Loss and Spatio-Temporal Feature Extraction
Abstract
1. Introduction
- 1.
- Diverging from distinct processing paradigms that isolate spatial attributes from temporal dynamics, the STEGCN framework orchestrates a coherent fusion of these dimensions into a unified architecture. Specifically, high-order spatial correlations extracted via GCN function as contextual antecedents for the GRU-based temporal modeling. This seamless methodology captures both instantaneous topological anomalies and their chronological evolution, thereby yielding a multidimensional representation of intrusion behaviors often overlooked by bifurcated models.
- 2.
- High-order feature extraction is facilitated through the implementation of a cascaded GCN configuration, which is designed to aggregate multi-hop neighborhood information. This mechanism ensures the simultaneous delineation of local and global topological characteristics within network traffic. Such comprehensive modeling provides a rigorous characterization of the latent spatial dependencies existing among diverse traffic features, substantially enhancing the representational capacity of the network.
- 3.
- The endemic issue of class imbalance in network traffic datasets is effectively counteracted by the integration of an EQLv2 mechanism into the architecture. This dynamic gradient-balancing strategy mitigates the suppression of minority classes by majority samples during the training phase. Consequently, detection sensitivity toward infrequent yet severe attack vectors is substantially elevated without compromising the classification fidelity of the overall system, offering superior robustness compared to traditional resampling techniques.
2. Related Work
2.1. Intrusion Detection System Based on Deep Learning
2.2. Current Research Status on Data Imbalance
3. Design and Method of the Model
3.1. Problem Modeling and Temporal Graph Construction
3.2. Overall Architecture of STEGCN
3.2.1. GCNII−Based Spatial Feature Extraction
3.2.2. GRU-Based Temporal Feature Modeling
3.2.3. EQLv2-Based Balanced Classification Decision
3.2.4. Overall Training Objective and Enhancement Strategies
4. Experiment and Result Analysis
4.1. Experiment Environment
4.2. Datasets and Data Processing
4.3. Evaluation Criteria
4.4. Experiments and Results
4.4.1. Comparative Model Performance Analysis
4.4.2. Comparative Analysis of Recall Performance Across Categories
4.4.3. Comparative Performance Analysis of Existing Methods
4.4.4. Ablation Study
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Anderson, J.P. Computer Security Threat Monitoring and Surveillance; Technical Report; James P. Anderson Company: Fort Washington, PA, USA, 1980. [Google Scholar]
- Fang, L.; Li, Y.; Liu, Z.; Yin, C.; Li, M.; Cao, Z.J. A practical model based on anomaly detection for protecting medical IoT control services against external attacks. IEEE Trans. Ind. Inform. 2020, 17, 4260–4269. [Google Scholar] [CrossRef]
- Zhang, H.; Zhang, X.; Zhang, Z.; Li, W. Summary of Intrusion Detection Models Based on Deep Learning. J. Comput. Eng. Appl. 2022, 58, 17–28. [Google Scholar]
- Chao, C.; Jingkai, W.; Mei, C. An Intrusion Detection Algorithm for Wireless Sensor Networks Based on RBM-SVM. Comput. Appl. Softw. 2022, 39, 325–329. [Google Scholar]
- Kanumalli, S.S.; Lavanya, K.; Rajeswari, A.; Samyuktha, P.; Tejaswi, M. A scalable network intrusion detection system using bi-lstm and cnn. In Proceedings of the 2023 Third International Conference on Artificial Intelligence and Smart Energy (ICAIS), Coimbatore, India, 2–4 February 2023; pp. 1–6. [Google Scholar]
- Ullah, F.; Ullah, S.; Srivastava, G.; Lin, J.C.W. IDS-INT: Intrusion detection system using transformer-based transfer learning for imbalanced network traffic. Digit. Commun. Netw. 2024, 10, 190–204. [Google Scholar] [CrossRef]
- 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]
- Sharafaldin, I.; Lashkari, A.H.; Ghorbani, A.A. Toward generating a new intrusion detection dataset and intrusion traffic characterization. ICISSp 2018, 1, 108–116. [Google Scholar]
- Ren, K.; Yuan, S.; Zhang, C.; Shi, Y.; Huang, Z. CANET: A hierarchical cnn-attention model for network intrusion detection. Comput. Commun. 2023, 205, 170–181. [Google Scholar] [CrossRef]
- Zhen, Z.; Yichen, Z.; Hongpeng, T. Network Intrusion Detection Based on Spatial Features and Generative Adversarial Networks. J. Zhengzhou Univ. Eng. Sci. 2024, 45, 40–47. [Google Scholar]
- Hong, C.; Chaoyi, J.; Haibo, J.; Cong, W.; Jianbo, L. Fusion of Improved Stacked Encoder and Multi-Layer BiLSTM for Intrusion Detection Model. Comput. Eng. Appl. 2025, 61, 306–314. [Google Scholar]
- Sha, Z.; Shengbing, C.; Youchen, K.; Xu, Z.; Shenyi, G. Network Intrusion Detection Based on Feature Selection and Spatio-Temporal Features. Comput. Eng. 2025, 51, 223–231. [Google Scholar]
- Lo, W.W.; Layeghy, S.; Sarhan, M.; Gallagher, M.; Portmann, M. E-graphsage: A graph neural network based intrusion detection system for iot. arXiv 2021, arXiv:2103.16329. [Google Scholar]
- Chang, L.; Branco, P. Graph-based solutions with residuals for intrusion detection: The modified e-graphsage and e-resgat algorithms. arXiv 2021, arXiv:2111.13597. [Google Scholar]
- Xueli, S.; Shifeng, L. Intrusion Detection Model Based on Graph Edge Feature Attention. Comput. Eng. 2024, 50, 236–245. [Google Scholar]
- Le, W.; Meng, H.; Xiaojuan, L.; Ni, Z.; Haodong, C. Review of Classification Methods for Unbalanced Data Sets. Comput. Eng. Appl. 2021, 57, 64606–64628. [Google Scholar]
- Wei, W.; Chen, Y.; Lin, Q.; Ji, J.; Wong, K.C.; Li, J. Multi-objective evolving long–short term memory networks with attention for network intrusion detection. Appl. Soft Comput. 2023, 139, 110216. [Google Scholar] [CrossRef]
- Yuan, L.; Yu, S.; Yang, Z.; Duan, M.; Li, K. A data balancing approach based on generative adversarial network. Future Gener. Comput. Syst. 2023, 141, 768–776. [Google Scholar] [CrossRef]
- Liu, C.; Antypenko, R.; Sushko, I.; Zakharchenko, O. Intrusion detection system after data augmentation schemes based on the VAE and CVAE. IEEE Trans. Reliab. 2022, 71, 1000–1010. [Google Scholar] [CrossRef]
- Tan, J.; Lu, X.; Zhang, G.; Yin, C.; Li, Q. Equalization loss v2: A new gradient balance approach for long-tailed object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 1685–1694. [Google Scholar]
- Panigrahi, A.; Pati, A.; Addula, S.R.; Pati, A.K.; Sahoo, G.; Dash, M. An Ensemble Machine Learning-Based Model for Blockchain Transactional Data Classification. In Proceedings of the International Conference on Biologically Inspired Techniques in Many-Criteria Decision-Making Technologies; Springer: Cham, Switzerland, 2024; pp. 430–438. [Google Scholar]
- Panigrahi, R.; Borah, S. A detailed analysis of CICIDS2017 dataset for designing Intrusion Detection Systems. Int. J. Eng. Technol. 2018, 7, 479–482. [Google Scholar]
- 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]
- Chen, M.; Wei, Z.; Huang, Z.; Ding, B.; Li, Y. Simple and deep graph convolutional networks. In Proceedings of the International Conference on Machine Learning, PMLR, Virtual, 13–18 July 2020; pp. 1725–1735. [Google Scholar]
- Upadhyay, A.; Thakur, N.; Pandey, A.; Khan, M.; Vibhute, A.D. Multiple Intrusion Detection in Complex Cloud Environments Using Random Forest and Deep Learning on the UNSW-NB15 Benchmark Datasets. In Proceedings of the International Conference on Intelligent Communication, Control and Devices; Springer: Singapore, 2024; pp. 71–85. [Google Scholar]
- Mohamed, F.O.A.; Agarwal, M. Using recursive feature elimination feature selection based machine learning classifier for attack classification on UNSW-NB 15 dataset. In Proceedings of the 2024 IEEE 9th International Conference for Convergence in Technology (I2CT), Pune, India, 5–7 April 2024; pp. 1–7. [Google Scholar]
- Sambandam, R.K.; Daniel, D.; Gokulapriya, R.; Vetriveeran, D.; Jenefa, J.; Anuneshwar. Comparison of Machine Learning-Based Intrusion Detection Systems Using UNSW-NB15 Dataset. In Proceedings of the International Conference on Artificial Intelligence on Textile and Apparel; Springer: Singapore, 2023; pp. 311–324. [Google Scholar]
- Al-Obaidi, A.; Ibrahim, A.A.; Khaleel, A.M. The Effectiveness of Deploying Machine Learning Techniques in Information Security to Detect Nine Attacks: UNSW-NB15 Dataset as a Case Study. Math. Model. Eng. Probl. 2023, 10, 5. [Google Scholar] [CrossRef]
- Hooshmand, M.K.; Hosahalli, D. Network anomaly detection using deep learning techniques. CAAI Trans. Intell. Technol. 2022, 7, 228–243. [Google Scholar] [CrossRef]
- Kumar, A.; Soni, A.; Singh, M. Performing multiclass classification on UNSW-NB15 dataset by applying machine learning approach on intrusion detection system. In Proceedings of the International Conference on Data Science and Big Data Analysis; Springer: Singapore, 2023; pp. 461–473. [Google Scholar]
- Jose, J.; Jose, D.V. Deep learning algorithms for intrusion detection systems in internet of things using CIC-IDS 2017 dataset. Int. J. Electr. Comput. Eng. (IJECE) 2023, 13, 1134–1141. [Google Scholar] [CrossRef]
- Imrana, Y.; Xiang, Y.; Ali, L.; Abdul-Rauf, Z. A bidirectional LSTM deep learning approach for intrusion detection. Expert Syst. Appl. 2021, 185, 115524. [Google Scholar] [CrossRef]
- Li, J.; Zhang, H.; Liu, Z.; Liu, Y. Network intrusion detection via tri-broad learning system based on spatial-temporal granularity. J. Supercomput. 2023, 79, 9180–9205. [Google Scholar] [CrossRef]
- Zhang, H.; Li, J.L.; Liu, X.M.; Dong, C. Multi-dimensional feature fusion and stacking ensemble mechanism for network intrusion detection. Future Gener. Comput. Syst. 2021, 122, 130–143. [Google Scholar] [CrossRef]
- Chen, Y.; Lin, Q.; Wei, W.; Ji, J.; Wong, K.C.; Coello, C. Intrusion detection using multi-objective evolutionary convolutional neural network for Internet of Things in Fog computing. Knowl.-Based Syst. 2022, 244, 108505. [Google Scholar] [CrossRef]





| Component | Specification |
|---|---|
| Operating System | Windows 11 (Microsoft Corporation, Redmond, WA, USA) |
| CPU | Intel(R) Core(TM) i7-11700 (Intel Corporation, Santa Clara, CA, USA) |
| GPU | NVIDIA GeForce RTX 3060 (NVIDIA Corporation, Santa Clara, CA, USA) |
| RAM | 32 GB |
| Python | 3.8.3 (Python Software Foundation, Wilmington, DE, USA) |
| Deep Learning Framework | PyTorch 2.1.0 (Meta Platforms Inc., Menlo Park, CA, USA) |
| Graph Neural Network Library | PyTorch Geometric 2.4.0 (https://pytorch-geometric.readthedocs.io) |
| New Label | Original Label | Quantity |
|---|---|---|
| Benign | Benign | 2,271,320 |
| DoS/DDoS | DDoS DoS GoldenEye DoS Hulk DoS Slowhttptest DoS Slowloris Heartbleed | 379,748 |
| PortScan | PortScan | 158,804 |
| Brute Force | FTP-Patator SSH-Patator | 13,832 |
| Web Attack | Brute Force SQL Injection XSS | 2180 |
| Botnet | Bot | 1956 |
| Index | Category | Quantity |
|---|---|---|
| 0 | Benign | 22,188,764 |
| 1 | Generic | 215,481 |
| 2 | Exploits | 44,525 |
| 3 | Fuzzers | 14,430 |
| 4 | DoS | 24,246 |
| 5 | Reconnaissance | 13,987 |
| 6 | Analysis | 2677 |
| 7 | Backdoors | 2329 |
| 8 | Shellcode | 1511 |
| 9 | Worms | 174 |
| Model | UNSW-NB15 | CICIDS2017 | ||||
|---|---|---|---|---|---|---|
| Accuracy (%) | Recall (%) | F1 (%) | Accuracy (%) | Recall (%) | F1 (%) | |
| NB | 96.0 | 38.1 | 52.8 | 80.1 | 91.1 | 85.2 |
| DT | 98.1 | 40.5 | 55.3 | 98.5 | 64.8 | 76.9 |
| RF | 98.1 | 35.8 | 51.2 | 98.5 | 56.3 | 70.4 |
| LR | 97.5 | 24.4 | 38.6 | 98.5 | 62.2 | 75.3 |
| MLP | 97.9 | 37.2 | 52.5 | 99.6 | 76.1 | 85.7 |
| CNN | 97.9 | 41.7 | 56.8 | 99.7 | 86.2 | 92.1 |
| RNN | 98.0 | 42.9 | 58.1 | 99.7 | 72.0 | 83.2 |
| LSTM | 98.2 | 40.5 | 55.6 | 99.7 | 72.7 | 83.7 |
| GRU | 98.0 | 42.6 | 57.7 | 99.7 | 72.3 | 83.4 |
| GCN | 94.7 | 51.7 | 63.5 | 93.2 | 98.2 | 95.6 |
| STEGCN | 96.3 | 66.4 | 78.6 | 98.8 | 99.6 | 99.2 |
| Category | Model (Recall%) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| NB | DT | RF | MLP | CNN | RNN | LSTM | GRU | GCN | STEGCN | |
| Benign | 98.0 | 99.0 | 99.0 | 99.8 | 99.6 | 99.4 | 99.8 | 100 | 98.1 | 98.6 |
| Generic | 2.5 | 39.5 | 29.0 | 38.9 | 33.7 | 45.5 | 25.3 | 0 | 97.2 | 97.3 |
| Exploits | 95.0 | 86.9 | 89.0 | 90.4 | 86.9 | 84.0 | 88.6 | 100 | 17.1 | 44.0 |
| Fuzzers | 29.9 | 19.6 | 21.4 | 0.4 | 32.7 | 65.8 | 33.8 | 0 | 37.5 | 75.7 |
| DoS | 1.4 | 0 | 0.7 | 0 | 0.6 | 0 | 0.9 | 0 | 2.5 | 7.3 |
| Reconnaissance | 1.1 | 73.7 | 81.8 | 68.5 | 59.2 | 54.9 | 72.6 | 100 | 0 | 50.9 |
| Analysis | 72.3 | 0 | 0 | 0 | 27.9 | 0 | 0 | 0 | 86.1 | 69.7 |
| Backdoors | 15.0 | 1.2 | 3.7 | 0 | 0.6 | 0 | 2.4 | 0 | 98.6 | 75.5 |
| Shellcode | 66.0 | 84.2 | 33.1 | 74.1 | 76.4 | 79.4 | 82.1 | 100 | 4.1 | 48.3 |
| Worms | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 76.3 | 76.3 |
| Category | Model (Recall%) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| NB | DT | RF | MLP | CNN | RNN | LSTM | GRU | GCN | STEGCN | |
| Benign | 78.2 | 99.5 | 99.8 | 99.8 | 99.8 | 99.9 | 99.3 | 100 | 92.3 | 98.5 |
| DoS/DDoS | 88.4 | 94.1 | 92.7 | 99.1 | 99.6 | 99.6 | 99.2 | 100 | 97.6 | 99.9 |
| PortScan | 97.4 | 94.6 | 97.4 | 99.4 | 99.6 | 99.7 | 99.7 | 100 | 99.4 | 99.9 |
| Brute Force | 98.5 | 98.1 | 46.6 | 98.3 | 98.5 | 99.2 | 99.3 | 100 | 100 | 100 |
| Web Attack | 85.7 | 0 | 0 | 0 | 93.6 | 4.2 | 5.1 | 0 | 100 | 99.5 |
| Botnet | 98.7 | 0 | 1.4 | 59.7 | 26.2 | 29.6 | 32.2 | 0 | 100 | 100 |
| Model | Accuracy (%) | Recall (%) | F1 (%) |
|---|---|---|---|
| Proposed Model | 96.3 | 66.4 | 78.6 |
| CNN [25] | 93.82 | 37.50 | 52.4 |
| KNN [26] | 97.36 | 60.50 | 73.8 |
| DT [26] | 97.19 | 60.7 | 73.9 |
| LR [26] | 95.12 | 49.4 | 63.2 |
| SVM [27] | 98.0 | 61.7 | 75.2 |
| XGB [28] | 83.2 | 65.3 | 72.8 |
| AdaBoost [28] | 57.5 | 40.1 | 46.3 |
| MLP [28] | 80.1 | 48.5 | 59.6 |
| 1-D CNN [29] | 76.3 | 76.1 | 76.2 |
| CNN-BiLSTM [30] | 82.0 | 48.0 | 59.8 |
| Model | Accuracy (%) | Recall (%) | F1 (%) |
|---|---|---|---|
| Proposed Model | 98.7 | 99.6 | 99.2 |
| DNN [31] | 94.6 | 84.6 | 89.2 |
| LSTM [32] | 98.9 | 74.8 | 85.0 |
| TBLS(W) [33] | 97.8 | 97.0 | 97.4 |
| MFFSEN(W) [34] | 99.9 | 99.9 | 99.9 |
| MECNN [35] | 99.7 | 79.1 | 87.9 |
| MBGAN [10] | 94.8 | 96.5 | 95.6 |
| SE-MBL [11] | 93.9 | 94.89 | 94.4 |
| Dataset | Model | Accuracy (%) | Recall (%) | F1 (%) |
|---|---|---|---|---|
| UNSW-NB15 | GCNII | 93.9 | 45.3 | 57.2 |
| +GRU | 95.8 | 53.2 | 66.8 | |
| +EQLv2 | 94.7 | 51.7 | 63.5 | |
| STEGCN | 96.3 | 66.4 | 78.6 | |
| CICIDS2017 | GCNII | 92.5 | 95.1 | 93.8 |
| +GRU | 98.1 | 96.8 | 97.4 | |
| +EQLv2 | 93.2 | 98.2 | 95.6 | |
| STEGCN | 98.8 | 99.6 | 99.2 |
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
Deng, M.; Fan, S.; Kan, Y.; Sun, C. An Intrusion Detection Model Based on Equalization Loss and Spatio-Temporal Feature Extraction. Electronics 2026, 15, 646. https://doi.org/10.3390/electronics15030646
Deng M, Fan S, Kan Y, Sun C. An Intrusion Detection Model Based on Equalization Loss and Spatio-Temporal Feature Extraction. Electronics. 2026; 15(3):646. https://doi.org/10.3390/electronics15030646
Chicago/Turabian StyleDeng, Miaolei, Shaojun Fan, Yupei Kan, and Chuanchuan Sun. 2026. "An Intrusion Detection Model Based on Equalization Loss and Spatio-Temporal Feature Extraction" Electronics 15, no. 3: 646. https://doi.org/10.3390/electronics15030646
APA StyleDeng, M., Fan, S., Kan, Y., & Sun, C. (2026). An Intrusion Detection Model Based on Equalization Loss and Spatio-Temporal Feature Extraction. Electronics, 15(3), 646. https://doi.org/10.3390/electronics15030646

