EEGdash›NeMAR›NM000229
Iss. 229 · 27 subjects · 196 recordings · CC0
Dataset Brief · Gwilliams et al. 2023 — Introducing MEG-MASC

NM000229: meg dataset, 27 subjects#

Gwilliams et al. 2023 — Introducing MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing

Access recordings and metadata through EEGDash.

Citation: Laura Gwilliams, Graham Flick, Alec Marantz, Liina Pylkkänen, David Poeppel, Jean-Rémi King (2019). Gwilliams et al. 2023 — Introducing MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing. 10.82901/nemar.nm000229

Modality: meg Subjects: 27 Recordings: 196 License: CC0 Source: nemar

Metadata: Complete (100%)

27-participant MEG dataset — Gwilliams et al. 2023 — Introducing MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing.

MEG · 256 ch1000 HzBIDS 1.9.04 tasks2 sessionsHealthyAuditoryLanguage
Layer 01Study
What was asked
Hypothesis, independent & dependent variables, paradigm, cohort, and the editorial caveats around what the recordings can and cannot answer.
Layer 02Signal · BIDS
What was recorded
Sidecars, channels & electrodes, coordinate system, event semantics, and quality stats from the NEMAR pipeline when available.
Layer 03Training · ML
What you can train on
Recommended access modes — MNE Raw, braindecode windows, PyTorch DataLoader — plus the targets the metadata makes addressable.
§ 01Access · Get started

Quickstart#

Install

pip install eegdash

Access the data

from eegdash.dataset import NM000229

dataset = NM000229(cache_dir="./data")
# Get the raw object of the first recording
raw = dataset.datasets[0].raw
print(raw.info)

Filter by subject

dataset = NM000229(cache_dir="./data", subject="01")

Advanced query

dataset = NM000229(
    cache_dir="./data",
    query={"subject": {"$in": ["01", "02"]}},
)

Iterate recordings

for rec in dataset:
    print(rec.subject, rec.raw.info['sfreq'])

If you use this dataset in your research, please cite the original authors.

BibTeX

