With the advent of digital communications, SMS spam has also become a widespread issue, which is inconvenient and even threatening to users. In this project, we advocate a hybrid spam detection model combining Convolutional Neural Networks (CNN), Long Short-Term Memory (LSTM) networks and TF-IDF, and efficiently leverages deep learning and text-processing methods to identify spam messages.We train our model using the publicly available UCI SMS spam dataset. The interface gives an easy and convenient means of classifying SMS messages. Upon providing a message for classification, the model processes the message very quickly and provides a real-time classification resultas either spam or ham.This project introduces a solution for SMS security through a useful spam detection systemwith excellent user experience. Following the integration of deep learning and conventional text-processing methods, our model has high accuracy and flexibility in spam detection. With this system implemented, we can mitigate risks from spam and ensure digital communication is safer and more reliable.
Introduction
Background & Motivation
As mobile communications grow, SMS spam becomes a significant concern, both for security and user experience. Traditional filtering techniques like keyword matching, rule-based systems, and basic machine learning models (e.g., Naive Bayes, SVM) struggle with context understanding and evasion techniques (e.g., word obfuscation).
Proposed Solution
This paper proposes a hybrid deep learning model combining CNN and LSTM with TF-IDF feature extraction to improve spam detection by:
Automatically learning and extracting relevant features.
Capturing both local patterns (via CNN) and long-term dependencies (via LSTM).
Enhancing robustness against evasion and context-aware spam.
Assigns higher weights to rare but meaningful words.
Enhances discrimination between spam and ham messages.
3. Hybrid Deep Learning Model
Text Tokenization & Padding: Prepares sequences for model input.
Embedding Layer: Maps words to dense vectors.
CNN Layer: Extracts local textual features.
LSTM Layer: Learns sequential dependencies for context understanding.
Dense Layers: Performs binary classification using ReLU and sigmoid activations.
4. Training & Optimization
Train-Test Split: 80-20%
Optimizer: Adam
Loss Function: Binary cross-entropy
Epochs: 5 | Batch Size: 64
Model Serialization: Enables future deployment.
Performance Evaluation
Metrics Used
Accuracy: Overall correct predictions.
Precision: Correct spam predictions out of all predicted spams.
Recall: Correctly identified spam out of all actual spam.
F1-Score: Balance between precision and recall.
Confusion Matrix: Class-wise breakdown of predictions.
Literature Review Insights
Early works using classical ML (Decision Trees, Naive Bayes, SVM) require extensive manual feature engineering.
Deep learning methods like CNN, LSTM, and their hybrids outperform traditional models.
Studies highlight the importance of TF-IDF, word embeddings, and content-based filtering.
Regional variations and linguistic diversity (e.g., in India) call for localized datasets.
Conclusion
This work proposes a hybrid deep learning model, which contains Convolutional Neural Networks (CNN), Long Short-Term Memory (LSTM) networks, and Term Frequency-Inverse Document Frequency (TF-IDF) for SMS spam detection. The CNN is responsible for the extraction of spatial features while the LSTM is in charge of the sequential relation-ships extraction. In doing so it manages to learn about the patterns in the spam messages.
Experimental results demonstrate the model’s high accuracy of 98.36%, with strong precision (96.37%) and recall (91.72%), confirming its reliability in detecting spam messages. The confusion matrix analysis shows minimal misclassifications, indicating the system’s robustness. Given its efficiency and adaptability, this approach can be deployed in real-time SMS filtering applications to enhance mobile security.
References
[1] S. Menthe, K. Rawal, M. Hirave, and A. J. Patil, \"SMS Spam Detection Using Machine Learning,\"International Journal of Advanced Research in Computer and Communication Engineering, vol. 13, no. 3, Mar. 2024.
https://www.researchgate.net/publication/379058545_SMS_SPAM_DETECTION_USING_MACHINE_LEARNING
[2] S. Gadde, A. Lakshmanarao, and S. Satyanarayana, \"SMS Spam Detection using Machine Learning and Deep Learning Techniques,\"7th International Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore, India, 2021.https://ieeexplore.ieee.org/document/9441783
[3] A. L. Gawade, S. S. Shinde, S. G. Sawant, R. S. Chougule, and A. A. Mahaldar, \"A Research Paper of SMS Spam Detection,\"International Journal of Novel Research and Development, vol. 9, no. 3, Mar. 2024. https://www.ijnrd.org/papers/IJNRD2403165.pdf
[4] J. M. Gomez Hidalgo, G. C. Bringas, E. P. Sanz, and F. C. García, \"Content-Based SMS Spam Filtering,\" in Proceedings of the 2006 ACM Symposium on Document Engineering, Amsterdam, The Netherlands, Oct. 2006. https://www.researchgate.net/publication/221353070_Content_based_SMS_spam_filtering
[5] R. G. de Luna et al., \"A Machine Learning Approach for Efficient Spam Detection in Short Messaging System (SMS),\" TENCON 2023 - 2023 IEEE Region 10 Conference (TENCON), Chiang Mai, Thailand, Oct. 2023.https://ieeexplore.ieee.org/document/10322491
[6] Sakshi Agarwal, Sanmeet Kaur, Sunita Garhwal, \"SMS spam detection for Indian messages\" ,2015 1st International Conference on Next Generation Computing Technologies (NGCT), Dehradun, India, Sept. 2015.https://ieeexplore.ieee.org/document/7375198