Manuscript Offprint
arXiv:2610.16921Time Window Optimization for Motor Imagery Classification via Temporal Structure Embedded Reinforcement Learning
Huan Luo, Na Lu, Xiaopeng Wang, and Ziyang Shang
Abstract—Online motor imagery-based brain-computer interfaces (MI-BCIs) usually processes continuous EEG signal with fixed-length sliding windows, which is inflexible, human intervened, and misaligned with neural events. Time window optimization has shown promising improvement as a substitute solution. However, the existing optimization methods typically evaluate windows isolatedly and fail to model temporal dependencies across consecutive windows, which may produce fragmented and physiologically implausible sequences. To address this limitation, we propose a novel Temporal Structure Embedded Reinforcement Learning (TSE-RL) framework. This framework embeds prior temporal-structure knowledge of MI events into a stable RL formulation, reformulating window optimization as a constrained Markov Decision Process with ordinal relation enforcement of neural event. First, the evaluation and action selection upon each window has been changed from simply “retain/discard” to semantic alignment between window and neural events as Discard/Onset/sustain/Offset. Second, action masking is imposed by a finite-state machine (FSM) which enforces physiologically plausible decision orders with constraint of neural activity progress in term of planning/execution/recovery, enhancing both rationality, interpretability and classification performance. Third, a Transformer-based history encoder is designed to capture long-range inter-window dependencies in parallel, improving training stability and efficiency compared with existing recurrent architectures. Besides, TSE-RL adopts a plug-and-play design that can be integrated with diverse MI classifiers. Extensive experiments on multiple benchmark datasets demonstrate that TSE-RL consistently improves decoding performance in both cross-session and cross-subject settings. Visualization analyses further suggest that the learned policy of window optimization aligns with neurophysiological principles.
Index Terms—Brain computer interface, electroencephalography, motor imagery, reinforcement learning
I. INTRODUCTION
This work was supported by National Natural Science Foundation of China under Grant No. 62476213, Natural Science Basic Research Program of Shaanxi Province under Grant 2024JC-YBMS-486. (Corresponding author: Na Lu.)
Huan Luo is with the School of Future Technology, Xi'an Jiaotong University, Xi'an, 710049, China (e-mail: luohuan123@stu.xjtu.edu.cn).
Other authors are with the School of Automation Science and Engineering, Xi'an Jiaotong University, Xi'an, 710049, China (e-mail: lvna2009@mail.xjtu.edu.cn; wxp035112@stu.xjtu.edu.cn; 2203712691@stu.xjtu.edu.cn).
B RAIN computer interface (BCI) technology establishes a direct communication and control pathway between the brain and external devices by decoding neural activity [1]. It has broad potential in diverse fields such as neurorehabilitation, entertainment [2], and human-machine interaction [3]. Among non-invasive acquisition modalities, electroencephalography (EEG) is widely adopted due to its high temporal resolution and relatively low cost [4]. In motor imagery (MI) BCIs, users voluntarily imagine limb movements to elicit event-related desynchronization/synchronization (ERD/ERS) patterns [5], [6], thereby enabling device control without external stimuli.
Recent years have witnessed significant advances in MI-EEG signal decoding techniques, most of which analyze a predefined post-cue segment (typically 0–4 s) for feature extraction and classification [7]. Representative approaches range from Common Spatial Patterns (CSP) [8], which learns spatial filters by maximizing inter-class variance, to diverse deep learning methods. Convolutional Neural Networks (CNNs) like EEGNet [9] and M-ShallowConvNet [10] efficiently capture spatio-temporal patterns with depthwise separable convolutions or shallow designs. FBCNet [11] performs frequency-band fusion via multi-view convolutions, while ATCNet [12] integrates attention mechanisms with temporal convolutional networks. More recently, Transformer-based models have been explored in EEGConformer [13] and TSLANet [14]. And CSPNet [15] embeds CSP principles within a neural network framework. Riemannian geometry-based methods such as manifold attention network (mAtt) [16] characterize EEG patterns on the Riemannian manifold of symmetric positive-definite (SPD) matrices.
Although these methods perform well in offline evaluations, their performance in online scenarios are constrained by using a single, shared temporal segment to represent MI activity across trials. For instance, online systems often relies on a sliding window of fixed length (around 1 s) moving along the continuous EEG signal. Some windows may cover only a fraction of an MI event, some may contain excessive pre-event baseline activity, and some may be contaminated by burst artifacts, the majority of which are misaligned with actual neural events. Meanwhile, fixed-length windows restrict the timeliness of the system response. Online decoding thus can benefit from time window optimization, where windows are adaptively accumulated or discarded to form a segment that
PREPRINT
better matches informative neural patterns, providing better balance between timeliness and accuracy.
Researchers have proposed various time window optimization strategies. Correlation-based Time Window Selection (CTWS) [17] adjusts the onset of window by correlating sliding windows with reference signals. Approaches based on Ant Colony Optimization (ACO) [18] and Sparrow Search Algorithm (SSA) [19] employ meta-learning and heuristic searches to identify optimal configurations in time-frequency parameter space. However, these techniques typically evaluate and select candidate windows independently, treating each as an isolated “good/bad” decision based on the quality of the window, with configurations searched offline and applied uniformly across trials [20], [21]. This limitation can result in fragmented or physiologically implausible window sequences that fail to capture the coherent evolution of MI events. In contrast, our method optimizes the time window sequence, conditioning each decision on cross-window history and on the constraint of MI phases. MI events exhibit contralateral desynchronization of the (8–13 Hz) and (13–30 Hz) rhythms during MI execution, and a subsequent rebound of synchronization of the -rhythm after the event ends [22]. Such an evolution suggests distinct MI phases from onset to sustained imagery and finally to offset.
Reinforcement Learning (RL) provides an ideal framework to overcome this limitation, as it inherently models sequential decision-making processes with uncertainty. By formulating the problem of time window optimization in MI-EEG as a Markov Decision Process (MDP), an agent makes adaptive decisions at each time step based on the current state and historical context (e.g., whether to retain a window and what temporal role it plays in the MI event) to maximize cumulative rewards through interactions with the environment. It also avoids brute-force search over window combinations through exploration-exploitation. In addition, Safe Reinforcement Learning [23] also inspires us to incorporate neural event ordinal information, where temporal-structure patterns must be embedded to constrain the action space. Notably, preliminary studies have demonstrated the potential of RL in improving BCI adaptivity. Aung et al. [24] use RL to decide whether to classify or skip the current time point, and Zhang et al. [25] use RL to adaptively focus on features at varying scales. In both, RL improves the adaptivity of the BCI decoding: the action optimizes one component inside the decoding pipeline, while the analyzed window remains fixed and predefined. Our work instead optimizes the window itself, taking each incoming window as the decision unit, assigning it an explicit semantic role, and constraining the action space by the structure of MI events.
Therefore, we propose a Temporal Structure Embedded Reinforcement Learning (TSE-RL) framework for adaptive time window optimization in MI-EEG decoding. The core innovation of this framework is to embed prior temporal-structure knowledge of MI events into a stable RL framework, transforming window optimization from isolated “good/bad” judgments to semantic alignment of complete neural events. Specifically, TSE-RL incorporates three mechanisms to make this idea practical and reliable. The first mechanism transforms the action selection upon each time window from simply “retain/discard” to semantic alignment between window and neural events as Discard/Onset/sustain/Offset. This semantic alignment mechanism imposes physiological patterns on window optimization of EEG signal. The second mechanism adopts Finite State Machine (FSM) for constrained action masking which enables safe reinforcement learning in restricted action space. Without proper constraints, the RL agent may generate physiologically implausible window sequences that violate the known temporal structure of MI events (e.g., selecting an Offset before an Onset). The third mechanism concerns Transformer-based history encoding. The decisions of window optimization require integrating historical context, while traditional RL methods often employing Recurrent Neural Networks (RNNs) to capture temporal dependencies. When processing long sequences, RNNs are prone to gradient vanishing or explosion, resulting in training instability [26]. The main contributions of this paper include:
-
We propose a temporal window optimization method that embeds MI event temporal structure knowledge into a reinforcement learning framework. The action space based on EEG time window evaluation is semantically aligned with neural event for interpretability and performance improvement. FSM-based action masking is designed to ensure physiological plausible decision sequence with constraint of neural activity progress in term of planning/execution/recovery.
-
We design a Transformer-based history encoder to replace training-unstable recurrent networks. This encoder takes historical window sequences as input and leverages self-attention mechanisms to learn temporal dependencies across windows in parallel, improving both training stability and computational efficiency.
-
TSE-RL is plug-and-play and can be integrated with various mainstream MI classifiers. Simulated online experiments on multiple public datasets demonstrate that it significantly improves decoding performance in both cross-session and cross-subject settings.

