Pipeline used to benchmark permutation-entropy features on the EEGMMIDB. It decodes motor execution (ME) and motor imagery (MI) tasks using:
- Temporal PE
- HV spatial PE (horizontal/vertical triplets)
- Cross-like spatial PE (plus-shaped neighboring electrodes)
- Spatiotemporal PE (center, up, right, and left electrodes combined with a time-lagged center electrode signal)
- Combined PE feature models, plus ablations and sanity checks (within-pair label permutation and capacity-matched controls)
- Loads EEGMMIDB EDF files (subjects S001–S109)
- Preprocesses EEG (EEG-only, resampling, average reference, optional notch)
- Extracts paired baseline/task epochs per cue
- Applies band-invariant artifact rejection and trial capping
- Computes PE features under two scopes: whole scalp and sensorimotor ROI
- Runs within-subject decoding using group-aware CV (trial-pair grouped)
- Writes per-subject and group summaries, plus figures
- Python 3.9+ is recommended
- Dependencies: see
requirements.txt
Install:
pip install -r requirements.txtYou can download EEGMMIDB (PhysioNet MI/ME dataset) and then place it in:
./data/EEGMMIDB/S001
./data/EEGMMIDB/S002
./data/EEGMMIDB/S003
...
You can copy the example configuration and then edit paths as needed:
cp config.example.json config.jsonImportant settings:
DATA_ROOT: path containingS001,S002,S003, ...OUT_FOLDER: where outputs are written (default:./outputs/...)BANDS, epoch windows, rejection thresholds, CV folds, etc. (seerun_pipeline.py)
The data path can also be set through the environment variable:
export EEGMMIDB_ROOT="/path/to/EEGMMIDB"python run_pipeline.pyA run folder is created under OUT_FOLDER and will contain files such as:
run_config.txt,run_config.jsonsubject_summary.csvdecoding_by_subject.csvdecoding_group_summary.csvfamily_comparisons_stats.csvfeature_condition_summary.csvablation_by_subject.csv,ablation_group_summary.csvpermutation_stats.csvmatched_subjects_MI_ME_summary.csvcross_count_distribution_summary.csvcapacity_matched_controls.csv- Figures:
Fig_decoding_bar_with_dots_<band>_<scope>.png
- This pipeline uses deterministic RNG (
RNG_SEED) - This pipeline uses group-aware CV (trial-pair grouping) when available (
StratifiedGroupKFold)