← Back to all projects

Case Study — Rabbit the Miner — DCNL, SNU

Rabbit the Miner — DCNL, SNU

Built the game engine and data pipeline for a real-time EEG neurofeedback study. Live brainwave stream → FFT-based FAA → a Pygame state machine that drives gameplay. Refactored a 1,100-line monolith, ported the stack to macOS, 10 participants, significant results.

At a glance

Role
Software Engineer & Researcher · May 2023 — Jan 2024
What
Real-Time EEG Neurofeedback Game for Depression Research
Did
Built the game engine and per-round feedback pipeline behind statistically significant brainwave gains
Stack
PythonPygamepandas / NumPyReal-Time Signal ProcessingEEG / FAA

Problem

Research shows that regulating Frontal Alpha Asymmetry (FAA) can reduce depressive symptoms. But existing neurofeedback paradigms are clinical and boring — participants disengage, data quality drops, and the therapeutic effect weakens. We needed an engaging way to train FAA regulation.


My Role

On a 5-person research team at DCNL, I owned the game engine and the data pipeline — the real-time loop that turns a live EEG stream into gameplay, and the logging/dashboard layer the study ran on.


Process

  1. 1

    Built the real-time loop: a live 2-channel EEG stream is bandpass-filtered and artifact-rejected, FFT'd over a 5-second sliding window every 100 ms to compute Frontal Alpha Asymmetry (FAA), then z-scored against each player's resting baseline.

  2. 2

    Drove a Pygame state machine off that signal — z-scored FAA is quantized into reward tiers that control the miner (mine faster, rest, or trigger a sustained-regulation 'fever' bonus), giving the player continuous per-round feedback.

  3. 3

    Refactored a 1,100-line monolithic game loop into a modular, screen-based state-machine architecture so the team could extend the game without touching the signal path.

  4. 4

    Built the data pipeline with pandas/matplotlib — logging raw EEG to CSV, persisting per-subject results across a 6-session × 5-block protocol, and auto-generating per-stage performance graphs.

  5. 5

    Ported the Windows-locked stack (device drivers, native deps) to macOS, unblocking cross-platform development and making the study reproducible beyond a single lab machine.


Outcome

Ran the experiment with 10 participants and measured statistically significant improvement in brainwave self-regulation across rounds. Players got competitive, found their own strategies, and stayed engaged — even wearing unfamiliar EEG equipment. The per-round feedback loop was the key driver of progressive improvement.


Stack

PythonPygamepandas / NumPyReal-Time Signal ProcessingEEG / FAA

What I Learned

Real-time systems leave no room to hide — the EEG-to-screen loop has to compute FFTs, reject artifacts, and render every frame on a tight budget, or the feedback feels laggy and the training breaks. The biggest engineering lever wasn't the signal processing itself; it was refactoring a monolith into something the team could safely build on. And seeing people improve their mental state through a game they didn't even realize was training their brain is what got me building products for real human impact.