10.57647/spre.2025.0904.21

Data Augmentation for Attack Detection in IoT Networks Using Contrastive Learning

  1. Department of Computer Engineering, Isf.C., Islamic Azad University, Isfahan, Iran
  2. Department of Computer Engineering, Kas.C., Islamic Azad University, Kashan, Iran

Received: 2025-08-25

Revised: 2025-10-12

Accepted: 2025-11-02

Published in Issue 2025-12-31

How to Cite

Mahdavinia, H., Soltanaghaei, M., & Esmaeili, M. (2025). Data Augmentation for Attack Detection in IoT Networks Using Contrastive Learning. Signal Processing and Renewable Energy (SPRE), 9(4). https://doi.org/10.57647/spre.2025.0904.21

PDF views: 101

Abstract

With the rapid expansion of the Internet of Things (IoT) in industrial, medical, and smart city applications, ensuring network security has become a fundamental challenge. One of the primary issues in Intrusion Detection Systems (IDS) is the imbalance in training data and the scarcity of rare attack data, both of which reduce the accuracy of learning models. In this study, a two-layer method based on data augmentation and improved attack classification was proposed to enhance the accuracy of detecting rare threats in IoT. In the first layer, a contrastive learning-based encoder was designed to generate new samples for the minority class using partial differential equations. This approach extracts the shared latent features of minority class data and reflects them with maximum possible accuracy while maintaining the highest level of distinction from other classes. In the second layer, a Bidirectional Long Short-Term Memory (BLSTM) model with a propagation-based classifier was employed to process the augmented data and improve attack detection accuracy. Evaluation results on the NSL-KDD dataset demonstrated that the proposed method outperformed existing models by achieving a 2.22% improvement in accuracy, a 0.68% improvement in precision, a 5.09% improvement in recall, a 2.9% improvement in F1-score, and a 12.34% reduction in false alarms. These findings indicated an increase in the reliability of the proposed approach for detecting rare attacks and enhancing the performance of intrusion detection systems in IoT networks.

Keywords

  • Anomaly Detection,
  • Contrastive Learning,
  • Intrusion Detection,
  • IoT,
  • Time-Series Augmentation

