Skip to main content

Detection of Cyberbullying on Social Media Platforms Using Machine Learning

  • Conference paper
  • First Online:
Advances in Computational Intelligence Systems (UKCI 2023)

Part of the book series: Advances in Intelligent Systems and Computing ((AISC,volume 1453))

Included in the following conference series:

  • 119 Accesses

Abstract

Cyberbullying is a prominent issue that affects many people within their lifetime. In this paper we explore the use of Machine Learning (ML) and Natural Language Processing (NLP) techniques to support automatic detection of cyberbullying. The paper discusses first the significance of cyberbullying and its relationship to cybersecurity. Then, in order to illustrate the automatic detection approach and its integration into a web application, we considered a benchmark dataset, the Offensive Language Identification Dataset (OLID). This is an annotated large-scale dataset with approximate 14,000 English tweets, that was used in various works for detecting offensive posts in social media, predicting their type and target. To solve the classification problems associated with OLID dataset, nine supervised models were developed for each task of the dataset. We used the TFIDF (Term Frequency Inverse Document Frequency) feature selection and GridSearchCV to find the optimum parameters for each of the ML algorithms. Evaluation metrics, such as build time, accuracy, precision, recall, and F1-score were used to compare the ML techniques. The Random Forest models achieved 82, 90, and 61% in accuracy for the tasks associated with the dataset, which were the best performing algorithms supported by the other metrics. The Random Forest models that achieved the best performance, were integrated within a Flask web application, publicly available. This serves as proof of concept, allowing users to test the classifier. The paper explains how a developed ML model can be integrated into a web application. Furthermore, one can develop an API for handling larger and more frequent data requests or integrate in a social media platform the classifier.

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

Notes

  1. 1.

    https://git.cms.waikato.ac.nz/weka/weka.

  2. 2.

    https://docs.python.org/3/library/re.html.

  3. 3.

    https://www.nltk.org/.

  4. 4.

    https://scikit-learn.org/stable/.

  5. 5.

    https://docs.python.org/3/library/time.html.

  6. 6.

    https://flask.palletsprojects.com/en/2.3.x/.

  7. 7.

    https://docs.python.org/3/library/pickle.html.