@dataset{nm000229,
  title = {Gwilliams et al. 2023 — Introducing MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing},
  author = {Laura Gwilliams and Graham Flick and Alec Marantz and Liina Pylkkänen and David Poeppel and Jean-Rémi King},
  doi = {10.82901/nemar.nm000229},
  url = {https://doi.org/10.82901/nemar.nm000229},
}
§ 02Study · The README

About This Dataset#

Laura Gwilliams, Graham Flick, Alec Marantz, Liina Pylkkänen, David Poeppel, Jean-Rémi King

  • Paper

  • Data

  • Code

    The “MEG-MASC” dataset provides a curated set of raw magnetoencephalography (MEG) recordings of 27 English speakers who listened to two hours of naturalistic stories. Each participant performed two identical sessions, involving listening to four fictional stories from the Manually Annotated Sub-Corpus (MASC) intermixed with random word lists and comprehension questions. We time-stamp the onset and offset of each word and phoneme in the metadata of the recording, and organize the dataset according to the ‘Brain Imaging Data Structure’ (BIDS). This data collection provides a suitable benchmark to large-scale encoding and decoding analyses of temporally-resolved brain responses to speech. We provide the Python code to replicate several validations analyses of the MEG evoked related fields such as the temporal decoding of phonetic features and word frequency. All code and MEG, audio and text data are publicly available to keep with best practices in transparent and reproducible research.

DOI

MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing.

Please cite

@article{gwilliams2022neural,

title={Neural dynamics of phoneme sequences reveal position-invariant code for content and order}, author={Gwilliams, Laura and King, Jean-Remi and Marantz, Alec and Poeppel, David}, journal={Nature Communications},

View full README

DOI

MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing.

Please cite

@article{gwilliams2022neural,

title={Neural dynamics of phoneme sequences reveal position-invariant code for content and order}, author={Gwilliams, Laura and King, Jean-Remi and Marantz, Alec and Poeppel, David}, journal={Nature Communications}, volume={13}, number={1}, pages={1–14}, year={2022}, publisher={Nature Publishing Group}

}

Task organisation

Each subject listened to four unique stories:
  • task-0 : ‘lw1’,

  • task-1 : ‘cable_spool_fort’,

  • task-2 : ‘easy_money’,

  • task-3 : ‘The_Black_Widow’

Stories were presented in a different order to each participant:

participant_id : task_order sub-01 : [0, 1, 2, 3] sub-02 : [0, 1, 3, 2] sub-03 : [0, 2, 3, 1] sub-04 : [3, 0, 1, 2] sub-05 : [2, 3, 1, 0] sub-06 : [0, 2, 1, 3] sub-07 : [0, 3, 1, 2] sub-08 : [3, 1, 0, 2] sub-09 : [2, 1, 3, 0] sub-10 : [1, 2, 3, 0] sub-11 : [1, 3, 2, 0] sub-12 : [2, 0, 3, 1] sub-13 : [1, 3, 0, 2] sub-14 : [1, 0, 3, 2] sub-15 : [2, 1, 0, 3] sub-16 : [3, 0, 2, 1] sub-17 : [1, 2, 3, 0] sub-18 : [2, 0, 1, 3] sub-19 : [0, 3, 2, 1] sub-20 : [2, 3, 0, 1] sub-21 : [1, 2, 3, 0] sub-22 : [1, 0, 2, 3] sub-23 : [0, 2, 3, 1] sub-24 : [3, 1, 2, 0] sub-25 : [0, 1, 3, 2] sub-26 : [3, 1, 0, 2] sub-27 : [1, 2, 3, 0]

Stimulus timestamps

The timing of each phoneme and each word is provided in each sub-*_ses-*_task-*_events.tsv file, for each subject, session and task. The timing links the MEG recording to the relevant speech moments of that story.

Each events file contains five columns:
  • onset (float) : onset time of event in seconds

  • duration (float) : duration of event in seconds

  • trial_type (dict) : dictionary of key:value pairs providing information about the event

  • sample (int) : onset time of event in MEG samples

Stories.

Each participant listened to four fictional stories, over the course of two ~1h-long MEG sessions, with the exception of 5 subjects who only underwent 1 session. The stories were played in different orders across participants. These stories were originally selected because they had been annotated for their syntactic structures (MASC). The corresponding text files can be found in stimuli/text/*.txt

Word lists and pseudo-words.

To potentially investigate MEG responses to words independently of their narrative context, the text of these stories have been supplemented with word lists. Specifically, a random word list consisting of the unique content words (nouns, proper nouns, verbs, adverbs and adjectives) selected from the preceding text segment was added in a random order. In addition, a small fraction (<1%) of non-words were inserted into the natural sentences of the stories. The corresponding text files can be found in stimuli/text_with_wordlist/*.txt. For simplicity, the brain responses to these word lists and to these pseudo words are fully discarded from the present study.

Audio synthesis.

Each of these stories was synthesized with Mac OS Mojave © version 10.14 text-to-speech. Voices (n=3 female) and speech rates (145 - 205 words per minute) varied every 5-20 sentences. The inter-sentence interval randomly varied between 0 and 1,000 ms. Both speech rate and inter-sentence intervals were sampled from a uniform distribution. Each text_with_wordlist files was divided into ~3 min sound files, which can be found in stimuli/audio/*.wav.

Forced Alignment.

The timing of words and phonemes were inferred from the forced-alignment between the wav and text files, using the ‘gentle aligner’ from the Python module lowerquality (lowerquality/gentle). We discarded the words that did not get a forced alignment through this procedure. Analysis of the Mel spectrogram and of the phonetic decoding led to better results when using gentle than when using the Penn Forced Aligner originally used in Gwilliams et al MASC. The timing of each word and phoneme can be found in the events.tsv of each individual recording session.

Verification. To verify that the forced alignment did not have a systematic bias, we systematically check the MEG decoding of phonetic features for each sound file separately.

References

Appelhoff, S., Sanderson, M., Brooks, T., Vliet, M., Quentin, R., Holdgraf, C., Chaumon, M., Mikulan, E., Tavabi, K., Höchenberger, R., Welke, D., Brunner, C., Rockhill, A., Larson, E., Gramfort, A. and Jas, M. (2019). MNE-BIDS: Organizing electrophysiological data into the BIDS format and facilitating their analysis. Journal of Open Source Software 4: (1896). https://doi.org/10.21105/joss.01896 Niso, G., Gorgolewski, K. J., Bock, E., Brooks, T. L., Flandin, G., Gramfort, A., Henson, R. N., Jas, M., Litvak, V., Moreau, J., Oostenveld, R., Schoffelen, J., Tadel, F., Wexler, J., Baillet, S. (2018). MEG-BIDS, the brain imaging data structure extended to magnetoencephalography. Scientific Data, 5, 180110. https://doi.org/10.1038/sdata.2018.110

NEMAR Metadata#

[![DOI](https://img.shields.io/badge/DOI-10.82901%2Fnemar.nm000229-blue)](https://doi.org/10.82901/nemar.nm000229) # MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing. Laura Gwilliams, Graham Flick, Alec Marantz, Liina Pylkkänen, David Poeppel, Jean-Rémi King - [Paper](https://arxiv.org) - [Data](https://osf.io/rguwj/) - [Code](kingjr/meg-masc) ## Abstract The “MEG-MASC” dataset provides a curated set of raw magnetoencephalography (MEG) recordings of 27 English speakers who listened to two hours of naturalistic stories. Each participant performed two identical sessions, involving listening to four fictional stories from the Manually Annotated Sub-Corpus (MASC) intermixed with random word lists and comprehension questions. We time-stamp the onset and offset of each word and phoneme in the metadata of the recording, and organize the dataset according to the ‘Brain Imaging Data Structure’ (BIDS). This data collection provides a suitable benchmark to large-scale encoding and decoding analyses of temporally-resolved brain responses to speech. We provide the Python code to replicate several validations analyses of the MEG evoked related fields such as the temporal decoding of phonetic features and word frequency. All code and MEG, audio and text data are publicly available to keep with best practices in transparent and reproducible research. ## Please cite @article{gwilliams2022neural,

title={Neural dynamics of phoneme sequences reveal position-invariant code for content and order}, author={Gwilliams, Laura and King, Jean-Remi and Marantz, Alec and Poeppel, David}, journal={Nature Communications}, volume={13}, number={1}, pages={1–14}, year={2022}, publisher={Nature Publishing Group}

} ## Task organisation Each subject listened to four unique stories:

  • task-0 : ‘lw1’,

  • task-1 : ‘cable_spool_fort’,

  • task-2 : ‘easy_money’,

  • task-3 : ‘The_Black_Widow’

Stories were presented in a different order to each participant:

participant_id : task_order sub-01 : [0, 1, 2, 3] sub-02 : [0, 1, 3, 2] sub-03 : [0, 2, 3, 1] sub-04 : [3, 0, 1, 2] sub-05 : [2, 3, 1, 0] sub-06 : [0, 2, 1, 3] sub-07 : [0, 3, 1, 2] sub-08 : [3, 1, 0, 2] sub-09 : [2, 1, 3, 0] sub-10 : [1, 2, 3, 0] sub-11 : [1, 3, 2, 0] sub-12 : [2, 0, 3, 1] sub-13 : [1, 3, 0, 2] sub-14 : [1, 0, 3, 2] sub-15 : [2, 1, 0, 3] sub-16 : [3, 0, 2, 1] sub-17 : [1, 2, 3, 0] sub-18 : [2, 0, 1, 3] sub-19 : [0, 3, 2, 1] sub-20 : [2, 3, 0, 1] sub-21 : [1, 2, 3, 0] sub-22 : [1, 0, 2, 3] sub-23 : [0, 2, 3, 1] sub-24 : [3, 1, 2, 0] sub-25 : [0, 1, 3, 2] sub-26 : [3, 1, 0, 2] sub-27 : [1, 2, 3, 0]

## Stimulus timestamps The timing of each phoneme and each word is provided in each sub-*_ses-*_task-*_events.tsv file, for each subject, session and task. The timing links the MEG recording to the relevant speech moments of that story. Each events file contains five columns:

  • onset (float) : onset time of event in seconds

  • duration (float) : duration of event in seconds

  • trial_type (dict) : dictionary of key:value pairs providing information about the event

  • sample (int) : onset time of event in MEG samples

## Stories. Each participant listened to four fictional stories, over the course of two ~1h-long MEG sessions, with the exception of 5 subjects who only underwent 1 session. The stories were played in different orders across participants. These stories were originally selected because they had been annotated for their syntactic structures (MASC). The corresponding text files can be found in stimuli/text/.txt ## Word lists and pseudo-words. To potentially investigate MEG responses to words independently of their narrative context, the text of these stories have been supplemented with word lists. Specifically, a random word list consisting of the unique content words (nouns, proper nouns, verbs, adverbs and adjectives) selected from the preceding text segment was added in a random order. In addition, a small fraction (<1%) of non-words were inserted into the natural sentences of the stories. The corresponding text files can be found in stimuli/text_with_wordlist/.txt. For simplicity, the brain responses to these word lists and to these pseudo words are fully discarded from the present study. ## Audio synthesis. Each of these stories was synthesized with Mac OS Mojave © version 10.14 text-to-speech. Voices (n=3 female) and speech rates (145 - 205 words per minute) varied every 5-20 sentences. The inter-sentence interval randomly varied between 0 and 1,000 ms. Both speech rate and inter-sentence intervals were sampled from a uniform distribution. Each text_with_wordlist files was divided into ~3 min sound files, which can be found in stimuli/audio/*.wav. ## Forced Alignment. The timing of words and phonemes were inferred from the forced-alignment between the wav and text files, using the ‘gentle aligner’ from the Python module lowerquality (lowerquality/gentle). We discarded the words that did not get a forced alignment through this procedure. Analysis of the Mel spectrogram and of the phonetic decoding led to better results when using gentle than when using the Penn Forced Aligner originally used in Gwilliams et al MASC. The timing of each word and phoneme can be found in the events.tsv of each individual recording session. ## Verification. To verify that the forced alignment did not have a systematic bias, we systematically check the MEG decoding of phonetic features for each sound file separately. References ———- Appelhoff, S., Sanderson, M., Brooks, T., Vliet, M., Quentin, R., Holdgraf, C., Chaumon, M., Mikulan, E., Tavabi, K., Höchenberger, R., Welke, D., Brunner, C., Rockhill, A., Larson, E., Gramfort, A. and Jas, M. (2019). MNE-BIDS: Organizing electrophysiological data into the BIDS format and facilitating their analysis. Journal of Open Source Software 4: (1896). https://doi.org/10.21105/joss.01896 Niso, G., Gorgolewski, K. J., Bock, E., Brooks, T. L., Flandin, G., Gramfort, A., Henson, R. N., Jas, M., Litvak, V., Moreau, J., Oostenveld, R., Schoffelen, J., Tadel, F., Wexler, J., Baillet, S. (2018). MEG-BIDS, the brain imaging data structure extended to magnetoencephalography. Scientific Data, 5, 180110. https://doi.org/10.1038/sdata.2018.110

License: CC0

Authors:

  • Laura Gwilliams

  • Graham Flick

  • Alec Marantz

  • Liina Pylkkänen

  • David Poeppel

  • … and 1 more

Versions:

Version

DOI

Released

current

10.82901/nemar.nm000229

§ 03Cohort · Participants

Cohort#

Dataset Statistics#

Age distribution by gender (n=27, range 18–41 yr, mean 24.6 yr)

152025303540
Female · 15Male · 12

Sex composition

27
subjects
Female
15
Male
12
F : M ratio
1.25 : 1
56% female · n = 27 subjects with reported sex.
HandednessRight · 27

Channel counts: 256 ch (n=196 recordings)

Sampling frequencies: 1000.0 Hz (n=196 recordings)

Total recording duration: 57 h

§ 04Signal · Electrodes & trace

Signal · Electrodes & live trace#

Fig. 01 Signal & montage 256 ch · MEG · 1000 Hz · 27 subjects, 196 recordings

No scalp electrode layout is currently indexed for this dataset. Once the eegdash montage registry ingests it, the interactive viewer will appear here automatically.

NEMAR Processing Statistics#

The plots below are generated by NEMAR’s automated EEG pipeline. The histogram shows pipeline success for data cleaning and ICA decomposition, the percentage of data frames and EEG channels retained after artefact removal, line noise per channel (RMS, dB), and the age/gender distribution of participants.

HED event descriptors word cloud HED event descriptors word cloud — NM000229
§ 05Manifest · BIDS tree

Manifest#

File Explorer#

Browse the BIDS file structure of this dataset. Records are fetched on demand from the EEGDash catalog the first time you open the explorer.

Recordings—
Files—
Subjects—
Modalities—
Click to load file structure…
Full dataset metadata table

Dataset ID

NM000229

Title

Gwilliams et al. 2023 — Introducing MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing

Author (year)

Gwilliams2023

Canonical

—

Importable as

NM000229, Gwilliams2023

Year

2019

Authors

Laura Gwilliams, Graham Flick, Alec Marantz, Liina Pylkkänen, David Poeppel, Jean-Rémi King

License

CC0

Citation / DOI

10.82901/nemar.nm000229

Source links

OpenNeuro | NeMAR | Source URL

Copy-paste BibTeX
@dataset{nm000229,
  title = {Gwilliams et al. 2023 — Introducing MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing},
  author = {Laura Gwilliams and Graham Flick and Alec Marantz and Liina Pylkkänen and David Poeppel and Jean-Rémi King},
  doi = {10.82901/nemar.nm000229},
  url = {https://doi.org/10.82901/nemar.nm000229},
}
§ 06API · Programmatic access

API Reference#

Signature
eegdash.dataset
class
eegdash.dataset.NM000229(cache_dir, query=None, s3_bucket=None, **kwargs)
Bases: EEGDashDataset
Author (year)Gwilliams2023
Canonical—
Importable asNM000229 · Gwilliams2023
Sourceeegdash/dataset/registry.py · [source ↗]
class eegdash.dataset.NM000229(cache_dir: str, query: dict | None = None, s3_bucket: str | None = None, **kwargs)[source]#

Gwilliams et al. 2023 — Introducing MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing

Study:

nm000229 (NeMAR)

Author (year):

Gwilliams2023

Canonical:

—

Also importable as: NM000229, Gwilliams2023.

Modality: meg; Experiment type: Language; Subject type: Healthy. Subjects: 27; recordings: 196; tasks: 4.

Parameters:
  • cache_dir (str | Path) – Directory where data are cached locally.

  • query (dict | None) – Additional MongoDB-style filters to AND with the dataset selection. Must not contain the key dataset.

  • s3_bucket (str | None) – Base S3 bucket used to locate the data.

  • **kwargs (dict) – Additional keyword arguments forwarded to EEGDashDataset.

data_dir#

Local dataset cache directory (cache_dir / dataset_id).

Type:

Path

query#

Merged query with the dataset filter applied.

Type:

dict

records#

Metadata records used to build the dataset, if pre-fetched.

Type:

list[dict] | None

Notes

Each item is a recording; recording-level metadata are available via dataset.description. query supports MongoDB-style filters on fields in ALLOWED_QUERY_FIELDS and is combined with the dataset filter. Dataset-specific caveats are not provided in the summary metadata.

References

OpenNeuro dataset: https://openneuro.org/datasets/nm000229 NeMAR dataset: https://nemar.org/dataexplorer/detail?dataset_id=nm000229 DOI: https://doi.org/10.82901/nemar.nm000229

Examples

>>> from eegdash.dataset import NM000229
>>> dataset = NM000229(cache_dir="./data")
>>> recording = dataset[0]
>>> raw = recording.load()
__init__(cache_dir: str, query: dict | None = None, s3_bucket: str | None = None, **kwargs)[source]#
save(path: str, overwrite: bool = False, offset: int = 0)[source]#

Save datasets to files by creating one subdirectory for each dataset:

path/
    0/
        0-raw.fif | 0-epo.fif
        description.json
        raw_preproc_kwargs.json (if raws were preprocessed)
        window_kwargs.json (if this is a windowed dataset)
        window_preproc_kwargs.json  (if windows were preprocessed)
        target_name.json (if target_name is not None and dataset is raw)
    1/
        1-raw.fif | 1-epo.fif
        description.json
        raw_preproc_kwargs.json (if raws were preprocessed)
        window_kwargs.json (if this is a windowed dataset)
        window_preproc_kwargs.json  (if windows were preprocessed)
        target_name.json (if target_name is not None and dataset is raw)
Parameters:
  • path (str) –

    Directory in which subdirectories are created to store

    -raw.fif | -epo.fif and .json files to.

  • overwrite (bool) – Whether to delete old subdirectories that will be saved to in this call. If a dataset still reads its data lazily from one of them, a ValueError is raised before anything is deleted: load the data into memory first (preload=True) or save to another directory.

  • offset (int) – If provided, the integer is added to the id of the dataset in the concat. This is useful in the setting of very large datasets, where one dataset has to be processed and saved at a time to account for its original position.

Access modesMNE → braindecode → PyTorch → ML
.rawMNE Raw object — standard tools (filter, epoch, ICA, plot_psd).mne
DataLoaderWraps the windowed dataset into a PyTorch DataLoader; supports parallel workers and on-the-fly augmentations.pytorch
Zarr cacheOptional braindecode Zarr mirror for fast resume; persisted to cache_dir.zarr
Hugging FacePre-bundled mirror at EEGDash/nm000229 · pull with datasets.load_dataset("EEGDash/nm000229").huggingface
Croissant 1.0Machine-readable JSON-LD descriptor — NM000229.croissant.json (MLCommons schema, ingestible by PyTorch / TensorFlow / JAX).mlcommons
Examples using EEGDashcurated · start here

Swap any load_dataset(...) call for nm000229 to reproduce the tutorial on this dataset.

Citation

Laura Gwilliams, Graham Flick, Alec Marantz, Liina Pylkkänen, David Poeppel, … (2019). Gwilliams et al. 2023 — Introducing MEG-MASC: a high-quality magneto-encephalography dataset for evaluating natural speech processing. 10.82901/nemar.nm000229

Provenance

¹Contributed to nemar in BIDS format.

²Curated & ingested by the EEGDash catalog; see CITATION.cff for canonical reference.

³Persistent identifier: 10.82901/nemar.nm000229.

BIDS
BIDS 1.9.0
Sidecars
events · events.json · channels · coordsystem · meg.json
Provenance
Machine-readable

See Also#