Email Spam Detection Using LSTM with Attention Mechanism

Abstract: Spam email detection is an important domain of cybersecurity because spam emails usually contain phishing URLs, malicious attachments, or fraudulent advertising content. These emails not only interfere with communication but also lead to major threats like data robbery, money loss, and system compromise. The conventional rule-based spam filters have been ineffective in dealing with these issues as they lack high adaptability in handling changing spam tactics. In this research, we propose a deep learning-based solution for spam filtering with an LSTM network with an attention mechanism. The model is formulated to efficiently capture sequential and contextual information from email content through highlighting key words—like "urgent," "free," or "win"—that frequently occur in spam mail. A conventional dataset of pre-labelled spam and non-spam (ham) emails was utilized for training and testing. To preprocess the data, preliminary steps like tokenization, padding, and vectorization were involved. The architecture of the model involves an embedding layer, a temporal dependency-learning LSTM layer, and a dedicated attention layer for identifying contextually important words. The ultimate classification output is obtained via a fully connected layer with a sigmoid activation function. Experimental outcomes show that the attention mechanism LSTM greatly surpasses standard Algorithms utilizing machine learning on accuracy, precision, recall, and F1-score. The model also enables real-time classification, enabling users to provide emails and receive instant predictions. This paper establishes the merits of using LSTM in conjunction with attention mechanisms for resilient and adaptive detection of spam email, and paves the way for future improvement with transformer models or multilingual data. Keywords Spam detection, Email Spam Filtering, LSTM with Attention, Machine Learning, Email Classification, Cybersecurity.

Authors

Publication Details

Journal
INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT
Published
2025-04-29
DOI
https://doi.org/10.55041/ijsrem46407
Citations
1
Primary Topic
Spam and Phishing Detection
Type
article
Field-Weighted Citation Impact
3.25
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Email Spam Detection Using LSTM with Attention Mechanism

A. Mallikarjuna Reddy
1 citations
INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT
Spam and Phishing Detection
3.25
article

Email Spam Detection Using LSTM with Attention Mechanism

A. Mallikarjuna Reddy
article en
1 citations

Abstract

Abstract: Spam email detection is an important domain of cybersecurity because spam emails usually contain phishing URLs, malicious attachments, or fraudulent advertising content. These emails not only interfere with communication but also lead to major threats like data robbery, money loss, and system compromise. The conventional rule-based spam filters have been ineffective in dealing with these issues as they lack high adaptability in handling changing spam tactics. In this research, we propose a deep learning-based solution for spam filtering with an LSTM network with an attention mechanism. The model is formulated to efficiently capture sequential and contextual information from email content through highlighting key words—like "urgent," "free," or "win"—that frequently occur in spam mail. A conventional dataset of pre-labelled spam and non-spam (ham) emails was utilized for training and testing. To preprocess the data, preliminary steps like tokenization, padding, and vectorization were involved. The architecture of the model involves an embedding layer, a temporal dependency-learning LSTM layer, and a dedicated attention layer for identifying contextually important words. The ultimate classification output is obtained via a fully connected layer with a sigmoid activation function. Experimental outcomes show that the attention mechanism LSTM greatly surpasses standard Algorithms utilizing machine learning on accuracy, precision, recall, and F1-score. The model also enables real-time classification, enabling users to provide emails and receive instant predictions. This paper establishes the merits of using LSTM in conjunction with attention mechanisms for resilient and adaptive detection of spam email, and paves the way for future improvement with transformer models or multilingual data. Keywords Spam detection, Email Spam Filtering, LSTM with Attention, Machine Learning, Email Classification, Cybersecurity.

INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENTVol. 09(04)
Openalex Percentile: Top 9%
Spam and Phishing Detection
3.25
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.