(a)
(b)
Fig. 1. Overview of the proposed TSE-RL framework. (a) MDP formulation with an internal FSM for action masking. At step n, the agent receives the state from the environment. The FSM determines the valid action subset for the current phase and constrains the masked policy . The selected action drives the environment transition and the reward. (b) Network architecture of TSE-RL. The feature extractor encodes each window into a representation, and the discriminator outputs class probabilities for reward computation. A Transformer-based history encoder models temporal dependencies among historical features. The FSM-constrained policy network integrates current features, historical context, and trial progress to produce actions under phase-dependent masking.
A. Problem Formulation
Given a labeled EEG dataset , where denotes the class label and represents a trial of length acquired from electrodes, with denoting the signal sample recorded at time step . Online decoding methods employ sliding windows for continuous trials, with window length and stride . The -th window is denoted as , where . We want to learn an optimal policy that can be utilised during the processing of the window sequence . At each time step, this policy dynamically decides whether the current window should be discarded or retained. And if retained, the policy must decide whether the window should be marked as the Onset, Sustain, or Offset phase of the MI event. The objective is to retain and mark an sequence of most informative windows such that the final classification accuracy based on this sequence is maximized. We formulate this problem as a Markov Decision Process (MDP) defined by the tuple .
State set S: At each time step n, the environment state is defined as , where is the current window, denotes fixed-length historical windows (with k being the history length), and is a normalized indicator of trial progress. In the implementation, and are further encoded into feature vectors by neural networks, but conceptually the MDP state is characterized by throughout this paper.
Action set A: The agent executes one of the four discrete actions . Specifically, action indicates that the current window is considered to be highly noisy and is discarded. Action denotes that the current window is retained and marked as the Onset phase of the MI event. Action denotes the current window is retained and marked as the Sustain phase. Action denotes the current window is retained and marked as the Offset phase. When is taken, or when the sliding window reaches the end of the trial, the agent terminates the current trial and triggers the final classification based on the sequence of the retained windows.
State transition function T: After the agent selects , the environment either advances the window to and updates , or terminates the trial. To incorporate the prior knowledge that an MI event follows an Onset→Sustain→Offset temporal structure, we introduce a discrete phase indicator . Importantly, is an internal phase of sensorimotor cortex rather than an additional MDP state. It is only used to constrain the legal actions given the current phase via a finite-state machine (FSM).
• Planning phase. At the beginning of each trial, the agent is in the Planning phase. It has been demonstrated that subtle rhythmic changes often precede the actual onset of MI performing, representing a preparation or planning phase [22]. In this phase, the agent searches for the onset of the event, and the legal actions are . Choosing marks the current window as Onset and switches the phase to Execution.
• Execution phase. After the first Onset has been detected, the agent enters the Execution phase, which covers the duration of the active MI. During this phase, the sensorimotor cortex typically exhibits a significant power reduction in the (8–13 Hz) and (13–30 Hz) rhythms, a phenomenon known as ERD [22]. This reduction persists as long as the subject actively performs the imagery task. Accordingly, the legal actions are . The agent may refine the onset boundary (action 1) or, upon confirming stable ERD patterns, select to capture the sustained activity. Selecting triggers the transition to the Recovery phase.
• Recovery phase. After a sustained segment is established, the agent enters the Recovery phase. This corresponds to the post-MI phase where sensorimotor rhythms return to baseline. Specifically, a distinct power rebound in the rhythms often occurs after MI performing, termed
PREPRINT
ERS [22]. To accommodate this, the legal actions are . The agent can continue to extend the sustained segment (action 2) to cover late ERD components or, upon detecting the ERS signature, select to mark the event termination. This action concludes the trial and resets the phase to Planning for the subsequent trial.
This FSM therefore implements the following intuitive rules: the agent must first identify the preparatory Onset during the Planning phase, then capture the sustained ERD during the Execution phase, and finally determine the Offset based on ERS patterns during the Recovery phase.
Reward function : The reward function is defined as , where the discrimination reward provides immediate feedback on the quality of the current window, the temporal continuity reward encourages smooth window sequences, and the termination reward reflects the final classification outcome of the retained windows.
The discrimination reward provides immediate feedback based on the classifier's confidence for the current window, encouraging retention of informative windows while discouraging ambiguous ones.
The continuity reward promotes consistent decisions (e.g., Sustain followed by Sustain), and penalizes unnecessary discards once the agent has started to track an MI segment.
(2)
where is the current FSM phase indicator and is the indicator function.
The termination reward is issued when the trial ends, either via an Offset action ( ) or when the sliding window exceeds the trial length. Let index the retained windows. The retained windows are aggregated into a trial-level class distribution by a weighted average of window-wise class probabilities
where , , and . Sustain windows cover the stage of the event where the ERD is fully developed, and are weighted highest. Onset and Offset windows lie at its boundaries, where the ERD is developing or returning to baseline, and are weighted lower. If , we set for all . The final prediction is , and the termination reward is
where is the number of retained windows and is a length-dependent multiplier. Both and are evaluated from the probabilities produced by , as public MI datasets provide trial-level labels only. The temporal structure of MI events is thus imposed not by the reward alone but jointly with the FSM-constrained action mask of Section II-B.
Discount factor : is used so that the agent optimizes cumulative long-term returns.
B. Temporal structure embedding via FSM-constrained action masking and Transformer-based history encoding
As mentioned in Introduction, applying RL to MI-EEG time window optimization faces two significant challenges. First, the agent must respect safety constraints so that selected window sequences remain physiologically meaningful. Second, the agent has to learn from long sequences of noisy EEG observations in a stable and data-efficient way. The proposed TSE-RL framework addresses these issues through a temporal structure embedding mechanism that combines an FSM-constrained action mask with a Transformer-based history encoder. This design enforces the decision of window optimization alignment with MI neural patterns, while providing a stable architecture for learning.
MI events exhibit contralateral desynchronization of the (8–13 Hz) and (13–30 Hz) rhythms during MI execution, and exhibit a rebound of synchronization of the -rhythm after the event ends [22]. Conventional isolated window optimization methods ignore this temporal pattern, leading to discontinuous or semantically incomplete window sequences. This consequently reduces classification accuracy and diminishes interpretability. Reward shaping can, in principle, discourage such sequences by penalizing non-contiguous or incomplete window selections. However, this soft constraint can only indirectly influence the policy through policy gradients. During the early stages of training, the policy that is not aligned with physiological patterns can still be explored. Even during inference, a converged policy employing stochastic sampling cannot entirely prevent the occurrence of invalid action sequences.
To ensure that the selected time window consistently constitutes a valid MI event, we embed the temporal structure of MI events into the decision process using FSM-constrained action masking. We employ FSM to model the legal phase transitions of events, restricting valid actions based on the current phase . The probability of all invalid actions is set to zero before the action sampling. This hard constraint reduces the policy search space, forcing the agent to follow physiologically plausible trajectories. Huang et al. [27] showed that invalid-action masking yields more effective gradient updates, with benefits increasing as the number of invalid actions grows. Masking scales well when invalid actions are numerous, while penalty-based methods struggle to explore the task. Furthermore, Stolz et al. [28] found that focusing exploration on state-specific valid actions significantly improves learning efficiency and the predictability of the agent in safety-critical tasks. Therefore, in EEG decoding, we propose FSM-constrained action masking combined with the reward function described in Section II-A to guide the agent to generate continuous and complete MI windows.
The second challenge is to integrate information over the histories of extended observation when the agent determines actions. Traditional RL methods employ RNNs, but they suffer from instability, particularly in MI-EEG tasks with trials spanning dozens of windows over several seconds [26]. Each additional window in the sequence elongates the gradient path, causing gradient to decay or explode exponentially. Beyond instability, RNNs require careful management of variable-length sequences and hidden states during training, complicating the implementation of batching strategies. These challenges can hinder the deployment of recurrent RL approaches in MI-EEG scenarios.
We thereby adopts a non-recurrent Transformer-based history encoder. Instead of propagating hidden states, it processes the recent history (as feature vectors ) in parallel using self-attention mechanisms. This generates a fixed-dimensional context vector that captures temporal dependencies across history observations. When concatenated with the current window feature and trial progress , this forms the full input for the policy network. By eliminating recursive propagation of hidden state, the design circumvents gradient instability while leveraging parallel computation for efficiency. The Transformer's multi-head attention effectively captures long-range temporal dependencies. This architecture has demonstrated superior performance in partial-observation RL tasks [29].
C. Overall TSE-RL framework
The TSE-RL framework is established to solve the MI-EEG time window optimization MDP, where the agent learns an adaptive policy to decide whether to discard, start, sustain or terminate a MI segment at each time step. As illustrated in Fig. 1(b), a feature extractor F and a discriminator D is used for window-wise assessment which is decomposed from a plug-and-play EEG backbone; a Transformer-based history encoder G summarizes historical features; and an FSM-constrained policy network outputs actions under the phase-dependent action mask.
Plug-and-play feature extractor and discriminator. Let denote the feature extractor and denote the discriminator. Given an established EEG classifier that maps an input window to class probabilities, we can write it as
where F consists of the backbone's feature extraction layers and D consists of the remaining layers plus the final classification head. It is important to note that this decomposition is applicable to a wide range of EEG backbones, including, but not limited to, convolutional, recurrent, and Transformer-based EEG networks.
For each incoming window , the extractor produces a feature vector
which is fed into the discriminator to obtain the probability distribution of class per window, i.e.,
For a given dataset, L and are fixed. Actions determine only whether a window is retained and which semantic role it takes. Thus, the extractor therefore always operates on windows of the same size. Fixed-dimensional class probabilities are aggregated by (3), so that accumulated EEG segments of different lengths can be classified without adjusting the input size.
History encoder. To capture temporal dependencies, the history encoder G operates on the features of the recent window buffer . The application of extractor F to each historical window yields a feature sequence
These features are then fed into a standard Transformer encoder G. The encoder computes self-attention across the sequence, aggregating contextual information. This is followed by mean pooling over the temporal dimension, which is then succeeded by a linear projection to a fixed-dimensional context vector
Here denotes the context dimension. This design yields a stable, fixed-dimensional representation of variable-length histories without relying on recurrent computations.
FSM-constrained policy network. At each time step , we construct the policy input vector by concatenating the current feature, the historical context, and the trial progress indicator, i.e. . The FSM-constrained policy network implements an actor-critic architecture on top of . A shared multilayer perceptron first transforms into a latent representation, which then branches into an actor head producing action logits and a critic head producing a scalar value estimate for the current state. The critic is trained jointly with the actor using Proximal Policy Optimization, but for notational simplicity we focus on the actor branch in the following computation graph.
Let denote the unconstrained action probability vector output by the actor head. The current FSM phase (defined in Section II-A) determines a binary action mask , which encodes the legal actions in that phase. The final action distribution used for sampling is obtained by masking and renormalization:
(10)
where denotes element-wise multiplication and the indicates that the masked probabilities are renormalized to sum to one. In this way, the policy is hard constrained by the FSM. Actions that violate the supported Onset–Sustain–Offset pattern are assigned zero probability and never sampled during either training or inference.
Overall, the feature extractor F provides a consistent representational feature, the discriminator D provides discrimination and terminal rewards, the history encoder G captures temporal context, and the FSM-constrained policy network integrates these information to produce window-level decisions that respect the MI event structure encoded by the FSM.
PREPRINT
TABLE I SUMMARY OF THE FOUR MI-EEG DATASETS
| Dataset | Number of subjects | Number of channels | Sampling rate (Hz) | Trial length (s) | Number of sessions | Trials in 1st session | Types of imaginations |
|---|---|---|---|---|---|---|---|
| BNCI2014001 | 9 | 22 | 250 | 4 | 2 | 288 | r/l hand, feet, tongue |
| BNCI2014002 | 14 | 15 | 512 | 5 | 1 | 160 | right hand, both feet |
| BNCI2015001 | 12 | 13 | 512 | 5 | 3 | 400 | right hand, both feet |
| OpenBMI | 54 | 62 | 1000 | 4 | 2 | 200 | right/left hand |
D. Learning framework
To address the low sample efficiency and training instability of end-to-end RL from random initialization, the TSE-RL framework is trained in three stages that progressively shift from supervised learning to policy optimization.
Stage 1: Supervised pretraining. In the first stage, we train the feature extractor and discriminator as a standard classifier on full time windows. From each training trial, we extract time windows using the window length and stride , and assign each window the corresponding trial label . The backbone then produces for each window, and we minimize the cross-entropy loss
temporally aggregated over all windows in a mini-batch. Trial-level validation accuracy can be computed by averaging window-level probabilities. At the end of this stage, has learned discriminative spatio-temporal representations of EEG windows, and has learned the class distribution whose probabilities will be reused in the reward design.
Stage 2: Policy learning. After the convergence of supervised pretraining, the parameters of and are frozen. Then we train the history encoder and the FSM-constrained policy network by reinforcement learning. We adopt Proximal Policy Optimization (PPO) [30] algorithm. In each trial, the agent interacts with the environment as described in Section II-A: the frozen extractor converts the current and historical windows into features, the frozen discriminator provides window-level probabilities for computing and , the history encoder produces the context vector , and the policy network maps to an action distribution that is masked by the current phase .
During this stage, PPO gradients update only the parameters of and . Consequently, the mapping from raw windows to features and probabilities does not change while the agent is learning decision policy. This separation prevents representation drift from interfering with policy optimization, making training more stable and data-efficient. The FSM-based action mask is active throughout, restricting the exploration to physiologically plausible action.
Stage 3: Joint fine-tuning. Once the policy has reached stable performance, we perform a final joint fine-tuning. We unfreeze the last few layers of the feature extractor while keeping the discriminator fixed, and continue PPO training with a smaller learning rate. Policy gradients are now allowed to slightly adjust the high-level feature representations, which allows mild adaptation of the feature representation to the learned policy while preserving the stability gained in Stage 2.
The pseudocode of the complete pipeline is given as Algorithm 1 in the Supplementary Material. The source code and the Supplementary Material are available at https://github.com/LunaLab-XJTU/TSE-RL.
III. EXPERIMENTAL RESULTS AND DISCUSSION
A. Datasets and preprocessing
TSE-RL is evaluated on four public MI-EEG datasets from MOABB [31], namely BNCI2014001, BNCI2014002, BNCI2015001 and OpenBMI [32]. Table I summarizes their statistics. BNCI2014001 is derived from BCI Competition IV-2a [33] and is the only four-class dataset, while the other three are two-class. Two experimental protocols are considered. For within-subject cross-session experiments, the T session of BNCI2014001 is used for training, while the E session is used for testing. For BNCI2014002, the first five runs are used for training, with the remaining three runs used for testing. In the case of BNCI2015001, the first session is used for training, while the second session is used for testing, and the same split is applied to OpenBMI. For cross-subject experiments, a leave-one-subject-out (LOSO) protocol is adopted in which, for each fold, a single subject serves as the test set and all remaining subjects are merged to form the training set.
All datasets share the same preprocessing steps. Raw EEG signals are band-pass filtered (8–32 Hz), then multiplied by a factor of to scale to microvolts ( ). For each recording block used in training or testing (session or run, depending on the dataset), all trials are concatenated along the time axis, in their original recording order, to form a continuous EEG dataflow that simulates online decoding. Sliding windows with length L = 1.0 s and stride s are applied to this EEG dataflow, producing a sequence of time windows as defined in Section II-A. At each time step, the TSE-RL agent interacts with this unlabeled window sequence and decides whether to discard the current window or to retain it as the Onset, Sustain, or Offset phase. The true trial boundaries and labels are used only to compute rewards during training and to evaluate accuracy during testing, and remain inaccessible to the agent. Decisions are causal in that the agent observes only the current window and the finite history at step n, while no future sample is available. At test time the trials are decoded one by one with a batch size of one, and no batch-normalization statistics are computed across trials, which rules out any leakage of information between trials.
B. Implementation details
Baselines. Eight representative MI-EEG classification backbones are used as supervised baselines and backbones for
TABLE II WITHIN-SUBJECT CLASSIFICATION ACCURACY (%) IN SIMULATED ONLINE EXPERIMENT ON BNCI2014001, WITH AN ASTERISK () DENOTING THE SIGNIFICANCE LEVEL (: P<0.05).
| Setting | Method | S0 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | Avg. |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Baseline-full | EEGNet | 84.97 | 53.51 | 86.15 | 61.92 | 54.14 | 52.54 | 76.85 | 80.11 | 81.16 | |
| TSLANet | 88.38 | 51.22 | 84.56 | 47.40 | 37.68 | 58.86 | 77.61 | 84.56 | 82.12 | ||
| EEGConformer | 84.51 | 49.83 | 89.19 | 63.41 | 46.57 | 55.86 | 86.50 | 79.30 | 81.73 | ||
| FBCNet | 82.33 | 58.38 | 81.64 | 68.79 | 44.14 | 51.78 | 84.07 | 83.38 | 84.07 | ||
| ATCNet | 87.26 | 54.56 | 89.21 | 65.95 | 57.26 | 59.07 | 82.96 | 83.72 | 83.65 | ||
| M-ShallowConvNet | 86.50 | 54.84 | 91.50 | 70.94 | 57.47 | 58.86 | 89.07 | 83.51 | 83.65 | ||
| mAtt | 87.15 | 58.68 | 83.68 | 64.93 | 51.74 | 47.57 | 79.86 | 83.68 | 85.07 | ||
| CSPNet | 88.24 | 57.68 | 88.93 | 70.53 | 62.19 | 60.81 | 87.89 | 82.68 | 84.07 | ||
| TSE-RL | EEGNet | 86.59 | 54.91 | 88.82 | 63.68 | 54.93 | 56.39 | 79.38 | 82.78 | 83.75 | |
| TSLANet | 88.72 | 48.44 | 76.56 | 46.71 | 37.68 | 56.78 | 74.49 | 86.99 | 83.51 | ||
| EEGConformer | 86.54 | 47.66 | 91.23 | 64.24 | 47.48 | 55.82 | 87.59 | 80.38 | 82.81 | ||
| FBCNet | 83.33 | 61.81 | 85.07 | 70.14 | 47.57 | 53.13 | 86.11 | 86.11 | 87.85 | ||
| ATCNet | 88.47 | 56.32 | 90.97 | 66.74 | 59.51 | 61.32 | 85.07 | 85.76 | 85.00 | ||
| M-ShallowConvNet | 88.06 | 56.94 | 92.78 | 72.08 | 60.42 | 62.92 | 91.46 | 86.04 | 84.93 | ||
| mAtt | 87.50 | 57.99 | 84.72 | 66.67 | 53.47 | 49.31 | 79.86 | 83.68 | 85.42 | ||
| CSPNet | 89.58 | 61.46 | 90.63 | 73.26 | 66.32 | 63.19 | 89.24 | 86.11 | 86.46 |
TABLE III AVERAGE WITHIN-SUBJECT CLASSIFICATION ACCURACY (%) IN SIMULATED ONLINE EXPERIMENTS ON BNCI2014002, BNCI2015001 AND OPENBMI. * INDICATES .
| Setting | Method | BNCI2014002 | BNCI2015001 | OpenBMI |
|---|---|---|---|---|
| Baseline-full | EEGNet | |||
| TSLANet | ||||
| EEGConformer | ||||
| FBCNet | ||||
| ATCNet | ||||
| M-ShallowConvNet | ||||
| mAtt | ||||
| CSPNet | ||||
| TSE-RL | EEGNet | |||
| TSLANet | ||||
| EEGConformer | ||||
| FBCNet | ||||
| ATCNet | ||||
| M-ShallowConvNet | ||||
| mAtt | ||||
| CSPNet |
TSE-RL: EEGNet [9], M-ShallowConvNet [10], FBCNet [11], ATCNet [12], EEGConformer [13], TSLANet [14], CSPNet [15] and mAtt [16]. Hyperparameters of these backbones follow the recommendations in the original papers or the official code repositories. For each backbone , the network is decomposed as following the principle in Section II-C. Concretely, the split between and is defined as follows:
-
EEGNet [9]: contains the initial temporal convolution and depthwise spatial convolution blocks (including batch normalization, ELU, and average pooling), which produce a compact spatio-temporal feature map. comprises the final separable convolution, global average pooling, dropout, and the dense classification layer that maps the pooled feature to class logits.
-
M-ShallowConvNet [10]: contains the temporal convolution and depthwise spatial convolution layers together with the first batch normalization. includes the squaring non-linearity, mean pooling, log transformation, dropout, and the final fully connected classifier.
-
FBCNet [11]: is the FBCNet feature extractor that applies multi-band temporal convolutions and spatial filters for each filter bank branch and outputs concatenated feature maps across bands. is the FBCNet discriminator that performs covariance-based pooling over the spatially filtered signals and projects the pooled representation to class logits through fully connected layers.
-
ATCNet [12]: consists of the temporal, depthwise and spatial convolution layers, and the stacked attentional temporal convolution blocks that form the main encoder. contains the final global average pooling, dropout, and classification layers that operate on the encoder output.
-
EEGConformer [13]: is the temporal and depthwise convolution layers. includes the remaining convolution layers, Conformer encoder, and the output linear classifier.
-
TSLANet [14]: comprises the temporal segmentation and patch embedding, and positional encoding. consists of the stacked temporal–spectral local attention blocks, final pooling over the sequence dimension and the dense classification head.
-
CSPNet [15]: includes the filter-bank temporal convolutions and CSP-like spatial projection layers that produce multi-band spatial features. aggregates these features via pooling and passes them through the final fully connected classifier.
-
mAtt [16]: is the multi-head Riemannian feature extractor that computes, for each window, covariance matrices, projects them to a low-dimensional subspace, and applies the matrix logarithm to obtain a stack of normalized log-SPD matrices without flattening. vectorizes the per-head SPD features, applies an attention mechanism to weight and aggregate the heads, and feeds the aggregated representation into an MLP classifier to produce class logits.
Experimental settings. Under the Baseline-full setting, each backbone is trained and evaluated as a purely super-
PREPRINT
TABLE IV CROSS-SUBJECT CLASSIFICATION ACCURACY (%) IN SIMULATED ONLINE EXPERIMENT ON BNCI2014001. * INDICATES .
| Setting | Method | S0 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | Avg. |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Baseline-full | EEGNet | 67.40 | 31.99 | 66.01 | 39.28 | 30.60 | 36.50 | 36.85 | 69.49 | 48.31 | |
| TSLANet | 64.97 | 29.21 | 62.89 | 38.24 | 26.43 | 33.72 | 38.93 | 63.58 | 55.25 | ||
| EEGConformer | 68.79 | 33.72 | 67.06 | 44.14 | 28.86 | 34.42 | 44.14 | 70.53 | 51.08 | ||
| FBCNet | 63.24 | 32.33 | 80.60 | 40.67 | 31.99 | 33.03 | 53.17 | 76.08 | 47.26 | ||
| ATCNet | 70.53 | 32.33 | 70.53 | 46.57 | 28.86 | 34.07 | 42.75 | 75.04 | 59.76 | ||
| M-ShallowConvNet | 71.22 | 33.72 | 69.49 | 39.28 | 33.03 | 32.68 | 39.28 | 73.31 | 53.17 | ||
| mAtt | 62.19 | 31.64 | 74.00 | 42.75 | 30.60 | 26.43 | 55.25 | 70.88 | 35.81 | ||
| CSPNet | 67.36 | 32.99 | 78.47 | 45.83 | 30.90 | 33.68 | 44.10 | 73.96 | 60.07 | ||
| TSE-RL | EEGNet | 65.63 | 36.81 | 66.67 | 42.71 | 32.64 | 40.97 | 39.24 | 68.06 | 58.68 | |
| TSLANet | 53.82 | 33.68 | 52.78 | 36.81 | 28.82 | 38.89 | 34.38 | 56.25 | 60.42 | ||
| EEGConformer | 59.72 | 35.42 | 62.85 | 40.97 | 30.21 | 38.54 | 45.49 | 64.24 | 65.28 | ||
| FBCNet | 64.24 | 36.11 | 81.94 | 43.40 | 35.42 | 34.03 | 54.86 | 77.78 | 62.85 | ||
| ATCNet | 72.22 | 38.19 | 71.88 | 47.57 | 30.90 | 36.11 | 44.44 | 74.31 | 67.36 | ||
| M-ShallowConvNet | 67.36 | 36.81 | 61.46 | 44.10 | 37.15 | 30.90 | 39.58 | 68.06 | 66.67 | ||
| mAtt | 64.24 | 38.19 | 76.39 | 43.75 | 31.94 | 27.08 | 56.25 | 71.88 | 38.89 | ||
| CSPNet | 67.71 | 36.81 | 78.47 | 47.22 | 31.94 | 35.07 | 45.14 | 73.96 | 69.10 |
vised classifier on the full time windows, where no window optimization is performed. Under the TSE-RL setting, the same pretrained backbone is split into the TSE-RL agent. The agent learns a policy to perform time-window optimization by selectively discarding or retaining windows and marking them as Onset, Sustain, or Offset. The agent then aggregates the probabilities of retained windows for classification. All experiments are independently repeated ten times, and performance is reported as mean accuracy and standard deviation across the ten runs. Statistical significance of performance improvement between TSE-RL and its corresponding Baseline-full counterpart is assessed using a paired test over the ten runs.
Hyperparameters. Unless otherwise stated, we use shared hyperparameters across datasets and backbones. The history encoder operates on the most recent windows and is implemented as a standard Transformer encoder with one layer, four attention heads, hidden size , dropout rate 0.1. The encoded sequence is temporally mean-pooled and linearly projected to obtain a vector , . The FSM-constrained policy network receives the concatenated vector and is realized as an actor-critic multilayer perceptron with two hidden layers of 64 units. The reward and discount factor follow Section II-A.
Training follows the three-stage scheme. In supervised pre-training, each backbone is trained end-to-end on full windows using the Adam optimizer with learning rate , batch size 64, and 300 epochs. After convergence, is split into and , and their parameters are frozen. In policy learning, only the history encoder and the FSM-constrained policy network are optimized by PPO with learning rate , PPO clipping parameter 0.2, generalized advantage estimation parameter , and a total of environment steps. In joint fine-tuning, are unfrozen and updated together with and the policy network using a smaller learning rate of for additional environment steps.
Configuration. Experiments were implemented in Python 3.10 and PyTorch 2.3.1 and ran on a workstation equipped with an NVIDIA TITAN V GPU and an Intel Xeon Gold 6230 CPU (2.10 GHz).
C. Within-subject cross-session classification in simulated online experiment
Tables II and III report within-subject cross-session accuracies. In all four datasets, TSE-RL consistently improves the performance of the Baseline-full models for most backbones, with some gains being statistically significant. On BNCI2014001 (Table II), TSE-RL yields improvements for EEGNet, FBCNet, ATCNet, M-ShallowConvNet, and CSPNet, with average accuracies increasing by about 2–3 percentage points. Only TSLANet exhibits a slight degradation, and on this dataset it has both the lowest accuracy and the largest standard deviation among the eight backbones. Since the rewards are computed from the window-level confidences, such a backbone provides a noisy learning signal for the policy. On BNCI2014002, BNCI2015001 and OpenBMI (Table III), TSE-RL improves every backbone, including TSLANet, and the benefit persists on the much larger OpenBMI dataset.
D. Cross-subject classification in simulated online experiment
Table IV summarizes cross-subject performance on BNCI2014001. Strong cross-subject variability makes this setting considerably more challenging, and Baseline-full models drop substantially relative to the within-subject case. Nevertheless, TSE-RL still improves average accuracy for most backbones, with statistically significant gains for EEGNet, FBCNet, ATCNet, mAtt, and CSPNet. TSE-RL is therefore compatible with a wide range of MI backbones across both cross-session and cross-subject decoding. Rehabilitation applications involve a further shift, as the ERD/ERS of stroke patients differs markedly from that of young healthy subjects. On the stroke dataset of Liu et al. [34], TSE-RL improves all eight backbones (Section 5 of the Supplementary Material).
E. Visualization of learned time-window optimization
The TSE-RL policy selects Onset/Sustain/Offset windows that overlap with the contralateral mu–beta ERD/ERS patterns. This suggests that it exploits the most informative segments,
Left-hand MI
(a)
C3

