A Hybrid Deep Learning-Based Architecture for Network Traffic Anomaly Detection via EFMS-Enhanced KMeans Clustering and CNN-GRU Models
Source abstract
Abstract
Early detection of network traffic anomalies is critical for cybersecurity, as a single compromised host can cause data breaches, reputational damage, and operational disruptions. However, traditional systems based on signatures and static rules are often ineffective against sophisticated and evolving threats. This study proposes a hybrid deep learning architecture for proactive anomaly detection in local and metropolitan networks. The dataset underwent an extensive process of cleaning, transformation, and feature selection, including normalization of numerical fields, encoding of ordinal variables, and derivation of behavioral metrics. The EFMS-KMeans algorithm was applied to pre-label traffic as normal or anomalous by estimating dense centers and computing centroid distances, enabling the training of a sequential CNN-GRU network, where the CNN captures spatial patterns and the GRU models temporal dependencies. To address class imbalance, the SMOTE technique was integrated, and the loss function was adjusted to improve training stability. Experimental results show a substantial improvement in accuracy and generalization compared to conventional approaches, validating the effectiveness of the proposed method for detecting anomalous traffic in dynamic and complex network environments.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Network Security and Intrusion Detection · Internet Traffic Analysis and Secure E-voting · Anomaly Detection Techniques and Applications
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Faculty of Systems and Telecommunications, Santa Elena Peninsula State University, La Libertad 240204, Ecuador
Center for Information and Communications Technologies Research (CITIC), Department of Computer Science and Information Technologies, University of A Coruña, 15071 A Coruña, Spain
Funding
Ministry of Science, Innovation and Universities (Spanish National Authority for Scientific Research and Innovation) and FEDER Funds of the European Union · Xunta de Galicia and the European Union
References (50)
Show source-provided references
1. Fotiadou, K., Velivassaki, T.H., Voulkidis, A., Skias, D., Tsekeridou, S., and Zahariadis, T. (2021). Network traffic anomaly detection via deep learning. Information, 12.10.3390/info12050215 ↗
2. Deep Cybersecurity: A Comprehensive Overview from Neural Network and Deep Learning Perspective10.1007/s42979-021-00535-6 ↗
3. Wang, Y.-C., Houng, Y.-C., Chen, H.-X., and Tseng, S.-M. (2023). Network Anomaly Intrusion Detection Based on Deep Learning Approach. Sensors, 23.10.3390/s23042171 ↗
4. Deep Learning for Anomaly Detection in Log Data: A Survey
5. Deep Learning for Time Series Anomaly Detection: A Survey
6. Fang, Z., Gu, M., Zhou, S., Chen, J., Tan, Q., Wang, H., and Bu, J. (2024). Towards a Unified Framework of Clustering-based Anomaly Detection. arXiv.
7. Miguel-Diez, A., Campazas-Vega, A., Álvarez-Aparicio, C., Esteban-Costales, G., and Guerrero-Higueras, Á.M. (2025). A Systematic Literature Review of Unsupervised Learning Algorithms for Anomalous Traffic Detection Based on Flows. arXiv.
8. Traffic Anomaly Detection Method Based on Improved GRU and EFMS-KMeans Clustering
9. A Novel Hybrid Approach Combining GCN and GAT for Effective Anomaly Detection from Firewall Logs in Campus Networks10.1016/j.comnet.2025.111082 ↗
10. Bacevicius, M., Paulauskaite-Taraseviciene, A., Zokaityte, G., Kersys, L., and Moleikaityte, A. (2025). Comparative Analysis of Perturbation Techniques in LIME for Intrusion Detection Enhancement. Mach. Learn. Knowl. Extr., 7.10.3390/make7010021 ↗
11. Liu, Y., Wang, Z., Pang, S., and Ju, L. (2024). Distributed Malicious Traffic Detection. Electronics, 13.10.3390/electronics13234720 ↗
12. Mohammadpour, L., Ling, T.C., Liew, C.S., and Aryanfar, A. (2022). A Survey of CNN-Based Network Intrusion Detection. Appl. Sci., 12.10.3390/app12168162 ↗
13. Chen, T., Chen, Y., Lv, M., He, G., Zhu, T., Wang, T., and Weng, Z. (2021). A payload based malicious http traffic detection method using transfer semi-supervised learning. Appl. Sci., 11.10.3390/app11167188 ↗
14. Larriva-Novo, X., Pérez Miguel, L., Villagra, V.A., Álvarez-Campana, M., Sanchez-Zas, C., and Jover, Ó. (2024). Post-Hoc Categorization Based on Explainable AI and Reinforcement Learning for Improved Intrusion Detection. Appl. Sci., 14.10.3390/app142411511 ↗
15. A Hybrid Intrusion Detection System with K-Means and CNN+LSTM
16. Intrusion Detection System Using K-Means SMOTE Algorithm with Multi-Dense Layer Bidirectional Long Short-Term Memory
17. Cao, B., Li, C., Song, Y., Qin, Y., and Chen, C. (2022). Network Intrusion Detection Model Based on CNN and GRU. Appl. Sci., 12.10.3390/app12094184 ↗
18. A Novel Hybrid CNN-CBAM-GRU Method for Intrusion Detection in Modern Networks10.1016/j.rineng.2025.107103 ↗
19. Zhai, F., Yang, T., Chen, H., He, B., and Li, S. (2023). Intrusion Detection Method Based on CNN–GRU–FL in a Smart Grid Environment. Electronics, 12.10.3390/electronics12051164 ↗
20. K-means Clustering Algorithms: A Comprehensive Review, Variants Analysis, and Advances in the Era of Big Data
21. Outlier Detection via Optimized Density Peaks Clustering and K-means-Derived Objective Function10.1016/j.chaos.2025.116791 ↗
22. A Survey on Advanced Persistent Threats: Techniques, Solutions, Challenges, and Research Opportunities10.1109/COMST.2019.2891891 ↗
23. An Adaptive Hybrid Framework for IIoT Intrusion Detection Using Neural Networks and Feature Optimization Using Genetic Algorithms10.1007/s43621-025-01141-9 ↗
24. Gadal, S., Mokhtar, R., Abdelhaq, M., Alsaqour, R., Ali, E.S., and Saeed, R. (2022). Machine Learning-Based Anomaly Detection Using K-Mean Array and Sequential Minimal Optimization. Electronics, 11.10.3390/electronics11142158 ↗
25. Aung, Y.Y., and Min, M.M. (2018, January 6–8). Hybrid Intrusion Detection System Using K-Means and K-Nearest Neighbors Algorithms. Proceedings of the 2018 IEEE/ACIS 17th International Conference on Computer and Information Science (ICIS), Singapore.10.1109/ICIS.2018.8466537 ↗
26. Hybrid Model for Network Traffic Anomaly Detection Based on Parallel Two-stage Feature Fusion10.1109/ACCESS.2025.3538319 ↗
27. VANET Network Traffic Anomaly Detection Using GRU-Based Deep Learning Model10.1109/TCE.2023.3326384 ↗
28. Patel, J., Reiner, J., Stilwell, B., Wahbeh, A., and Seetan, R. (2025). Leveraging K-Means Clustering and Z-Score for Anomaly Detection in Bitcoin Transactions. Informatics, 12.10.3390/informatics12020043 ↗
29. Unsupervised Anomaly Detection Based on Clustering Methods and Sensor Data on a Marine Diesel Engine10.1080/20464177.2019.1633223 ↗
30. A Deep Learning Approach for Intrusion Detection Using Recurrent Neural Networks10.1109/ACCESS.2017.2762418 ↗
31. Intrusion Detection System Combined Enhanced Random Forest with SMOTE Algorithm10.1186/s13634-022-00871-6 ↗
32. Hybrid CNN–GRU Network with Edge Computing for Efficient Malware Detection in IIoT
33. Anomaly Detection of Policies in Distributed Firewalls Using Data Log Analysis10.1007/s11227-023-05417-7 ↗
34. Komadina, A., Kovačević, I., Štengl, B., and Groš, S. (2024). Comparative Analysis of Anomaly Detection Approaches in Firewall Logs: Integrating Light-Weight Synthesis of Security Logs and Artificially Generated Attack Detection. Sensors, 24.10.3390/s24082636 ↗
35. F-NIDS—A Network Intrusion Detection System Based on Federated Learning10.1016/j.comnet.2023.110010 ↗
36. Anomaly Detection in Encrypted Internet Traffic Using Hybrid Deep Learning10.1155/2021/5363750 ↗
37. Applying self-supervised learning to network intrusion detection for network flows with graph neural network10.1016/j.comnet.2024.110495 ↗
38. Cloud-Based Deep Learning for Real-Time URL Anomaly Detection: LSTM/GRU and CNN/LSTM Models10.32604/csse.2025.060387 ↗
39. Zhao, Z., Guo, H., and Wang, Y. (2024). A Multi-information Fusion Anomaly Detection Model Based on Convolutional Neural Network and AutoEncoder. Sci. Rep., 14.10.1038/s41598-024-66760-0 ↗
40. Rashid, A., Siddique, M.J., and Ahmed, S.M. (2020, January 17–19). Machine and Deep Learning-Based Comparative Analysis Using Hybrid Approaches for Intrusion Detection System. Proceedings of the 2020 3rd International Conference on Advancements in Computational Sciences (ICACS), Lahore, Pakistan.10.1109/ICACS47775.2020.9055946 ↗
41. CNN-GRU-FF: A Double-Layer Feature Fusion-Based Network Intrusion Detection System Using Convolutional Neural Network and Gated Recurrent Units10.1007/s40747-023-01313-y ↗
42. Research and Application of Firewall Log and Intrusion Detection Log Data Visualization System10.1049/2024/7060298 ↗
43. Network Traffic Analysis over Clustering-Based Collective Anomaly Detection10.1016/j.comnet.2022.108760 ↗
44. Chen, L., Gao, S., and Liu, B. (2022). An Improved Density Peaks Clustering Algorithm Based on Grid Screening and Mutual Neighborhood Degree for Network Anomaly Detection. Sci. Rep., 12.10.1038/s41598-021-02038-z ↗
45. SMOTE: Synthetic Minority Over-Sampling Technique10.1613/jair.953 ↗
46. Joloudari, J.H., Marefat, A., Nematollahi, M.A., Oyelere, S.S., and Hussain, S. (2023). Effective Class-Imbalance Learning Based on SMOTE and Convolutional Neural Networks. Appl. Sci., 13.10.3390/app13064006 ↗
47. Xiang, Q., Wu, S., Wu, D., Liu, Y., and Qin, Z. (2025). Research on CNN-BiLSTM Network Traffic Anomaly Detection Model Based on MindSpore. arXiv.
48. Sattar, S., Khan, S., Khan, M.I., Akhmediyarova, A., Mamyrbayev, O., Kassymova, D., Oralbekova, D., and Alimkulova, J. (2025). Anomaly Detection in Encrypted Network Traffic Using Self-Supervised Learning. Sci. Rep., 15.10.1038/s41598-025-08568-0 ↗
49. Ji, I.H., Lee, J.H., Kang, M.J., Park, W.J., Jeon, S.H., and Seo, J.T. (2024). Artificial Intelligence-Based Anomaly Detection Technology over Encrypted Traffic: A Systematic Literature Review. Sensors, 24.10.3390/s24030898 ↗
50. Marfo, W., Rico, E.A., Tosh, D.K., and Moore, S.V. (2025). Network Anomaly Detection in Distributed Edge Computing Infrastructure. arXiv.10.1109/CCNC54725.2025.10976032 ↗