Skip to content

About

Python-based spam message classifier using TF-IDF vectorization, Naive Bayes, and Tkinter for real-time email and SMS spam detection.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

📧 Spam Message Classifier

A Python-based spam message classification system that uses TF-IDF vectorization and the Multinomial Naive Bayes algorithm to classify SMS and email messages as Spam or Not Spam. The application also provides a user-friendly Tkinter GUI for real-time message classification.


📖 Project Overview

Spam messages are one of the most common cybersecurity threats, ranging from phishing emails to fraudulent SMS campaigns. This project applies Natural Language Processing (NLP) and Machine Learning techniques to automatically classify incoming messages and assist users in identifying potentially malicious content.

The classifier preprocesses text, extracts TF-IDF features, trains a Multinomial Naive Bayes model, and predicts whether a message is spam or legitimate.


✨ Key Features

  • 📧 SMS and email spam classification
  • 🧹 Automatic text preprocessing and cleaning
  • 📊 TF-IDF feature extraction
  • 🤖 Multinomial Naive Bayes classifier
  • 📈 Model performance evaluation
  • 🖥️ Tkinter-based graphical user interface
  • ⚡ Real-time spam prediction

🏗️ System Workflow

Dataset
    │
    ▼
Text Cleaning
    │
    ▼
TF-IDF Vectorization
    │
    ▼
Train-Test Split
    │
    ▼
Multinomial Naive Bayes
    │
    ▼
Prediction
    │
    ▼
Spam / Not Spam

⚙️ Technologies Used

Programming

  • Python

Machine Learning

  • Scikit-learn
  • TF-IDF Vectorizer
  • Multinomial Naive Bayes

Data Processing

  • Pandas
  • Regular Expressions (Regex)

GUI

  • Tkinter

📂 Project Structure

spam-message-classifier/
│
├── docs/
│   └── Project_Report.pdf
│
├── ham/
├── spam/
│
├── spam.csv
├── spam_classifier.py
├── requirements.txt
├── LICENSE
├── README.md
└── .gitignore

🚀 Installation

Clone the repository

git clone https://github.com/parthan2001/spam-message-classifier.git

Navigate to the project

cd spam-message-classifier

Install dependencies

pip install -r requirements.txt

Run the application

python spam_classifier.py

📊 Project Summary

Aspect Detail
Stack Python, Pandas, Scikit-learn, Tkinter
Domain Machine Learning & Cybersecurity
Technique TF-IDF + Multinomial Naive Bayes
Application Spam Message Detection
Performance Real-time message classification
Repository 🔗 https://github.com/parthan2001/spam-message-classifier

📈 Machine Learning Pipeline

  • Text preprocessing using regular expressions
  • Removal of URLs, email addresses, punctuation, and numbers
  • TF-IDF vectorization with unigram and bigram features
  • 80:20 train-test split
  • Multinomial Naive Bayes classifier
  • Performance evaluation using:
    • Accuracy
    • Confusion Matrix
    • Classification Report

📈 Future Enhancements

  • Deep Learning (LSTM/BERT) based spam detection
  • Phishing URL detection
  • Email attachment analysis
  • Real-time email client integration
  • Multilingual spam detection
  • Model persistence using Pickle

🎯 Learning Outcomes

  • Natural Language Processing (NLP)
  • Machine Learning Classification
  • TF-IDF Feature Engineering
  • Naive Bayes Classification
  • Python GUI Development
  • Cybersecurity Fundamentals

👨‍💻 Author

Parthan VA

M.Tech Information Security
College of Engineering Trivandrum (CET)


📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Python-based spam message classifier using TF-IDF vectorization, Naive Bayes, and Tkinter for real-time email and SMS spam detection.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages