Inspiration

Content moderation is broken right now—especially in India. Most automated filters just check against a list of bad English words. But that’s not how people talk online. People use "code-switching," jumping back and forth between Hindi and English in the exact same sentence.

Trolls and cyberbullies know this, and they actively exploit it to bypass automated safety nets. We wanted to build a moderation layer that actually understands linguistic context and nuance, rather than just acting like a glorified keyword scanner.

What it does

Lumina Mod-AI acts as a localized trust and safety filter. We built a live web dashboard where any text—be it pure Hindi, pure English, or a slang-heavy mix of both—can be evaluated in real time. If the model detects a threat or toxic behavior, it flags the comment, blocks it from being posted, and outputs an exact confidence probability for platform admins to review.

How we built it

We decided to bypass standard BERT architectures and went straight for microsoft/mdeberta-v3-base. The disentangled attention mapping in mDeBERTa is significantly better at catching the semantic meaning between code-switched languages.

We brought the dataset into a custom PyTorch training loop on a Google Colab T4 VM. To keep the model from memorizing the highly imbalanced training data, we didn't just use standard dropout. We injected a 5-pass Multi-Sample Dropout layer right before the classification head, which heavily stabilized our validation scores without needing extra epochs. Finally, we tied the model weights to a Streamlit frontend so we actually had a working product to show.

Challenges we ran into

Hardware constraints and library conflicts hit us hard during the build. When we first migrated the mDeBERTa HuggingFace weights into PyTorch, the backward propagation kept throwing fatal Half vs Float datatype crashes. We lost a lot of time debugging it before finally ripping out the mixed-precision wrappers and hardcoding the entire network to compute in pure Float32.

We also hit a nasty VRAM bottleneck where our Streamlit UI crashed because the background Jupyter kernel was hogging all 14GB of the GPU. We fixed it by creating a dynamic memory split:

  • We trained the model on the GPU
  • We forced the Streamlit inference engine to run strictly on the CPU

Accomplishments that we're proud of

Walking away from a 12-hour sprint with a 94.4% Macro F1 Score and a 98.4% ROC-AUC is huge for us. But honestly, we are most proud that we didn't just dump a CSV file and call it a day. We fought through the deployment bugs and actually delivered a judge-testable software UI that doesn't crash.

What we learned

We learned a harsh lesson about deployment stability. Sometimes, chasing speed by using mixed-precision math (FP16) isn't worth it if it compromises system stability. Forcing absolute Float32 math cost us a few minutes of training time, but it guaranteed our pipeline wouldn't crash during evaluation.

What's next for Lumina Mod-AI

The immediate next step is getting this off Colab entirely. We plan to containerize the model with Docker and host it as a FastAPI endpoint. That way, any Discord server, Reddit sub, or local forum can just hook into our API and get enterprise-grade, cross-lingual moderation for free.

Built With

Share this project:

Updates