Implementation of Naive Bayes and Support Vector Machine for SMS Spam Classification Using the SMS Spam Collection Dataset

Authors

  • Muhammad Abrar Rayhan Telkom University

DOI:

https://doi.org/10.54065/artificial.1249

Keywords:

SMS Spam Detection, Machine Learning, Text Classification, Naïve Bayes, Support Vector Machine

Abstract

Short Message Service (SMS) is one of the most popular communication services on mobile networks. The rapid proliferation of mobile communication has led to an increase in spam messages offering ads, false links, and misinformation, which could pose a threat to user privacy. Automated spam detection using machine learning methods has become a key approach to tackling this problem in recent years. The aim of this research is to apply and train on how the SMS Spam Collection. Dataset for SMS spam classification using 2 machine learning algorithms, Naïve Bayes and Support Vector Machine (SVM). Several steps are taken, including data preprocessing, text cleanup, feature extraction using the Term Frequency–Inverse Document Frequency (TF-IDF) method, and model training. The performance of the implemented models is assessed using accuracy, precision, recall, F1-score, a confusion matrix, and cross-validation. The results from the experiments show that both algorithms can successfully classify these SMS spam messages. However, the Support Vector Machine model outperforms the Naïve Bayes model, achieving an accuracy of nearly 98% on the classification task. These results demonstrate that machine learning techniques, including Support Vector Machine in combination with TF-IDF feature extraction, provide reliable performance for SMS spam detection, and could be helpful for an automated filter system in m-commerce services.

References

Abayomi?Alli, O., Misra, S., & Abayomi?Alli, A. (2022). A Deep Learning Method For Automatic SMS Spam Classification: Performance Of Learning Algorithms On Indigenous Dataset. Concurrency And Computation: Practice And Experience, 34(17), E6989. Https://Doi.Org/10.1002/Cpe.6989

Dey, S., Wasif, S., Tonmoy, D. S., Sultana, S., Sarkar, J., & Dey, M. (2020). A Comparative Study Of Support Vector Machine And Naive Bayes Classifier For Sentiment Analysis On Amazon Product Reviews. In 2020 International Conference On Contemporary Computing And Applications (IC3A) (Pp. 217-220). IEEE.

Johari, M. F., Chiew, K. L., Hosen, A. R., Yong, K. S., Khan, A. S., Abbasi, I. A., & Grzonka, D. (2025). Key Insights Into Recommended SMS Spam Detection Datasets. Scientific Reports, 15(1), 8162. Https://Doi.Org/10.1038/S41598-025-92223-1

Pranckevi?ius, T., & Marcinkevi?ius, V. (2017). Comparison Of Naive Bayes, Random Forest, Decision Tree, Support Vector Machines, And Logistic Regression Classifiers For Text Reviews Classification. Baltic Journal Of Modern Computing, 5(2). Https://Doi.Org/10.22364/Bjmc.2017.5.2.05

Saeed, V. A. (2023). A Method For SMS Spam Message Detection Using Machine Learning. Artif. Intell. Robot. Dev. J, 3, 214-228. Https://Doi.Org/10.52098/Airdj.202366

Zhang, Y., & Wallace, B. (2017). A Sensitivity Analysis Of (And Practitioners’ Guide To) Convolutional Neural Networks For Sentence Classification. Journal Of Artificial Intelligence Research, 59, 367–410. Https://Doi.Org/10.1613/Jair.5245

Kowsari, K., Heidarysafa, M., Brown, D. E., Meimandi, K. J., & Barnes, L. E. (2019). Text Classification Algorithms: A Survey. Information, 10(4), 150. Https://Doi.Org/10.3390/Info10040150

Raschka, S. (2018). Model Evaluation, Model Selection, And Algorithm Selection In Machine Learning. Arxiv Preprint Arxiv:1811.12808. Https://Doi.Org/10.48550/Arxiv.1811.12808

