Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN)
Abstract
While the growing accessibility of technology improves usability, it also creates more opportunities for cybercriminals to exploit vulnerabilities, significantly accelerating the proliferation of cybersecurity attacks. Deep learning (DL) approaches present significant advancements over conventional machine learning (ML) techniques by automating feature selection and extraction while minimizing external dependencies. This study proposes a deep learning-based model to enhance cyberattack detection and ensure that data security goals are achieved. This study employs a quantitative research design, utilizing simulation and modeling as the primary analytical tools. The dataset used is the Canadian Institute for Cybersecurity Intrusion Detection System (CIC-IDS-2017) dataset. Three distinct DL algorithms are used to design the detection models, namely, Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN). The performance comparison metrics are F1-score, accuracy, sensitivity, false positive rate (FPR), specificity, positive predictive value (PPV), false negative rate (FNR), and negative predictive value (NPV). Optimization concepts are integrated to enhance the detection efficiency in web-based systems, including loss functions, gradient-based optimization, and efficient model generalization techniques. The results of k-fold cross-validation show LSTM’s higher scores for F1-score (94.6%), recall (94.7%), accuracy (94.8%), and precision (94.6%). LSTM outperformed RNN and DNN, achieving the highest accuracy, precision, specificity, and sensitivity at 94.7%, 94.3%, 98.9%, and 94.7% respectively, validating LSTM's superior generalizability for cyberattack detection tasks.
Keywords
References
- S. K. Lala and A. Kumar, “Secure Web Development Using OWASP Guidelines,” in Proc. 5th Int. Conf. Intelligent Computing and Control Systems (ICICCS), pp. 323–332, 2021.
- T. Sendjaja, E. P. Irwandi, Y. Suryani, and et al., “Cybersecurity in the Digital Age: Developing Robust Strategies to Protect Against Evolving Global Digital Threats and Cyberattacks,” International Journal of Science and Society, vol. 6, no. 1, pp. 1008–1019, 2024.
- P. Sharma and H. Gupta, “Emerging Cyber Security Threats and Security Applications in Digital Era,” in Proc. 11th Int. Conf. Reliability, Infocom Technologies and Optimization (ICRITO), pp. 1–6, 2024.
- W. S. Admass, Y. Y. Munaye, and A. A. Diro, “Cyber Security: State of the Art, Challenges and Future Directions,” Cyber Security and Applications, vol. 2, p. 100031, 2024.
- A. Hoffman, Web Application Security. O’Reilly Media, Inc., 2024. Accessed from https://books.google.co.ke/.
- CrowdStrike, “CrowdStrike 2025 Global Threat Report,” 2025. Accessed from https://www.crowdstrike.com/enus/global-threat-report/.
- M. Roshanaei, M. R. Khan, and N. N. Sylvester, “Enhancing Cybersecurity Through AI and ML: Strategies, Challenges, and Future Directions,” Journal of Information Security, vol. 15, no. 3, pp. 320–339, 2024.
- L. Tukaram, “Deep Learning in Cybersecurity: Applications, Challenges, and Future Prospects,” International Journal of Innovations in Science, Engineering and Management, vol. 4, no. 2, pp. 27–33, 2025.
Details
Primary Language
English
Subjects
Artificial Intelligence (Other)
Journal Section
Research Article
Authors
Publication Date
December 29, 2025
Submission Date
November 11, 2025
Acceptance Date
December 29, 2025
Published in Issue
Year 1970 Volume: 6 Number: 2
APA
Odiaga, G., Masinde, N., & Yoga, C. (2025). Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN). Journal of Soft Computing and Artificial Intelligence, 6(2), 39-54. https://doi.org/10.55195/jscai.1820478
AMA
1.Odiaga G, Masinde N, Yoga C. Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN). JSCAI. 2025;6(2):39-54. doi:10.55195/jscai.1820478
Chicago
Odiaga, Gloria, Newton Masinde, and Castro Yoga. 2025. “Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN)”. Journal of Soft Computing and Artificial Intelligence 6 (2): 39-54. https://doi.org/10.55195/jscai.1820478.
EndNote
Odiaga G, Masinde N, Yoga C (December 1, 2025) Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN). Journal of Soft Computing and Artificial Intelligence 6 2 39–54.
IEEE
[1]G. Odiaga, N. Masinde, and C. Yoga, “Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN)”, JSCAI, vol. 6, no. 2, pp. 39–54, Dec. 2025, doi: 10.55195/jscai.1820478.
ISNAD
Odiaga, Gloria - Masinde, Newton - Yoga, Castro. “Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN)”. Journal of Soft Computing and Artificial Intelligence 6/2 (December 1, 2025): 39-54. https://doi.org/10.55195/jscai.1820478.
JAMA
1.Odiaga G, Masinde N, Yoga C. Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN). JSCAI. 2025;6:39–54.
MLA
Odiaga, Gloria, et al. “Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN)”. Journal of Soft Computing and Artificial Intelligence, vol. 6, no. 2, Dec. 2025, pp. 39-54, doi:10.55195/jscai.1820478.
Vancouver
1.Gloria Odiaga, Newton Masinde, Castro Yoga. Deep Learning for Cyberattack Detection: A Comparative Analysis of Deep Neural Network (DNN), Long Short-Term Memory (LSTM), and Recurrent Neural Network (RNN). JSCAI. 2025 Dec. 1;6(2):39-54. doi:10.55195/jscai.1820478