The dataset viewer is not available for this split.
Error code: StreamingRowsError
Exception: ValueError
Message: Dataset 'ch_names' has length 12 but expected 7409
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 147, in get_rows_or_raise
return get_rows(
dataset=dataset,
...<4 lines>...
column_names=column_names,
)
File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/utils.py", line 127, in get_rows
rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
File "/src/services/worker/src/worker/utils.py", line 483, in safe_iter
yield from ds.decode(False) if ds.features else ds
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2840, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2373, in __iter__
for key, pa_table in self._iter_arrow():
~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2398, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/hdf5/hdf5.py", line 76, in _generate_tables
num_rows = _check_dataset_lengths(h5, self.info.features)
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/hdf5/hdf5.py", line 353, in _check_dataset_lengths
raise ValueError(f"Dataset '{path}' has length {dset.shape[0]} but expected {num_rows}")
ValueError: Dataset 'ch_names' has length 12 but expected 7409Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
EESM17-Processed
Processed HDF5 export of the EESM17 OpenNeuro dataset ("Ear-EEG Sleep Monitoring 2017", Mikkelsen et al., Aarhus University; source paper 10.1186/s12938-017-0400-5). It contains paired in-ear EEG and scalp EEG sleep-staging samples from the single at-home sleep night (ses-001) of all 9 subjects — recorded with simultaneous partial PSG and 14 ear-EEG electrodes on one amplifier.
This is the earliest and smallest of the three Aarhus ear-EEG sleep datasets in this collection (EESM19-Processed, EESM23-Processed). All three share the same schema, the same five sleep classes in the same index order, and the same 30-second-epoch-per-sample layout, so they are directly interchangeable as benchmark tasks.
Source recordings
Each subject performed two recordings on the same evening. Only the night recording (task-sleep) is exported here; the pre-bed relaxed-wakefulness recording (task-wake) carries no sleep scoring and is not used. Recordings were made at the subject's home, with the equipment mounted in the afternoon.
| Subject | Recording | Lights off | Scored epochs | Exported |
|---|---|---|---|---|
sub-001 |
7.72 h | 1.7 s | 926 | 926 |
sub-002 |
8.01 h | 872.6 s | 932 | 932 |
sub-003 |
9.12 h | 7087.6 s | 857 | 857 |
sub-004 |
9.73 h | 391.8 s | 1,150 | 1,150 |
sub-005 |
8.67 h | 1.7 s | 1,040 | 1,039 |
sub-006 |
6.29 h | 7924.9 s | 491 | 491 |
sub-007 |
8.22 h | 166.8 s | 964 | 964 |
sub-008 |
6.67 h | 1272.6 s | 758 | 757 |
sub-009 |
3.33 h | 3182.6 s | 293 | 293 |
| Total | 7,411 | 7,409 |
Preprocessing
Generated with Ear-EEG-FM-Benchmark/dataset/preprocess_eesm17.py using schema/eegfm version 0.5.0:
- 0.1–95 Hz band-pass and 50 Hz notch filtering on each continuous recording (see "95 Hz, not 100 Hz" below)
- no re-referencing and no resampling; the scalp mastoids are renamed
A1/A2→M1/M2(see below) - each labeled 30-second AASM scoring epoch is stored as one 30-second window (one sample = one epoch = one label = one prediction — the canonical sleep-staging unit)
- classes:
Wake,N1,N2,N3,REM;A/Artefact/Unscoredevents are dropped - real sensor/data-loss NaN/Inf samples are preserved and recorded in overall and per-channel quality fields (this dataset happens to contain none — see "Data quality")
- the ear-EEG and scalp outputs are strictly row-aligned; both are sliced from the same file on one shared timeline
- recording bounds are checked per 30-second window (the full epoch must lie inside the recording)
- all signal values are stored as
float32microvolts at 200 Hz (6,000 samples per window)
Why 30-second windows
The 30-second epoch is the unit at which sleep is scored (AASM) and evaluated: the
benchmark's reference foundation models (BENDR, EEGPT, CBraMod, REVE, and the EEGPT
comparison implementations of LaBraM/BIOT) all ingest full 30-second epochs downstream
and emit one stage prediction per epoch. Storing 30 s is also a strict superset of a
shorter export: the benchmark loader (dataset/loader.py) accepts an epoch_sec
argument and crops a shorter window from each stored sample at load time, so a 4-second
(or any ≤30 s) view is available without re-exporting; the reverse is not possible.
Notes specific to EESM17
Five things differ from the EESM19/EESM23 exports and are worth reading before use.
1. Scoring onsets are relative to "Lights off", not to the recording start
This is the most consequential difference, and getting it wrong silently corrupts
the labels. The onset column of *_task-sleep_acq-scoring_events.tsv runs
0, 30, 60, … — it looks recording-relative, but it is not. The dataset README
states "for all subjects, the sleep scoring begins at 'Lights out'", and the
dataset's own converter (code/bidsConversion/ntlab_create_scoringfile_tsv.py)
simply numbers epochs from the first scored epoch with no recording offset.
The export therefore adds the Lights Off onset L from
*_task-sleep_events.tsv to every scoring onset. This was verified on every
subject: L + n_epochs × 30 s reproduces the Lights On marker to within one
epoch for all 9 subjects (exactly, to 0.00 s, for sub-005):
sub-001 |
sub-002 |
sub-003 |
sub-004 |
sub-005 |
sub-006 |
sub-007 |
sub-008 |
sub-009 |
|
|---|---|---|---|---|---|---|---|---|---|
error vs Lights On |
+1.7 s | +0.1 s | −14.9 s | +7.7 s | 0.0 s | +23.9 s | +21.8 s | +5.7 s | +0.2 s |
Assuming recording-relative onsets instead would only be correct for the two
subjects whose lights-off happens to fall at t ≈ 0 (sub-001, sub-005), and
would misalign sub-003 and sub-006 by roughly two hours.
As a downstream check, spectral power in this export follows the expected sleep architecture in both modalities — δ (0.5–4 Hz) as a fraction of 0.5–30 Hz power is highest in N3 and lowest in REM, and σ (11–16 Hz, spindles) peaks in N2:
| δ / total | Wake | N1 | N2 | N3 | REM |
|---|---|---|---|---|---|
| scalp | 0.706 | 0.724 | 0.806 | 0.926 | 0.676 |
| in-ear | 0.858 | 0.815 | 0.847 | 0.928 | 0.803 |
2. Two ear electrodes are dropped (14 → 12 channels)
Per the dataset README: "Due to a miscommunication in the original sleep study, two ear-EEG channels, ERB1 and ELB1, were not used. However, they are included in the data set." Keeping them would place two never-connected electrodes into the input tensor, so the 14 ear channels present in the source are reduced to the 12 that were actually recorded.
3. A1/A2 are renamed to M1/M2
EESM17 uses the older mastoid nomenclature. EESM19 and EESM23 both store
M1 F3 C3 O1 M2 F4 C4 O2, so renaming makes the scalp montage name-for-name and
order-for-order identical across all three datasets — channel-name-keyed model
code (LaBraM's channel table, REVE's coordinate bank) then resolves the same rows
on every dataset. The signal itself is untouched.
4. Integer sleep-stage codes with a non-standard mapping
Like EESM19, the scoring column (staging) holds an integer code, not a string
stage name, and the mapping is not the usual AASM digit order — note
2 = REM and 5 = N3:
| code | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| stage | Wake | REM | N1 | N2 | N3 | A (movement/arousal) | Artefact | Unscored |
Codes 6/7/8 are dropped. Labels are re-emitted in the shared class order
(Wake, N1, N2, N3, REM) so class indices line up across datasets. Unlike EESM19
there is only one scorer, so there is no scorer selection to make.
Channel groups are selected by name (the EEGLAB .set marks every channel as
EEG, so EOG/EMG/DC/SpO2 cannot be told apart by type). All 9 subjects share an
identical 34-channel montage; EOG (LOC, ROC), EMG (CHIN12), and the
auxiliary Event/DIF*/DC*/OSAT channels are dropped.
5. 95 Hz, not 100 Hz — and the 200 Hz store is the native store
EESM19 and EESM23 both use a 0.1–100 Hz band-pass. That is not representable
at EESM17's 200 Hz sampling rate: 100 Hz is exactly the Nyquist frequency, and a
low-pass there has no transition band to occupy (MNE rejects it outright —
lowpass frequency 100.0 must be less than Nyquist (100.0)). The high cut is
therefore set to 95 Hz.
In practice this changes almost nothing. Content above Nyquist cannot exist in a 200 Hz recording — the acquisition hardware's anti-alias filter removed it before digitisation — and the source data confirms it: 95–100 Hz carries 0.003 % of total power, and 80–95 Hz carries 0.019 %. The other two datasets' 100 Hz-limited signal is likewise band-limited to the same 100 Hz once a model resamples it to 200 Hz.
The same fact makes a separate 200 Hz store unnecessary: this export is already
at 200 Hz, so the *-200hz.h5 files that EESM19-Processed ships as genuine
resampled copies would here be byte-for-byte duplicates
(resample_poly with up = down = 1). The benchmark's
training/run.py::resolve_h5 falls back to the native store when no -200hz.h5
exists, and every 200 Hz-family transform skips its resample when
native_sfreq == 200, so the native file is the 200 Hz store.
Files
| File | Channels | Shape (N, C, T) |
Size |
|---|---|---|---|
eesm17-in-ear-eeg.h5 |
ELA, ELB, ELG, ELK, ELE, ELI, ERA, ERB, ERG, ERK, ERE, ERI | (7,409, 12, 6000) |
1.99 GiB |
eesm17-scalp-eeg.h5 |
M1, F3, C3, O1, M2, F4, C4, O2 | (7,409, 8, 6000) |
1.33 GiB |
T = 6000 is one 30-second epoch at 200 Hz. N is the number of scored epochs — one sample per 30-second AASM epoch.
Label distribution (identical for both modalities — the samples are row-aligned):
| Wake | N1 | N2 | N3 | REM |
|---|---|---|---|---|
| 1,269 | 525 | 3,183 | 1,036 | 1,396 |
Per subject:
| Subject | Wake | N1 | N2 | N3 | REM | Total |
|---|---|---|---|---|---|---|
sub-001 |
71 | 25 | 422 | 253 | 155 | 926 |
sub-002 |
298 | 34 | 380 | 101 | 119 | 932 |
sub-003 |
311 | 87 | 245 | 57 | 157 | 857 |
sub-004 |
178 | 96 | 608 | 40 | 228 | 1,150 |
sub-005 |
176 | 83 | 437 | 91 | 252 | 1,039 |
sub-006 |
35 | 30 | 196 | 131 | 99 | 491 |
sub-007 |
87 | 94 | 517 | 121 | 145 | 964 |
sub-008 |
33 | 40 | 334 | 177 | 173 | 757 |
sub-009 |
80 | 36 | 44 | 65 | 68 | 293 |
| Total | 1,269 | 525 | 3,183 | 1,036 | 1,396 | 7,409 |
The class balance is typical of whole-night sleep (N2 dominant at 43 %, N1 rare at
7 %), and the per-subject spread is wide: sub-002/sub-003 are a third Wake,
while sub-006/sub-008 are under 8 %. sub-009's night is much shorter than
the rest (293 epochs vs a median of 926), which is worth keeping in mind for
leave-one-subject-out evaluation, where it is both the smallest training
contributor and the smallest test fold.
Retained and discarded epochs
The source scoring files label 7,411 30-second epochs across the 9 nights. Of
these, 7,410 carry one of the five retained sleep-stage labels and 1 is
Unscored; the A and Artefact codes do not occur anywhere in this dataset.
Each retained epoch becomes exactly one 30-second sample, so the final files
contain 7,409 strictly paired samples per modality:
| Reason | Epochs |
|---|---|
Unscored (code 8, sub-005) — outside the five-class task |
1 |
30-second epoch not fully inside the recording bounds (sub-008) |
1 |
| Total excluded | 2 |
The single out-of-bounds epoch is benign, and is the same effect seen in EESM19:
a scoring file annotates one epoch slightly past the end of the signal, so
onset + 30 s runs past the end of the recording and the epoch is dropped. No
session is dropped: all 9 nights load cleanly, and — unlike EESM19's two
truncated sessions — every .set header agrees with its .fdt.
Data quality
This export contains no NaN/Inf samples at all: nan_fraction is 0.0 for all
7,409 samples in both modalities, and no channel is dead for any part of any
night. That makes EESM17 the cleanest of the three datasets — for comparison,
EESM19-Processed retains 38,155 in-ear and 11,399 scalp samples with at least
one non-finite value. The quality fields are still present in the schema, so code
written against the other two exports needs no change.
Amplitude artifacts
Preprocessing deliberately preserves real sensor artifacts — no window is dropped for being noisy — so the store contains everything the night contained: genuine EEG plus whatever movement, electrode-pop and skin-potential excursions occurred. Physiological EEG lives around ±100 µV; an ear electrode disturbed by the subject rolling over produces millivolt-scale excursions that decay over tens of seconds. Reproduce any of the numbers below with:
python -m dataset.artifact_audit --family eesm17
python -m dataset.artifact_audit --all --stride 12 --csv results/artifact_audit.csv
Most epochs are clean; the distribution is heavy-tailed, not uniformly shifted. Peak amplitude per epoch, in-ear (median 275 µV, but p90 = 2.2 mV and p99 = 15 mV):
| band | epochs | share |
|---|---|---|
| 0–200 µV (physiological) | 2,444 | 33.0 % |
| 200–500 µV | 2,467 | 33.3 % |
| 500 µV–1 mV | 1,142 | 15.4 % |
| 1–2 mV | 570 | 7.7 % |
| 2–5 mV | 422 | 5.7 % |
| > 5 mV (severe motion) | 364 | 4.9 % |
Looked at per-sample rather than per-epoch, 60 % of in-ear epochs have >99 % of their samples inside ±200 µV and 78 % have >95 % — the typical contaminated epoch is clean signal with a burst at one end, not noise throughout. The scalp montage is markedly cleaner than the ear montage (83.3 % vs 60.1 % of epochs
99 % clean).
This is characteristic of unattended at-home ear-EEG, not specific to EESM17:
| store | median | > 1 mV | > 5 mV | epochs >99 % clean |
|---|---|---|---|---|
| EESM17 in-ear | 275 µV | 18.3 % | 4.9 % | 60.1 % |
| EESM17 scalp | 164 µV | 4.8 % | 0.3 % | 83.3 % |
| EESM19 in-ear | 165 µV | 18.5 % | 7.3 % | 71.2 % |
| EESM19 scalp | 197 µV | 14.8 % | 6.6 % | 74.5 % |
| EESM23 in-ear | 78 µV | 12.9 % | 2.2 % | 81.4 % |
| EESM23 scalp | 202 µV | 7.2 % | 1.9 % | 78.7 % |
(EESM17 rows are a full pass over all 7,409 epochs; the EESM19/EESM23 rows are a stride-12 subsample, which is why they differ slightly from those datasets' own cards.)
Two skews in how the artifacts are distributed matter more than the totals.
Artifacts concentrate in a few subjects
sub-001 |
sub-002 |
sub-003 |
sub-004 |
sub-005 |
sub-006 |
sub-007 |
sub-008 |
sub-009 |
|
|---|---|---|---|---|---|---|---|---|---|
| median (µV) | 221 | 258 | 584 | 184 | 892 | 691 | 227 | 161 | 183 |
| > 1 mV | 7.6 % | 12.7 % | 30.3 % | 6.4 % | 44.8 % | 18.5 % | 17.8 % | 9.4 % | 11.9 % |
| > 5 mV | 2.6 % | 1.6 % | 9.3 % | 0.6 % | 12.4 % | 10.2 % | 4.0 % | 1.2 % | 3.8 % |
sub-005's artifact rate is 7× sub-004's. Under leave-one-subject-out each
of these is a whole test fold, so between-fold variance is partly a measure of
recording quality rather than of the model. With only 9 subjects a single fold
carries ~11 % of the reported mean, so per-subject results are worth reading
alongside the mean ± std. (EESM19 shows the same effect at 6.8×, EESM23 at 3.1×.)
Amplitude leaks the Wake label
| stage | Wake | N1 | N2 | N3 | REM |
|---|---|---|---|---|---|
| median peak (µV) | 917 | 341 | 244 | 250 | 253 |
| > 1 mV | 47.7 % | 20.6 % | 10.9 % | 11.4 % | 12.7 % |
Wake epochs are 3.7× the amplitude of N2/N3/REM epochs. This is physiologically expected — subjects move, blink and talk while awake and lie still in deep sleep — and is itself corroboration that the labels are aligned to the signal. But it means raw amplitude is a shortcut feature for Wake. A model can learn "large signal ⇒ Wake" instead of learning EEG morphology, and that shortcut fails on a subject who moves during sleep. The signature to watch for is a suspiciously high Wake recall combined with N1 being absorbed into Wake in the confusion matrix. Every dataset in the collection shows this (EESM19 in-ear 7.5×, EESM23 in-ear 20×), so it is a property of the task, not of this export.
Interaction with model normalization
The benchmark's input transforms scale each epoch differently, so an artifact burst reaches each model differently. Measured over 60 in-ear epochs with peaks above 2 mV: "compression" is how much the genuine-EEG portion of the epoch shrinks when the burst is present versus when it is spliced out, and "peak input" is the largest value the network actually receives.
| normalization | models | compression (median / p90 / max) | peak input |
|---|---|---|---|
| per-trial z-score | eegnet, eegconformer, eegdeformer |
1.07× / 1.92× / 2.93× | 6.9 |
| 95th-percentile scaling | biot |
1.10× / 2.24× / 4.44× | 3.8 |
| z-score + clip(±15) | reve |
1.07× / 1.92× / 2.93× | 6.9 |
| fixed ÷100 | cbramod, labram_base |
none (scale is data-independent) | 49.8 |
Two results here are worth stating explicitly because they are easy to assume otherwise:
- REVE's clip never fires. A 3 mV burst is only ≈7σ after z-scoring, well inside the ±15 clip, so REVE's output is bit-identical to plain z-score on these epochs (0.000 % of samples clipped across the sample).
- BIOT's percentile scaling is not more robust here — it is marginally worse. A burst lasting ~3 s covers ~10 % of a 30 s epoch, which is above the 5 % the 95th percentile discards, so the scaling factor is inflated too.
The practical effect is smaller than the raw amplitudes suggest: the typical contaminated epoch loses ~7 % of its signal scale, with a tail reaching 2–4× in the worst cases. The fixed ÷100 transforms do not rescale at all, so they instead pass a ~50-unit input into a network that normally sees ~0.6.
No filtering is applied — preserving the artifacts is the pipeline's explicit
policy, applied identically across all three datasets and all models, so
cross-model and cross-dataset comparisons stay fair. Reproduce the table above
with python -m dataset.artifact_audit --family eesm17.
HDF5 schema (v0.5)
/data (N, C, 6000) float32
/durations (N,) int64
/nan_fraction (N,) float32
/channel_nan_fraction (N, C) float32
/labels (N,) int64
/sample_id (N,) int64
/subject (N,) string
/session (N,) string
/task (N,) string
/acquisition (N,) string
/run (N,) string
/recording_id (N,) string
/trial_id (N,) int64
/event_id (N,) int64
/split_group_id (N,) int64
/window_start_sample (N,) int64
/window_stop_sample (N,) int64
/ch_names (C,) string
event_id and split_group_id both identify the source 30-second scoring row;
here each sample is one epoch, so there is one sample per split group. For
sequence-model sleep staging that needs adjacent-epoch context, group by
subject (there is only one session per subject) and order by
window_start_sample. trial_id is -1 throughout — sleep scoring epochs are
events, not trials.
window_start_sample is an index into the continuous recording, i.e. it
already includes the lights-off offset described above; it is not the raw
onset × sfreq from the scoring file.
Important attributes include sfreq, class_names, unit, eegfm_version,
preprocess_config_json, split_group_kind, and window_reference. The
preprocess_config_json attribute records the effective filter band, the
scoring_onset_origin (lights_off_event), the dropped ear channels, and the
A1/A2 → M1/M2 rename.
One session per subject
Every subject has exactly one night (ses-001), unlike EESM19 (four nights) and
EESM23 (two scored nights). Cross-subject protocols (leave-one-subject-out) are
unaffected, but within-subject adaptation cannot hold out a session — it has
to split one night temporally. In this benchmark that is expressed as
within_splitter: 'sample-holdout' in the dataset profile, where EESM19/EESM23
use 'session-holdout'.
Storage format
The signal is stored uncompressed as float32 microvolts at the native
200 Hz, with /data chunked one sample per chunk — chunks = (1, C, 6000). This
layout is chosen for map-style DataLoader training: each __getitem__(i) reads
exactly one contiguous chunk (one 30-second epoch with its channels), so random
access across the whole file costs one chunk read and no wasted I/O. When the
loader crops a shorter epoch_sec window it reads only that slice of the chunk.
Compression is intentionally not applied. EEG windows are high-entropy signals
that gzip/lzf shrink only ~1.2–1.5×, and decompression would add CPU cost on every
sample fetched by the DataLoader workers. The files are therefore ≈ the raw array
size (N × C × 6000 × 4 bytes).
Citation
When using this data, cite the original study:
Mikkelsen, K. B., Villadsen, D. B., Otto, M., & Kidmose, P. (2017). Automatic sleep staging using ear-EEG. BioMedical Engineering OnLine, 16(1), 111. https://doi.org/10.1186/s12938-017-0400-5
and the OpenNeuro dataset: doi:10.18112/openneuro.ds004348.v1.0.4.
- Downloads last month
- 62