Case study / 06
Machine Learning-Based Email Threat Detection and Classification System | 2025
Classifies email text into harmful, malicious, phishing, solicited, and spam categories using TF-IDF features and supervised learning. The notebook compares Naive Bayes, LinearSVC, and logistic regression, with a Django application providing a text-classification interface.
01 / Context & purpose
The project in detail
Email threat classification turns unstructured messages into categories that can support triage. This project uses text preprocessing and TF-IDF features to compare supervised classifiers across harmful, malicious, phishing, solicited, and spam labels.
The repository includes experimental notebooks and a Django application for text classification. The saved experiment reports a perfect score on its own test split; that result is presented with its experimental context rather than treated as evidence of production security effectiveness.
02 / Engineering perspective
How the project works
Prepare labeled messages and normalize textual features for the classification pipeline.
Use cross-validation and parameter searches to compare Naive Bayes, LinearSVC, and logistic regression.
Inspect held-out classification reports and confusion matrices, then expose classification through a web interface.
03 / Engineering perspective
Results & Outcomes
The saved notebook reports 100% test accuracy for all three compared classifiers on its 2,080-example test split.
The displayed Naive Bayes confusion matrix covers all five categories. This is a saved experimental result, not an independently validated production detection rate.
04 / Engineering perspective
Why this project matters
Demonstrates an end-to-end path from text features and model selection to an accessible application.
Makes category-specific errors visible, which is more informative for triage than aggregate accuracy alone.
Provides a baseline for studying the distinction between ordinary unwanted content and potentially threatening messages.
05 / Potential next steps
Advancing AI & Future Directions
Research opportunities and proposed extensions, rather than completed achievements.
Evaluate deduplicated, source-disjoint, and time-separated data to check for leakage and distribution shift.
Study precision-recall trade-offs, calibration, and human review for uncertain or high-impact decisions.
Compare transformer representations with the TF-IDF baseline on independently collected messages before claiming operational gains.