References

  1. H. Yan, X. Lin, S. Li, H. Peng, and B. Zhang, "Global or Local Adaptation? Client-Sampled Federated Meta-Learning for Personalized IoT Intrusion Detection," IEEE Transactions on Information Forensics and Security, vol. 20, pp. 279–293, 2024, https://doi.org/10.1109/TIFS.2024.3516548.
  2. J. J. Shirley and M. Priya, "An Adaptive Intrusion Detection System for Evolving IoT Threats: An Autoencoder-FNN Fusion," IEEE Access, vol. 13, pp. 4201–4217, 2025, https://doi.org/10.1109/ACCESS.2024.3525074.
  3. S. S. Khatami, M. Shoeibi, A. E. Oskouei, D. Martín, and M. K. Dashliboroun, "5DGWO-GAN: A Novel Five-Dimensional Gray Wolf Optimizer for Generative Adversarial Network-Enabled Intrusion Detection in IoT Systems," Computers, Materials & Continua, vol. 82, no. 1, pp. 881–911, 2025, http://dx.doi.org/10.32604/cmc.2024.059999.
  4. K. Swathi and G. H. Bindu, "An automated intrusion detection system in IoT system using attention based deep bidirectional sparse auto encoder model," Knowledge-Based Systems, vol. 305, p. 112633, 2024, https://doi.org/10.1016/j.knosys.2024.112633.
  5. R. Savithramma, C. Anitha, N. Sanjay Kumar, S. Kamble, and B. Ashwini, "Automatic attack detection in IOT environment using relational auto encoder with enhanced ANFIS," International Journal of Information Technology, vol. 16, no. 8, pp. 5307–5315, 2024, https://doi.org/10.1007/s41870-024-02141-0.
  6. C. Oh, S. Han, and J. Jeong, "Time-series data augmentation based on interpolation," Procedia Computer Science, vol. 175, pp. 64–71, 2020, https://doi.org/10.1016/j.procs.2020.07.012.
  7. H. Jia, J. Liu, M. Zhang, X. He, and W. Sun, "Network intrusion detection based on IE-DBN model," Computer Communications, vol. 178, pp. 131–140, 2021, https://doi.org/10.1016/j.comcom.2021.07.016.
  8. G. Radhakrishnan, K. Srinivasan, S. Maheswaran, K. Mohanasundaram, D. Palanikkumar, and A. Vidyarthi, "WITHDRAWN: A deep-RNN and meta-heuristic feature selection approach for IoT malware detection," ed: Elsevier, 2021.
  9. M. Kurni, S. M. Mujeeb, B. B. Yannam, and A. Singh, "MRPO-Deep maxout: Manta ray political optimization based Deep maxout network for big data intrusion detection using spark architecture," Advances in Engineering Software, vol. 174, p. 103324, 2022, https://doi.org/10.1016/j.advengsoft.2022.103324.
  10. A. Kumar, K. Abhishek, M. R. Ghalib, A. Shankar, and X. Cheng, "Intrusion detection and prevention system for an IoT environment," Digital Communications and Networks, vol. 8, no. 4, pp. 540–551, 2022, https://doi.org/10.1016/j.dcan.2022.05.027.
  11. W. Ma, R. Liu, K. Li, S. Yan, and J. Guo, "An adversarial domain adaptation approach combining dual domain pairing strategy for IoT intrusion detection under few-shot samples," Information Sciences, vol. 629, pp. 719–745, 2023, https://doi.org/10.1016/j.ins.2023.02.031.
  12. J. Wu et al., "An intelligent IoT intrusion detection system using HeInit-WGAN and SSO-BNMCNN based multivariate feature analysis," Engineering Applications of Artificial Intelligence, vol. 127, p. 107132, 2024, https://doi.org/10.1016/j.engappai.2023.107132.
  13. Y. Yan, Y. Yang, S. Fang, M. Gao, and Y. Chen, "MUS Model: A Deep Learning-Based Architecture for IoT Intrusion Detection," Computers, Materials & Continua, vol. 80, no. 1, pp. 875–896, 2024, https://doi.org/10.32604/cmc.2024.051685.
  14. B. I. Hairab, M. S. Elsayed, A. D. Jurcut, and M. A. Azer, "Anomaly detection based on CNN and regularization techniques against zero-day attacks in IoT networks," IEEE Access, vol. 10, pp. 98427–98440, 2022, https://doi.org/10.1109/ACCESS.2022.3206367.
  15. P. Bhale, D. R. Chowdhury, S. Biswas, and S. Nandi, "OPTIMIST: lightweight and transparent IDS with optimum placement strategy to mitigate mixed-rate DDoS attacks in IoT networks," IEEE Internet of Things Journal, vol. 10, no. 10, pp. 8357–8370, 2023, https://doi.org/10.1109/JIOT.2023.3234530.
  16. S. Li, Y. Cao, S. Liu, Y. Lai, Y. Zhu, and N. Ahmad, "Hda-ids: A hybrid dos attacks intrusion detection system for iot by using semi-supervised cl-gan," Expert Systems with Applications, vol. 238, p. 122198, 2024, https://doi.org/10.1016/j.eswa.2023.122198.
  17. M. A. Alsoufi et al., "Anomaly-based intrusion detection model using deep learning for IoT Networks," Computer Modeling in Engineering & Sciences, vol. 141, no. 1, pp. 823–845, 2024, https://doi.org/10.32604/cmes.2024.052112.
  18. Y. Zhang and Q. Liu, "On IoT intrusion detection based on data augmentation for enhancing learning on unbalanced samples," Future Generation Computer Systems, vol. 133, pp. 213–227, 2022, https://doi.org/10.1016/j.future.2022.03.007.
  19. G. Sharma, J. Grover, and A. Verma, "QSec-RPL: detection of version number attacks in RPL based mobile IoT using Q-learning," Ad Hoc Networks, vol. 142, p. 103118, 2023, https://doi.org/10.1016/j.adhoc.2023.103118.
  20. T. Gaber, J. B. Awotunde, M. Torky, S. A. Ajagbe, M. Hammoudeh, and W. Li, "Metaverse-IDS: Deep learning-based intrusion detection system for Metaverse-IoT networks," Internet of Things, vol. 24, p. 100977, 2023, https://doi.org/10.1016/j.iot.2023.100977.
  21. T. Yang, J. Chen, H. Deng, and B. He, "A lightweight intrusion detection algorithm for IoT based on data purification and a separable convolution improved CNN," Knowledge-Based Systems, vol. 304, p. 112473, 2024, https://doi.org/10.1016/j.knosys.2024.112473.
  22. D. Hamouda, M. A. Ferrag, N. Benhamida, H. Seridi, and M. C. Ghanem, "Revolutionizing intrusion detection in industrial IoT with distributed learning and deep generative techniques," Internet of Things, vol. 26, p. 101149, 2024, https://doi.org/10.1016/j.iot.2024.101149.
  23. A. K. Silivery, K. R. M. Rao, and R. Solleti, "Dual-path feature extraction based hybrid intrusion detection in IoT networks," Computers and Electrical Engineering, vol. 122, p. 109949, 2025, https://doi.org/10.1016/j.compeleceng.2024.109949.
  24. H. Chen, Z. Wang, S. Yang, X. Luo, D. He, and S. Chan, "Intrusion detection using synaptic intelligent convolutional neural networks for dynamic Internet of Things environments," Alexandria Engineering Journal, vol. 111, pp. 78–91, 2025, https://doi.org/10.1016/j.aej.2024.10.014.
  25. A. Kalidindi and M. B. Arrama, "Feature selection and hybrid CNNF deep stacked autoencoder for botnet attack detection in IoT," Computers and Electrical Engineering, vol. 122, p. 109984, 2025, https://doi.org/10.1016/j.compeleceng.2024.109984.
  26. J. Li, H. Chen, M. S. Othman, N. Salim, L. M. Yusuf, and S. R. Kumaran, "NFIoT-GATE-DTL IDS: Genetic algorithm-tuned ensemble of deep transfer learning for NetFlow-based intrusion detection system for internet of things," Engineering Applications of Artificial Intelligence, vol. 143, p. 110046, 2025, https://doi.org/10.1016/j.engappai.2025.110046.
  27. B. Cai et al., "Complex network structural analysis based on information supplementation graph contrastive learning," Knowledge-Based Systems, vol. 309, p. 112833, 2025, http://doi.org/ 10.1016/j.knosys.2024.112833.
  28. R. Jain, V. Frinken, C. Jawahar, and R. Manmatha, "BLSTM neural network based word retrieval for Hindi documents," in 2011 International Conference on Document Analysis and Recognition, 2011: IEEE, pp. 83–87, https://doi.org/10.1109/ICDAR.2011.26.
  29. M. Shahidi, L. Barros, and E. Esmi, "Linear fuzzy partial differential equations for A-linearly correlated fuzzy processes," Information Sciences, vol. 691, p. 121629, 2025, http://doi.org/10.1016/j.ins.2024.121629.
  30. S. Feng, T. Weng, X. Chen, Z. Ren, C. Su, and C. Li, "Scaling law of diffusion processes on fractal networks," Physica A: Statistical Mechanics and its Applications, vol. 640, p. 129704, 2024,http://doi.org /10.1016/j.physa.2024.129704.