Bidirectional Temporal Attention Convolutional Networks for High-Performance Network Traffic Anomaly Detection
Abstract
1. Introduction
- (1)
- The integration of dilated causal convolution and a residual module is capable of effectively capturing long-range temporal sequence information, thereby mitigating the vanishing gradient issues inherent in traditional RNNs.
- (2)
- The Bidirectional structure fully extracts contextual feature information of network traffic, and the ECA module is introduced to assign weights to contextual features.
- (3)
- A network traffic anomaly detection model based on Bi-TACN is constructed, and comparative experiments are conducted with existing typical methods on public datasets to verify its feature extraction capability and anomaly detection accuracy.
2. Related Work
2.1. Dilated Causal Convolution
2.2. Residual Structure
2.3. Bidirectional Structure
2.4. Efficient Channel Attention (ECA)
3. Proposed Formulation
3.1. Data Preprocessing
3.2. Bi-TACN Pretrain
4. Experimental Validation
4.1. Experiment Description
4.2. Evaluation Indicators
4.3. Ablation Experiment
4.4. Performance Analysis
4.5. Generalization Verification
5. Conclusions
- (1)
- The Bi-TACN integrates dilated causal convolutions to expand the range of information extraction, which facilitates the capture of multi-scale temporal patterns. The associated residual modules effectively mitigate the vanishing gradient problem and accelerate model convergence.
- (2)
- The bidirectional structure integrated with the ECA module helps the proposed Bi-TACN effectively extract key features of anomaly states from network traffic information, simultaneously ensuring that it is not interfered with by redundant information, thereby correctly classifying the anomaly types of network traffic.
- (3)
- Comparison with classical baseline algorithms verifies that the proposed Bi-TACN algorithm has a faster convergence speed and superior network traffic anomaly detection performance, enabling high-performance network traffic anomaly detection.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Fotiadou, K.; Velivassaki, T.-H.; Voulkidis, A.; Skias, D.; Tsekeridou, S.; Zahariadis, T. Network Traffic Anomaly Detection via Deep Learning. Information 2021, 12, 215. [Google Scholar] [CrossRef]
- Javaheri, D.; Gorgin, S.; Lee, J.-A.; Masdari, M. Fuzzy Logic-Based DDoS Attacks and Network Traffic Anomaly Detection Methods: Classification, Overview, and Future Perspectives. Inf. Sci. 2023, 626, 315–338. [Google Scholar] [CrossRef]
- Narmadha, S.; Balaji, N.V. Improved Network Anomaly Detection System Using Optimized Autoencoder- LSTM. Expert Syst. Appl. 2025, 273, 126854. [Google Scholar] [CrossRef]
- Yu, Y.; Si, X.; Hu, C.; Zhang, J. A Review of Recurrent Neural Networks: LSTM Cells and Network Architectures. Neural Comput. 2019, 31, 1235–1270. [Google Scholar] [CrossRef]
- Zavrak, S.; Iskefiyeli, M. Flow-Based Intrusion Detection on Software-Defined Networks: A Multivariate Time Series Anomaly Detection Approach. Neural Comput. Appl. 2023, 35, 12175–12193. [Google Scholar] [CrossRef]
- Chowdhury, R.; Sen, S.; Goswami, A.; Purkait, S.; Saha, B. An Implementation of Bi-Phase Network Intrusion Detection System by Using Real-Time Traffic Analysis. Expert Syst. Appl. 2023, 224, 119831. [Google Scholar] [CrossRef]
- Gao, J.; Ozbay, K.; Hu, Y. Real-Time Anomaly Detection of Short-Term Traffic Disruptions in Urban Areas through Adaptive Isolation Forest. J. Intell. Transp. Syst. 2025, 29, 269–286. [Google Scholar] [CrossRef]
- Chen, X.; Yuan, Z.; Feng, S. Anomaly Detection Based on Improved k-Nearest Neighbor Rough Sets. Int. J. Approx. Reason. 2025, 176, 109323. [Google Scholar] [CrossRef]
- Baldoni, S.; Battisti, F. Histogram-Based Network Traffic Representation for Anomaly Detection through PCA. Comput. Netw. 2025, 265, 111276. [Google Scholar] [CrossRef]
- Ness, S.; Eswarakrishnan, V.; Sridharan, H.; Shinde, V.; Janapareddy, N.V.P.; Dhanawat, V. Anomaly Detection in Network Traffic Using Advanced Machine Learning Techniques. IEEE Access 2025, 13, 16133–16149. [Google Scholar] [CrossRef]
- Yin, C.; Zhang, S.; Wang, J.; Xiong, N.N. Anomaly Detection Based on Convolutional Recurrent Autoencoder for IoT Time Series. IEEE Trans. Syst. Man Cybern. Syst. 2022, 52, 112–122. [Google Scholar] [CrossRef]
- Rezk, N.M.; Nordström, T.; Ul-Abdin, Z. Shrink and Eliminate: A Study of Post-Training Quantization and Repeated Operations Elimination in RNN Models. Information 2022, 13, 176. [Google Scholar] [CrossRef]
- Ren, X.; Gu, H.; Wei, W. Tree-RNN: Tree Structural Recurrent Neural Network for Network Traffic Classification. Expert Syst. Appl. 2021, 167, 114363. [Google Scholar] [CrossRef]
- Noh, S.-H. Analysis of Gradient Vanishing of RNNs and Performance Comparison. Information 2021, 12, 442. [Google Scholar] [CrossRef]
- Wan, X.; Liu, H.; Xu, H.; Zhang, X. Network Traffic Prediction Based on LSTM and Transfer Learning. IEEE Access 2022, 10, 86181–86190. [Google Scholar] [CrossRef]
- Sahoo, B.B.; Jha, R.; Singh, A.; Kumar, D. Long Short-Term Memory (LSTM) Recurrent Neural Network for Low-Flow Hydrological Time Series Forecasting. Acta Geophys. 2019, 67, 1471–1481. [Google Scholar] [CrossRef]
- Nasreen Fathima, A.H.; Ibrahim, S.P.S.; Khraisat, A. Enhancing Network Traffic Anomaly Detection: Leveraging Temporal Correlation Index in a Hybrid Framework. IEEE Access 2024, 12, 136805–136824. [Google Scholar] [CrossRef]
- Ullah, S.; Chen, X.; Han, H.; Wu, J.; Dong, J.; Liu, R.; Ding, W.; Liu, M.; Li, Q.; Qi, H.; et al. A Novel Hybrid Ensemble Approach for Wind Speed Forecasting with Dual-Stage Decomposition Strategy Using Optimized GRU and Transformer Models. Energy 2025, 329, 136739. [Google Scholar] [CrossRef]
- Jiang, L.; Zhang, D.; Zhu, Y.; Zhang, X. Abnormal Traffic Detection Based on a Fusion BiGRU Neural Network. In Advances in Swarm Intelligence; Springer: Cham, Switzerland, 2023; Volume 13969, pp. 232–245. [Google Scholar]
- Chen, J.; Lv, T.; Cai, S.; Song, L.; Yin, S. A Novel Detection Model for Abnormal Network Traffic Based on Bidirectional Temporal Convolutional Network. Inform. Softw. Tech. 2023, 157, 107166. [Google Scholar] [CrossRef]
- Tran, T.M.; Bui, D.C.; Nguyen, T.V.; Nguyen, K. Transformer-Based Spatio-Temporal Unsupervised Traffic Anomaly Detection in Aerial Videos. IEEE Trans. Circuits Syst. Video Technol. 2024, 34, 8292–8309. [Google Scholar] [CrossRef]
- Ahmad Awan, K.; Ud Din, I.; Almogren, A.; Han, Z.; Guizani, M. TrustAware-GNN: Graph-Neural-Network-Based Trust Management for IoT Anomaly Detection. IEEE Internet Things J. 2025, 12, 37670–37681. [Google Scholar] [CrossRef]
- Xiang, L.; Bing, H.; Li, X.; Hu, A. A Frequency Channel-Attention Based Vision Transformer Method for Bearing Fault Identification across Different Working Conditions. Expert Syst. Appl. 2025, 262, 125686. [Google Scholar] [CrossRef]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 13–19 June 2020; pp. 11534–11542. [Google Scholar]
- Song, Y.; Luktarhan, N.; Shi, Z.; Wu, H. TGA: A Novel Network Intrusion Detection Method Based on TCN, Bi-GRU and Attention Mechanism. Electronics 2023, 12, 2849. [Google Scholar] [CrossRef]
- Zhang, R.; Sun, F.; Song, Z.; Wang, X.; Du, Y.; Dong, S. Short-Term Traffic Flow Forecasting Model Based on GA-TCN. J. Adv. Transport. 2021, 2021, 1338607. [Google Scholar] [CrossRef]
- Liang, H.; Cao, J.; Zhao, X. Multi-Sensor Data Fusion and Bidirectional-Temporal Attention Convolutional Network for Remaining Useful Life Prediction of Rolling Bearing. Meas. Sci. Technol. 2023, 34, 105126. [Google Scholar] [CrossRef]
- Park, K.; Soh, J.W.; Cho, N.I. A Dynamic Residual Self-Attention Network for Lightweight Single Image Super-Resolution. IEEE Trans. Multimed. 2023, 25, 907–918. [Google Scholar] [CrossRef]
- Zhi, J.; Song, T.; Yu, K.; Yuan, F.; Wang, H.; Hu, G.; Yang, H. Multi-Attention Module for Dynamic Facial Emotion Recognition. Information 2022, 13, 207. [Google Scholar] [CrossRef]
- Protić, D.D. Review of KDD Cup ‘99, NSL-KDD and Kyoto 2006+ Datasets. Vojnoteh. Glas. 2018, 66, 580–596. [Google Scholar] [CrossRef]
- Li, Y.; Xu, Y.; Cao, Y.; Hou, J.; Wang, C.; Guo, W.; Li, X.; Xin, Y.; Liu, Z.; Cui, L. One-Class LSTM Network for Anomalous Network Traffic Detection. Appl. Sci. 2022, 12, 5051. [Google Scholar] [CrossRef]
- Duan, X.; Fu, Y.; Wang, K. Network Traffic Anomaly Detection Method Based on Multi-Scale Residual Classifier. Comput. Commun. 2023, 198, 206–216. [Google Scholar] [CrossRef]
- Wei, G.; Wang, Z. Adoption and Realization of Deep Learning in Network Traffic Anomaly Detection Device Design. Soft Comput. 2021, 25, 1147–1158. [Google Scholar] [CrossRef]
- Kim, T.-Y.; Cho, S.-B. Web Traffic Anomaly Detection Using C-LSTM Neural Networks. Expert Syst. Appl. 2018, 106, 66–76. [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]
- Nawaz, A.; Abu Ali, N.; Ahmad, A. Fall Detection System Using Tabular GAN for Data Augmentation with Integration of Isolation Forest Model. Appl. Soft Comput. 2025, 185, 113931. [Google Scholar] [CrossRef]
- He, Y.; Chen, R.; Li, X.; Hao, C.; Liu, S.; Zhang, G.; Jiang, B. Online At-Risk Student Identification Using RNN-GRU Joint Neural Networks. Information 2020, 11, 474. [Google Scholar] [CrossRef]
- Fathima, A.; Khan, A.; Uddin, M.F.; Waris, M.M.; Ahmad, S.; Sanin, C.; Szczerbicki, E. Performance Evaluation and Comparative Analysis of Machine Learning Models on the UNSW-NB15 Dataset: A Contemporary Approach to Cyber Threat Detection. Cybern. Syst. 2025, 56, 1160–1176. [Google Scholar] [CrossRef]









