An Intrusion Detection Method for the Internet of Things Based on Spatiotemporal Fusion
Abstract
1. Introduction
- (1)
- In the data preprocessing process, this paper introduces batch normalization for dealing with the insufficient and uneven data distribution caused by small differences in IoT traffic categories. And STWGA is proposed to address the problem of insufficient feature extraction in IoT data.
- (2)
- In STWGA, an improved CNN is displayed to deeply extract spatial feature information from the data. It combines with a gated position-sensitive transformer self-attention mechanism, effectively modeling contextual semantic information and global spatial relationships. In addition, to comprehensively capture the temporal features of the data and the dependencies between features, Bi-LSTM is used to extract global deep spatiotemporal features. Finally, the softmax() is used to achieve classification.
- (3)
- In the experiment, it is verified that STWGA has better spatiotemporal feature extraction ability and can effectively improve the intrusion detection performance of IoT. STWGA is capable of significantly enhancing the overall effectiveness of intrusion detection.
2. Literature Review
3. IoT Intrusion Detection Approach
3.1. IoT Data Preprocessing
- 1.
- One-hot encoding
- 2.
- Embedding code
- 3.
- Normalization
3.2. A Deep Learning Intrusion Detection Approach Based on STWGA
3.2.1. STWGA Architecture Overview
3.2.2. STWGA Intrusion Detection Process
3.2.3. Gated Attention Transformer
4. Experiment Analysis
4.1. Performance Testing Indicators
4.2. Evaluation and Analysis of Experimental Results
4.3. Analysis of Ablation Experiment
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Nassereddine, M.; Khang, A. Applications of Internet of Things (IoT) in smart cities. In Advanced IoT Technologies and Applications in the Industry 4.0 Digital Economy; CRC Press: Boca Raton, FL, USA, 2024; pp. 109–136. [Google Scholar]
- Lim, D.-W.; Kang, J.-M. Joint Antenna Selection and Transmit Power Optimization for UAV-Assisted Relaying in Cognitive Radio IoT Networks. Mathematics 2025, 13, 3540. [Google Scholar] [CrossRef]
- Chen, J.; Han, P.; Zhang, Y.; You, T.; Zheng, P. Scheduling energy consumption-constrained workflows in heterogeneous multi-processor embedded systems. J. Syst. Archit. 2023, 142, 102938. [Google Scholar] [CrossRef]
- Uzunkol, O.; Kiraz, M.S. Still wrong use of pairings in cryptography. Appl. Math. Comput. 2018, 333, 467–479. [Google Scholar] [CrossRef]
- Xiao, N.; Wang, Z.; Sun, X.; Miao, J. A novel blockchain-based digital forensics framework for preserving evidence and enabling investigation in industrial Internet of Things. Alex. Eng. J. 2024, 86, 631–643. [Google Scholar] [CrossRef]
- Song, L.; Lan, H.; Du, J.; Wang, K.; Kang, W. Application of intelligent Internet of Things technology in the security monitoring system of power Internet of Things network. Discov. Internet Things 2025, 5, 44. [Google Scholar] [CrossRef]
- Bai, Z.; Miao, H.; Miao, J.; Xiao, N.; Sun, X. Artificial Intelligence-driven Cybersecurity Applications and Challenges. Innov. Appl. AI 2025, 2, 26–33. [Google Scholar] [CrossRef]
- Gao, X.-S.; Liu, S.; Yu, L. Achieving optimal adversarial accuracy for adversarial deep learning using Stackelberg games. Acta Math. Sci. 2022, 42, 2399–2418. [Google Scholar] [CrossRef]
- Li, J.; Rosier, C. Parameters Identification in a Saltwater Intrusion Problem. Acta Math. Sci. 2020, 40, 1563–1584. [Google Scholar] [CrossRef]
- Miao, J.; Wang, Z.; Ning, X.; Shankar, A.; Maple, C.; Rodrigues, J.J. Practical and Secure Authentication Protocol for Vehicle to Grid in Intelligent Transportation Systems. IEEE Trans. Intell. Transp. Syst. 2025, 26, 22447–22456. [Google Scholar] [CrossRef]
- Qu, G.; Jin, H.; Zhang, L.; Ge, M.; Wu, X.; Li, H.; Xu, J. Enhance Graph-Based Intrusion Detection in Optical Networks via Pseudo-Metapaths. Mathematics 2025, 13, 3432. [Google Scholar] [CrossRef]
- V.S., D.P.; Sethuraman, S.C.; Khan, M.K. Blockchain-based deep learning models for intrusion detection in Industrial Control Systems: Frameworks and open issues. J. Netw. Comput. Appl. 2025, 243, 104286. [Google Scholar] [CrossRef]
- Li, H.; Cao, H.; Feng, Y.; Li, X.; Pei, J. Optimization of graph clustering inspired by dynamic belief systems. IEEE Trans. Knowl. Data Eng. 2023, 36, 6773–6785. [Google Scholar] [CrossRef]
- Zhu, P.; Cheng, L.; Gao, C.; Wang, Z.; Li, X. Locating multi-sources in social networks with a low infection rate. IEEE Trans. Netw. Sci. Eng. 2022, 9, 1853–1865. [Google Scholar] [CrossRef]
- Zhao, D.; Xiang, W.; Song, W.; Xu, L.; Chen, C.; Wang, Z. Reset observer-based containment protocol via event-triggered strategy for multi-agent networks against aperiodic DoS attacks. Appl. Math. Comput. 2025, 500, 129415. [Google Scholar] [CrossRef]
- Dhelim, S.; Aung, N.; Kechadi, M.T.; Ning, H.; Chen, L. Trust2Vec: Large-scale IoT trust management system based on signed network embeddings. IEEE Internet Things J. 2022, 10, 553–562. [Google Scholar] [CrossRef]
- Dina, A.S.; Siddique, A.B.; Manivannan, D. A deep learning approach for intrusion detection in Internet of Things using focal loss function. Internet Things 2023, 22, 100699. [Google Scholar] [CrossRef]
- Zheng, X.; Wang, Y.; Jia, L.; Xiong, D.; Qiang, J. Network intrusion detection model based on Chi-square test and stacking approach. In Proceedings of the 2020 7th International Conference on Information Science and Control Engineering (ICISCE), Changsha, China, 18–20 December 2020; IEEE: New York, NY, USA, 2020; pp. 894–899. [Google Scholar]
- Khan, F.A.; Gumaei, A.; Derhab, A.; Hussain, A. A novel two-stage deep learning model for efficient network intrusion detection. IEEE Access 2019, 7, 30373–30385. [Google Scholar] [CrossRef]
- Li, Y.; Xia, J.; Zhang, S.; Yan, J.; Ai, X.; Dai, K. An efficient intrusion detection system based on support vector machines and gradually feature removal method. Expert Syst. Appl. 2012, 39, 424–430. [Google Scholar] [CrossRef]
- Yang, S.U. Research on network behavior anomaly analysis based on bidirectional LSTM. In Proceedings of the 2019 IEEE 3rd Information Technology, Networking, Electronic and Automation Control Conference (ITNEC), Chengdu, China, 15–17 March 2019; IEEE: New York, NY, USA, 2019; pp. 798–802. [Google Scholar]
- Yin, C.; Zhu, Y.; Fei, J.; He, X. A deep learning approach for intrusion detection using recurrent neural networks. IEEE Access 2017, 5, 21954–21961. [Google Scholar] [CrossRef]
- Kunang, Y.N.; Nurmaini, S.; Stiawan, D.; Suprapto, B.Y. Attack classification of an intrusion detection system using deep learning and hyperparameter optimization. J. Inf. Secur. Appl. 2021, 58, 102804. [Google Scholar] [CrossRef]
- Kim, J.; Kim, J.; Kim, H.; Shim, M.; Choi, E. CNN-based network intrusion detection against denial-of-service attacks. Electronics 2020, 9, 916. [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]
- Tian, Q.; Han, D.; Li, K.C.; Liu, X.; Duan, L.; Castiglione, A. An intrusion detection approach based on improved deep belief network. Appl. Intell. 2020, 50, 3162–3178. [Google Scholar] [CrossRef]
- Derhab, A.; Aldweesh, A.; Emam, A.Z.; Khan, F.A. Intrusion detection system for internet of things based on temporal convolution neural network and efficient feature engineering. Wirel. Commun. Mob. Comput. 2020, 2020, 6689134. [Google Scholar] [CrossRef]
- Ma, H.; Cao, J.; Mi, B.; Huang, D.; Liu, Y.; Li, S. A GRU-based lightweight system for CAN intrusion detection in real time. Secur. Commun. Netw. 2022, 2022, 5827056. [Google Scholar] [CrossRef]
- El-Sayed, O.A.; Fawzy, S.K.; Tolba, S.H.; Salem, R.S.; Hassan, Y.S.; Ahmed, A.M.; Khattab, A. Deep Learning Framework for Accurate Network Intrusion Detection in ITSs. In Proceedings of the 2021 International Conference on Microelectronics (ICM), Cairo, Egypt, 19–22 December 2021; IEEE: New York, NY, USA, 2021; pp. 212–215. [Google Scholar]
- Van Huong, P.; Hung, D.V. Intrusion detection in IoT systems based on deep learning using convolutional neural network. In Proceedings of the 2019 6th NAFOSTED Conference on Information and Computer Science (NICS), Hanoi, Vietnam, 12–13 December 2019; IEEE: New York, NY, USA, 2019; pp. 448–453. [Google Scholar]
- Georgiades, M.; Hussain, F. An explainable ai approach for interpretable cross-layer intrusion detection in internet of medical things. Electronics 2025, 14, 3218. [Google Scholar] [CrossRef]
- Yao, R.; Wang, N.; Chen, P.; Ma, D.; Sheng, X. A CNN-transformer hybrid approach for an intrusion detection system in advanced metering infrastructure. Multimed. Tools Appl. 2023, 82, 19463–19486. [Google Scholar] [CrossRef]
- Cao, B.; Li, C.; Sun, J.; Song, Y. IoT intrusion detection technology based on Deep learning. In Proceedings of the 2022 3rd International Conference on Computer Vision, Image and Deep Learning & International Conference on Computer Engineering and Applications (CVIDL & ICCEA), Changchun, China, 20–22 May 2022; IEEE: New York, NY, USA, 2022; pp. 284–289. [Google Scholar]
- Lee, J.H.; Park, K.H. AE-CGAN model based high performance network intrusion detection system. Appl. Sci. 2019, 9, 4221. [Google Scholar] [CrossRef]
- Elsayed, N.; Zaghloul, Z.S.; Azumah, S.W.; Li, C. Intrusion detection system in smart home network using bidirectional lstm and convolutional neural networks hybrid model. In Proceedings of the 2021 IEEE International Midwest Symposium on Circuits and Systems (MWSCAS), East Lansing, MI, USA, 8–11 August 2021; IEEE: New York, NY, USA, 2021; pp. 55–58. [Google Scholar]
- Shone, N.; Ngoc, T.N.; Phai, V.D.; Shi, Q. A deep learning approach to network intrusion detection. IEEE Trans. Emerg. Top. Comput. Intell. 2018, 2, 41–50. [Google Scholar] [CrossRef]
- Faught, J.N.; Kempton, M.; Knudson, A. A Nordhaus-Gaddum type problem for the normalized Laplacian spectrum and graph Cheeger constant. Appl. Math. Comput. 2024, 480, 128920. [Google Scholar] [CrossRef]
- Segu, M.; Tonioni, A.; Tombari, F. Batch normalization embeddings for deep domain generalization. Pattern Recognit. 2023, 135, 109115. [Google Scholar] [CrossRef]
- Zhu, P.; Wang, B.; Tang, K.; Zhang, H.; Cui, X.; Wang, Z. A knowledge-guided graph attention network for emotion-cause pair extraction. Knowl.-Based Syst. 2024, 286, 111342. [Google Scholar] [CrossRef]
- Peterson, J.M.; Leevy, J.L.; Khoshgoftaar, T.M. A review and analysis of the bot-iot dataset. In Proceedings of the 2021 IEEE International Conference on Service-Oriented System Engineering (SOSE), Oxford, UK, 23–26 August 2021; IEEE: New York, NY, USA, 2021; pp. 20–27. [Google Scholar]
- Wang, B.; Su, Y.; Zhang, M.; Nie, J. A deep hierarchical network for packet-level malicious traffic detection. IEEE Access 2020, 8, 201728–201740. [Google Scholar] [CrossRef]
- Meftah, S.; Rachidi, T.; Assem, N. Network based intrusion detection using the UNSW-NB15 dataset. Int. J. Comput. Digit. Syst. 2019, 8, 478–487. [Google Scholar] [CrossRef]
- Ravipati, R.D.; Abualkibash, M. Intrusion detection system classification using different machine learning algorithms on KDD-99 and NSL-KDD datasets—A review paper. Int. J. Comput. Sci. Inf. Technol. (IJCSIT) 2019, 11, 65–80. [Google Scholar] [CrossRef]
- Mehta, S.; Kukreja, V. Enhancing Soybean Disease Diagnosis Using CNN-Based Feature Extraction and Random Forest Classification. In Proceedings of the 2025 International Conference on Computing Technologies (ICOCT), Bengaluru, India, 13–14 June 2025; IEEE: New York, NY, USA, 2025. [Google Scholar]
- Andresini, G.; Appice, A.; Caforio, F.P.; Malerba, D.; Vessio, G. ROULETTE: A neural attention multi-output model for explainable network intrusion detection. Expert Syst. Appl. 2022, 201, 117144. [Google Scholar] [CrossRef]
- Chen, H.C.; Widodo, A.M.; Wisnujati, A.; Rahaman, M.; Lin, J.C.W.; Chen, L.; Weng, C.E. AlexNet convolutional neural network for disease detection and classification of tomato leaf. Electronics 2022, 11, 951. [Google Scholar] [CrossRef]
- Devi, A.; Prabhakaran, M.K.; Kumar, J.P.; Kumar, J.N. Autoencoder-Based Anomaly Detection for Cyber Threat Monitoring. In Utilizing AI in Network and Mobile Security for Threat Detection and Prevention; IGI Global Scientific Publishing: Hershey, PA, USA, 2025; pp. 59–80. [Google Scholar]
- Ding, P.; Chen, H.; Yang, X.; Yang, Q. Intrusion Detection Method for Power Internet of Things Based on Data Hybrid Detection Model Considering the Spatio-Temporal Characteristics. Int. J. High Speed Electron. Syst. 2025, 2540437. [Google Scholar] [CrossRef]
- Arroyo, Á.; Granados, D.; De Miguel, F.; Velasco, N.; Herrero, Á. Dimensionality Reduction and Outlier Analysis for the NF-ToN-IoT Cybersecurity Dataset. In Proceedings of the International Work-Conference on Artificial Neural Networks, A Coruna, Spain, 16–18 June 2025; Springer Nature: Cham, Switzerland, 2025; pp. 392–401. [Google Scholar]
- Hasan, M.D.A.; Eaman, A.; Hassan, E. Efficient DDoS Detection with Minimal Features: High Accuracy Using CIC-DDoS2019. Procedia Comput. Sci. 2025, 265, 124–131. [Google Scholar] [CrossRef]






