Comparative Analysis of Traditional Machine Learning and Sequential Deep Learning Models for Spam Email Classification

Authors

  • Harliana Harliana Universitas Nahdlatul Ulama Blitar
  • Hartatik Hartatik Universitas AMIKOM Yogyakarta
  • Achmad Alvi Yudanuari Universitas Nahdlatul Ulama Blitar

DOI:

https://doi.org/10.55927/fjcis.v5i1.16502

Keywords:

Spam Classification, TF-IDF, Logistic Regression, RNN, LSTM

Abstract

This study compares the performance of traditional machine learning methods and sequential deep learning models for text-based spam classification. The primary issue addressed is the lack of consistent, fair evaluation across these approaches due to variations in datasets, preprocessing techniques, and experimental settings across previous studies. To overcome this limitation, this research proposes a controlled comparative evaluation framework by employing a unified dataset, standardized preprocessing procedures, consistent data splitting, and identical evaluation metrics. The dataset used consists of 5,572 messages with an imbalanced class distribution; therefore, oversampling was applied to the training data to mitigate bias. The evaluated models include TF-IDF-based Logistic Regression as the baseline, as well as Recurrent Neural Networks (RNNs), Long Short-Term Memory (LSTM), and Gated Recurrent Units (GRUs) as deep learning models.

Downloads

Download data is not yet available.

References

Agrawal, E. G., & Goyal, S. J. (2022). Survey on Data Leakage Prevention through Machine Learning Algorithms. International Mobile and Embedded Technology Conference (MECON) Survey, 2020–2022. https://doi.org/10.1109/MECON53876.2022.9752047.

Aguiar, G., Krawczyk, B., & Cano, A. (2024). A survey on learning from imbalanced data streams : taxonomy, challenges, empirical study, and reproducible. In Machine Learning (Vol. 113, Issue 7). Springer US. https://doi.org/10.1007/s10994-023-06353-6.

Ahmed, N., Amin, R., Aldabbas, H., Koundal, D., Alouffi, B., & Shah, T. (2022). Machine Learning Techniques for Spam Detection in Email and IoT Platforms : Analysis and Research Challenges. Security and Communication Networks, 2022. https://doi.org/10.1155/2022/1862888.

Al-augby, S., Alyasiri, H., Abdulkadhim, F. G., & Oleiwi, Z. C. (2025). A Stacked Ensemble Classifier for Email Spam Detection via an Evolutionary Algorithm. Mesopotamian Journal of Cybersecurity, 5(2), 657–670. https://doi.org/10.58496/MJCS/2025/039.

Altalhan, M., Algarni, A., & Alouane, M. T. (2025). Imbalanced Data Problem in Machine Learning : A Review. IEEE Access, 13(December 2024), 13686–13699. https://doi.org/10.1109/ACCESS.2025.3531662.

Aubaid, A. M., Mishra, A., & Mishra, A. (2024). Machine learning and rule ‑ based embedding techniques for classifying text documents. International Journal of System Assurance Engineering and Management, 15(12), 5637–5652. https://doi.org/10.1007/s13198-024-02555-w.

Bansal, M., Goyal, A., & Choudhary, A. (2022). A comparative analysis of K-Nearest Neighbor, Genetic, Support Vector Machine, Decision Tree, and Long Short Term Memory algorithms in machine learning. Decision Analytics Journal, 3(November 2021), 100071. https://doi.org/10.1016/j.dajour.2022.100071.

Guleria, P., Frnda, J., & Srinivasu, P. N. (2025). NLP based text classification using TF-IDF enabled fine-tuned long short-term memory : An empirical analysis. Array, 27(July), 100467. https://doi.org/10.1016/j.array.2025.100467.

Hasan, S. U., Ahamed, J., & Ahmad, K. (2022). Analytics of machine learning-based algorithms for text classification. Sustainable Operations and Computers, 3(July 2021), 238–248. https://doi.org/10.1016/j.susoc.2022.03.001.

Kowsari, K., Meimandi, K. J., Heidarysafa, M., & Mendu, S. (2019). Text Classification Algorithms : A Survey. Information, 10(4), 1–68. https://doi.org/10.3390/info10040150.

Mao, S., Member, G. S., & Sejdi, E. (2023). A Review of Recurrent Neural Network-Based Methods in Computational Physiology. IEEE TRANSACTIONS ON NEURAL NETWORKS AND LEARNING SYSTEMS, 34(10), 1–21. https://doi.org/10.1109/TNNLS.2022.3145365.

Naulak, C. (2023). A comparative study of Naive Bayes Classifiers with improved technique on Text Classification. TechRxiv, 1(May), 0–8. https://doi.org/10.36227/techrxiv.19918360.v1.

Qazi, A., Hasan, N., Mao, R., Mohamed Abo, M. E., Dey, S. K., & Hardaker, G. (2024). Machine Learning-Based Opinion Spam Detection : A Systematic Literature Review. IEEE Access, 12(May), 143485–143499. https://doi.org/10.1109/ACCESS.2024.3399264.

Rahimzad, M., Moghaddam, A., & Hosam, N. (2021). Performance Comparison of an LSTM ‑ based Deep Learning Model versus Conventional Machine Learning Algorithms for Streamflow Forecasting. Water Resources Management, September. https://doi.org/10.1007/s11269-021-02937-w.

Sherstinsky, A. (2020). Fundamentals of Recurrent Neural Network (RNN) and Long Short-Term Memory (LSTM) network. Physica D, 404, 132306. https://doi.org/10.1016/j.physd.2019.132306.

Siddique, Z. Bin, Khan, M. A., Din, I. U., Almogren, A., Mohiuddin, I., & Nazir, S. (2021). Machine Learning-Based Detection of Spam Emails. Scientific Programming, December. https://doi.org/10.1155/2021/6508784.

Utomo, M. W. S., Murti, H. W., Sujatmoko, Am. W. I., & Sari, A. P. (2024). Deteksi Spam Email Menggunakan Metode LSTM (Long Short Term Memory). JATI (Jurnal Mahasiswa Teknik Informatika), 8(6), 11406–11411. https://doi.org/10.36040/jati.v8i6.11474.

Published

2026-03-30

How to Cite

Harliana, H., Hartatik, H., & Yudanuari, A. A. (2026). Comparative Analysis of Traditional Machine Learning and Sequential Deep Learning Models for Spam Email Classification. Formosa Journal of Computer and Information Science, 5(1), 111–124. https://doi.org/10.55927/fjcis.v5i1.16502

Issue

Section

Articles