Article
Detection of Cyberbullying on Facebook Twitter (X) Using Bi-Directional Long Short-Term Memory and Extreme Gradient Boost Algorithms


This work is licensed under a Creative Commons Attribution 4.0 International License.
Copyright
The authors shall retain the copyright of their work but allow the Publisher to publish, copy, distribute, and convey the work.
License
Digital Technologies Research and Applications (DTRA) publishes accepted manuscripts under Creative Commons Attribution 4.0 International (CC BY 4.0). Authors who submit their papers for publication by DTRA agree to have the CC BY 4.0 license applied to their work, and that anyone is allowed to reuse the article or part of it free of charge for any purpose, including commercial use. As long as the author and original source are properly cited, anyone may copy, redistribute, reuse, and transform the content.
Received: 26 October 2025; Revised: 5 December 2025; Accepted: 12 March 2026; Published: 1 July 2026
The social networking sites have transformed digital communication but have simultaneously enabled the escalation of harmful online behaviors, particularly cyberbullying. This recurring form of digital aggression can lead to serious emotional and psychological harm, including anxiety, depression, and in severe cases, self-inflicted injury or suicidal behavior. The timely identification and prevention of cyberbullying have become an essential focus of current research. Although numerous machine learning techniques have been applied to detect abusive content, many continue to face challenges such as inefficient kernel tuning, extended training durations, and reduced predictive accuracy. To address these limitations, this study presents a hybrid deep learning architecture that integrates a Bidirectional Long Short-Term Memory (BiLSTM) network with the Extreme Gradient Boosting (XGBoost) algorithm to improve contextual awareness and classification accuracy. The proposed framework was trained and evaluated on datasets collected from Facebook and X (formerly Twitter), capturing diverse linguistic and behavioral characteristics of user interactions. Experimental results indicate that the BiLSTM–XGBoost hybrid model outperforms conventional classifiers by effectively managing context representation, adaptive learning, and class imbalance. The model achieved 97% accuracy, 95% precision, 92% recall, and an F1-score of 96%, confirming its robustness and efficiency for cyberbullying detection in dynamic social media environments. The study helps educational institutions, online platforms and legal frameworks provide insights into how to better identify cyberbullying in real-world scenarios. The study’s high recall ensures that cyberbullies are easily identified and it enhances the understanding of how combining multiple models can lead to better performance in cyberbullying detection.
Keywords:
Cyberbullying Deep Learning BiLSTM XGBoost Machine Learning Social MediaReferences
- Balakrishnan, V.; Khan, S.; Arabnia, H.R. Improving cyberbullying detection using Twitter users’ psychological features and machine learning. Comput. Secur. 2020, 90, 101710.
- Siddhartha, K.; Raj Kumar, K.; Jayanth Varma, K.; et al. Cyber Bullying Detection Using Machine Learning. In Proceedings of the 2022 2nd Asian Conference on Innovation in Technology (ASIANCON), Ravet, India, 26–28 August 2022; pp. 1–4.
- Cuzcano, X.M.; Ayma, V.H. A comparison of classification models to detect cyberbullying in the Peruvian Spanish language on Twitter. Int. J. Adv. Comput. Sci. Appl. 2020, 11, 12–78.
- Aggarwal, P.; Mahajan, R. Shielding Social Media: BERT and SVM Unite for Cyberbullying Detection and Classification. J. Inf. Syst. Inform. 2022, 6, 607–623.
- Teng, T.H.; Varathan, K.D. Cyberbullying detection in social networks: A comparison between machine learning and transfer learning approaches. IEEE Access 2022, 11, 55533–55560.
- Vishwamitra, N.; Hu, H.; Luo, F.; et al. Towards understanding and detecting cyberbullying in real-world images. In Proceedings of the Network and Distributed Systems Security (NDSS) Symposium 2021, Online, 21–25 February 2021.
- Philipo, A.G.; Sarwatt, D.S.; Ding, J.; et al. Cyberbullying detection: Exploring datasets, technologies, and approaches on social media platforms. arXiv preprint 2021, arXiv:2407.12154.
- Dong, X.; Choi, J.D. XD at SemEval-2020 Task 12: Ensemble approach to offensive language identification in social media using transformer encoders. In Proceedings of the Fourteenth Workshop on Semantic Evaluation, Barcelona, Spain, 12 December 2020.
- Dewani, A.; Memon, M.A.; Bhatti, S. Cyberbullying detection: Advanced preprocessing techniques & deep learning architecture for Roman Urdu data. J. Big Data 2021, 8, 160.
- Mahesh, K.; Gothane, S.; Toshniwal, A.; et al. Cyber bullying detection on social media using machine learning. Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol. 2021, 7, 410–416.
- Dadvar, M.; Trieschnigg, D.; Ordelman, R.; et al. Improving cyberbullying detection with user context. Available online: https://link.springer.com/chapter/10.1007/978-3-642-36973-5_62 (accessed on 23 February 2025).
- Cirillo, S.; Desiato, D.; Polese, G.; et al. Exploring the ability of emerging large language models to detect cyberbullying in social posts through new prompt-based classification approaches. Inf. Process. Manag. 2025, 62, 104043. DOI: https://doi.org/10.1016/j.ipm.2024.104043
- Agbaje, M.; Afolabi, O. Neural network-based cyber-bullying and cyber-aggression detection using Twitter(X) text. Rev. Intell. Artif. 2024, 38, 837–846. DOI: https://doi.org/10.18280/ria.380310
- Alqahtani, A.F.; Ilyas, M. A machine learning ensemble model for the detection of cyberbullying. arXiv preprint 2024, arXiv:2402.12538. DOI: https://doi.org/10.48550/arXiv.2402.12538
- Philipo, A.G.; Sarwatt, D.S.; Ding, J.; et al. Assessing text classification methods for cyberbullying detection on social media platforms. IEEE Trans. Inf. Forensics Secur. 2025, 20, 7602–7616. DOI: https://doi.org/10.1109/TIFS.2025.3588728
- Brakas, K.J.; Alanezi, M. Measuring the extent of cyberbullying comments in Facebook groups for Mosul University students. Mesopotamian J. Cybersecur. 2025, 5, 337–348.
- Reynolds, K.; Kontostathis, A.; Edwards, L. Using machine learning to detect cyberbullying. In Proceedings of the 2011 10th International Conference on Machine Learning and Applications, Honolulu, HI, USA, 18–21 December 2011; pp. 241–244.
- Jadhav, P.A.; Nakhate, M.; Bulani, R.; et al. Real time cyberbullying detection using ML and NLP. Int. J. Creat. Res. Thoughts 2023, 11, a545–a549.
- Atoum, J.O. Cyberbullying detection through sentiment analysis. In Proceedings of the 2020 International Conference on Computational Science and Computational Intelligence, Las Vegas, NV, USA, 16–18 December 2020; pp. 292–297. DOI: https://doi.org/10.1109/CSCI51800.2020.00056
- Bharadwaj, V.Y.; Likhitha, V.; Vardhini, V.; et al. Automated cyberbullying activity detection using machine learning algorithm. E3S Web Conf. 2023, 430, 01039. DOI: https://doi.org/10.1051/e3sconf/202343001039
- Vijayakumar, V.; Prasad, H.D.; Adolf, P. Multimodal cyberbullying detection using hybrid deep learning algorithms. Int. J. Appl. Eng. Res. 2021, 16, 568.
- Al-garadi, M.; Hussain, M.R.; Khan, N.; et al. Prediction of cyberbullying on social media in the big data era using machine learning algorithms: Review of literature and open challenges. IEEE Access 2019, 7, 70701–70718.
- Gupta, S.; Vadgama, U.; Vedhavathy, T.R.; et al. Identification and labeling of textual cyberbullying using BiLSTM and BERT. In Proceedings of the 2023 International Conference on Networking and Communications (ICNWC), Chennai, India, 5–6 April 2023; pp. 1–5.
- Shi, L.; Liu, X.; Xu, C.; et al. Cross-lingual offensive speech identification with transfer learning for low-resource languages. Comput. Electr. Eng. 2021, 101, 108005.
- Akhter, A.; Acharjee, U.K.; Talukder, M.A.; et al. A robust hybrid machine learning model for Bengali cyber bullying detection in social media. Nat. Lang. Process. 2023, 4, 100027.
- Al-Hashedi, M.; Soon, L.K.; Goh, H.N. Cyberbullying detection using deep learning and word embeddings: An empirical study. In Proceedings of the 2019 2nd International Conference on Computational Intelligence and Intelligent Systems, Bangkok, Thailand, 23–25 November 2019; pp. 17–21.
- Ali, A.; Syed, A.M. Cyberbullying detection using machine learning. Pak. J. Eng. Technol. 2022, 3, 45–50. DOI: https://doi.org/10.51846/vol3iss2pp45-50
- Hande, A.; Hegde, S.U.; Priyadharshini, R.; et al. Benchmarking multi-task learning for sentiment analysis and offensive language identification in under-resourced dravidian languages. arXiv preprint 2021, arXiv:2108.03867.
- Islam, M.M.; Uddin, M.A.; Islam, L.; et al. Cyberbullying detection on social networks using machine learning approaches. In Proceedings of the 2020 IEEE Asia-Pacific Conference on Computer Science and Data Engineering (CSDE), Gold Coast, Australia, 16–18 December 2020. DOI: https://doi.org/10.1109/CSDE50874.2020.9411601
- Kumar, A.; Sachdeva, N. Multimodal cyberbullying detection using capsule network with dynamic routing and deep convolutional neural network. Multimed. Syst. 2022, 28, 2043–2052.
- Muneer, A.; Alwadain, A.; Ragab, M.G.; et al. Cyberbullying detection on social media using stacking ensemble learning and enhanced BERT. Information 2023, 14, 467.
- Raj, M.; Singh, S.; Solanki, K.; et al. An application to detect cyberbullying using machine learning and deep learning techniques. SN Comput. Sci. 2022, 3, 401.
- Keni, A.; Deepa, M.; Kini, K.V.; et al. Cyber-bullying detection using machine learning algorithms. Int. J. Eng. Res. Technol. 2020, 11, 690–695.
- Hani, J.; Nashaat, M.; Ahmed, M.; et al. Social media cyberbullying detection using machine learning. Int. J. Adv. Comput. Sci. Appl. 2019, 10, 83–87.
- Thorat, P.B.; Kangane, S.V.; Indalkar, S.V.; et al. Detection of cyber bullying on social media using machine learning. Int. J. Nov. Res. Dev. 2022, 7, 34–98.
- Mehendale, N.; Rajpara, K.; Shah, K.; et al. A review on cyberbullying detection using machine learning. Available online: https://ssrn.com/abstract=4116153 (accessed on 13 September 2025).
- Zhong, J.; Qiu, J.; Sun, M.; et al. To be ethical and responsible digital citizens or not: A linguistic analysis of cyberbullying on social media. Front. Psychol. 2021, 13, 861823.
- Nahar, K.M.O.; Alauthman, M.; Yonbawi, S.; et al. Cyberbullying Detection and Recognition with Type Determination Based on Machine Learning. Comput. Mater. Contin. 2021, 75, 5307–5319.
- El Koshiry, A.M.; Eliwa, E.H.I.; El-Hafeez, T.A.; et al. Detecting cyberbullying using deep learning techniques: A pre-trained glove and focal loss technique. PeerJ Comput. Sci. 2024, 10, e1961.

Download
