File size: 7,391 Bytes
2e8dbe2
4e654b8
2e8dbe2
4e654b8
 
 
 
 
2e8dbe2
 
4e654b8
2e8dbe2
4e654b8
 
 
 
 
 
 
 
 
 
 
 
2e8dbe2
19d95be
2e8dbe2
4e654b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e8dbe2
4e654b8
 
 
 
2e8dbe2
4e654b8
4738f09
4e654b8
2e8dbe2
4e654b8
 
 
2e8dbe2
4e654b8
 
 
 
2e8dbe2
4e654b8
 
 
2e8dbe2
4e654b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e8dbe2
 
4e654b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2e8dbe2
4e654b8
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
license: other
tags:
  - eeg
  - motor
  - in-ear-eeg
  - scalp-eeg
  - hdf5
---

# Motor-Processed

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-class
left / right hand grasp** task. This repo holds the two processed HDF5 files (one per
modality); 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 | 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 — one
sample per trial. The two files are **strictly row-aligned**: sample `i` is the same trial
in both, so the in-ear and scalp views share label, `trial_id`, `split_group_id`, and window
bounds. For an ear-EEG foundation-model benchmark the 8 in-ear channels are the payload and
the 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 **arrow
pointing 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).

| Event code | Class | label |
|---:|---|---:|
| **1** | left hand  | 0 |
| **2** | right hand | 1 |

The `1 = left, 2 = right` mapping is stated explicitly in the IEEE DataPort record.

## Channels

The raw recording has 132 channels = **122 scalp EEG + 8 in-ear + Trigger + REF**; the
processed files keep only the 122 scalp and 8 in-ear signals (Trigger/REF dropped). The 8
in-ear electrodes:

| Ear label | Position |
|---|---|
| `LF`, `LB` / `RF`, `RB` | left / right **ear-canal**, front & back |
| `LOU`, `LOD` / `ROU`, `ROD` | left / right **concha** (outer ear), upper & lower |

The 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.

## 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
```

Key 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 is
recoverable 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

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 DataPort
record. Processed with `dataset/preprocess_motor.py` at eegfm schema `0.5.0`.