References

  1. Ahmad, G.N., Fatima, H., Ullah, S., Saidi, A.S., et al.: Efficient medical diagnosis of human heart diseases using machine learning techniques with and without GridSearchCV. IEEE Access 10, 80151–80173 (2022)

    Article  Google Scholar 

  2. Ahuja, R., Chug, A., Kohli, S., Gupta, S., Ahuja, P.: The impact of features extraction on the sentiment analysis. Procedia Comput. Sci. 152, 341–348 (2019)

    Article  Google Scholar 

  3. Al-Garadi, M.A., Hussain, M.R., Khan, N., Murtaza, G., Nweke, H.F., Ali, I., Mujtaba, G., Chiroma, H., Khattak, H.A., Gani, A.: Predicting cyberbullying on social media in the big data era using machine learning algorithms: review of literature and open challenges. IEEE Access 7, 70701–70718 (2019)

    Article  Google Scholar 

  4. Ali, M.U.: Detection of cyberbullying on social media platforms using machine learning. Master’s thesis, University of Bradford (2023)

    Google Scholar 

  5. Atanassova, I., Bertin, M., Mayr, P.: Mining scientific papers: NLP-enhanced bibliometrics. Front. Res. Metrics Anal. 4(2), 1–3 (2019)

    Google Scholar 

  6. Balakrishnan, V., Lloyd-Yemoh, E.: Stemming and lemmatization: a comparison of retrieval performances. Lecture Notes Softw. Eng. 2(3), 262–267 (2014)

    Article  Google Scholar 

  7. Berry, M.W., Mohamed, A., Yap, B.W.: Supervised and Unsupervised Learning for Data Science. Springer, New York, NY (2019)

    Google Scholar 

  8. Dadvar, M., Eckert, K.: Cyberbullying Detection in Social Networks Using Deep Learning Based Models; A Reproducibility Study. arXiv preprint arXiv:1812.08046 (2018)

  9. Fichtner, L.: What kind of cyber security? Theorising cyber security and mapping approaches. Internet Policy Rev. 7(2) (2018)

    Google Scholar 

  10. Ham, J.V.D.: Toward a better understanding of “cybersecurity’’. Digital Threats: Res. Practice 2(3), 1–3 (2021)

    Article  Google Scholar 

  11. Hinduja, S., Patchin, J.W.: Bullying, cyberbullying, and suicide. Arch. Suicide Res. 14(3), 206–221 (2010)

    Article  Google Scholar 

  12. Islam, M.M., Uddin, M.A., Islam, L., Akter, A., Sharmin, S., Acharjee, U.K.: Cyberbullying detection on social networks using machine learning approaches. In: 2020 IEEE Asia-Pacific Conference on Computer Science and Data Engineering (CSDE), pp. 1–6. IEEE (2020)

    Google Scholar 

  13. Jahan, M.S., Oussalah, M.: A systematic review of hate speech automatic detection using natural language processing. Neurocomputing 126232 (2023)

    Google Scholar 

  14. Khan, S., Qureshi, A.: Cyberbullying detection in Urdu language using machine learning. In: 2022 International Conference on Emerging Trends in Electrical, Control, and Telecommunication Engineering (ETECTE), pp. 1–6. IEEE (2022)

    Google Scholar 

  15. Khyani, D., Siddhartha, B., Niveditha, N., Divya, B.: An interpretation of lemmatization and stemming in natural language processing. J. Univ. Shanghai Sci. Technol. 22(10), 350–357 (2021)

    Google Scholar 

  16. Kowsari, K., Jafari Meimandi, K., Heidarysafa, M., Mendu, S., Barnes, L., Brown, D.: Text classification algorithms: a survey. Information 10(4), 150 (2019)

    Article  Google Scholar 

  17. Perera, A., Fernando, P.: Accurate cyberbullying detection and prevention on social media. Procedia Comput. Sci. 181, 605–611 (2021)

    Article  Google Scholar 

  18. Rosa, H., Pereira, N., Ribeiro, R., Ferreira, P.C., Carvalho, J.P., Oliveira, S., Coheur, L., Paulino, P., Simão, A.V., Trancoso, I.: Automatic cyberbullying detection: a systematic review. Comput. Hum. Behav. 93, 333–345 (2019)

    Article  Google Scholar 

  19. Sindhu, V., Nivedha, S., Prakash, M.: An empirical science research on bioinformatics in machine learning. J. Mech. Continua Math. Sci. 7, 86–94 (2020)

    Google Scholar 

  20. Singhal, M., Ling, C., Kumarswamy, N., Stringhini, G., Nilizadeh, S.: SoK: Content Moderation in Social Media, from Guidelines to Enforcement, and Research to Practice. arXiv preprint arXiv:2206.14855 (2022)

  21. Slonje, R., Smith, P.K., Frisén, A.: The nature of cyberbullying, and strategies for prevention. Comput. Hum. Behav. 29(1), 26–32 (2013)

    Article  Google Scholar 

  22. Snakenborg, J., Van Acker, R., Gable, R.A.: Cyberbullying: prevention and intervention to protect our children and youth. Prevent. Sch. Fail. Altern. Educ. Child. Youth 55(2), 88–95 (2011)

    Article  Google Scholar 

  23. Truell, A.D., Zhao, J.J., Lazaros, E.J., Davison, C., Nicley, D.L.: Cyberbullying: important considerations. Issues Inform. Syst. 20(2), 83–88 (2019)

    Google Scholar 

  24. Waller, A.P., Lokhande, A.P., Ekambaram, V., Deshpande, S.N., Ostermeyer, B.: Cyberbullying: an unceasing threat in today’s digitalized world. Psychiatr. Ann. 48(9), 408–415 (2018)

    Article  Google Scholar 

  25. Zampieri, M., Malmasi, S., Nakov, P., Rosenthal, S., Farra, N., Kumar, R.: Predicting the type and target of offensive posts in social media. In: Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, pp. 1415–1420. Association for Computational Linguistics (2019)

    Google Scholar 

  26. Zampieri, M., Malmasi, S., Nakov, P., Rosenthal, S., Farra, N., Kumar, R.: SemEval-2019 Task 6: identifying and categorizing offensive language in social media (OffensEval). In: Proceedings of the 13th International Workshop on Semantic Evaluation, SemEval@NAACL-HLT 2019, pp. 75–86. Association for Computational Linguistics (2019)

    Google Scholar 

  27. Zampieri, M., Nakov, P., Rosenthal, S., Atanasova, P., Karadzhov, G., Mubarak, H., Derczynski, L., Pitenis, Z., Çöltekin, Ç.: SemEval-2020 Task 12: multilingual offensive language identification in social media (OffensEval 2020). In: Proceedings of the Fourteenth Workshop on Semantic Evaluation, SemEval@COLING 2020, pp. 1425–1447. International Committee for Computational Linguistics (2020)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mohammad Usmaan Ali .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 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

Ali, M.U., Lefticaru, R. (2024). Detection of Cyberbullying on Social Media Platforms Using Machine Learning. In: Naik, N., Jenkins, P., Grace, P., Yang, L., Prajapat, S. (eds) Advances in Computational Intelligence Systems. UKCI 2023. Advances in Intelligent Systems and Computing, vol 1453. Springer, Cham. https://doi.org/10.1007/978-3-031-47508-5_18

Download citation

Publish with us

Policies and ethics