SpamSense: AI-Powered SMS Filtering
View on GitHub
The Challenge
Unsolicited spam and phishing SMS messages are a persistent nuisance and a significant security risk for mobile users. The goal was to develop an application that could intelligently and automatically classify incoming messages as either legitimate (“ham”) or spam, protecting users from malicious content.
My Solution
I developed SpamSense, an AI-powered SMS filtering application that leverages classical machine learning and natural language processing (NLP) techniques. The project involved the full lifecycle of a machine learning application, from data preprocessing and model training to deploying the model via a web-based API.
Key Features & Technical Implementation:
- Effective NLP Pipeline: Utilized the Natural Language Toolkit (NLTK) for essential text preprocessing steps, including tokenization and the removal of stopwords. This cleaned and prepared the raw SMS text data for feature extraction.
- TF-IDF Vectorization: Converted the processed text messages into a meaningful numerical format using Term Frequency-Inverse Document Frequency (TF-IDF). This technique effectively highlights words that are important to a message’s classification while down-weighting common words.
- Efficient & Accurate Classifier: Trained and evaluated a Multinomial Naive Bayes classifier, an algorithm well-suited for text classification tasks. The model was trained on the widely-used SMS Spam Collection Dataset and achieved strong performance across key metrics (accuracy, precision, recall, and F1-score).
- Model Deployment with Flask: To make the trained model usable by other applications, I serialized it using
jobliband created a lightweight REST API using the Flask web framework. This API endpoint can receive a new SMS message and return its predicted classification in real-time.
This project demonstrates foundational skills in building and deploying a complete NLP-based machine learning solution from scratch.