EEG Edge AI
Brain–Computer Interface Exploration
Exploring how EEG can be read, understood and acted on in real time.
- Python
- PyQt5
- XGBoost
- Signal Processing
- Year
- 2026
- Status
- In progress — exploring
- Role
- Research plan, architecture, prototypes
- Platform
- Python · PyQt5
Background
Research models can classify brain states from recorded EEG — the depth of anaesthesia, or the onset of a seizure. But a model that works on an offline dataset is not yet a tool. Between the electrodes and a useful alert sit communication protocols, binary formats, feature pipelines and an interface someone can trust. This project investigates that gap: how pre-trained models from existing research could run on a live EEG stream, close to the device, with low latency.
Challenge
The model is the easy part. Everything around it has to be exactly right.
Raw streams
Devices emit binary packets with sync words and 16-bit samples that must be decoded as they arrive.
Two formats
Research uses standard EDF files; the live stream does not. Channels must be matched between the two.
Same features, online
Features computed live must follow exactly the distribution the model was trained on.
Latency and noise
Parsing must keep pace with sampling, and dropped or corrupted packets must not raise false alarms.
Solution
The approach under investigation is a four-part architecture. Prototypes are being built one module at a time.
01
Stream parsing
Listen to the device through file monitoring or sockets; unpack packets by their sync word and convert 16-bit integers to microvolts — fast enough to stay well inside the sampling interval.
02
Two paths for data
An offline path packages raw recordings as standard EDF for research; channel correspondence is checked by waveform correlation.
03
Offline to online
Export the PCA projection fixed during training and load it into the live software, so classifiers such as XGBoost see the same feature space online.
04
A calm interface
In PyQt5, waveform drawing and model computation run on separate threads. An alert requires agreement across several consecutive windows, to avoid false alarms from momentary artefacts.
Technology
Python
Data handling, parsing and experiments.
Sockets & file monitoring
Receiving the device stream as it grows.
EDF
The standard format for offline EEG research.
PCA · XGBoost
Feature projection and classification, carried from offline to online.
PyQt5
A multithreaded, low-latency monitoring interface.
My contribution
- Defining the research questions and the system architecture
- Designing the parsing, storage, inference and interface modules
- Building and testing prototypes, one module at a time
Reflection
The hardest part of applying AI is often not the model. It is making sure the model sees online exactly what it saw offline — the same channels, the same features, the same assumptions. This project is how I am learning that discipline.