លំហសិក្សាកម្ពុជា
V1.0
Combining Naive Bayes & DistilBERT for Intelligent Spam Detection
1. Background & Objectives
1.1 Problem Statement
Global electronic communication continues to expand rapidly, with an estimated 392 billion emails sent daily worldwide, approximately 49% of which are flagged as spam. Email and SMS serve as critical everyday communication channels; however, the proliferation of spam, phishing attacks, financial scams, and embedded malicious links creates severe security vulnerabilities. Manual identification is unscalable and inefficient, necessitating automated Machine Learning (ML) and Natural Language Processing (NLP) solutions capable of keeping pace with continuously evolving threats.
1.2 Research Objectives
The primary objective of this project is to construct a scalable framework to classify text messages as either Spam or Ham (legitimate). The specific goals include:
1.3 Key Research Questions
2. Dataset & Model Architecture
2.1 Dataset Overview
The project utilizes the SMS Spam Collection dataset sourced from the UCI Machine Learning Repository and Kaggle, containing approximately 5,572 binary-labeled text messages (Spam vs. Ham). The data processing pipeline involves removing duplicate entries followed by an 80/20 stratified train/test split to preserve the natural label imbalance ($\sim13\%$ spam ratio).
2.2 Model Selection
3. Architecture & Operational Workflow
3.1 Tiered Hybrid Architecture
The proposed system implements a two-tier decision cascade to optimize both throughput and accuracy:
+---------------------+
| Input Message |
+----------+----------+
|
v
+---------------------+
| Text Preprocessing |
+----------+----------+
|
v
+---------------------+
| TIER 1: Naive Bayes |
+----------+----------+
|
/------------+------------\
/ \
[Clear Prediction] [Borderline / Ambiguous]
| |
v v
+-----------------------+ +-----------------------+
| Final Decision: | | TIER 2: DistilBERT |
| Spam / Ham | | Contextual Audit |
+-----------------------+ +-----------+-----------+
|
v
+-----------------------+
| Final Decision: |
| Spam / Ham |
+-----------------------+
3.2 End-to-End Workflow Pipeline
The development lifecycle consists of nine sequential phases:
4. Results & Explainability
4.1 Benchmark Performance Metrics
The models were evaluated across key performance metrics on the test dataset:
Metric | Naive Bayes | DistilBERT |
Accuracy | $\sim97\%$ | $\sim99\%$ |
Precision | $\sim95\%$ | $\sim98\%$ |
Recall | $\sim93\%$ | $\sim98\%$ |
F1-Score | $\sim94\%$ | $\sim98\%$ |
Latency | $< 1\text{ ms/sample}$ | $\sim15\text{--}30\text{ ms/sample}$ |
4.2 Model Explainability & Interpretability
5. Conclusion & Future Work
5.1 Summary
The hybrid framework effectively harmonizes the operational speed of Naive Bayes with the semantic intelligence of DistilBERT. This dual-tier methodology maximizes efficiency while guaranteeing contextual accuracy for sophisticated security threats.
5.2 Technical Constraints & Future Roadmaps
មតិយោបល់ 0