AI-powered brain signal decoder · Real-time EEG intent classification
Built by Asma Rizwan Rao
A818_NF (NeuroFlow) is a production-ready brain-computer interface software that decodes human intent from raw EEG signals. Dual-mode architecture supports both a high-accuracy 3-class decoder and an extended 5-class decoder with per-subject calibration.
| Mode | Classes | Accuracy | Model | Calibration |
|---|---|---|---|---|
| Focus Mode | 3 (Rest · Left Fist · Right Fist) | 91.0% | Logistic Regression | Not required |
| Extended Mode | 5 (Rest · L.Fist · R.Fist · Both Fists · Both Feet) | 78.4% | EEGNet (CNN) | 20 min per subject |
- 3-class training: 2,820 trials, 5 subjects
- 5-class training: 4,500 trials (balanced), 20 subjects
- Data source: PhysioNet EEG Motor Movement/Imagery (109 subjects)
- Channels: 64 (3-class) / 22 (5-class, after harmonization)
- Sampling rate: 160 Hz
Raw EEG Signal ↓ Preprocessing (MNE-Python) · Notch filter (50 Hz) · Bandpass (8–30 Hz) · Z-score normalization ↓ Feature Extraction / Deep Learning · 3-class: Flatten + StandardScaler · 5-class: EEGNet convolutional model ↓ Classification · Focus Mode → Logistic Regression · Extended Mode → EEGNet CNN ↓ Intent Prediction + Confidence Distribution
text
- Dual-mode decoder — switch between 3-class and 5-class
- Two operating modes — Bench Test (saved data) vs Live Recording (hardware)
- Device-aware — Live Mode refuses to run without EEG headband connected
- Real-time EEG waveforms — scrolling plot for 6 channels
- Confidence distribution — per-class probability bars
- Session log — timestamped predictions with correct/incorrect flags
- Calibration workflow — per-class recording for personalized models
- Professional UI — dark theme, live status indicators, no fake outputs
| File | Purpose |
|---|---|
app.py |
Streamlit production app (dual-mode) |
A818_NF_PhysioNet_v2.ipynb |
5-class training notebook |
NeuroFlow_v1.ipynb |
3-class training notebook |
best_model.pkl |
3-class Logistic Regression model |
scaler.pkl |
3-class feature scaler |
A818_NF_5class_eegnet_v2.pth |
5-class EEGNet weights |
A818_NF_5class_X_bal.npy |
Balanced 5-class training data |
A818_NF_5class_y_bal.npy |
5-class labels |
data/ |
Sample PhysioNet EEG files |
Note: Large data files (.npy, .pth) are hosted on Google Drive due to GitHub's 100 MB file size limit.
The app includes a device interface layer for EEG headband integration. When hardware is connected:
- Fill in
EEGDeviceInterface.detect()— Bluetooth port scanner - Fill in
EEGDeviceInterface.read_sample()— Bluetooth data reader - No other code changes needed
Recommended hardware: BioAmp EXG Pill + ESP32 (~$100)
- ✅ Phase 1 — 3-class decoder (91% accuracy)
- ✅ Phase 2 — 5-class extended decoder (78% with calibration)
- ✅ Phase 3 — Production dual-mode software
- 🔄 Phase 4 — EEG headband hardware integration
- ⏳ Phase 5 — Real-time live demo with users
- ⏳ Phase 6 — Medical partnerships & clinical validation
AI/ML: PyTorch · scikit-learn · MNE-Python · NumPy · SciPy App: Streamlit · Matplotlib Training: Google Colab (T4 GPU) Deployment: Cloudflare Tunnel (dev) · Streamlit Cloud (planned)
pip install streamlit mne scikit-learn torch numpy matplotlib scipy
streamlit run app.py
Contact
GitHub: @deepbuildASI
LinkedIn: Asma Rizwan Rao
Email: asma.rizwanrao7@gmail.com
License
MIT License — see LICENSE