| Category | KDDTrain+ | KDDTest+ | Total |
|---|---|---|---|
| Normal | 67,343 | 9711 | 77,054 |
| DoS | 45,927 | 7458 | 53,385 |
| Probe | 11,656 | 2421 | 14,077 |
| R2L | 995 | 2754 | 3749 |
| U2R | 52 | 200 | 252 |
| Total | 125,973 | 22,544 | 148,517 |
| Parameter | Value |
|---|---|
| Optimizer | Adam |
| Batch size | 64 |
| Training epochs | 50 |
| Learning rate | 0.001 |
| Number of layers | 3 |
| Dilation factors | 1, 2, 4 |
| Kernel size | |
| Number of channels | [32, 64, 128] |
| Dropout rate | 0.5 |
| Method | Accuracy (%) | Variance | Precision (%) | Recall (%) | F1-Score (%) | AUC-ROC |
|---|---|---|---|---|---|---|
| LSTM | 1.46 | 0.81 | ||||
| GRU | 1.74 | 0.82 | ||||
| BiGRU | 1.56 | 0.84 | ||||
| BiTCN | 1.54 | 0.86 | ||||
| Bi-TACN | 1.61 | 0.87 |
| Class | Accuracy (%) | Precision (%) | Recall (%) | F1 (%) |
|---|---|---|---|---|
| Normal | 91.1 | 83.3 | 99.3 | 90.6 |
| Dos | 97.8 | 98.0 | 95.5 | 96.7 |
| Probe | 93.6 | 90.9 | 44.9 | 60.1 |
| U2R | 99.6 | 93.6 | 58.5 | 72.0 |
| R2L | 97.3 | 94.8 | 82.2 | 88.1 |
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
Wang, F.; Huang, Y.; Shi, Y. Bidirectional Temporal Attention Convolutional Networks for High-Performance Network Traffic Anomaly Detection. Information 2026, 17, 61. https://doi.org/10.3390/info17010061
Wang F, Huang Y, Shi Y. Bidirectional Temporal Attention Convolutional Networks for High-Performance Network Traffic Anomaly Detection. Information. 2026; 17(1):61. https://doi.org/10.3390/info17010061
Chicago/Turabian StyleWang, Feng, Yufeng Huang, and Yifei Shi. 2026. "Bidirectional Temporal Attention Convolutional Networks for High-Performance Network Traffic Anomaly Detection" Information 17, no. 1: 61. https://doi.org/10.3390/info17010061
APA StyleWang, F., Huang, Y., & Shi, Y. (2026). Bidirectional Temporal Attention Convolutional Networks for High-Performance Network Traffic Anomaly Detection. Information, 17(1), 61. https://doi.org/10.3390/info17010061

