In the era of digital communication, chat platforms have increasingly become targets for cybercriminal activities such as phishing, fraud, and harassment. This paper presents CyGuardNLP, a deep learning-based system designed to analyze chat logs and detect various cybercrime categories. Leveraging a fine-tuned BERT model combined with Optical Character Recognition (OCR) for screenshot analysis, CyGuardNLP supports multiple input formats including raw text, CSV files, and images. Experimental results demonstrate the system’s robustness and high accuracy, highlighting its potential for real-time cybercrime monitoring and safer online interactions.
Introduction
Instant messaging platforms such as WhatsApp, Telegram, and Slack have transformed digital communication but also created new opportunities for cybercrime, including phishing, scams, harassment, and cyberbullying. Traditional detection systems that rely on keyword matching or metadata struggle with the informal, fast-changing, and context-dependent nature of chat messages. To address these limitations, CyGuardNLP leverages advanced Natural Language Processing (NLP), particularly transformer-based models like BERT, to accurately classify harmful chat content. Because chat evidence is often shared as screenshots, the system integrates Tesseract OCR to extract text, enabling multimodal cybercrime detection. A user-friendly interface built with Gradio supports real-time text analysis, batch processing, and image-based evaluation.
The core problem addressed is the lack of automated tools for detecting chat-based cyber threats across diverse formats. Existing cybersecurity systems focus mainly on emails or network intrusion, making human moderation of large chat volumes impractical. CyGuardNLP aims to fill this gap by developing a comprehensive cybercrime dataset, fine-tuning BERT for contextual classification, and incorporating OCR for screenshot analysis.
The literature shows that early keyword-based or RNN-based approaches performed poorly on informal chat language, whereas transformer models like BERT significantly improve contextual understanding. However, few studies combine NLP with OCR for cybercrime detection—an important gap that CyGuardNLP targets.
Methodologically, the system compiles a diverse dataset of labeled chat messages and screenshots, applies minimal preprocessing to preserve context, uses BERT’s WordPiece tokenizer, and fine-tunes BERT-base for multi-label classification. Input can be text, CSV logs, or screenshots; OCR text is fed through the same pipeline. The architecture is modular, scalable, and implemented using PyTorch, HuggingFace Transformers, pytesseract, and Gradio.
Conclusion
The CyGuardNLP framework demonstrates a comprehensive and effective approach for detecting cybercrime activities within chat-based communications. By integrating a fine-tuned BERT transformer model with OCR technology, the system is capable of processing diverse input formats including raw text, batch CSV data, and chat screenshots. The fusion of deep contextual understanding from NLP and visual text extraction enhances detection accuracy and flexibility in real-world applications. These results highlight the feasibility of employing advanced machine learning techniques for proactive cybercrime monitoring, contributing significantly to online safety and digital forensics. Furthermore, the modular design ensures that components can be updated or expanded independently, promoting adaptability and long-term sustainability of the system.
References
[1] Silva Sifath, Tania Islam, md Erfan, Samart Kumar Dey, md. Minhaj Ul Islam, md Samsuddoha, Tazizur Rahman (2024). “Recruitment Neural Network Based Multiclass Cyberbullying Classification”, Natural Language ProcessingJournal,Volume9,2024,https://doi.org/10.1016/j.nlp.2024.100111.
[2] Ogunleye B, Dharmaraj B, “The Use of a Large Model for Cyberbullying Detection,” Analytics,2023,2,694-707. https://doi.org/10.3390/analytics2030038.
[3] Kumar Y, Huang K, Perez A, Li J J, Morreale P et al. “Bias and Cyberbullying Detection and Data Generation Using Transformer AI Models and Top Large Language Models”, Electronics 2024, 13, 3431.https://doi.org/10.3390/electronics13173431.
[4] Maity, K., Bhattacharya, S., & Saha, S. (2023). A Deep Learning Framework for the Detection of Malay Hate Speech. IEEE Access. DOI:10.1109/ACCESS.2023.3298808.
[5] Khan, S., Kamal, A., Fazil, M., & Alshara, M. (2022). HCovBi-Caps: Hate Speech Detection Using Convolutional and Bi-Directional GRU with Capsule Network. IEEEAccess.DOI:10.1109/ACCESS.2022.3143799.