Analisis Komparasi Kinerja LSTM dan CNN dalam Deteksi Spam Email Berbasis Deep learning


Authors

  • Maugy Al Kautsar Universitas Semarang, Semarang, Indonesia
  • Galet Guntoro Setiaji Universitas Semarang, Semarang, Indonesia
  • Ahmad Rifa'i Universitas Semarang, Semarang, Indonesia

DOI:

https://doi.org/10.47065/bulletincsr.v5i4.572

Keywords:

Spam Email; Deep Learning; CNN; LSTM; Text Classification

Abstract

Spam email remains a critical issue in digital communication due to its potential misuse in spreading false information and online fraud. This study aims to evaluate and compare the performance of two deep learning models Convolutional Neural Network (CNN) and Long Short-Term Memory (LSTM) for text-based spam email classification. The dataset used in this study was obtained from Kaggle and contains 5,572 labeled email entries categorized as spam and non-spam. The preprocessing stage included labeling, cleaning, lowercasing (casefolding), tokenization, stopword removal, and stemming. The data was split into training and testing sets with a 70:30 ratio. Both models were trained using the same configuration and evaluated using accuracy, loss, confusion matrix, and F1-score metrics. The results indicate that the LSTM model achieved the highest accuracy of 98.72% with a loss value of 0.0377, outperforming the CNN model, which achieved 87.78% accuracy and a loss of 0.3659. Based on these findings, LSTM demonstrated superior performance in detecting spam emails using text-based input. This research is expected to serve as a reference for developing more accurate and effective spam detection systems in the future.

Downloads

Download data is not yet available.

References

A. Muhaimin, I. A. Taufik, and D. D. Daniswara, “Pendeteksian Spam pada E-mail menggunakan Pendekatan Natural Language Processing,” Pros. Semin. Nas. Sains Data, vol. 3, no. 1, pp. 116–121, 2023, doi: 10.33005/senada.v3i1.90.

A. N. Salim, A. Adryani, and T. Sutabri, “Deteksi Email Spam dan Non-spam Berdasarkan Isi Konten Menggunakan Metode K-Nearest Neighbor dan Support Vector Machine,” Syntax Idea, vol. 6, no. 2, pp. 991–1001, 2024, doi: 10.46799/syntax-idea.v6i2.3052.

C. M. Bachri and W. Gunawan, “Deteksi Email Spam menggunakan Algoritma Convolutional Neural Network (CNN),” Edukasi dan Penelit. Inform., vol. 10, no. 1, pp. 88–94, 2024.

I. AbdulNabi and Q. Yaseen, “Spam email detection using deep learning techniques,” Procedia Computer Science, vol. 184, no. January 2021, pp. 853–858, 2021, doi: 10.1016/j.procs.2021.03.107.

E. al. Ratnam Dodda, “Precision in Classification: A Comparative Study of Logistic Regression, Naive Bayes, LSTM, and CNN for Spam Email Detection,” Int. J. Recent Innov. Trends Comput. Commun., vol. 11, no. 9, pp. 2276–2280, 2023, doi: 10.17762/ijritcc.v11i9.9233.

R. Approaches and G. Airlangga, “A Comparative Analysis of Deep learning Models for SMS Spam Detection : CNN-LSTM, CNN-GRU, and ResNet Approaches,” Journal of Computer Networks , Architecture and High Performance Computing, vol. 6, no. 4, pp. 1952–1960, 2024.

S. N. Saputra, G. G. Setiaji, and M. T. A. C. Widiyanto, “Perbandingan Kinerja RNN dan CNN Dalam Klasifikasi Sentimen Ulasan Pengguna Aplikasi di Play Store,” Journal of Computer System and Informatics (JoSYC), vol. 6, no. 1, pp. 349–362, 2024, doi: 10.47065/josyc.v6i1.6408.

A. Sheneamer, “Comparison of Deep learning and Traditional Methods for Email Spam Filtering,” Int. J. Adv. Comput. Sci. Appl., vol. 12, no. 1, pp. 560–565, 2021, doi: 10.14569/IJACSA.2021.0120164.

H. Setiawan and D. Ariatmanto, “Analisis Perbandingan Algoritma Machine Learning Dan Deep learning Untuk Sentimen Analisis Teks Umpan Balik Tentang Evaluasi Pengajaran Dosen,” JSAI (Journal Sci. Appl. Informatics), vol. 7, no. 2, pp. 379–385, 2024, doi: 10.36085/jsai.v7i2.6572.

S. Govindan, A. F. A. Abidin, M. A. Mohamed, S. D. Mohd Satar, M. F. Abdul Kadir, and N. Abd Hamid, “Spam Detection Model Using Tensorflow and Deep learning Algorithm,” Malaysian J. Comput. Appl. Math., vol. 6, no. 2, pp. 11–21, 2023, doi: 10.37231/myjcam.2023.6.2.84.