Cz

C4

(b)
Action distribution across time windows

(c)
Mean classification confidence across time windows
Fig. 2. Average decision process for Left-hand MI on BNCI2014001. (a) Induced ERD/ERS maps computed following Graimann et al. [35] with bootstrap significance testing (black contours indicate ). (b) Action distribution over time shown as a stacked profile ordered from bottom to top as Discard, Onset, Sustain, and Offset. (c) Mean classification confidence for the true class at each time window.
rather than random clipping. We visualize the learned decision process on BNCI2014001 under the simulated online setting. A representative single-trial example is included in the Graphical Abstract for illustration. The analysis is then supplemented by class-wise averages to assess the generalizability of these findings beyond a single trial. Only Left-hand and Right-hand tasks are reported because these classes exhibit the clearest contralateral ERD/ERS patterns over the sensorimotor cortex. The visualizations of Feet and Tongue imagery show weaker contralateral effects with similar temporal decision patterns and are therefore omitted. All visualizations use the same configuration as in the online experiment.
Fig. 2 and Fig. 3 present averaged decision process for Left-hand and Right-hand motor imagery respectively. In both figures, row (a) displays induced ERD/ERS maps computed using the method from Graimann et al. [35], where phase-locked components are removed by subtracting the across-trial mean, followed by short-time Fourier transforms, baseline correction relative to the 0-1 s, and statistical validation via t-percentile bootstrap testing. Black contours highlight time-frequency regions with statistically significant deviations from baseline ( ). Row (b) visualizes the action probability distribution over time as a stacked profile, where the vertical axis represents the mean proportion of each action. The stack is ordered from bottom to top as Discard, Onset, Sustain, and Offset. Row (c) reports the mean confidence of the true class across windows, visualizing the confidence evolution throughout the trial.
The three rows reveal knowledge alignment between induced ERD/ERS patterns and the learned policy. Row (a) exhibits induced ERD/ERS over the contralateral sensorimotor cortex within the mu-beta range, with stronger desynchronization occurring during MI performing periods. In Fig. 2(a), Left-hand imagery exhibits a clear -band desynchronization over C4 (around 10 Hz). In Fig. 3(a), Right-hand imagery shows a prominent -band desynchronization over C3 (around 20 Hz). Row (b) demonstrates that early time windows are dominated by Discard or Onset decisions. From approximately 0.8 s to 2.5 s, the agent's selections consist mainly of Onset and Sustain actions, indicating that discriminative evidence is concentrated in this period. Beyond approximately 2.5-4.0 s, Offset becomes the prevailing action, reducing the inclusion of low-information windows, which is consistent with typical motor imagery durations. In row (c), the mean probability of the true class rises at onset, surpasses 0.7 during the sustained desynchronization stage, and then gradually declines as neural activity returns toward baseline. These visualizations indicate that TSE-RL policy aligns its time-window optimization with
PREPRINT
Right-hand MI
(a)
C3