| Source of Literature | Core Method |
|---|---|
| Dhelim et al. [16] | Trust2Vec. |
| Dina et al. [17] | An efficient and accurate IoT intrusion detection system. |
| Zheng et al. [18] | An intrusion detection method that combines stacking technology. |
| Khan et al. [19] | A two-stage intrusion detection system called TSDL. |
| Li et al. [20] | They used the feature reduction GFR method to select the 19 most relevant features for intrusion detection on the KDD Cup 99 intrusion detection dataset. |
| Yang et al. [21] | A combination of Bi-LSTM and RNN in anomaly detection and multi-class attack recognition tasks. |
| Yin et al. [22] | A new intrusion detection model by utilizing an RNN. |
| Kunang et al. [23] | Autoencoder (AE) and DNN models to adjust various deep structure models. |
| J. Kim et al. [24] | A convolutional neural network-based intrusion detection system. |
| Y. Imrana et al. [25] | The application of Bi-LSTM in intrusion detection. |
| Tian et al. [26] | An intrusion detection method based on an improved Deep Belief Network (DBN). |
| Derhab et al. [27] | An intrusion detection approach for IoT data grounded in temporal convolutional neural networks. |
| Ma et al. [28] | A specialized feature extraction algorithm tailored for connected vehicles. |
| El Sayed et al. [29] | An improved deep neural network (DNN) algorithm. |
| Van et al. [30] | An enhanced model to extract TCP/IP traffic features. |
| Georgiades et al. [31] | An interpretable artificial intelligence approach enhances the transparency of attack detection. |
| Yao et al. [32] | The XGBoost algorithm, CNN, and Transformer to establish feature associations. |
| Cao et al. [33] | A combined network model integrating the time domain convolutional neural network TCN and GRUs. |
| Lee et al. [34] | A model integrating Autoencoder (AE) and Generative Adversarial Networks (GANs) for intrusion detection systems. |
| Elsayed et al. [35] | A hybrid model composed of Bi-LSTM and CNN. |
| Shone et al. [36] | A classification model. |
| Dataset | Model | Accuracy (%) | Recall (%) | Precision (%) | F1-Score (%) |
|---|---|---|---|---|---|
| Bot-IoT | CNN-SoftMax [44] | 77.44 | 78.32 | 80.23 | 82.6 |
| CNN-LSTM [45] | 87.39 | 81.67 | 84.21 | 82.36 | |
| AlexNet [46] | 89.01 | 87.02 | 88.79 | 89.95 | |
| S-NDAE [47] | 92.37 | 91.42 | 91.4 | 90.31 | |
| CWGAN-CSSAE [48] | 93.64 | 92.38 | 92.49 | 92.34 | |
| STWGA | 96.81 | 94.70 | 95.9 | 96.79 | |
| USTC-TFC2016 | CNN-SoftMax [44] | 82.42 | 83.2 | 81.58 | 81.38 |
| CNN-LSTM [45] | 80.87 | 80.69 | 84.29 | 81.92 | |
| AlexNet [46] | 89.81 | 89.17 | 89.12 | 89.06 | |
| S-NDAE [47] | 95.26 | 95.72 | 94.52 | 93.92 | |
| CWGAN-CSSAE [48] | 92.44 | 95.97 | 95.84 | 94.39 | |
| STWGA | 97.04 | 96.91 | 96.98 | 96.46 | |
| UNSW-NB15 | CNN-SoftMax [44] | 80.24 | 78.62 | 78.81 | 80.86 |
| CNN-LSTM [45] | 78.28 | 78.77 | 80.89 | 82.7 | |
| AlexNet [46] | 91.98 | 93.79 | 89.94 | 89.28 | |
| S-NDAE [47] | 94.05 | 93.12 | 92.3 | 95.54 | |
| CWGAN-CSSAE [48] | 96.18 | 96.08 | 95.93 | 94.52 | |
| STWGA | 97.93 | 98.11 | 97.24 | 97.06 | |
| NSL-KDD | CNN-SoftMax [44] | 82.75 | 77.21 | 78.64 | 81.49 |
| CNN-LSTM [45] | 80.02 | 78.92 | 78.83 | 81.62 | |
| AlexNet [46] | 90.92 | 92.61 | 87.95 | 90.22 | |
| S-NDAE [47] | 95.57 | 94.52 | 95.07 | 95.52 | |
| CWGAN-CSSAE [48] | 94.18 | 95.93 | 95.28 | 94.56 | |
| STWGA | 96.98 | 97.33 | 97.71 | 97.46 |
| Dateset | Improved CNN | Gated Attention Transformer | Bi-LSTM | F1-Score |
|---|---|---|---|---|
| NF-ToN-IoT | × | √ | × | 0.819 |
| √ | √ | × | 0.841 | |
| × | √ | √ | 0.862 | |
| √ | √ | √ | 0.965 | |
| CIC-DDoS2019 | × | √ | × | 0.827 |
| √ | √ | × | 0.870 | |
| × | √ | √ | 0.893 | |
| √ | √ | √ | 0.971 |
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
He, J.; An, X. An Intrusion Detection Method for the Internet of Things Based on Spatiotemporal Fusion. Mathematics 2026, 14, 504. https://doi.org/10.3390/math14030504
He J, An X. An Intrusion Detection Method for the Internet of Things Based on Spatiotemporal Fusion. Mathematics. 2026; 14(3):504. https://doi.org/10.3390/math14030504
Chicago/Turabian StyleHe, Junzhong, and Xiaorui An. 2026. "An Intrusion Detection Method for the Internet of Things Based on Spatiotemporal Fusion" Mathematics 14, no. 3: 504. https://doi.org/10.3390/math14030504
APA StyleHe, J., & An, X. (2026). An Intrusion Detection Method for the Internet of Things Based on Spatiotemporal Fusion. Mathematics, 14(3), 504. https://doi.org/10.3390/math14030504
