Perbandingan Machine Learning dan Deep Learning untuk Klasifikasi Spam dengan Class Balancing

Isi Artikel Utama

Bayu Yanuargi
Fahmi Auliya Tsani

Abstrak

Klasifikasi SPAM/HAM menghadapi dua tantangan utama, yaitu ketidakseimbangan kelas dan kebutuhan memilih model yang akurat sekaligus efisien. Penelitian ini membandingkan Algoritma Konvensional Naive Bayes, Support Vector Machine, dan Recurrent Deep Learning yaitu Long Short-Term Memor, dan Gated Recurrent Unit dengan strategi class balancing. Data dibersihkan dan dideduplikasi, kemudian dipisahkan menjadi development 80% dan final test 20%. Balancing hanya diterapkan pada training set melalui downsampling HAM dan oversampling SPAM hingga masing-masing 1.500 sampel; validation dan final test tetap mengikuti distribusi alami. NB dan SVM menggunakan TF-IDF, sedangkan LSTM dan GRU menggunakan tokenisasi, embedding 128 dimensi, dan masking padding. NB memberikan accuracy 98,63% dan Macro-F1 96,65%, tertinggi dari empat model. SVM menghasilkan PR-AUC 97,55%, GRU memperoleh recall SPAM tertinggi 94,96%, dan LSTM memperoleh ROC-AUC tertinggi 98,92%. Waktu training NB hanya 0,004 detik, dibandingkan GRU 6,61 detik dan LSTM 12,95 detik. Hasil menunjukkan bahwa model tradisional tetap kompetitif dan memberikan trade-off performa-efisiensi yang lebih baik pada data pesan pendek setelah class balancing.

Rincian Artikel

Bagian
Articles

Referensi

[1] T. A. Almeida, J. M. G. Hidalgo, and A. Yamakami, “Contributions to the study of SMS spam filtering: new collection and results,” in Proceedings of the 11th ACM Symposium on Document Engineering, in DocEng ’11. New York, NY, USA: Association for Computing Machinery, 2011, pp. 259–262. doi: 10.1145/2034691.2034742.
[2] U. Maqsood, S. Ur Rehman, T. Ali, K. Mahmood, T. Alsaedi, and M. Kundi, “An Intelligent Framework Based on Deep Learning for SMS and e-mail Spam Detection,” Applied Computational Intelligence and Soft Computing, vol. 2023, no. 1, p. 6648970, Jan. 2023, doi: https://doi.org/10.1155/2023/6648970.
[3] S. Zavrak and S. Yilmaz, “Email spam detection using hierarchical attention hybrid deep learning method,” Expert Syst. Appl., vol. 233, p. 120977, 2023, doi: https://doi.org/10.1016/j.eswa.2023.120977.
[4] P. Wanda, “GRUSpam: robust e-mail spam detection using gated recurrent unit (GRU) algorithm,” International Journal of Information Technology, vol. 15, no. 8, pp. 4315–4322, 2023, doi: 10.1007/s41870-023-01516-z.
[5] M. Kshirsagar, V. Rathi, and C. Ryan, “Meta-learner-based frameworks for interpretable email spam detection,” Front. Artif. Intell., vol. Volume 8-2025, 2025, doi: 10.3389/frai.2025.1569804.
[6] Y. P. Qiao, “Spam email classification based on SVM, Transformer and Naive Bayes,” Applied and Computational Engineering, 2024, [Online]. Available: https://api.semanticscholar.org/CorpusID:268585650
[7] M. Mujahid et al., “Data oversampling and imbalanced datasets: an investigation of performance for machine learning and feature engineering,” J. Big Data, vol. 11, no. 1, p. 87, 2024, doi: 10.1186/s40537-024-00943-4.
[8] N. Ramoji Rao and G. A. F. Vinodhini, “Measuring the efficiency of random forest, naive bayes, multilayer perceptron and support vector machine in email spam detection,” AIP Conf. Proc., vol. 3270, no. 1, p. 020052, Apr. 2025, doi: 10.1063/5.0262529.
[9] P. Charanarur, H. Jain, G. S. Rao, D. Samanta, S. S. Sengar, and C. T. Hewage, “Machine-Learning-Based Spam Mail Detector,” SN Comput. Sci., vol. 4, no. 6, p. 858, 2023, doi: 10.1007/s42979-023-02330-x.
[10] H. Amnur, “Customer Relationship Management and Machine Learning Technology for Identifying the Customer,” JOIV : Int. J. Inform. Visualization, vol. 1, no. 1, pp. 12–15, Mar. 2017, doi: 10.30630/joiv.1.1.10.
[11] P. Ghogare, H. Dawoodi, and M. Patil, Enhancing Spam Email Classification Using Effective Preprocessing Strategies and Optimal Machine Learning Algorithms. 2023. doi: 10.21203/rs.3.rs-3417942/v1.
[12] E. H. Tusher and M. A. Ismail, “FLSTM-ESD: A hybrid approach to fuzziness based long short-term memory network for email spam detection,” Advanced Engineering Informatics, vol. 73, p. 104597, 2026, doi: https://doi.org/10.1016/j.aei.2026.104597.
[13] G. Airlangga, “Spam Detection on YouTube Comments Using Advanced Machine Learning Models: A Comparative Study,” Brilliance: Research of Artificial Intelligence, vol. 4, no. 2, pp. 500–508, Oct. 2024, doi: 10.47709/brilliance.v4i2.4670.
[14] R. Arumugam S, A. Deborah S, R. S, M. R S, and M. T T, “SSN_ARMM at SemEval-2024 Task 10: Emotion Detection in Multilingual Code-Mixed Conversations using LinearSVC and TF-IDF,” in Proceedings of the 18th International Workshop on Semantic Evaluation (SemEval-2024), A. Kr. Ojha, A. S. Doğruöz, H. Tayyar Madabushi, G. Da San Martino, S. Rosenthal, and A. Rosá, Eds., Mexico City, Mexico: Association for Computational Linguistics, Jun. 2024, pp. 730–736. doi: 10.18653/v1/2024.semeval-1.105.
[15] R. Marriam, R. Mohamad, S. H. Moi, and H. Amnur, “A Comparative Study of Rumor Detection Domains: Machine Learning, Deep Learning, and Statistical Approaches,” JOIV : Int. J. Inform. Visualization
[16] Y. Yang, H. A. Khorshidi, and U. Aickelin, “A review on over-sampling techniques in classification of multi-class imbalanced datasets: insights for medical problems,” Front. Digit. Health, vol. Volume 6-2024, 2024, doi: 10.3389/fdgth.2024.1430245.
[17] F. Ares-Robledo, H. Rifà-Pous, and R. Clarisó, “Graph neural networks for anomaly detection: a systematic review of dynamic temporal approaches,” Artif. Intell. Rev., vol. 59, no. 5, p. 129, 2026, doi: 10.1007/s10462-026-11532-7.
[18] X. Wen and W. Li, “Time Series Prediction Based on LSTM-Attention-LSTM Model,” IEEE Access, vol. 11, pp. 48322–48331, 2023, doi: 10.1109/ACCESS.2023.3276628