Cz

C4

(b)
Action distribution across time windows

(c)
Mean classification confidence across time windows

Fig. 3. Average decision process for Right-hand MI of subject 0. Layout and analysis pipeline are identical to Fig. 2.
TABLE V SINGLE-WINDOW COMPUTATIONAL EFFICIENCY UNDER BASELINE AND TSE-RL SETTINGS. TIME IS MEASURED IN MS PER WINDOW (BATCH SIZE 1). FLOPs AND PARAMS ARE REPORTED PER FORWARD PASS.
| Setting | Backbone | Time (ms) | FLOPs (M) | Params (M) |
|---|---|---|---|---|
| Baseline (FE+Disc) | EEGNet | 0.57 | 3.13 | 0.002 |
| TSLANet | 2.73 | 7.94 | 0.366 | |
| EEGConformer | 4.16 | 14.39 | 0.278 | |
| FBCNet | 0.42 | 0.40 | 0.002 | |
| ATCNet | 4.00 | 12.29 | 0.036 | |
| M-ShallowConvNet | 0.49 | 16.37 | 0.014 | |
| mAtt | 5.68 | 0.29 | 0.101 | |
| CSPNet | 0.57 | 3.45 | 0.006 | |
| TSE-RL (Full pipeline) | EEGNet | 1.72 | 21.85 | 4.340 |
| TSLANet | 3.77 | 42.77 | 5.400 | |
| EEGConformer | 9.24 | 99.32 | 1.940 | |
| FBCNet | 1.75 | 5.00 | 0.337 | |
| ATCNet | 5.55 | 85.28 | 0.199 | |
| M-ShallowConvNet | 2.42 | 99.36 | 0.198 | |
| mAtt | 16.67 | 8.25 | 4.979 | |
| CSPNet | 1.74 | 24.33 | 6.660 |
task-specific induced ERD/ERS patterns from typical MI durations, by placing retained windows in periods where contralateral desynchronization is strongest, which helps explain the performance gains observed in the online experiments.
F. Computational efficiency analysis
Online MI decoding requires repeated inference on sliding windows, so the computational cost for each window is critical for practical deployment. We compare the computational efficiency of different backbones. A single EEG window of size (1.0 s at 250 Hz) from BNCI2014001 is forwarded with batch size 1. Table V reports inference time, forward FLOPs, and parameter count. Baseline measures the backbone classifier only, consisting of a feature extractor and a discriminator (FE+Disc). TSE-RL measures the full window optimization pipeline, which adds a history encoder and a policy network on top of FE+Disc. The increase in FLOPs and parameter count from Baseline to TSE-RL primarily results from the additional history encoder and policy network. They process multiple historical windows with intermediate high-dimensional features. Despite this additional computation, the per-window inference time remains low across all backbones. Note that mAtt exhibits longer inference time due to its reliance on eigendecomposition operations, which are less suited to parallel computations on GPUs. Even the slowest configuration remains well below the 0.1 s stride interval and significantly below the 1.0 s window duration. This indicates that TSE-RL introduces only a modest overhead and is compatible with online decoding requirements.
TABLE VI ABLATION STUDY ON THE EEGNET BACKBONE ACROSS SETTINGS AND MI DATASETS. MEAN ± S.D. CLASSIFICATION ACCURACY (%).
| Components | BNCI2014001 | BNCI2014002 | BNCI2015001 | |||
|---|---|---|---|---|---|---|
| RL | Action mask | History enc. | within-subject | cross-subject | within-subject | within-subject |
| × | × | × | ||||
| ✓ | × | × | ||||
| ✓ | ✓ | × | ||||
| ✓ | × | ✓ | ||||
| ✓ | ✓ | ✓ | ||||
G. Ablation study
To validate the core contributions of TSE-RL, an ablation study is conducted on the EEGNet backbone. The results are reported in Table VI across settings and datasets. The comparison starts from a supervised baseline that disables RL, the history encoder, and the FSM-based action mask, which corresponds to EEGNet (Baseline-full) operating on all windows without window optimization. RL is then enabled while keeping both the history encoder and the action mask disabled, yielding a minimal policy that uses only the current-window feature and the trial-progress indicator. Two intermediate variants are further evaluated by adding either the FSM-based action mask or the history encoder. And the full model then enables RL, the history encoder, and the action mask simultaneously. Overall, Table VI shows that RL alone improves performance over the supervised baseline, indicating the benefit of learning an time-window optimization policy. Adding either the FSM-based action mask or the history encoder provides further gains, and enabling both consistently achieves the highest accuracy across all datasets and settings.
H. Sensitivity analysis
To assess the robustness of TSE-RL to hyperparameters, a sensitivity analysis is performed with respect to the window length , stride , and history length on the EEGNet backbone. The default configuration in the main experiments is s, s, and . Fig. 4 varies these hyperparameters within practical ranges ( s, s, and ) and reports accuracy along with the retained-window ratio (retained windows divided by all candidate windows). This ratio is reported because changing or alters the number of candidate windows per trial, making raw window counts incomparable. Overall, Fig. 4 reveals that TSE-RL demonstrates considerable stability around the default parameter configuration, with only moderate performance variation under perturbations of , , and .
IV. CONCLUSION
Online MI-BCI decoding operates on continuous EEG dataflow using fixed-length sliding windows, some of which are misaligned with the true boundaries of MI events. Time window optimization therefore matters for forming an informative segment by adaptively accumulating relevant windows and discarding irrelevant ones. However, most existing strategies evaluate candidate windows independently, ignoring temporal dependencies across consecutive windows and yielding fragmented or physiologically implausible sequences. To address this limitation, we proposed Temporal Structure Embedded Reinforcement Learning, which reformulates window optimization as a constrained Markov Decision Process in which an FSM-constrained action mask keeps the selected windows consistent with the temporal structure of MI events while assigning each of them an explicit temporal role. A Transformer-based history encoder captures long-range inter-window dependencies with better training stability than recurrent designs. The framework is plug-and-play and integrates with diverse MI classification backbones. Extensive

