Skip to content

sivapriyanka-dev/SpamShield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SpamShield – AI-Powered SMS Spam Detection

Python Django React Tailwind CSS Scikit-Learn NLP Model Accuracy Deployment

Project Overview

SpamShield is a full-stack AI-powered web application that detects whether an SMS message is Spam or Ham (Safe) using Natural Language Processing and Machine Learning.

The project began as an NLP classification model and was later transformed into a production-ready full-stack web application with a modern responsive user interface.

Users can paste suspicious SMS messages and instantly receive spam detection predictions through a live deployed web application.


Live Demo

πŸš€ https://sms-spam-detector-kzfg.onrender.com


Features

  • AI-powered SMS spam detection
  • Real-time message classification
  • NLP text preprocessing pipeline
  • TF-IDF vectorization
  • Multinomial Naive Bayes classification
  • REST API backend using Django REST Framework
  • Modern responsive frontend built with React
  • Beautiful UI designed using Tailwind CSS + Stitch-inspired design
  • Full-stack deployment on Render
  • Production-ready frontend/backend integration

Tech Stack

Frontend

  • React.js
  • Axios
  • Tailwind CSS
  • Lucide React Icons
  • Vite

Backend

  • Python
  • Django
  • Django REST Framework
  • django-cors-headers

Machine Learning / NLP

  • Pandas
  • NumPy
  • NLTK
  • Scikit-learn
  • TF-IDF Vectorizer
  • Multinomial Naive Bayes

Deployment

  • Render

Dataset

SMS Spam Collection Dataset

Dataset contains:

  • 5,572 SMS messages
  • Real-world spam/ham labeled messages
  • Binary classification dataset

NLP Pipeline

SMS Message Input
β†’ Lowercase Conversion
β†’ Remove Numbers
β†’ Remove Punctuation
β†’ Stopword Removal
β†’ TF-IDF Vectorization
β†’ Multinomial Naive Bayes Prediction
β†’ Spam / Ham Output


Model Performance

Accuracy: 97.13%

Model used:

Multinomial Naive Bayes


UI Preview

Web Application Interface

image image

Results

image image

Example Predictions

Spam

Congratulations! You won a free iPhone. Click now!

Result:

🚨 Spam

Ham

Hey, where are you? Call me when you're free.

Result:

βœ… Ham

Project Structure

spamshield/
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ predictor/
β”‚   β”œβ”€β”€ model.pkl
β”‚   β”œβ”€β”€ vectorizer.pkl
β”‚   β”œβ”€β”€ requirements.txt
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ package.json
β”‚
β”œβ”€β”€ spam_classifier.py
β”œβ”€β”€ README.md

Run Locally

Backend Setup

cd backend
pip install -r requirements.txt
python manage.py runserver

Backend runs at:

http://127.0.0.1:8000

Frontend Setup

cd frontend
npm install
npm run dev

Frontend runs at:

http://localhost:5173

Production Deployment

Frontend + Backend deployed on Render

Deployment includes:

  • React frontend build using Vite
  • Django backend hosting
  • Static asset serving
  • ML model pickle loading
  • API integration
  • Production build automation

Future Improvements

  • Email spam detection
  • URL phishing detection
  • User authentication
  • Spam history dashboard
  • Dark mode UI
  • Mobile-first PWA version
  • Confidence score display

Author

Siva Priyanka

GitHub: https://github.com/sivapriyanka-dev

Passionate about Machine Learning, NLP, full-stack development, and building real-world AI applications πŸš€