
Research Article
Comparative Analysis of Transformer and LSTM Architectures for Cybersecurity Threat Detection Using Machine Learning
@ARTICLE{10.4108/airo.9759, author={Jobanpreet Kaur and Mani Prabha and Md Samiun and Syed Nazmul Hasan and Rakibul Hasan and Hammed Esa and Md Fakhrul Hasan Bhuiyan and Md Abdur Rob and Durga Shahi}, title={Comparative Analysis of Transformer and LSTM Architectures for Cybersecurity Threat Detection Using Machine Learning}, journal={EAI Endorsed Transactions on AI and Robotics}, volume={4}, number={1}, publisher={EAI}, journal_a={AIRO}, year={2025}, month={9}, keywords={Cybersecurity, Machine learning, LSTM, transformer, threat classification, emerging threats, predictive analytics}, doi={10.4108/airo.9759} }
- Jobanpreet Kaur
Mani Prabha
Md Samiun
Syed Nazmul Hasan
Rakibul Hasan
Hammed Esa
Md Fakhrul Hasan Bhuiyan
Md Abdur Rob
Durga Shahi
Year: 2025
Comparative Analysis of Transformer and LSTM Architectures for Cybersecurity Threat Detection Using Machine Learning
AIRO
EAI
DOI: 10.4108/airo.9759
Abstract
The growing prevalence of advanced persistent threats (APTs), zero-day exploits, and the rapid proliferation of IoT devices have exposed limitations in traditional cybersecurity approaches. In response, this study presents a comparative analysis of deep learning models—specifically Long Short-Term Memory (LSTM) and Transformer-based architectures—for cybersecurity threat classification from textual data. Leveraging a standardized dataset and consistent preprocessing pipeline, both models are evaluated across key performance metrics, including accuracy, precision, recall, and F1-score. The results demonstrate that Transformer models significantly outperform LSTM-based approaches, exhibiting superior capacity to capture long-range dependencies, handle complex threat narratives, and generalize to previously unseen data. These findings offer valuable insights into the practical application of modern deep learning techniques in cybersecurity and provide a foundation for designing more robust and adaptive threat detection systems.
Copyright © 2025 Jobanpreet Kaur et al., licensed to EAI. This is an open access article distributed under the terms of the CC BYNC-SA 4.0, which permits copying, redistributing, remixing, transformation, and building upon the material in any medium so long as the original work is properly cited.