MegNIST, A Benchmark for Non-Invasive Inner Speech Decoding

Teyun Kwon, Pratik Somaiya, Gereon Elvers, Francesco Mantegna, Anna Camera, Sven Braeutigam, Mark Woolrich, Oiwi Parker JonesarXiv 2026 · arXiv

TL;DR

MegNIST is a new, standardized benchmark dataset for decoding "inner speech" (imagined words) from non-invasive MEG brain scans. By providing 12,000 high-quality trials and machine-learning-ready tools, it aims to do for neural decoding what the original MNIST did for computer vision: lower the barrier to entry and accelerate rapid prototyping.

What Problem Does This Paper Address?

Neural decoding—the task of mapping brain activity to meaningful output like text or speech—is a frontier for deep learning. However, the field faces a "data bottleneck." Most high-quality datasets are gated behind institutional approvals, require massive domain expertise to preprocess, or lack standardized "train/test" splits, making it nearly impossible to compare different machine learning models fairly.

Furthermore, most existing speech datasets focus on heard speech. For a practical Brain-Computer Interface (BCI) aimed at helping paralyzed patients, we need to decode inner speech (the silent imagination of speaking). MegNIST addresses this by providing a massive, open-access, and pre-processed dataset specifically designed for ML researchers to jump straight into model building.

Methods

The researchers recorded 12,000 trials from a single participant using Magnetoencephalography (MEG), which measures the tiny magnetic fields produced by neural activity with millisecond precision.

The MegNIST experimental paradigm: participants imagine saying a digit while 306 MEG sensors record their brain activity.

Key technical steps included: * The Task: The participant was shown a digit (0-9) and asked to imagine saying it three times rapidly within a 750ms window. * Preprocessing: They used Signal Space Separation (SSS) to remove environmental noise and head-movement artifacts, followed by bandpass filtering (0.1–125 Hz) and downsampling to 250 Hz. * The Baseline Model: To prove the data was decodable, they used a simple Multi-Layer Perceptron (MLP). They flattened the 306-channel MEG data into a single feature vector of 76,500 elements per trial. * Standardization: The data is provided via the pnpl Python library, allowing researchers to load it directly into PyTorch as HDF5 tensors, bypassing the need for complex neuroimaging software.

Datasets

The primary contribution is the MegNIST dataset:

  • Scale: 12,000 trials (1,200 per digit).
  • Splits: 10,000 for training, 1,000 for validation, and 1,000 for testing.
  • Temporal Integrity: Crucially, the splits are assigned by entire experimental runs rather than random shuffling. This prevents "information leakage" from slow physiological changes that occur over time, ensuring the model truly learns to decode speech rather than just identifying the time of day.
Overview of the dataset sessions and the simple MLP architecture used for baseline validation.

Key Insights and Ideas

  • Depth Over Breadth: The authors chose a "deep" approach (lots of data from one person) rather than a "broad" one (little data from many people). This accounts for the high variability between individuals' brains, providing enough data for deep learning models to actually converge.
  • The Spatiotemporal Cascade: Even though the speech was only imagined, the researchers found a clear progression of brain activity. It starts with visual processing (~100ms), moves to lexical access (~242ms), and ends with phonological encoding (~580ms). This confirms that MegNIST captures the complex linguistic pipeline of the human brain.
  • Accessibility as a Feature: By hosting the data on Hugging Face and providing a PyTorch loader, the authors are intentionally trying to "democratize" neuroimaging research, moving it out of specialized labs and into the broader ML community.

Key Results

The baseline results prove that inner speech decoding is viable, even with simple models:

  • Classification Accuracy: The 1024-unit MLP achieved 22.6% accuracy on the test set. While this sounds low, it is significantly above the 10% chance level for a 10-class problem.
  • Statistical Significance: Permutation testing ($p < 10^{-5}$) confirmed that the model was picking up on real neural signals related to the digits, not just random noise.
Validation and test accuracy across different hidden layer sizes, showing the 1024-unit model as the top performer.
Permutation testing results showing the observed accuracy (yellow line) far exceeding the null distribution (green).

Limitations and Future Work

  • Single Subject: The current dataset doesn't allow for testing how well a model generalizes to a new person. Future iterations would benefit from multi-subject data.
  • Vocabulary Size: Decoding 10 digits is a great benchmark, but real-world utility requires moving toward full-sentence decoding and larger vocabularies.
  • Healthy vs. Clinical: The data comes from a healthy volunteer. The ultimate goal is to apply these methods to patients with speech disabilities, whose neural signals may differ.

MegNIST represents a vital stepping stone, providing the "clean" environment needed to refine the algorithms that will one day power non-invasive, thought-to-speech communication devices.

Summary updated

Abstract

MegNIST is a benchmark dataset for developing and evaluating machine learning methods for inner speech decoding from magnetoencephalography (MEG). The dataset comprises 12,000 trials of a single participant imagining speaking the digits zero through nine, recorded across four sessions. Each trial contains 306-channel MEG recordings sampled at 250 Hz, preprocessed using signal space separation, filtering, and downsampling. Data are provided as pre-defined training (10,000 trials), validation (1,000 trials), and test (1,000 trials) splits, with entire experimental runs assigned to each split to preserve temporal independence. The dataset is available in both BIDS format for neuroimaging analysis and as serialised tensors for machine learning workflows. Baseline classification results demonstrate that imagined digits can be decoded significantly above chance. Standardised splits, validated baselines, example code, and a PyTorch-compatible loader in the pnpl Python library enable straightforward integration with machine learning frameworks, lowering barriers for researchers to rapidly develop and benchmark inner speech decoding methods for non-invasive brain-computer interfaces.
BibTeX
@misc{kwon2026megnist,
  author = {Teyun Kwon and Pratik Somaiya and Gereon Elvers and Francesco Mantegna and Anna Camera and Sven Braeutigam and Mark Woolrich and Oiwi Parker Jones},
  title = {{MegNIST, A Benchmark for Non-Invasive Inner Speech Decoding}},
  year = {2026},
  eprint = {2611.21399},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.21399},
}
Figure