PROJECT AI & BCI RESEARCHER

MindTune-OS: BCI Adaptive AI

Achieved 92.94% mental state classification accuracy on desktop, and 74% accuracy on a TinyML model compressed to 32KB SRAM for real-time edge inference.

Tech Stack
Pythonscikit-learnGroq LLMSpotify APIArduino (C++)TinyMLFlask

Architecture

Frontend

  • Flask Real-time Dashboard
  • Chart.js for Biofeedback
  • Atomic state.json updates
  • Vanilla JS Polling

Backend

  • SGDClassifier (Online Learning)
  • Groq Llama-3 Agent
  • Last.fm Semantic Tagging
  • Arduino FFT Engine

Key Achievements

92.94% desktop EEG state accuracy

74% accuracy TinyML model at 32KB SRAM

Real-time 'partial_fit' personalization

Neuroscience-validated biomarker tracking

Deep Dive

Solving Stress with Biofeedback

MindTune-OS is an adaptive brain-computer interface (BCI) music recommendation system. It solves the “passive stress” problem: most people don’t realize they are stressed until their performance suffers.

MindTune-OS monitors brainwaves in the background and automatically triggers a personalized Spotify intervention the moment it detects sustained stress—learning over time that you might specifically calm down to dubstep, even if “generic” advice suggests ambient music.


The Architecture: “The Neural Loop”

The system runs a complex pipeline from microvolts to music in under 2 seconds:

1. EEG Classification (92.94% Accuracy)

I trained an SGDClassifier on 988 frequency-domain features. Unlike “black box” models, this approach allows for partial_fit(), meaning the system performs Online Personalization. When a user skips a song, the decision boundary of the brain-state model actually shifts to better fit that individual’s neural signature.

2. TinyML: Intelligence at the Edge

To prove the efficiency of the ML architecture, I deployed a compressed version of the classifier to an Arduino Uno R4 (32KB SRAM), reaching 74% accuracy under that much tighter memory budget.

  • The Constraint: A fraction of the memory available on a laptop.
  • The Solution: A 128-point FFT at 256Hz, extracting 5 core band-power features (Delta to Gamma) to run inference directly on the sensor hardware.

The Engineering: Multimodal Fusion

MindTune-OS doesn’t just look at the brain; it looks at the music. I implemented a Multimodal Fusion layer that stacks 988 EEG features with 5 Spotify audio scalars (Energy, Valence, etc.).

As the user interacts, a Phase 2 Preference Model activates. It uses a second logistic regression model to answer: “Given your current alpha/beta biomarker ratios AND these music tags, how likely are you to respond positively?”


Key Insights & Demo Results

One of the most surprising outcomes during testing was the Genre Personalization. While most systems recommend “Chillout” music for stress, the MindTune-OS preference model identified that for specific users, “Dubstep” had a 100% success rate in resolving stress, while “Ambient” music only had a 25% success rate.

This is the system working as intended: ignoring generic recommendations in favor of individual physiological proof.