arXiv:2610.20349cs.LGOct 2026

Manuscript Offprint

arXiv:2610.20349

NeuroDETR: Multiscale Discrete Spatiotemporal Tokenization for Asynchronous EEG Event Detection

Yaozhi Wen, Kun Zhao, Wei Wei, Haoyang Chen, Kangning Wang, Yi Sun, Shaowei Gu, Dingkun Liu, Shuang Qiu, Huiguang He

ABSTRACT

Asynchronous EEG event detection supports practical brain-computer interfaces by identifying event classes and temporal boundaries directly from continuous recordings without predefined event boundaries at inference time. The primary challenge lies in extracting event-related patterns embedded in ongoing background activity. To address this, we propose NeuroDETR, a discrete spatiotemporal multiscale framework that combines structured tokenization with event-aware feature refinement. Multiscale temporal codebooks capture brief responses and sustained dynamics, while Spatial-Pyramid VQ hierarchically encodes spatial structure across EEG channels. These complementary representations form a compact event memory for jointly classifying events and estimating their onsets and offsets. Before tokenization, we apply FOCAL, an event-aware sparse attention module that uses predicted event presence to guide temporal feature refinement and spatial aggregation, emphasizing likely event periods while preserving context across the recording. Experiments on eight EEG datasets that span diverse paradigms demonstrate state-of-the-art performance. These findings provide a basis for the development of BCI systems that recognize meaningful neural activity during continuous interaction and monitoring.

1 INTRODUCTION

Brain–computer interfaces (BCIs) establish direct communication pathways between neural activity and external devices by translating neural signals into actionable information for device control, human–computer interaction, and clinical decision-making [1, 2]. Achieving this goal depends on reliably identifying behaviorally or physiologically meaningful neural events in continuous electroencephalographic (EEG) recordings. Asynchronous EEG decoding addresses this challenge by jointly identifying event categories and localizing their onset and offset within the ongoing signal.

As shown in Figure 1a (i), a straightforward approach to asynchronous decoding applies sliding-window classifiers to continuous EEG, assigning each window an event or background label [3, 4]. However, the mismatch between fixed-length windows and variable event durations and boundaries can fragment detections or merge adjacent events, making performance sensitive to window settings and post-processing rules [5]. As illustrated in Figure 1a (ii), query-based detection addresses this

Figure

ii. Sliding-window classification

iii. Query-based detection

(a) EEG decoding paradigms

Figure

(b) Relative performance

Figure 1: EEG decoding paradigms and relative performance. (a) Sliding-window classification and query-based event detection. (b) Performance of NeuroDETR and six baselines across eight datasets. Scores on each dataset are normalized by NeuroDETR's score (NeuroDETR = 1).

mismatch by directly mapping continuous EEG to an unordered set of events, each characterized by its category, onset, and offset.

The effectiveness of this approach depends on how well the EEG features supplied to the decoder preserve event-specific information. Existing methods use cross-attention to aggregate information from long feature sequences into a fixed set of continuous latent tokens, but do not explicitly organize event cues across temporal scales and spatial regions [6, 7]. Across EEG datasets and paradigms, events vary in duration, occurrence frequency, and spatial distribution. Their responses are also embedded in ongoing background activity, requiring feature aggregation to preserve weak or transient event cues.

In this study, we propose NeuroDETR, a multiscale discrete spatiotemporal framework for asynchronous EEG event detection. NeuroDETR uses vector quantization to organize continuous features into reusable learned codewords. To accommodate differences across datasets and paradigms, multiscale temporal VQ represents both brief responses and sustained dynamics, while SpatialPyramid VQ encodes channel information at complementary spatial levels. These representations form a compact event memory that supports joint localization and classification within a unified detection architecture.

To guide this representation toward event-related activity, we introduce FOCAL, an event-aware sparse attention module. FOCAL uses predicted event presence to guide temporal feature refinement before quantization and temporal pooling within the spatial branch, while retaining cross-window context. This shared event guidance connects the temporal and spatial representations, supplying the DETR decoder with event-aware multiscale information for predicting event classes and boundaries. We evaluate NeuroDETR on eight EEG datasets spanning P300, motor imagery, motor execution, speech, and seizure detection. NeuroDETR achieves the highest event-level F1 among the evaluated methods on all eight datasets, demonstrating its effectiveness across EEG paradigms with diverse event characteristics. By improving neural event detection in continuous EEG, NeuroDETR supports the development of practical BCI applications.

Our main contributions are summarized as follows:

• We propose NeuroDETR, which jointly predicts event classes, onsets, and offsets from continuous EEG without predefined event boundaries. At its core, vector quantization organizes EEG features into a compact event memory, with multiscale temporal and hierarchical spatial codebooks accommodating diverse event characteristics across paradigms.

• We introduce FOCAL, an event-aware sparse attention module that concentrates local feature refinement on likely event periods while preserving cross-window context. By sharing event-presence estimates with spatial aggregation, FOCAL directs both temporal and spatial tokenization toward event-relevant information.

• Experiments on eight EEG datasets spanning diverse paradigms demonstrate state-of-the-art performance. Ablation studies support the complementary contributions of spatiotemporal tokenization and event-aware refinement.

References (35)