Research Article

An Approach to Provide Clear Findings for Identifying Unwanted Messages in Electronic Communication Systems

Chenghao Xu*
University of San Diego

* Corresponding author: [email protected]

Abstract

Unwanted messages in electronic communication, such as spam and phishing attempts, continue to pose significant risks, including information theft, malware distribution, and data loss. Traditional rule-based and keyword-based filtering methods have become less effective due to the evolving tactics used by malicious actors. This study presents a comprehensive machine learning framework for detecting unwanted messages, which combines both textual features—such as term frequency-inverse document frequency (TF-IDF)—and structural features including message length, word count, frequency of special characters, and ratios of uppercase letters. The framework is evaluated using three widely adopted classification algorithms: logistic regression, linear support vector machine, and random forest, applied to a large, publicly available Kaggle dataset of electronic messages. Experimental results demonstrate that the random forest model outperforms the other methods, achieving a precision-recall score of 0.986 and an area under the ROC curve of 0.998. These findings highlight the advantage of integrating diverse engineered features with classical machine learning techniques for effective and interpretable spam detection. Further analysis of feature importance and classification errors provides additional insight into model behavior and error patterns. Future research will focus on incorporating advanced deep learning and explainability methods to further improve detection accuracy and transparency in real-world communication systems.

Keywords: Email Spam Detection; Machine Learning; Random Forest; Explainable AI; Text Classification.
Published: January 26, 2026
DOI: 10.54254/2755-2721/2026.CH31490
Volume: ACE Vol.225
pp. 9-17
Download PDF

References

  1. Nikhil, K., Sanket, S. (2020) Email spam detection using machine learning algorithms, International Journal of Computer and Information Technology. Available: https: //www.ijcit.com/ index.php/ijcit/article/view/417/11
  2. Saleem, S., Islam, Z. U., Hasan, S. S. U., Akbar, H., Khan, M. F., and Ibrar, S. A. (2025) Spam email detection using long short-term memory and gated recurrent unit, Applied Sciences, vol. 15, no. 13, Art. no. 7407, 2025, doi: 10.3390/app15137407.
  3. Nasreen, G., Khan, M., Younus, M., Zafar, B., and Hanif, M. K. (2024) Email spam detection by deep learning models using novel feature selection technique and BERT, Egyptian Informatics Journal, vol. 26, Art. no. 100473, 2024. Available: https: //www.sciencedirect.com/science/ article/pii/S1110866524000367
  4. Guo, Y., Mustafaoglu, Z., and Koundal, D. (2022) Spam detection using bidirectional transformers and machine learning classifier algorithms, Journal of Computational and Cognitive Engineering, vol. 2, no. 1, pp. 5–9, doi: 10.47852/bonviewJCCE2202192.
  5. Nicholas, N. N. and Nirmalrani, V. (2024) An enhanced mechanism for detection of spam emails by deep learning technique with bio-inspired algorithm, e-Prime – Advances in Electrical Engineering, Electronics and Energy, vol. 21, Art. no. 100504, doi: 10.1016/j.prime.2024.100504.
  6. Bouke, M. A., Alramli, O. I., and Abdullah, A. (2024) XAIRF-WFP: A novel XAI-based random forest classifier for advanced email spam detection, International Journal of Information Security, vol. 24, no. 1, Art. no. 5, doi: 10.1007/s10207-024-00920-1.
  7. Filali, A. et al. (2024) The role of explainable AI in mitigating spam threats, Procedia Computer Science. Available: https: //www.sciencedirect.com/science/article/pii/S1877050924010627
  8. Abutalha, M., Tasnim, F., Nazmul, N., and Tasnim, A. (2024) Explainable AI-based framework for efficient detection of spam from text using an enhanced ensemble technique, Engineering, Technology & Applied Science Research, vol. 14, no. 4, pp. 15596–15601. Available: https: //etasr.com/index. php/ETASR/article/view/7901/3869
  9. Uddin, M. A. and Mahiuddin, M. (2024) Explainable Email Spam Detection: A Transformer-based Language Modeling Approach, in Proc. 27th Int. Conf. Computer and Information Technology (ICCIT), doi: 10.1109/ICCIT64611.2024.11022595.
  10. Kadam, P. (2025) Email spam detection using hybrid model, International Journal for Research in Applied Science & Engineering Technology (IJRASET). Available: https: //www.ijraset.com/research-paper/email-spam-detection-using-hybrid-model