Detect spam messages with confidence scores, AI explanations, keyword detection, prediction history, and interactive analytics.
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
- Linear SVM Classifier
- TF-IDF Vectorization
- NLP Text Processing
- Fast Prediction Engine
- Spam Probability
- Ham Probability
- Confidence Score
- Risk Level
- AI Explanation
- Keyword Detection
- Prediction History
- Search & Sort
- Download History
- Statistics Dashboard
- Daily Prediction Trends
- SQLite Integration
- Automatic Prediction Storage
SMS Message
โ
โผ
Text Preprocessing
โ
โผ
TF-IDF Vectorizer
โ
โผ
Linear SVM Model
โ
โผ
Spam / Ham Prediction
โ
โผ
AI Explanation
โ
โผ
SQLite Database
โ
โผ
Statistics Dashboard
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
| Category | Technology |
|---|---|
| Language | Python |
| Machine Learning | Scikit-learn |
| NLP | TF-IDF |
| Framework | Streamlit |
| Database | SQLite |
| Data Analysis | Pandas |
| Visualization | Plotly |
| Model Storage | Joblib |
Clone the repository:
git clone https://github.com/YOUR_GITHUB_USERNAME/SpamShield-AI.gitNavigate to the project folder:
cd SpamShield-AICreate a virtual environment:
python -m venv .venvActivate the environment:
Windows (CMD)
.venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtStart the Streamlit application:
streamlit run app.pyOpen your browser and visit:
http://localhost:8501
- Launch the application.
- Enter an SMS message.
- Click Predict Message.
- View:
- Spam/Ham prediction
- Confidence score
- Risk level
- AI explanation
- Suspicious keywords
- Browse previous predictions in Prediction History.
- Analyze trends in the Statistics Dashboard.
| Item | Value |
|---|---|
| Algorithm | Linear Support Vector Machine |
| Feature Extraction | TF-IDF |
| Dataset | SMS Spam Collection Dataset |
| Prediction | Spam / Ham |
| Storage | SQLite Database |
--
| 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 |
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
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.
This project demonstrates:
- Data Preparation
- Feature Engineering
- Machine Learning Model Development
- Model Evaluation
- Explainable AI
- Database Management
- Data Visualization
- Interactive Application Development
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.
This project is licensed under the MIT License.
You are free to:
- Use
- Modify
- Learn from
- Share
If you found this project useful:
- โญ Star this repository
- ๐ด Fork the repository
- ๐ Report issues
- ๐ก Suggest new features
AI-Powered SMS Spam Detection System
Built with โค๏ธ using Python โข Streamlit โข Scikit-learn โข SQLite