Wafda, A. (2024). Integrasi Machine Learning Dalam Ritel: Tinjauan Komprehensif Tentang Prediksi Harga, Analisis Data Pelanggan, Dan Pemanfaatan Media Sosial. Journal Artificial: Informatika Dan Sistem Informasi, 2(2), 90–106. Https://Doi.Org/10.54065/Artificial.543

Wafda, A. (2025). Transfer Learning Advancements: A Comprehensive Literature Review On Text Analysis, Image Processing, And Health Data Analytics. Journal Artificial: Informatika Dan Sistem Informasi, 3(1), 1–10. Https://Doi.Org/10.54065/Artificial.544

Anggraini, D. A., Ikhsan, M., & Suhardi, S. (2024). Implementation Of The Naïve Bayes Algorithm In The Sms Spam Filtering System. Journal Of Computer Networks, Architecture And High Performance Computing, 6(2), 838-849. Https://Doi.Org/10.47709/Cnahpc.V6i2.3875

Krishnaveni, N., & Radha, V. (2021). Comparison Of Naive Bayes And Svm Classifiers For Detection Of Spam Sms Using Natural Language Processing. Ictact Journal On Soft Computing, 11(2).

Setiyono, A., & Pardede, H. F. (2019). Klasifikasi Sms Spam Menggunakan Support Vector Machine. Jurnal Pilar Nusa Mandiri, 15(2), 275-280. Https://Doi.Org/10.33480/Pilar.V15i2.693

Gupta, S. D., Saha, S., & Das, S. K. (2021). SMS Spam Detection Using Machine Learning. In Journal Of Physics: Conference Series 1797(1) 012017. IOP Publishing. Https://Doi.Org/10.1088/1742-6596/1797/1/012017

Singh, A. A. S., Tamilmani, V., Maniar, V., Kothamaram, R. R., Rajendran, D., & Namburi, V. D. (2021). Predictive Modeling For Classification Of SMS Spam Using NLP And ML Techniques. International Journal Of Artificial Intelligence, Data Science, And Machine Learning, 2(4), 60-69. Https://Doi.Org/10.63282/3050-9262.IJAIDSML-V2I4P107

Shahbazov, V. (2026). SMS Dataset For Multi-Class Classification Of Ham, Spam, And Smishing In Azerbaijani Language. Problems Of Information Technology, 32-39. Https://Doi.Org/10.25045/Jpit.V17.I1.04

Giri, S., Das, S., Das, S. B., & Banerjee, S. (2023). SMS Spam Classification–Simple Deep Learning Models With Higher Accuracy Using BUNOW And Glove Word Embedding. Journal Of Applied Science And Engineering, 26(10), 1501-1511. Https://Doi.Org/10.6180/Jase.202310_26(10).0015

Ugbotu, E. V., Aghaunor, T. C., Onoma, P. A., Max-Egba, A. T., Geteloma, V. O., Eboka, A. O., ... & Odiakaose, C. C. (2025). Transfer Learning Using A CNN Fused Random Forest For SMS Spam Detection With Semantic Normalization Of Text Corpus. NIPES-Journal Of Science And Technology Research, 7(2), 371-382. Https://Doi.Org/10.37933/Nipes/7.2.2025.29

Roy, P. K., Singh, J. P., & Banerjee, S. (2020). Deep Learning To Filter SMS Spam. Future Generation Computer Systems, 102, 524-533. Https://Doi.Org/10.1016/J.Future.2019.09.001

Nagwani, N. K., & Sharaff, A. (2017). SMS Spam Filtering And Thread Identification Using Bi-Level Text Classification And Clustering Techniques. Journal Of Information Science, 43(1), 75-87. Https://Doi.Org/10.1177/0165551515616310

Downloads

Published

2026-05-20

How to Cite

Rayhan, M. A. (2026). Implementation of Naive Bayes and Support Vector Machine for SMS Spam Classification Using the SMS Spam Collection Dataset. Journal Artificial: Informatika Dan Sistem Informasi, 4(2), 197–212. https://doi.org/10.54065/artificial.1249