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 (91.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 (2KB RAM).
- The Constraint: 500x less memory than 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.