Context-Aware Spam Detection Using BERT Embeddings with Multi-Window CNNsOA
Spam emails remain one of the most persistent threats to digital communication,necessitating effective detection solutions that safeguard both individuals and organisations.We propose a spam email classification frame-work that uses Bidirectional Encoder Representations from Transformers(BERT)for contextual feature extraction and a multiple-window Convolutional Neural Network(CNN)for classification.To identify semantic nuances in email content,BERT embeddings are used,and CNN filters extract discriminative n-gram patterns at various levels of detail,enabling accurate spam identification.The proposed model outperformed Word2Vec-based baselines on a sample of 5728 labelled emails,achieving an accuracy of 98.69%,AUC of 0.9981,F1 Score of 0.9724,and MCC of 0.9639.With a medium kernel size of(6,9)and compact multi-window CNN architectures,it improves performance.Cross-validation illustrates stability and generalization across folds.By balancing high recall with minimal false positives,our method provides a reliable and scalable solution for current spam detection in advanced deep learning.By combining contextual embedding and a neural architecture,this study develops a security analysis method.
Sajid Ali;Qazi Mazhar Ul Haq;Ala Saleh Alluhaidan;Muhammad Shahid Anwar;Sadique Ahmad;Leila Jamel
Department of Computer Science and Engineering,Yuan Ze University,Zhongli,TaiwanDepartment of Computer Science and Engineering,Yuan Ze University,Zhongli,Taiwan Department of International Bachelor Program in Informatics,Yuan Ze University,Zhongli,TaiwanDepartment of Information Systems,College of Computer and Information Sciences,Princess Nourah bint Abdulrahman University,P.O.Box 84428,Riyadh,Saudi ArabiaIRC for Finance and Digital Economy,King Fahd University of Petroleum and Minerals,Dhahran,Saudi ArabiaEIAS Data Science&Blockchain Laboratory,College of Computer and Information Science,Prince Sultan University,Riyadh,Saudi ArabiaDepartment of Information Systems,College of Computer and Information Sciences,Princess Nourah bint Abdulrahman University,P.O.Box 84428,Riyadh,Saudi Arabia
信息技术与安全科学
E-mail spam detectionBERT embeddingtext classificationcybersecurityCNN
《Computer Modeling in Engineering & Sciences》 2026 (1)
P.1296-1310,15
funded by Princess Nourah bint Abdulrahman University Researchers Supporting Project number(PNURSP2026R234)Princess Nourah bint Abdulrahman University,Riyadh,Saudi Arabia.
评论