Explore
2025–2026

CyberShield

NLP Cyberbullying Detection System
TypeAcademic · COMP1921 Advanced Topics in Data Science and AI
Year2025–2026
Problem

What was being investigated

Traditional content moderation is slow, inconsistent, and unscalable. CyberShield is a prototype NLP classification system that detects cyberbullying across 6 categories in Twitter text, with interpretability and ethical accountability built in from the start, not added as an afterthought.

Approach

Methodology & tools

End-to-end NLP pipeline on a Cyberbullying Tweets dataset. Text cleaned via lowercasing, punctuation removal, stopword filtering, and tokenisation. TF-IDF vectorisation with unigrams and bigrams to capture short semantic patterns. Multi-class classification across 6 categories: ethnicity, religion, age, gender, other cyberbullying, and not cyberbullying. Evaluated using classification report, confusion matrix, and per-class F1 scores. Top TF-IDF weighted features extracted per class to surface what signals drive predictions, making the model auditable rather than opaque. Deployed as a Gradio interactive prototype with real-time text classification. Dedicated ethical analysis covering explainability trade-offs, cultural bias in western-centric training data, and responsible deployment constraints.

Findings

Results & conclusions

81% overall accuracy (macro F1: 0.81). Explicit hate categories performed strongly (ethnicity F1=0.97, religion F1=0.95, age F1=0.96) because direct hate language is reliably detectable by lexical features. Ambiguous categories performed lower: not_cyberbullying F1=0.55, other_cyberbullying F1=0.59: sarcasm, irony, and coded language fall outside TF-IDF's context window. The model is suitable for flagging explicit content for priority review; automated disciplinary actions without human oversight are explicitly out of scope.

Visuals

Output & results

Classification report
Confusion matrix
Gradio prototype
Top TF-IDF terms
Stack

Methods & Tools

./cybershield · methods
LanguagePython
Librariesscikit-learn · pandas · NLTK · Matplotlib
MethodTF-IDF with bigrams · Multi-class classification
InterfaceGradio, interactive real-time classification prototype
EvaluationAccuracy · Precision · Recall · F1 (macro avg) · Confusion matrix
Reflection

What I'd do differently

One thing I'd change

I'd extend to transformer-based embeddings to handle sarcasm and context-dependent language, the places where bag-of-words representations systematically fail.