Phishing Email Detection Using BERT and RoBERTa

Read full text
Authors: Mariam Ibrahim, Ruba Elhafiz
Cited by: 4
References: 31

Abstract

One of the most harmful and deceptive forms of cybercrime is phishing, which targets users with malicious emails and websites. In this paper, we focus on the use of natural language processing (NLP) techniques and transformer models for phishing email detection. The Nazario Phishing Corpus is preprocessed and blended with real emails from the Enron dataset to create a robustly balanced dataset. Urgency, deceptive phrasing, and structural anomalies were some of the neglected features and sociolinguistic traits of the text, which underwent tokenization, lemmatization, and noise filtration. We fine-tuned two transformer models, Bidirectional Encoder Representations from Transformers (BERT) and the Robustly Optimized BERT Pretraining Approach (RoBERTa), for binary classification. The models were evaluated on the standard metrics of accuracy, precision, recall, and F1-score. Given the context of phishing, emphasis was placed on recall to reduce the number of phishing attacks that went unnoticed. The results show that RoBERTa has more general performance and fewer false negatives than BERT and is therefore a better candidate for deployment on security-critical tasks.

Fields of Study & Subjects

Spam and Phishing Detection Cybercrime and Law Enforcement Studies Deception detection and forensic psychology

Publication details

Journal / source
Computation
Publisher
MDPI AG
Volume
14
Issue
2
Pages
46–46
Publication date
7 February 2026
Language
EN