A BERT-Enhanced Framework for Semantic-Aware Phishing Email Detection and Real-Time Analysis
A BERT-Enhanced Framework for Semantic-Aware Phishing Email Detection and Real-Time Analysis
Piya Mondal,Sudakshina Mandal,2 Authors,Sabari Kumar
Abstract
The problem of phishing emails is still one of the most serious cyber threats. It calls for smarter and more reliable detection mechanisms. This paper proposes a deep learning-based approach using Bidirectional Encoder Representations from Transformers for improving the understanding of contextual information within email text. The paper first constructs and preprocesses a phishing e-mail dataset, showing in detail the process of data cleaning and how to address class imbalance. In an attempt to establish a baseline, several traditional machine learning models, namely Logistic Regression, KNN, SVM, Random Forest and XGBoost were evaluated using TF-IDF features. Among these models, Logistic Regression and SVM achieved full precision, while Random Forest attained the maximum accuracy of 99.56%. Despite this strong performance, it is observed that TF-IDF cannot capture deeper semantic patterns which motivated shifting towards a transformer-based model. The BERT model demonstrated superior language understanding and achieved 99.47% accuracy and a precision score of 0.989. It was useful in practical real-time phishing e-mail detection to prepare the trained BERT model integrated into a RESTful API implemented in Flask and connected with a user-friendly web-based interface for live analysis of e-mails. Results show that though traditional models are effective, BERT’s contextual capabilities make it a more suitable choice for practical phishing email detection.
