Skip to main content

Implementation and Evaluation of a Deep Neural Network for Spam Detection: An Empirical Study of Accuracy and Efficiency

  • Conference paper
  • First Online:
Advanced Technologies, Systems, and Applications VIII (IAT 2023)

Abstract

The problem of spam emails is a widespread issue that creates a lot of inconvenience for individuals and organizations. According to statistics, approximately 84% of emails received on a daily basis are recognized as spam. This paper aims to present a solution to this problem by proposing the use of a neural network capable of identifying and classifying potential spam emails. The neural network was developed using Python, TensorFlow, Keras, Google Colaboratory, and Jupyter. These tools were chosen because they are widely used and well-suited for the task of creating a deep learning model. The results of the network were found to be satisfactory, with an accuracy rate of approximately 99%. This is comparable to the results achieved by large companies such as Google and Yahoo! who are known to use similar methods to combat spam. Overall, this paper demonstrates that neural networks can be a powerful tool for addressing the problem of spam emails and that the proposed solution has the potential to improve the efficiency and effectiveness of spam filtering for individuals and organizations.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. A Complete Guide to LSTM Architecture and its Use in Text Classification. https://analyticsindiamag.com/a-complete-guide-to-lstm-architecture-and-its-use-in-text-classification/. Accessed 20 Oct 2022

  2. Abraham, A.: Artificial Neural Networks, vol. 17 (2005)

    Google Scholar 

  3. Activation Functions in Neural Networks. https://towardsdatascience.com/activation-functions-neural-networks-1cbd9f8d91d6. Accessed 8 Dec 2022

  4. Average daily spam volume worldwide from October 2020 to September 2021. https://www.statista.com/statistics/1270424/daily-spam-volume-global/. Accessed 16 Oct 2022

  5. Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473 (2014)

  6. Butt, U.A., Amin, R., Aldabbas, H., Mohan, S., Alouffi, B., Ahmadian, A.: Cloud-based email phishing attack using machine and deep learning algorithm. Complex Intell. Syst., 1–28 (2022)

    Google Scholar 

  7. Dada, E.G., Bassi, J.S., Chiroma, H., Abdulhamid, S.M., Adetunmbi, A.O., Ajibuwa, O.E.: Machine learning for email spam filtering: review, approaches and open research problems. Heliyon 5(6), e01802 (2019). https://doi.org/10.1016/j.heliyon.2019.e01802. https://www.sciencedirect.com/science/article/pii/S2405844018353404

  8. Devi, K.K., Kumar, G.: Stochastic gradient boosting model for twitter spam detection. Comput. Syst. Sci. Eng. 41(2), 849–859 (2022)

    Article  Google Scholar 

  9. Dietterich, T.: Overfitting and undercomputing in machine learning. ACM Comput. Surv. 27(3), 326–327 (1995). https://doi.org/10.1145/212094.212114

  10. Email Length Best Practices for Email Marketers and Email Newbies. https://www.campaignmonitor.com/blog/email-marketing/email-length-best-practices-for-email-marketers-and-email-newbies/. Accessed 28 Oct 2022

  11. Gmail Spam Filter: When It Is Not Enough to Stop Spam. https://clean.email/gmail-spam-filter. Accessed 18 Oct 2022

  12. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735–1780 (1997)

    Article  Google Scholar 

  13. How to Choose an Activation Function for Deep Learning. https://machinelearningmastery.com/choose-an-activation-function-for-deep-learning/. Accessed 19 Nov 2022

  14. Hrinchuk, O., Khrulkov, V., Mirvakhabova, L., Orlova, E., Oseledets, I.: Tensorized embedding layers. In: Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 4847–4860 (2020)

    Google Scholar 

  15. Kingma, D.P., Ba, J.: Adam: a method for stochastic optimization (2014). https://doi.org/10.48550/ARXIV.1412.6980. https://arxiv.org/abs/1412.6980

  16. Mohamed, I.S.: Detection and tracking of pallets using a laser rangefinder and machine learning techniques. Ph.D. thesis, European Master on Advanced Robotics+(EMARO+), University of Genova, Italy (2017)

    Google Scholar 

  17. Saidani, N., Adi, K., Allili, M.S.: A semantic-based classification approach for an enhanced spam detection. Comput. Secur. 94, 101716 (2020)

    Article  Google Scholar 

  18. Spam or Ham: Convolutional Neural Networks for SMS Classification. https://www.linkedin.com/pulse/spam-ham-convolutional-neural-networks-sms-maggie-lavery/. Accessed 12 Nov 2022

  19. Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., Salakhutdinov, R.: Dropout: a simple way to prevent neural networks from overfitting. J. Mach. Learn. Res. 15(1), 1929–1958 (2014)

    MathSciNet  MATH  Google Scholar 

  20. Tensorflow. https://www.tensorflow.org/api_docs/python/tf/keras/layers/LSTM. Accessed 16 Oct 2022

  21. The Spam Assassin Email Classification Dataset. https://www.kaggle.com/datasets/ganiyuolalekan/spam-assassin-email-classification-dataset. Accessed 05 Nov 2022

  22. Understanding embedding layer in Keras. https://medium.com/analytics-vidhya/understanding-embedding-layer-in-keras-bbe3ff1327ce. Accessed 10 Oct 2022

  23. Understanding LSTM Networks. https://colah.github.io/posts/2015-08-Understanding-LSTMs/. Accessed 25 Oct 2022

  24. Yacim, J., Boshoff, D.: Impact of artificial neural networks training algorithms on accurate prediction of property values. J. Real Estate Res. 40, 375–418 (2018). https://doi.org/10.1080/10835547.2018.12091505

  25. Zhang, Z.: Improved Adam optimizer for deep neural networks. In: 2018 IEEE/ACM 26th International Symposium on Quality of Service (IWQoS), pp. 1–2. IEEE (2018)

    Google Scholar 

  26. Zhao, C., Xin, Y., Li, X., Zhu, H., Yang, Y., Chen, Y.: An attention-based graph neural network for spam bot detection in social networks. Appl. Sci. 10(22), 8160 (2020)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Časlav Livada .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Varga, L., Livada, Č., Baumgartner, A., Šojo, R. (2023). Implementation and Evaluation of a Deep Neural Network for Spam Detection: An Empirical Study of Accuracy and Efficiency. In: Ademović, N., Kevrić, J., Akšamija, Z. (eds) Advanced Technologies, Systems, and Applications VIII. IAT 2023. Lecture Notes in Networks and Systems, vol 644. Springer, Cham. https://doi.org/10.1007/978-3-031-43056-5_28

Download citation

Publish with us

Policies and ethics