Overview
MAGSEL is a metaverse for gender-sensitive social-emotional education. Students move through a Unity 3D world that reads how they feel from what they type and adapts to it. I built it alone as a research project and presented it at the WILLS 2025 Conference at Kyoto University of Foreign Studies, Japan.
Three pieces work together: a Unity client that generates its own terrain, a Python service that classifies emotion and generates learning content, and a small Node backend for accounts.
What it does
- Emotion detection. A DistilBERT classifier fine-tuned on six emotions (sadness, joy, love, anger, fear, surprise) reads student text. The Unity client sends the text to a Flask endpoint and reacts to the label that comes back.
- Procedural terrain. I wrote a Wave Function Collapse solver from scratch in C# that builds the world's terrain from tile constraints. A networked manager keeps the terrain consistent across clients, and a benchmark harness measures generation time.
- Quiz generation. A local Qwen2.5-0.5B-Instruct model generates quiz questions and pulls topics out of free text, returned as JSON.
- Accounts. Registration and login run through an Express and MongoDB backend.
What I measured
The classifier was fine-tuned from distilbert-base-uncased on the Hugging Face emotion dataset plus additional labeled data, for 2 epochs. On the held-out test split it reaches about 92% accuracy and about 0.93 weighted F1. A separate script re-checks the running API against a labeled set and prints per-class precision and recall, a confusion matrix and response latency.
The extra labeled data file is not in the public repo, so rerunning the training script as is trains on the Hugging Face dataset alone.
Research
The work asks whether a metaverse that knows a learner's emotional state can improve engagement in social-emotional education. It was presented at WILLS 2025 at Kyoto University of Foreign Studies.
What I Learned
Putting a model behind a game client meant caring about response time, because a student waiting on a label breaks the flow of the scene. Writing the terrain solver myself also taught me more about constraint propagation than using a library would have.
Tech Stack
Unity and C# for the client, Flask and Python for the AI service, PyTorch and Hugging Face Transformers with DistilBERT for emotion classification, Qwen2.5-0.5B-Instruct for quiz generation, Node.js, Express and MongoDB for accounts.