Architecture & Methodology

A detailed look at the technical stack and machine learning pipeline behind the classification process.

1. Data Collection & Preprocessing

The model was trained on the 5,572 records of the SMS Spam Collection dataset. Each message underwent a rigorous cleaning process: Lowercasing, Tokenization (nltk), Removal of special characters and punctuation, and Porter Stemming to reduce words to their root form (e.g., "running" becomes "run").

2. Feature Engineering (TF-IDF)

We used the Term Frequency-Inverse Document Frequency (TF-IDF) vectorizer to convert text into numerical vectors. This algorithm weighs terms based on their frequency in a specific message compared to the entire corpus, highlighting unique keywords that distinguish spam from legitimate messages.

3. Classification Algorithm

The Multinomial Naive Bayes (MNB) classifier was selected for its exceptional performance in text classification tasks. Based on Bayes' Theorem, it calculates the probability of each class given the input features, assuming independence between them—a proven architecture for reliable spam filtering.

Precision

Optimized for low false-positive rates to ensure legitimate mail isn't tagged as spam.

Latency

Real-time processing with less than 100ms inference time per message.

Scalability

Flask-ready architecture suitable for deployment on cloud infrastructure.

Project Contributors

Gaurav Singh

Lead Frontend & UX Architect

Gyanendra Singh

Backend & ML Engineer