(a)
(b)
(c)
Fig. 4. Sensitivity analysis of window length , stride step , and history length on BNCI2014001 (within-subject), BNCI2014001 (cross-subject), BNCI2014002 (within-subject), and BNCI2015001 (within-subject). The left column displays classification accuracy, while the right column shows the ratio of retained windows.
PREPRINT
experiments show consistent improvements in cross-session and cross-subject settings at modest overhead compatible with real-time constraints. Visualization analyses further show that the learned policy aligns decision windows with contralateral mu-beta ERD/ERS, confirming that it exploits neurophysiological patterns. These results establish TSE-RL as an effective approach for online time window optimization. Its behavior under closed-loop feedback remains to be examined, since the simulated online experiment reproduces the non-stationary environmental noise and the fatigue-induced neural pattern shifts of real recordings but leaves the BCI output disconnected from the user. Closed-loop validation on data acquired will be studied in future work.
REFERENCES
[1] J. Wolpaw and E. W. Wolpaw, Brain–Computer Interfaces: Principles and Practice. Oxford University Press, 2012.
[2] C. He, Y.-Y. Chen, C.-R. Phang, C. Stevenson, I.-P. Chen, T.-P. Jung, and L.-W. Ko, “Diversity and suitability of the state-of-the-art wearable and wireless EEG systems review,” IEEE Journal of Biomedical and Health Informatics, vol. 27, no. 8, pp. 3830–3843, 2023.
[3] R. li, J. Liu, J. Liu, S. Yang, W. Liu, K. Deng, and W. Wang, "A novel grasping robot control method using motion execution BCI combining knowledge reasoning," IEEE Journal of Biomedical and Health Informatics, pp. 1–12, 2025.
[4] S. Vaid, P. Singh, and C. Kaur, “EEG signal analysis for BCI interface: A review,” in 2015 Fifth International Conference on Advanced Computing and Communication Technologies. IEEE, 2015, pp. 143–147.
[5] Z. Ma, X. Yang, J. Meng, K. Wang, M. Xu, and D. Ming, “Decoding arm movement direction using ultra-high-density eeg,” IEEE Journal of Biomedical and Health Informatics, vol. 29, no. 6, pp. 4035–4045, 2025.
[6] Z. Wang, Y. Liu, S. Huang, S. Qiu, Y. Zhang, H. Huang, X. An, and D. Ming, “EEG characteristic comparison of motor imagery between supernumerary and inherent limb: Sixth-finger mi enhances the erd pattern and classification performance,” IEEE Journal of Biomedical and Health Informatics, vol. 28, no. 12, pp. 7078–7089, 2024.
[7] H. Altaheri, G. Muhammad, M. Alsulaiman, S. U. Amin, G. A. Altuwaijri, W. Abdul, M. A. Bencherif, and M. Faisal, “Deep learning techniques for classification of electroencephalogram (EEG) motor imagery (MI) signals: A review,” Neural Computing and Applications, vol. 35, no. 20, pp. 14681–14722, 2023.
[8] F. Lotte and C. Guan, “Regularizing common spatial patterns to improve BCI designs: Unified theory and new algorithms,” IEEE Transactions on Biomedical Engineering, vol. 58, no. 2, pp. 355–362, 2011.
[9] V. J. Lawhern, A. J. Solon, N. R. Waytowich, S. M. Gordon, C. P. Hung, and B. J. Lance, “EEGNet: A compact convolutional neural network for EEG-based brain–computer interfaces,” Journal of Neural Engineering, vol. 15, no. 5, p. 056013, 2018.
[10] S.-J. Kim, D.-H. Lee, and S.-W. Lee, “Rethinking CNN architecture for enhancing decoding performance of motor imagery-based EEG signals,” IEEE Access, vol. 10, pp. 96984–96996, 2022.
[11] R. Mane, E. Chew, K. Chua, K. K. Ang, N. Robinson, A. P. Vinod, S.-W. Lee, and C. Guan, “FBCNet: A multi-view convolutional neural network for brain–computer interface,” arXiv preprint arXiv:2104.01233, 2021.
[12] H. Altaheri, G. Muhammad, and M. Alsulaiman, “Physics-informed attention temporal convolutional network for EEG-based motor imagery classification,” IEEE Transactions on Industrial Informatics, vol. 19, no. 2, pp. 2249–2258, 2023.
[13] Y. Song, Q. Zheng, B. Liu, and X. Gao, “EEG conformer: Convolutional transformer for EEG decoding and visualization,” IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 31, pp. 710–719, 2023.
[14] E. Eldele, M. Ragab, Z. Chen, M. Wu, and X. Li, “TSLANet: Rethinking transformers for time series representation learning,” in Proceedings of the 41st International Conference on Machine Learning, 2024, pp. 12409–12428.
[15] X. Jiang, L. Meng, X. Chen, Y. Xu, and D. Wu, “CSP-Net: Common spatial pattern empowered neural networks for EEG-based motor imagery classification,” Knowledge-Based Systems, vol. 305, p. 112668, 2024.
[16] Y.-T. Pan, J.-L. Chou, and C.-S. Wei, “MAtt: A manifold attention network for EEG decoding,” in Advances in Neural Information Processing Systems, 2022, pp. 31116–31129.
[17] J. Feng, E. Yin, J. Jin, R. Saab, I. Daly, X. Wang, D. Hu, and A. Cichocki, “Towards correlation-based time window selection method for motor imagery BCIs,” Neural Networks, vol. 102, pp. 87–95, 2018.
[18] R. I. Agustin and P. Raphisak, “Optimized time window segmentation for motor imagery EEG classification: An ant colony optimization-based approach,” in 2025 13th International Conference on Brain-Computer Interface (BCI). IEEE, 2025, pp. 1–5.
[19] J. Huang, G. Li, Q. Zhang, Q. Yu, and T. Li, “Adaptive time-frequency segment optimization for motor imagery classification,” Sensors, vol. 24, no. 5, p. 1678, 2024.
[20] H. Wu, S. Li, and D. Wu, “Motor imagery classification for asynchronous EEG-based brain–computer interfaces,” IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 32, pp. 527–536, 2024.
[21] F. Zhuo, B. Lv, and F. Tang, “Time window optimization for riemannian geometry-based motor imagery EEG classification,” in 46th Annual International Conference of the IEEE Engineering in Medicine and Biology Society. IEEE, 2024, pp. 1–5.
[22] G. Pfurtscheller and F. H. Lopes da Silva, “Event-related EEG/MEG synchronization and desynchronization: Basic principles,” Clinical Neurophysiology, vol. 110, no. 11, pp. 1842–1857, 1999.
[23] S. Gu, L. Yang, Y. Du, G. Chen, F. Walter, J. Wang, and A. Knoll, “A review of safe reinforcement learning: Methods, theories and applications,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 46, no. 1, pp. 1–24, 2024.
[24] H. W. Aung, J. J. Li, Y. An, and S. W. Su, “EEG_RL-Net: Enhancing EEG motor imagery classification through reinforcement learning-optimised graph neural networks,” arXiv preprint arXiv:2405.00723, 2024.
[25] W. Zhang, X. Tang, and M. Wang, “Attention model of EEG signals based on reinforcement learning,” Frontiers in Human Neuroscience, vol. 18, p. 1442398, 2024.
[26] R. S. Osei and D. Lopez, “Deep neural networks and experience replay in Q-learning extensions: A review,” International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, vol. 33, no. 4, pp. 401–432, 2025.
[27] S. Huang and S. Ontañón, “A closer look at invalid action masking in policy gradient algorithms,” The International FLAIRS Conference Proceedings, vol. 35, pp. 221–226, 2022.
[28] R. Stolz, H. Krasowski, J. Thumm, M. Eichelbeck, P. Gassert, and M. Althoff, “Excluding the irrelevant: Focusing reinforcement learning through continuous action masking,” Advances in Neural Information Processing Systems, vol. 37, pp. 95067–95094, 2024.
[29] W. Wang and Z. Chen, “DATD3: Depthwise attention twin delayed deep deterministic policy gradient for model-free reinforcement learning under output feedback control,” arXiv preprint arXiv:2505.23857, 2025.
[30] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov, “Proximal policy optimization algorithms,” arXiv preprint arXiv:1707.06347, 2017.
[31] V. Jayaram and A. Barachant, “MOABB: Trustworthy algorithm benchmarking for BCIs,” Journal of Neural Engineering, vol. 15, no. 6, p. 066011, 2018.
[32] M.-H. Lee, O.-Y. Kwon, Y.-J. Kim, H.-K. Kim, Y.-E. Lee, J. Williamson, S. Fazli, and S.-W. Lee, “EEG dataset and OpenBMI toolbox for three BCI paradigms: An investigation into BCI illiteracy,” GigaScience, vol. 8, no. 5, p. giz002, 2019.
[33] M. Tangermann, K.-R. Müller, A. Aertsen, N. Birbaumer, C. Braun, C. Brunner, R. Leeb, C. Mehring, K. J. Miller, G. R. Müller-Putz et al., "Review of the BCI competition IV," Frontiers in Neuroscience, vol. 6, p. 55, 2012.
[34] H. Liu, P. Wei, H. Wang, X. Lv, W. Duan, M. Li et al., “An EEG motor imagery dataset for brain computer interface in acute stroke patients,” Scientific Data, vol. 11, no. 1, p. 131, 2024.
[35] B. Graimann, J. Huggins, S. Levine, and G. Pfurtscheller, “Visualization of significant ERD/ERS patterns in multichannel EEG and ECoG data,” Clinical Neurophysiology, vol. 113, no. 1, pp. 43–47, 2002.