Skip to content

Latest commit

ย 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ SpamShield AI

Python Streamlit Scikit-Learn SQLite Version License

AI-Powered SMS Spam Detection using Machine Learning & NLP

Detect spam messages with confidence scores, AI explanations, keyword detection, prediction history, and interactive analytics.


๐Ÿ“– Project Overview

SpamShield AI is a Machine Learning web application that classifies SMS messages as Spam or Ham using Natural Language Processing (NLP).

The project combines TF-IDF Vectorization, a Linear Support Vector Machine (Linear SVM) classifier, and an interactive Streamlit interface to deliver fast and reliable spam detection.

In addition to prediction, the application provides:

  • AI-powered explanations
  • Spam & Ham confidence scores
  • Risk level analysis
  • Suspicious keyword detection
  • Prediction history
  • Interactive statistics dashboard

โœจ Features

๐Ÿค– Machine Learning

  • Linear SVM Classifier
  • TF-IDF Vectorization
  • NLP Text Processing
  • Fast Prediction Engine

๐Ÿ›ก๏ธ Spam Analysis

  • Spam Probability
  • Ham Probability
  • Confidence Score
  • Risk Level
  • AI Explanation
  • Keyword Detection

๐Ÿ“Š Dashboard

  • Prediction History
  • Search & Sort
  • Download History
  • Statistics Dashboard
  • Daily Prediction Trends

๐Ÿ’พ Database

  • SQLite Integration
  • Automatic Prediction Storage

๐Ÿ“ธ Application Screenshots

๐Ÿ  Home

Home


๐Ÿšจ Spam Prediction

Spam


๐Ÿ“œ Prediction History

History

๐Ÿ“Š Statistics Dashboard

Statistics


๐Ÿง  About Model

About Model

๐Ÿ‘จโ€๐Ÿ’ป About Developer

Developer

๐Ÿง  Machine Learning Pipeline

SMS Message
      โ”‚
      โ–ผ
Text Preprocessing
      โ”‚
      โ–ผ
TF-IDF Vectorizer
      โ”‚
      โ–ผ
Linear SVM Model
      โ”‚
      โ–ผ
Spam / Ham Prediction
      โ”‚
      โ–ผ
AI Explanation
      โ”‚
      โ–ผ
SQLite Database
      โ”‚
      โ–ผ
Statistics Dashboard

๐Ÿ“‚ Project Structure

SpamShield-AI/
โ”‚
โ”œโ”€โ”€ screenshots/
โ”œโ”€โ”€ assets/
โ”œโ”€โ”€ data/
โ”œโ”€โ”€ database/
โ”œโ”€โ”€ models/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ predict.py
โ”‚   โ”œโ”€โ”€ preprocess.py
โ”‚   โ”œโ”€โ”€ history.py
โ”‚   โ”œโ”€โ”€ database.py
โ”‚   โ”œโ”€โ”€ highlight.py
โ”‚   โ”œโ”€โ”€ explain.py
โ”‚   โ”œโ”€โ”€ keywords.py
โ”‚   โ”œโ”€โ”€ train.py
โ”‚   โ””โ”€โ”€ evaluate.py
โ”‚
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

๐Ÿ› ๏ธ Technologies Used

Category Technology
Language Python
Machine Learning Scikit-learn
NLP TF-IDF
Framework Streamlit
Database SQLite
Data Analysis Pandas
Visualization Plotly
Model Storage Joblib

โš™๏ธ Installation

Clone the repository:

git clone https://github.com/YOUR_GITHUB_USERNAME/SpamShield-AI.git

Navigate to the project folder:

cd SpamShield-AI

Create a virtual environment:

python -m venv .venv

Activate the environment:

Windows (CMD)

.venv\Scripts\activate

Install dependencies:

pip install -r requirements.txt

โ–ถ๏ธ Running the Application

Start the Streamlit application:

streamlit run app.py

Open your browser and visit:

http://localhost:8501

๐Ÿš€ Usage

  1. Launch the application.
  2. Enter an SMS message.
  3. Click Predict Message.
  4. View:
    • Spam/Ham prediction
    • Confidence score
    • Risk level
    • AI explanation
    • Suspicious keywords
  5. Browse previous predictions in Prediction History.
  6. Analyze trends in the Statistics Dashboard.

๐Ÿ“Š Model Information

Item Value
Algorithm Linear Support Vector Machine
Feature Extraction TF-IDF
Dataset SMS Spam Collection Dataset
Prediction Spam / Ham
Storage SQLite Database

--

๐Ÿ“ˆ Application Modules

Module Description
๐Ÿ  Home Predict Spam or Ham messages
๐Ÿ“œ Prediction History View and search previous predictions
๐Ÿ“Š Statistics Visualize prediction analytics
๐Ÿง  About Model ML model information
๐Ÿ‘จโ€๐Ÿ’ป About Developer Project and developer details

๐Ÿ”ฎ Future Scope

Planned improvements for future versions include:

  • ๐Ÿ“ฑ Android Application
  • ๐Ÿ“ฉ Live SMS Detection
  • ๐Ÿ” Sender Verification
  • ๐Ÿค– Improved Machine Learning Model
  • ๐ŸŒ Multi-language Support
  • โ˜๏ธ Cloud Deployment
  • ๐Ÿ”„ Continuous Model Retraining

๐Ÿ‘จโ€๐Ÿ’ป About the Developer

SpamShield AI was developed as an end-to-end Machine Learning project to demonstrate practical skills in:

  • Machine Learning
  • Natural Language Processing
  • Data Analytics
  • Streamlit Development
  • SQLite Database Integration
  • Interactive Dashboard Design

This project showcases the complete ML lifecycle, from data preprocessing and model training to deployment as an interactive web application.

๐Ÿ“š Learning Outcomes

This project demonstrates:

  • Data Preparation
  • Feature Engineering
  • Machine Learning Model Development
  • Model Evaluation
  • Explainable AI
  • Database Management
  • Data Visualization
  • Interactive Application Development

๐Ÿค Acknowledgements

This project uses the following open-source technologies:

  • Python
  • Streamlit
  • Scikit-learn
  • Pandas
  • NumPy
  • Plotly
  • SQLite

Dataset:

  • SMS Spam Collection Dataset

Special thanks to the open-source community for providing the tools and resources that made this project possible.

๐Ÿ“œ License

This project is licensed under the MIT License.

You are free to:

  • Use
  • Modify
  • Learn from
  • Share

Please provide appropriate attribution if you redistribute this project.

โญ Support

If you found this project useful:

  • โญ Star this repository
  • ๐Ÿด Fork the repository
  • ๐Ÿ› Report issues
  • ๐Ÿ’ก Suggest new features

Your feedback and contributions are always welcome.

๐Ÿ“ฌ Contact

For questions or suggestions, feel free to open an issue in this repository.

๐Ÿ›ก๏ธ SpamShield AI v1.0

AI-Powered SMS Spam Detection System

Built with โค๏ธ using Python โ€ข Streamlit โ€ข Scikit-learn โ€ข SQLite

About

AI-Powered SMS Spam Detection System using Machine Learning, NLP, Streamlit, and SQLite.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages