Update to v0.5 export: 1114 trials, [-1,+2]s @1000Hz , 8 in-ear + 122 scalp; integrated README; drop stale v0.2.0 files
Browse filesFiles changed (5)
- README.md+139-32
- motor-ear-eeg.h5Deleted-3
- motor-eeg.h5Deleted-3
- motor-in-ear-eeg.h5+2-2
- motor-scalp-eeg.h5+2-2
123423678945678910121112141314151617181920212223242526271819202128293031323334353637383940414243444546474849505152535455565758596061626364656667686970237172737475257677277879293031323334353637808182833984858687884189909192434445939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311324813313413513613713813914014114214314414514614714814915015115215315450155156157---pretty_name: Motor Processed EEGtask_categories:- otherlicense: othertags:- eeg- ear-eeg- motor-task- bids - eeg - motor - in-ear-eeg - scalp-eeg - hdf5---
# Motor Processed EEG# Motor-Processed
Paper-aligned scalp-EEG and ear-EEG HDF5 files for binary left/right motor-task classification, prepared for the [Ear-EEG FM Benchmark](https://github.com/zhikaili1150/Ear-EEG-FM-Benchmark).Processed HDF5 export of the **Wu et al. 2020** in-ear / scalp EEG motor dataset — paired**in-ear EEG + high-density scalp EEG** recorded while 6 subjects performed a **2-classleft / right hand grasp** task. This repo holds the two processed HDF5 files (one permodality); the raw Curry-7 recordings live on IEEE DataPort.
- **Paper:** Wu, Zhang, Fu, Cheung, Chan (2020). *An investigation of in-ear sensing for motor task classification.* J. Neural Eng. 17 066010. [10.1088/1741-2552/abc1b6](https://doi.org/10.1088/1741-2552/abc1b6)- **Source (raw) dataset:** IEEE DataPort [10.21227/j7rq-2p11](https://dx.doi.org/10.21227/j7rq-2p11). License: see the DataPort record.- **Participants:** 6 adults (2 M / 4 F, ages 22–28), all right-handed. Approved by the City University of Hong Kong ethics committee (ref. 2-25-201602_01).
## Files
| File | Samples | Shape | Size | SHA-256 ||---|---:|---|---:|---|| `motor-eeg.h5` | 1,083 | `(1083, 122, 750)` | 396,762,364 bytes | `104fd2333f44aa7ca3a9976d5e65dbb00223ac45294c9e5f94b8bbbc24818bfb` || `motor-ear-eeg.h5` | 1,097 | `(1097, 6, 750)` | 20,130,804 bytes | `bc88050fcfd5242bc0166224b25f399234774029661d9ab970320f8d57fb032f` || File | Channels | Shape `(N, C, T)` ||---|---|---:|| `motor-in-ear-eeg.h5` | `LF, LB, LOU, LOD, RF, RB, ROU, ROD` (8 in-ear) | `(1114, 8, 3000)` || `motor-scalp-eeg.h5` | 122 scalp EEG (Quik-Cap C190, extended 10-05) | `(1114, 122, 3000)` |
`T = 3000` is one 3-second epoch at 1000 Hz. `N = 1114` is the total number of trials — onesample per trial. The two files are **strictly row-aligned**: sample `i` is the same trialin both, so the in-ear and scalp views share label, `trial_id`, `split_group_id`, and windowbounds. For an ear-EEG foundation-model benchmark the 8 in-ear channels are the payload andthe 122 scalp channels are the gold-standard reference.
Label distribution (identical for both modalities):
| left | right ||---:|---:|| 557 | 557 |
## Preprocessing
Generated with `Ear-EEG-FM-Benchmark/dataset/preprocess_motor.py` (schema/eegfm version`0.5.0`), reading the raw Curry-7 files directly via MNE `read_raw_curry`:
- **one trial = one sample.** Each trial has a single arrow cue; it is extracted as one **3-second epoch spanning [−1 s, +2 s] around arrow onset** — the classifier epoch used by the paper. At the native 1000 Hz this is `T = 3000` samples.- **0.1–100 Hz band-pass + 50 Hz notch**, applied to the full continuous recording *before* slicing (avoids per-window filter edge effects).- **no re-referencing, no resampling (kept at 1000 Hz), original channel names preserved** (no near-ear renaming). Two modality groups only: 8 in-ear + 122 scalp.- labels from the Curry event code: **1 → `left` (0)**, **2 → `right` (1)**; Curry system markers (codes ≥ 1e5) are dropped. The `Trigger` and `REF` channels are used only to read events and are never stored as data.- **bad channels are recorded, not repaired:** subject-4's known-broken `FP1` is kept as-is and listed in the `known_bad_channels_json` file attribute. Any real non-finite samples are preserved (gaps interpolated only on a temporary filter copy, then the original NaN mask restored) and reported in `nan_fraction` / `channel_nan_fraction`.
## Task and labels
Each trial (10 s): a fixation cross (3 s; a warning beep 2 s after cross onset) → an **arrowpointing left or right (pseudo-random) for 4 s**, during which the subject grasps (clenches)the cued hand. The stored epoch is aligned to the **arrow onset** (= start of the grasp).
The leading dimension differs because peak-to-peak rejection is applied independently to scalp and ear channels.| Event code | Class | label ||---:|---|---:|| **1** | left hand | 0 || **2** | right hand | 1 |
> Use the two files listed above for schema v0.4. The older `motor-scalp-eeg.h5` and `motor-in-ear-eeg.h5` files are retained only as legacy artifacts and do not follow the current hierarchy.The `1 = left, 2 = right` mapping is stated explicitly in the IEEE DataPort record.
## Processing and hierarchy## Channels
- Source hierarchy: `subject / session / run / block / trial`- Source trials: 1,114 experimental trials across 6 subjects; each trial lasts 10 s- H5 sample: one 3 s window from `-1` to `+2` s relative to event onset- Signal processing: 4–38 Hz band-pass, 250 Hz output sampling rate, 750 time points- Labels: `left` (`0`) and `right` (`1`)- Rejection: peak-to-peak amplitude greater than 800 uV- `trial_id`: experimental trial identifier from `events.tsv:trial_id`- `split_group_id`: paper-defined experimental block from `events.tsv:block_id`; treat it as indivisible within its recording when constructing data splits- Data unit: uV, stored as `float32`The raw recording has 132 channels = **122 scalp EEG + 8 in-ear + Trigger + REF**; theprocessed files keep only the 122 scalp and 8 in-ear signals (Trigger/REF dropped). The 8in-ear electrodes:
The HDF5 schema version is `0.4.0`. Each file also stores subjects, sessions, runs, recording IDs, event/sample IDs, channel names, window bounds, preprocessing metadata, and class names.| Ear label | Position ||---|---|| `LF`, `LB` / `RF`, `RB` | left / right **ear-canal**, front & back || `LOU`, `LOD` / `ROU`, `ROD` | left / right **concha** (outer ear), upper & lower |
## DownloadThe scalp montage is the Neuroscan Quik-Cap C190 (extended 10-05):`T9, FT9, FTT9h, T7, TP7, … C3, Cz, C4 … T8, TP8` (see `ch_names` in the file). All ear +scalp channels were referenced to a shared scalp REF; scalp GRD was the ground.
```bashhuggingface-cli download Zachary1150/Motor-Processed \ --repo-type dataset --local-dir data## Per-subject / per-run trial counts
Subjects 1, 5, 6 span several chronological runs (`run-01 …`, from the raw `motorN`recordings); subjects 2, 3, 4 are single-run. Counts parsed from the source event files:
| Subject | Runs | Trials (L / R) | ≈ blocks (÷16) ||---|---|---:|---:|| sub-01 | 3 | 240 (120 / 120) | 15 || sub-02 | 1 | 160 (80 / 80) | 10 || sub-03 | 1 | 160 (80 / 80) | 10 || sub-04 | 1 | 80 (40 / 40) | 5 || sub-05 | 4 | 234 (117 / 117) | ~14.6 (irregular) || sub-06 | 3 | 240 (120 / 120) | 15 || **Total** | **13** | **1114 (557 / 557)** | — |
One block = 16 trials; perfectly class-balanced overall.
## HDF5 schema (v0.5)
```text/data (N, C, 3000) float32 # µV at 1000 Hz/durations (N,) int64/nan_fraction (N,) float32/channel_nan_fraction (N, C) float32/labels (N,) int64 # 0=left, 1=right/sample_id (N,) int64/subject (N,) string # 'sub-01' … 'sub-06'/session (N,) string # '' (no sessions)/task (N,) string # 'grasp'/acquisition (N,) string/run (N,) string # 'run-01' …/recording_id (N,) string/trial_id (N,) int64 # arrow-event index within the run/event_id (N,) int64 # Curry trigger code (1=left, 2=right)/split_group_id (N,) int64 # unique per trial (trial-level splitting)/window_start_sample (N,) int64 # epoch bounds in the continuous recording/window_stop_sample (N,) int64/ch_names (C,) string```
## SourceKey attributes: `sfreq` (1000.0), `class_names` (`['left','right']`), `unit` (`uV`),`eegfm_version` (`0.5.0`), `preprocess_config_json`, `split_group_kind` (`trial`),`event_id_kind`, `window_reference`, and `known_bad_channels_json` (`{"sub-04":["FP1"]}`).
No block grouping is baked in (`split_group_id` is unique per trial); block structure isrecoverable post-hoc from `window_start_sample` gaps (≈11 127-sample within-block cadence,larger gaps between blocks).
## Known issues / caveats
- **Task framing is described inconsistently across sources.** The paper says subjects "make a fist" (motor **execution**); the IEEE DataPort record says "**imagine and grasp**". The task is stored under the neutral name `grasp` — do not hard-assert MI vs ME.- **subject-4** `FP1` is a known-broken channel (kept, not repaired — see Preprocessing).- **subject-5** has 234 trials — not a clean multiple of the 16-trial block (split 80/60/30/64 across 4 runs).- **Block/subject counts in the paper / DataPort prose are unreliable** (DataPort is marked "under construction" and disagrees with both the paper and the files). The counts here are parsed directly from the source event files.
## Provenance
The original recordings accompany *An investigation of in-ear sensing for motor task classification* and are distributed through [IEEE DataPort](https://ieee-dataport.org/open-access/ear-eeg-recording-brain-computer-interface-motor-task). Users are responsible for complying with the original dataset terms.Trial counts, channel lists, and the `1 = left / 2 = right` mapping were read from the raw`.dap` / `.rs3` / `.ceo` files and cross-checked against the paper and the IEEE DataPortrecord. Processed with `dataset/preprocess_motor.py` at eegfm schema `0.5.0`.123version https://git-lfs.github.com/spec/v1oid sha256:bc88050fcfd5242bc0166224b25f399234774029661d9ab970320f8d57fb032fsize 20130804123version https://git-lfs.github.com/spec/v1oid sha256:104fd2333f44aa7ca3a9976d5e65dbb00223ac45294c9e5f94b8bbbc24818bfbsize 39676236412323version https://git-lfs.github.com/spec/v1oid sha256:a20500e2187131e419c54df16ed27100f454c7b7314d48a51d637f92fef1f199size 107330768oid sha256:de3312c1edaa4e0066f062733389c28f8f1862346500f0cc750d28b0b4ff8833size 10762174412323version https://git-lfs.github.com/spec/v1oid sha256:1166fca4ba2585f84be754d0135e16150ec5d881f4b73d5fc30b2132e86bb2a8size 2174920720oid sha256:2d106bf67018cf4d3c21f3e91cd69450a2780f17e278793c5ae87ad778d1e3ffsize 1632513552README.md+139-32
motor-ear-eeg.h5Deleted-3
motor-eeg.h5Deleted-3
motor-in-ear-eeg.h5+2-2
motor-scalp-eeg.h5+2-2