Real-time EEG + AI Brain Prediction Platform
NeuroSync combines Meta's TRIBE v2 fMRI brain encoding model with Neurosity consumer EEG headband to create a neural content analysis tool.
TRIBE v2 predicts what the brain should do in response to any video/audio content. Neurosity measures what the brain actually does in real-time. NeuroSync correlates both to score content engagement at the neural level.
Video/Audio Content
|
v
TRIBE v2 (offline) Neurosity EEG (real-time)
Predicts brain activation Measures brain activity
across 180 brain regions 8 channels, 256Hz
per second of content calm, focus, band power
| |
v v
+------ NeuroSync Dashboard ----------+
Per-second correlation
Predicted vs Measured engagement
CSV export for analysis
TribeV2/
├── server/ # Python FastAPI backend
│ ├── app.py # Server + video streaming
│ ├── tribe_worker.py # Background TRIBE v2 processing
│ ├── routers/ # API endpoints (videos, sessions, export)
│ └── db.py # SQLite storage
├── BCI/ # React frontend
│ └── src/
│ ├── pages/
│ │ ├── VideoLibrary.jsx # Browse ready videos
│ │ ├── Processing.jsx # Upload/queue management
│ │ ├── DataCollection.jsx # Watch video + record EEG
│ │ └── Dashboard.jsx # Correlation analysis
│ └── hooks/
│ ├── useNeurosityRecorder.js # Multi-stream EEG capture
│ └── useBandPower.js # FFT band power from raw EEG
└── tribev2/ # Meta's TRIBE v2 model (submodule)
git clone https://github.com/ScottLL/NeuroSync.git
cd NeuroSync
cd tribev2
python -m venv .venv
source .venv/bin/activate
pip install -e ".[plotting]"
pip install fastapi uvicorn python-multipart aiofiles yt-dlp
Set your HuggingFace token:
export HF_TOKEN="your_token_here"
cd BCI
npm install
Start both services:
# Terminal 1: API server
cd server && ../tribev2/.venv/bin/python -m uvicorn app:app --port 8000
# Terminal 2: React dev server
cd BCI && npm run dev
Open http://localhost:5173, log in with your Neurosity device credentials.
TRIBE v2 predicts fMRI BOLD activation (spatial, 20K cortical vertices). Neurosity EEG measures scalp electrical activity (temporal, 8 channels). These are complementary signals:
| TRIBE v2 Prediction | Expected EEG Correlate | Evidence |
|---|---|---|
| High visual cortex activation | Alpha desync at PO3/PO4 | Strong (most replicated EEG-fMRI finding) |
| High language network activation | Frontal theta increase | Moderate |
| Low activation (boring segment) | Alpha increase, focus drops | Strong |
| High overall engagement | Beta up, alpha down | Strong |
The correlation is at the metric level (engagement scores), not voxel level. 8-channel consumer EEG cannot validate individual brain regions but can reliably measure overall engagement/attention states.
All data persists locally:
server/neurosync.db -- SQLite database (videos, predictions, EEG sessions)server/uploads/ -- Downloaded/uploaded video filestribev2/cache/ -- Cached feature extractions (reused across runs)Backend: Python, FastAPI, PyTorch, TRIBE v2 (1B param transformer), SQLite
Frontend: React 19, Vite, Neurosity SDK, Canvas API
Models: V-JEPA2 (video), LLaMA 3.2 (text), Wav2Vec-BERT (audio)
Real-time EEG + AI Brain Prediction Platform
NeuroSync combines Meta's TRIBE v2 fMRI brain encoding model with Neurosity consumer EEG headband to create a neural content analysis tool.
TRIBE v2 predicts what the brain should do in response to any video/audio content. Neurosity measures what the brain actually does in real-time. NeuroSync correlates both to score content engagement at the neural level.
Video/Audio Content
|
v
TRIBE v2 (offline) Neurosity EEG (real-time)
Predicts brain activation Measures brain activity
across 180 brain regions 8 channels, 256Hz
per second of content calm, focus, band power
| |
v v
+------ NeuroSync Dashboard ----------+
Per-second correlation
Predicted vs Measured engagement
CSV export for analysis
TribeV2/
├── server/ # Python FastAPI backend
│ ├── app.py # Server + video streaming
│ ├── tribe_worker.py # Background TRIBE v2 processing
│ ├── routers/ # API endpoints (videos, sessions, export)
│ └── db.py # SQLite storage
├── BCI/ # React frontend
│ └── src/
│ ├── pages/
│ │ ├── VideoLibrary.jsx # Browse ready videos
│ │ ├── Processing.jsx # Upload/queue management
│ │ ├── DataCollection.jsx # Watch video + record EEG
│ │ └── Dashboard.jsx # Correlation analysis
│ └── hooks/
│ ├── useNeurosityRecorder.js # Multi-stream EEG capture
│ └── useBandPower.js # FFT band power from raw EEG
└── tribev2/ # Meta's TRIBE v2 model (submodule)
git clone https://github.com/ScottLL/NeuroSync.git
cd NeuroSync
cd tribev2
python -m venv .venv
source .venv/bin/activate
pip install -e ".[plotting]"
pip install fastapi uvicorn python-multipart aiofiles yt-dlp
Set your HuggingFace token:
export HF_TOKEN="your_token_here"
cd BCI
npm install
Start both services:
# Terminal 1: API server
cd server && ../tribev2/.venv/bin/python -m uvicorn app:app --port 8000
# Terminal 2: React dev server
cd BCI && npm run dev
Open http://localhost:5173, log in with your Neurosity device credentials.
TRIBE v2 predicts fMRI BOLD activation (spatial, 20K cortical vertices). Neurosity EEG measures scalp electrical activity (temporal, 8 channels). These are complementary signals:
| TRIBE v2 Prediction | Expected EEG Correlate | Evidence |
|---|---|---|
| High visual cortex activation | Alpha desync at PO3/PO4 | Strong (most replicated EEG-fMRI finding) |
| High language network activation | Frontal theta increase | Moderate |
| Low activation (boring segment) | Alpha increase, focus drops | Strong |
| High overall engagement | Beta up, alpha down | Strong |
The correlation is at the metric level (engagement scores), not voxel level. 8-channel consumer EEG cannot validate individual brain regions but can reliably measure overall engagement/attention states.
All data persists locally:
server/neurosync.db -- SQLite database (videos, predictions, EEG sessions)server/uploads/ -- Downloaded/uploaded video filestribev2/cache/ -- Cached feature extractions (reused across runs)Backend: Python, FastAPI, PyTorch, TRIBE v2 (1B param transformer), SQLite
Frontend: React 19, Vite, Neurosity SDK, Canvas API
Models: V-JEPA2 (video), LLaMA 3.2 (text), Wav2Vec-BERT (audio)