Hardware
Devices
PiEEG-8
Signals & Datasets

Signals & Datasets

What real PiEEG-8 recordings look like, open data to practise with, and a first machine-learning project.

Example signals

EEG: alpha rhythm

Eyes closed, the alpha rhythm (8–13 Hz) over the back of the head grows. Each "Closed" period below shows a clear rise in amplitude.

Alpha rhythm in PiEEG-8 EEG when the eyes are closed

EEG: artifacts

Chewing and blinking leave large, sharp signals in the EEG. These come from muscles and eye movement, not the brain. The wavelet view (bottom) shows how they spread across frequencies.

Chewing and blinking artifacts in PiEEG-8 EEG with wavelet transform

Learn to recognise artifacts before you analyse anything. Remove or mark them before computing band power or training a model.

EMG: muscle activity

Bursts of activity as the muscle contracts and relaxes.

EMG recorded with PiEEG-8

ECG: heart activity

Each sharp peak is one heartbeat (the QRS complex).

ECG recorded with PiEEG-8

Datasets

All datasets are in the PiEEG-8 repository (opens in a new tab).

DatasetContentFormat
Datasets/dataset.xlsx (opens in a new tab)Raw EEG, dry Ag/AgCl electrodes without gel, 10-20 positions, 250 SPSExcel, µV
1.GUI/dataset/ (opens in a new tab)Raw EEG with chewing (4-3-2-1 times) and blinking (4-3-2-1 times), 250 SPSExcel, µV
2.Software/Dataset/eeg_data_3.txt (opens in a new tab)Raw 27-byte frames from the PiEEG appText

Each dataset folder has a plotting script, for example 1.data_graph_visualization.py and 2.Alpha_plot.py.

Machine learning: stress detection

A complete beginner pipeline in ML_application (opens in a new tab): record, turn raw EEG into alpha power, then train a classifier.

StepScriptWhat it does
1. Collect1.save_data_short_Pi5.pyRecord raw EEG to Excel. Aim for about 50 recordings of 1 minute or more for each condition (for example, stress and no stress).
2. Extract features2.Convert_to_Power_Alpha.pyConvert raw EEG to alpha-band power, which is more informative for stress than raw voltage. Remove recordings with strong artifacts first.
3. PrepareCombine the recordings into one file per condition, and add a column with the recording (or subject) number.
4. Train3.ML.pyTrain and test a classifier on the two conditions.

Full walkthrough: How to use machine learning for stress control via EEG (opens in a new tab).

⚠️

This is a learning example. A classifier trained on a few recordings is not a validated measure of stress, emotion or health.