Real-Time Explainable Spam Message Classification Using DistilBERT

  • Unique Paper ID: 199517
  • Volume: 12
  • Issue: 11
  • PageNo: 15671-15680
  • Abstract:
  • The rapid growth of digital communication technologies, including email services, mobile messaging applications, and social networking platforms, has significantly increased the volume of spam messages transmitted across the internet. Spam messages are unsolicited communications that often contain phishing links, fraudulent advertisements, deceptive promotional offers, or malicious content designed to exploit users. These messages not only create inconvenience but also pose serious cybersecurity threats such as identity theft, financial loss, and unauthorized access to sensitive information. Traditional spam detection techniques, including rule-based filtering and classical machine learning algorithms such as Naive Bayes and Support Vector Machine, have been widely used to address this issue. However, these approaches are limited in their ability to capture contextual relationships within text and often fail to detect sophisticated spam messages that use semantic manipulation and obfuscation techniques. To overcome these limitations, this research proposes a real-time explainable spam message classification system based on the DistilBERT transformer architecture. DistilBERT is a lightweight and computationally efficient version of BERT that maintains strong contextual language understanding while reducing model complexity and processing overhead. The model is fine-tuned using the PyTorch deep learning framework in combination with the HuggingFace Transformers library to classify incoming messages as spam or legitimate. Furthermore, to enhance transparency and interpretability, explainable artificial intelligence techniques such as SHAP and LIME are integrated into the system to identify and visualize the words that contribute most significantly to the model’s predictions. For practical implementation, the trained model is deployed using a FastAPI-based backend system and hosted on cloud platforms such as Amazon Web Services and Render, enabling scalable and real-time spam detection through API-based communication. Experimental evaluation conducted on the SMS Spam Collection Dataset demonstrates that the proposed system achieves high classification performance with an accuracy of 96

Copyright & License

Copyright © 2026 Authors retain the copyright of this article. This article is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

BibTeX

@article{199517,
        author = {Tanaya Chaudhari and Nachiket Shewale and Siddhesh Jadhav and Atharva Chavan and Prof. Vijaya Patil},
        title = {Real-Time Explainable Spam Message Classification Using DistilBERT},
        journal = {International Journal of Innovative Research in Technology},
        year = {2026},
        volume = {12},
        number = {11},
        pages = {15671-15680},
        issn = {2349-6002},
        url = {https://ijirt.org/article?manuscript=199517},
        abstract = {The rapid growth of digital communication technologies, including email services, mobile messaging applications, and social networking platforms, has significantly increased the volume of spam messages transmitted across the internet. Spam messages are unsolicited communications that often contain phishing links, fraudulent advertisements, deceptive promotional offers, or malicious content designed to exploit users. These messages not only create inconvenience but also pose serious cybersecurity threats such as identity theft, financial loss, and unauthorized access to sensitive information. Traditional spam detection techniques, including rule-based filtering and classical machine learning algorithms such as Naive Bayes and Support Vector Machine, have been widely used to address this issue. However, these approaches are limited in their ability to capture contextual relationships within text and often fail to detect sophisticated spam messages that use semantic manipulation and obfuscation techniques.
To overcome these limitations, this research proposes a real-time explainable spam message classification system based on the DistilBERT transformer architecture. DistilBERT is a lightweight and computationally efficient version of BERT that maintains strong contextual language understanding while reducing model complexity and processing overhead. The model is fine-tuned using the PyTorch deep learning framework in combination with the HuggingFace Transformers library to classify incoming messages as spam or legitimate. Furthermore, to enhance transparency and interpretability, explainable artificial intelligence techniques such as SHAP and LIME are integrated into the system to identify and visualize the words that contribute most significantly to the model’s predictions.
For practical implementation, the trained model is deployed using a FastAPI-based backend system and hosted on cloud platforms such as Amazon Web Services and Render, enabling scalable and real-time spam detection through API-based communication. Experimental evaluation conducted on the SMS Spam Collection Dataset demonstrates that the proposed system achieves high classification performance with an accuracy of 96},
        keywords = {DistilBERT, Explainable Artificial Intelligence (XAI), FastAPI, Natural Language Processing (NLP), Spam Detection, Text Classification, Transformer Models.},
        month = {April},
        }

Cite This Article

Chaudhari, T., & Shewale, N., & Jadhav, S., & Chavan, A., & Patil, P. V. (2026). Real-Time Explainable Spam Message Classification Using DistilBERT. International Journal of Innovative Research in Technology (IJIRT), 12(11), 15671–15680.

Related Articles