B. A. Febryanto and I. Tahyudin, “Perbandingan Algoritma CNN, LSTM, FNN untuk Diagnosa Fibrosis Hati dengan Citra Medis,” Techno.Com, vol. 24, no. 1, pp. 41–55, 2025.

K. Thakur, M. L. Ali, M. A. Obaidat, and A. Kamruzzaman, “A Systematic Review on Deep-Learning-Based Phishing Email Detection,” Electron., vol. 12, no. 21, pp. 1–26, 2023, doi: 10.3390/electronics12214545.

S. Atawneh and H. Aljehani, “Phishing Email Detection Model Using Deep learning,” Electron., vol. 12, no. 20, 2023, doi: 10.3390/electronics12204261.

MR Adepu Rajesh and Dr Tryambak Hiwarkar, “Exploring Preprocessing Techniques for Natural LanguageText: A Comprehensive Study Using Python Code,” Int. J. Eng. Technol. Manag. Sci., vol. 7, no. 5, pp. 390–399, 2023, doi: 10.46647/ijetms.2023.v07i05.047.

F. Jáñez-Martino, R. Alaiz-Rodríguez, V. González-Castro, E. Fidalgo, and E. Alegre, “Classifying spam emails using agglomerative hierarchical clustering and a topic-based approach,” Appl. Soft Comput., vol. 139, p. 110226, 2023, doi: 10.1016/j.asoc.2023.110226.

N. C. Dewi and A. Qoiriah, “Implementasi Algoritma Jaro-Winkler Distance dan N-Gram untuk Deteksi dan Prediksi Perbaikan Kesalahan Penulisan Kata Bahasa Indonesia pada Karya Tulis Ilmiah Mahasiswa,” J. Informatics Comput. Sci., vol. 2, no. 03, pp. 169–177, 2021, doi: 10.26740/jinacs.v2n03.p169-177.

Y. A. Risqi and I. Susilawati, “Pemanfaatan Artificial Intelligence dan Cognitive Behavioral Therapy Untuk Pengembangan Chatbot Pembelajaran Matematika Sekolah Menengah,” Journal of Information System Research (JOSH), vol. 6, no. 2, 2025, doi: 10.47065/josh.v6i2.6523.

N. Nurwanda, N. Suarna, and W. Prihartono, “Penerapan NLP (Natural Language Processing) Dalam Analisis Sentimen Pengguna Telegram Di Playstore,” JATI (Jurnal Mhs. Tek. Inform., vol. 8, no. 2, pp. 1841–1846, 2024, doi: 10.36040/jati.v8i2.8469.

M. S. Anwar, I. Much, I. Subroto, and S. Mulyono, “Sistem Pencarian E-Journal Menggunakan Metode Stopword Removal dan Stemming,” Prosiding Konstelasi Ilmiah Mahasiswa Unissula (KIMU), pp. 58–70, 2019.

J. Pardede, and D. Darmawan, “Perbandingan Algoritma Stemming Porter, Sastrawi, Idris, Arifin dan Setiono pada Dokumen Teks Bahasa Indonesia”, JTIK (Jurnal Teknologi Informasi dan Ilmu Komputer), vol. 12, no. 1, 2025, doi: 10.25126/jtiik.2025128860.

E. Muningsih, “Kombinasi Metode K-Means Dan Decision Tree Dengan Perbandingan Kriteria Dan Split Data,” J. Teknoinfo, vol. 16, no. 1, p. 113, 2022, doi: 10.33365/jti.v16i1.1561.

E. Rasywir, R. Sinaga, and Y. Pratama, “Analisis dan Implementasi Diagnosis Penyakit Sawit dengan Metode Convolutional Neural Network (CNN),” Paradig. - J. Komput. dan Inform., vol. 22, no. 2, pp. 117–123, 2020, doi: 10.31294/p.v22i2.8907.

A. Hanifa, S. A. Fauzan, M. Hikal, and M. B. Ashfiya, “Perbandingan Metode LSTM dan GRU (RNN) untuk Klasifikasi Berita Palsu Berbahasa Indonesia,” Din. Rekayasa, vol. 17, no. 1, p. 33, 2021, doi: 10.20884/1.dr.2021.17.1.436.


Bila bermanfaat silahkan share artikel ini

Berikan Komentar Anda terhadap artikel Analisis Komparasi Kinerja LSTM dan CNN dalam Deteksi Spam Email Berbasis Deep learning

Dimensions Badge

ARTICLE HISTORY

Published: 2025-06-26

Abstract View: 572 times
PDF Download: 359 times

How to Cite

Maugy Al Kautsar, Galet Guntoro Setiaji, & Ahmad Rifa’i. (2025). Analisis Komparasi Kinerja LSTM dan CNN dalam Deteksi Spam Email Berbasis Deep learning. Bulletin of Computer Science Research, 5(4), 584-593. https://doi.org/10.47065/bulletincsr.v5i4.572

Issue

Section

Articles