Detection of Toxic Comments and Minimization of Unintended Model Bias — B.Sc. Thesis (Grade: 10.0/10.0)
Research goal and dataset overview
Investigated and predicted toxicity in online comments using Deep Learning, with a primary focus on mitigating unintended machine learning bias against specific demographic and identity subgroups (race, gender, religion, etc.).
Utilized Kaggle's "Jigsaw Unintended Bias in Toxicity Classification" dataset, containing approximately 1.8 million annotated public comments — a highly imbalanced dataset with 92% non-toxic and 8% toxic samples.
Maximizing vocabulary coverage through extensive text cleaning
Performed extensive text cleaning and preprocessing to maximize vocabulary coverage. Leveraged pre-trained word embeddings utilizing FastText (300D) and GloVe (300D) to accurately capture semantic meaning across the corpus.
Designed, trained, and evaluated 16 distinct Neural Network architectures
Bidirectional architectures capturing long-range sequential dependencies in text.
TextCNN capturing local n-gram features through parallel convolutions.
State-of-the-art sequence-to-sequence models with self-attention.
Weighted average combination of top-performing models.
Ensuring the model does not unfairly penalize frequently targeted identities
Addressed the highly imbalanced dataset (92% non-toxic, 8% toxic) by utilizing specialized evaluation metrics designed to measure unintended model bias against specific demographic and identity subgroups.
Measures model performance specifically on comments mentioning identity subgroups (e.g., race, gender, religion), ensuring the model does not underperform on protected groups.
Background Positive, Subgroup Negative — evaluates whether the model incorrectly flags non-toxic comments mentioning identity terms as toxic, penalizing false positives on subgroup mentions.
Background Negative, Subgroup Positive — evaluates whether the model misses toxic comments directed at identity groups, penalizing false negatives on targeted harassment.
Ensemble model performance and competition standing
Private AUC Score — Ensemble Model
The final Ensemble Model — combining RoBERTa (0.4 weight), BiLSTM (0.2 weight), GPT-2 (0.2 weight), and BiGRU (0.2 weight) — achieved the highest performance, leveraging a weighted average technique to correct individual model errors and boost overall accuracy.
Languages, frameworks, and environment
Papers used in architecture design