Neural spam, scam & phishing detection — a premium cybersecurity SaaS demo built with Python, Streamlit, scikit-learn and NLP.
SpamShield AI classifies any message as Spam · Safe · Promotional · Scam · Advertisement, with confidence scoring, threat level, phishing probability, suspicious-keyword highlighting and cybersecurity recommendations — wrapped in a futuristic dark dashboard.
- 🧠 Real-time AI classification (TF-IDF + Multinomial Naive Bayes, with Logistic Regression comparison)
- 🔬 Full NLP pipeline — lowercase, punctuation strip, stopword removal, stemming, TF-IDF vectorization
- 📊 Analytics dashboard — category distribution, top suspicious keywords, detection timeline, model metrics
- 🚨 Threat-level system — Low · Medium · High · Critical
- 🔗 Phishing & URL heuristics — IP-address URLs, look-alike domains, shortened links
- 🔥 Dangerous keyword highlighter
- 🗂️ Detection history in session, with CSV / JSON export
- 🛡️ Cyber recommendations for every verdict
- 🎨 Premium dark UI — glassmorphism, neon gradients, animated metrics
SpamShieldAI/
├── app.py # Streamlit dashboard
├── train_model.py # TF-IDF + NB/LR training script
├── spam_classifier.py # Prediction API (returns rich JSON report)
├── requirements.txt
├── README.md
├── .streamlit/config.toml # Dark theme
├── model/
│ ├── model.pkl
│ ├── vectorizer.pkl
│ └── metrics.json
├── dataset/spam.csv # Seed dataset (550 rows)
├── utils/
│ ├── preprocessing.py # Clean / tokenize / stem / keyword & URL heuristics
│ ├── helpers.py # Threat-level, tips, safer alternatives
│ └── visualizations.py # Plotly charts
└── exported_reports/
raw message
▼
[Preprocessing] ── lowercase · strip punct · stopwords · stem · token-normalize
▼
[TF-IDF (1-2 grams, 5k features)]
▼
[Naive Bayes / Logistic Regression] ── best by F1
▼
[Threat scoring] ── phishing prob · URL heuristics · keyword flags
▼
JSON report ─→ Streamlit UI
git clone https://github.com/your-username/SpamShieldAI.git
cd SpamShieldAI
pip install -r requirements.txt
python train_model.py # builds model/model.pkl + vectorizer.pkl
streamlit run app.pyThe app opens at http://localhost:8501.
- Push this repo to GitHub.
- Go to share.streamlit.io → New app.
- Pick the repo, set
app.pyas the entrypoint.
- Create a new Space → SDK: Streamlit.
- Push this repo to the Space.
- New → Web Service, connect repo.
- Build:
pip install -r requirements.txt && python train_model.py - Start:
streamlit run app.py --server.port=$PORT --server.address=0.0.0.0
- Import repo.
.replitrun command:bash -c "pip install -r requirements.txt && python train_model.py && streamlit run app.py --server.port=8080 --server.address=0.0.0.0"
Python · Streamlit · scikit-learn · NLTK · pandas · NumPy · Plotly · pickle · fpdf2
- Transformer-based classifier (DistilBERT) alongside the NB baseline
- Multilingual detection (XLM-R)
- Voice input via
streamlit-mic-recorder - AI chatbot assistant for explaining verdicts
- Persistent storage (SQLite / Supabase)
- Browser extension / Gmail plug-in
Project Developed During:
Artificial Intelligence Internship
Organization: Codec Technologies Pvt. Ltd.
Duration: 1 Month Internship Program
Domain: Artificial Intelligence & Machine Learning
Ardhendu Sekhar Sahoo
Artificial Intelligence Intern
LinkedIn: https://www.linkedin.com/in/ardhendu-sahoo/
GitHub: https://github.com/Ardhendu-dot/SpamShield-AI
This project is intended for educational, learning, and research purposes.