Client
Self-initiated
Year
2026
Role
AI Engineer · Full Stack
Stack
Python · DistilBERT · Flask · Hugging Face · PyTorch
Status
Live on HF Spaces
Context
Spam evolves. Detection must too.
Email spam is more than an annoyance—it’s a gateway for phishing, fraud, and security breaches. Traditional rule-based filters fall short against evolving language patterns. SpamShield brings Transformer-based NLP to email security, fine-tuning DistilBERT on 190,000+ emails for deep contextual understanding.
The Vision
Accurate, transparent, instant.
Two rules shaped the build. One: predictions must be explainable, not just a flag. Two: speed cannot be sacrificed for accuracy. DistilBERT gives Transformer-grade inference on standard CPUs, making it accessible without specialized hardware.
The Product
Paste. Detect. Trust.
A single-page dashboard where users paste email text and get instant spam/ham classification with confidence metrics. A scan log tracks session history, and the model analyzes up to 2,500 characters per email to catch subtle linguistic patterns.
Architecture
Architecture.
Frontend
Midnight Boutique UI with holographic effects and staggered animations.
Backend
Flask server handling inference, session logging, and model serving with GPU auto-detection.
Model
Fine-tuned on 190k spam/ham emails with optimized sampling for efficient training.
Runtime
Deployed on Hugging Face Spaces with automatic GPU acceleration when available.
Outcome
In numbers.
Challenge
Transformer inference on a CPU budget.
BERT models are powerful but typically need a GPU for real-time inference. DistilBERT solved this — retaining 97% of BERT’s language understanding while running 60% faster on CPU. The challenge was optimizing the sampling strategy during fine-tuning so the dataset trained efficiently on consumer hardware.
Performance
Performance
DistilBERT
Base Model
190K emails
Training Data
2,500 chars
Context Window
CPU-ready
Inference
Dataset
Dataset
190k emails (Spam/Ham)
Classes
2 (Spam / Ham)
Sample Strategy
Optimized subset
GPU Auto-Detect
Yes
My Contribution
End-to-end pipeline: DistilBERT fine-tuning with optimized sampling, Flask web application, session logging system, and Hugging Face Spaces deployment.
Next case