Abstract
High-performance brain-computer interfaces (BCIs) typically require invasive surgery to achieve high data rates. This paper introduces Brain2Qwerty, a non-invasive deep learning architecture that decodes full sentences from Magnetoencephalography (MEG) and Electroencephalography (EEG) recordings while users type. By integrating convolutional feature extraction, transformer-based contextual refinement, and an n-gram language model, Brain2Qwerty achieves a character error rate (CER) as low as 19% with MEG. These results demonstrate that non-invasive BCIs can capture fine-grained motor execution signals to enable complex natural language production.
Introduction
The primary hurdle for widespread BCI adoption is the trade-off between signal quality and invasiveness. Surgical implants provide high-fidelity signals but carry risks like infection or hemorrhage. Conversely, non-invasive methods like EEG often suffer from low signal-to-noise ratios, limiting their use to simple control tasks. This research addresses whether complex language can be decoded from the brain's motor signals during the familiar task of typing, potentially offering a safe yet high-speed communication channel for patients with motor impairments.
Methodology
The researchers developed the Brain2Qwerty pipeline, which processes brain activity through three distinct stages:
- Convolutional Module: Extracts temporal and spatial features from 500ms windows of brain signals using spatial attention and convolutional blocks.
- Transformer Module: Refines predictions by considering the entire sentence context, allowing the model to leverage the relationships between sequential keystrokes.
- Language Module: A pretrained 9-gram character-level language model trained on Spanish Wikipedia acts as a statistical "spellcheck" to correct remaining errors.
The study involved 35 healthy volunteers who typed memorized Spanish sentences on a non-ferromagnetic QWERTY keyboard while undergoing MEG or EEG recording. The dataset comprised approximately 193,000 characters for MEG and 146,000 for EEG.
Results and Discussion
The experimental results highlight a significant performance advantage for MEG over EEG. MEG achieved an average CER of 32%, with top-performing individuals reaching 19%. In contrast, EEG performance was notably lower, with an average CER of 67%.
Key findings include:
- Model Specialization: Clustering analysis revealed that the model's internal embeddings naturally grouped keys by their physical QWERTY layout, indicating it learned the motor patterns of typing.
- Motor Execution Focus: Performance drops during user typos suggest the model tracks motor execution rather than abstract intent.
- Architectural Impact: The full Brain2Qwerty pipeline significantly outperformed standard baselines like EEGNet, particularly in the MEG condition where it was 2.25x more effective.
Conclusion and Future Directions
While Brain2Qwerty represents a major step forward for non-invasive BCIs, several challenges remain. The current system is not yet real-time, as it requires full-sentence context for the Transformer and Language modules. Additionally, the reliance on supervised learning with ground-truth typing labels poses a challenge for "locked-in" patients. Future work will explore the use of wearable MEG sensors (OPMs) for portability and clinical validation in patients with severe motor disabilities.
Summary updated