Skip to content

About

Hands-on NeuroTechX workshop for real-time EEG and brain–computer interfaces with Python. Use simulated or recorded data, or connect a supported EEG device.

Topics

Resources

Stars

95 stars

Watchers

20 watching

Forks

Repository files navigation

NeuroTechX BCI Workshop (v2.0)

A turnkey, device-agnostic 2.5-hour hands-on Brain–Computer Interface (BCI) workshop built for NeuroTechX city chapters, university student clubs, and hacknights—usable with zero hardware (built-in realistic LSL simulator & file replay) or with 18+ consumer and open-hardware EEG/biosignal boards.


60-Second Quickstart (No Headset Needed!)

We recommend uv (standard python -m venv + pip works identically; see INSTRUCTIONS.md):

git clone https://github.com/NeuroTechX/bci-workshop.git
cd bci-workshop

# 1. Create environment & install core + Riemannian geometry extras
uv venv && uv pip install -e ".[riemann,dev]"

# 2. Verify Python packages, audio cues, and LSL streaming in one command
uv run python exercises/00_check_setup.py --self-test

Now open two terminals:

# Terminal 1 — Start an EEG stream (built-in simulator, or see docs/TARGETS.md for Muse/OpenBCI/PiEEG)
uv run python streams/mock_eeg_stream.py
# Terminal 2 — Run Exercise 01 (Neurofeedback) and Exercise 02 (Calibrated Live BCI)
uv run python exercises/01_neurofeedback.py
uv run python exercises/02_basic_bci.py --clf lda          # or --clf riemann-mdm --online-adapt
uv run python exercises/03_udp_output_demo.py              # in a 3rd terminal to receive live BCI JSON!

# Bonus — CPU-fast EEG-to-Image zero-shot retrieval lab (2026 Challenge Track 01 / Alljoined style)
uv run python exercises/05_eeg_to_image_retrieval.py
# Or stream a ~20 MB 1-subject real Alljoined-1.6M shard via HTTP Range (no 6 GB download!):
uv run python streams/prepare_alljoined_shard.py --subject sub-01 --accept-nc-terms
uv run python exercises/05_eeg_to_image_retrieval.py --npz data/alljoined_sub01_shard.npz

(In 50 Hz mains regions such as Europe, Asia, Africa, and Australia, pass --mains 50.)

Recommended Machine-Learning Brush-Up (Optional)

Because BCI evaluation fails silently whenever preprocessing or overlapping time windows leak across train/test splits, we recommend the free Inria / Probabl scikit-learn MOOC (especially the modules on Pipeline composition and non-i.i.d. GroupKFold / TimeSeriesSplit validation).


Two Parallel Real-Time Paths + 2026 Challenge Tracks

  1. Path A — Transparent Python (exercises/ + src/bci_workshop/): Inspectable scripts teaching non-lagging LSL ring buffers, causal IIR notch/bandpass filtering, Welch PSD bandpower neurofeedback (Berger 8–12 Hz alpha effect), Shrinkage LDA vs. Riemannian Geometry (pyRiemann MDM / Tangent Space), temporal leakage auditing & Balanced Accuracy, causal label-free session adaptation (--online-adapt), and live LSL/UDP outputs.
  2. Path B — Declarative Graphs & Browser UI (timeflux/): Ready-to-run YAML pipelines for Timeflux serving live browser dashboards (http://localhost:8000) and connecting directly into timeflux/demos (Oddball, EMG Roshambo, P300 Speller, and dry-EEG c-VEP Speller). See timeflux/README.md.
  3. 2026 EEG/EMG Foundation Challenge Bridge (neural-interfaces26):
    • Track 01 (EEG -> Image): exercises/05_eeg_to_image_retrieval.py implements CPU-friendly zero-shot visual embedding retrieval (RidgeCV onto DINOv2/CLIP latents, comparing single-trial vs. multi-repeat SNR) and links directly to Alljoined/Alljoined-1.6M (32-ch Emotiv, NEMAR nm000134, CC BY-NC-SA 4.0) and Alljoined/ENIGMA (MIT, CLIP + SDXL Turbo reconstruction of viewed images).
    • Track 02 (Cross-Session BCI, PROTEUS nm000290): Causal B=1 streaming (reset_state()), label-free running recentering (--online-adapt in 02_basic_bci.py), and 3-class mental commands (motor imagery, mental subtraction, word generation).
    • Track 03 (4-ch Muse Home EEG Regression, nm000287): Continuous time-to-sleep-onset (0–600 s) regression on 4-channel Muse headbands with domain-weighted error (W-bMAE).
    • Track 04 (EMG -> Pose, EMG2Pose): 16-ch wrist surface EMG to continuous 20-joint hand pose angles.

Where to Go Next in the NeuroTechX Ecosystem


History

  • May 2015 — Raymundo Cassani and Hubert Banville created the original workshop for BCI Montréal at District 3, Concordia University. The exercises used MuLES to stream EEG.
  • 2015–2018 — Early revisions added Muse streaming and IPython notebooks. The 2017–2018 refresh moved to Python 3 and Lab Streaming Layer (LSL), with contributions from Dano Morrison, Sydney Swaine-Simon, and the NeuroTechX community.
  • 2026 — NeuroTechX rebuilt the workshop for chapters, student clubs, and hacknights. Version 2 adds hardware-free EEG simulation and file replay, support for multiple EEG devices, and parallel Python and Timeflux exercises.

See HISTORY.md for legacy Git tags, contributor credits, and details on how the exercises evolved.

License

Released under the MIT License.

About

Hands-on NeuroTechX workshop for real-time EEG and brain–computer interfaces with Python. Use simulated or recorded data, or connect a supported EEG device.

Topics

Resources

Stars

95 stars

Watchers

20 watching

Forks

Releases

Packages

Contributors

Languages