Continual Learning for EEG based Brain Computer Interfaces
rajpuraparam@iitgn.ac.in pankaj.p@iitgn.ac.in kprasad@iitgn.ac.in
Abstract
A healthy human brain manifests a high variance in signals captured from different modalities like EEG, MEG, and fMRI during ongoing activity.
Further, there is brain signal variability exhibited at the user level.
The study of within-subject and cross-subject variance is essential to design general Brain-Computer Interfaces (BCI) that help interpret these signals into intended outcomes.
We propose that these variations can be studied under the umbrella of Continual Learning (CL).
We performed an empirical evaluation to understand the impact of CL strategies on the benchmark dataset.
Our findings in within-subject and cross-subject scenarios suggest that CL strategies can outperform offline learning and build robust models for BCI applications.
In the cross-subject scenario, CL can lead to learning invariant subject representation when transferring knowledge from one subject to another.
In the within-subject scenario, CL can enhance performance when transferring knowledge from one session to another.
1. Introduction
Noninvasive techniques that measure brain signals at the ensemble levels are sensitive to dynamic changes in neural activity arising as a response to various stimuli or task conditions(Faisal et al.
Study in individuals responding to stimuli suggests that specific individuals maintain high baseline activity or lower baseline activity while performing different
tasks(Arazi et al.
(2017a,b); Sheehan et al.
showcasing evidence of variability in brain signal across task conditions and subjects.
Furthermore, components of brain function that vary across time lead to unreliable EEG signatures and show a lack of repeatability within-subject across trials.
(Meyer et al.
To build robust BCI systems, the earliest attempts were to train users to modulate brain signals to overcome within-subject variations.
Later, machine learning models were calibrated for each session and user, respectively.
Recent studies have focused on transfer learning to provide a mechanism to indirectly transfer knowledge pertaining to the sources of within-subject and cross-subject variability (Saha and Baumert (2020)).
Bakas et al.
, winners of the recent EEG Transfer Learning Competition (NeurIPS 2021) address this difficulty by explicitly aligning feature distributions at various layers of the deep learning model, using both simple statistical techniques and trainable methods with more representational capacity.
The feature alignment process is either subject or session-specific.
Gibson et al.
(2022) demonstrate that the variation in EEG signal strength and variability was found across subjects rather than across sessions.
This was true across sessions that differed considerably in their behavioral and cognitive demands on the same task—further suggesting that EEG variability can be a sensitive subject-driven signal of interest.
In this work, we propose that continual learning strategies must form an integral part of BCI systems because they are crucial for user adaptation.
Especially considering cases of mental imagery in which human learning is involved (Lotte et al.
; Pfurtscheller and Neuper (2010)).
Adaptation may not always assist; it may even be an impediment.
M¨uller et al.
(2017) indicated that either too fast or too slow adaptation can be detrimental to user learning.
Thus, adaptive classifiers must be designed to ensure and favor human learning (Lotte et al.
The combination of transfer learning and online adaptive learning for BCI can be studied under the umbrella of CL as discussed in Mundt et al.
The unique challenges in the EEG modality can further lead to robust strategies in CL.
In this paper, we empirically evaluate CL strategies on the motor imagery dataset as a benchmark and try to assess the following:
• The impact of catastrophic forgetting in transfer learning for cross-subject and withinsubject scenarios.
• The impact of existing CL strategies on classification accuracy for cross-subject and within-subject scenarios.
2. Methodology 2.1. Benchmark Dataset
We focus on EEG brain signals captured during motor movements or imagery for this study.
Our benchmark is based on the existing dataset: EEGMMID (Goldberger et al.
Schalk et al.
EEGMMID provides 64-channel EEG recordings of 109 volunteers at 160Hz sampling frequency.
Each subject performed three two-minute runs of each of the four following tasks:
• Task 1 (open and close left or right fist) • Task 2 (imagine opening and closing left or right fist) • Task 3 (open and close both fists or both feet) • Task 4 (imagine opening and closing both fists or both feet)
We merge the movement and imagery tasks (Task 3 and 4) to augment the dataset.
Each subject, on average, did 93 trials that ran for approximately 4 seconds.
We divide each 4-second trials into 2 seconds, resulting in 320 sample recordings in each sequence and an average of 185 sequences for each subject.
Each sequence was labeled based on the activity: 0 for opening/closing of both fists and 1 for opening/closing of both feet.
Train-test split was 75%-25% respectively, maintaining class balance.
For the within-subject and crosssubject scenario, the training and test set were chosen accordingly.
In both scenarios, the training set was then divided into five experiences used to train the model employed with CL strategy iteratively, each iteration followed by an evaluation on the test set.
2.2. Experimental Setup
We conduct the empirical evaluation to understand CL strategies’ behavior in within-subject and cross-subject scenarios.
We follow the experimental setup and implementation of Matteoni et al.
for the empirical evaluation.
We test CL strategies, namely:
• Replay (Hayes et al.
): retains the previous dataset partially for the next experience.
• Elastic Weighted Consolidation (EWC) (Kirkpatrick et al.
(2017)): restricts change in model weights based on its importance value.
• Learning without Forgetting (LwF) (Li and Hoiem (2017)): uses a combination of knowledge distillation and transfer learning.
• Gradient of Episodic Memory (GEM)
(Lopez-Paz and Ranzato (2017)): projects the gradient on the current minibatch by using an external episodic memory of patterns from previous experiences.
Apart from these CL strategies, naive transfer learning and cumulative strategy (including current and all previous experiences as the training set) are also considered.
We also compare the CL strategies with offline training, where the complete training dataset is trained in a single phase.
Offline training acts as a higher baseline for the given task.
We use an LSTM network with two layers and 64 hidden units.
For Replay, the memory is set to 25%.
Every training phase and strategy uses the same hyperparameters for Adam optimiser and cross-entropy loss as the loss criterion.
We measure the accuracy on the test set after every experience for each strategy and scenario.
All the experiments use the
CL framework provided by Avalanche library(Lomonaco et al.
to manage dataset benchmarks, training phases, and evaluations.
3. Results and Discussion
Table 1 and Table 2 report the accuracy achieved at the end of the training on all five experiences for cross-subject and within-subject scenarios, respectively.
Figure 1 and Figure 2 report the accuracy achieved after training on each experience for cross-subject and within-subject scenarios, respectively.
3.1. CL strategies perform better than offline
Results reported in Table 1 and Table 2 show that in most cases except three cases, CL strategies outperform offline learning by a considerable margin.
While for Subject ID(within-subject scenario), offline learning outperforms, suggesting considerable scope for the CL in BCI applications.
3.2. Memory driven vs. Regularisation Strategy
For both cross-subject and within-subject scenarios, memory or replay-driven strategies, namely Replay and Gradient of Episodic Memory(GEM), outperform other strategies.
The reason may be correlated with the finding that there is no catastrophic forgetting in this case and other methods focus on avoiding forgetting by regularisation.
3.3. Better performance in Cross-Subject
It is surprising to observe that cross-subject scenarios have greater accuracy than withinsubject scenarios for their respective subject ids.
This finding needs further investigation to understand the cause.
3.4. Stopping or control criteria for CL
Referring to Figure 1 and Figure [Table] one can note a significant drop in accuracy after training on specific experiences.
It is crucial to define a control strategy or stopping criteria for CL strategies in order to protect the model from deterioration by learning on new data.
We observe that further experimentation and theoretical framework is required to understand this space
[Table]
[Table]
4. Conclusion and Future Work
We can conclude that there is a necessity and an opportunity for inducting continual learning in Brain-computer interface(BCI) systems.
These findings need to be corroborated on remaining subjects and other datasets.
Further studies to identify distributions and define control strategies or stopping criteria for continual learning can be pursued.
The work can be extended by leveraging CL strategies for domain incremental and task incremental scenarios on a large corpus of EEG data with multiple tasks and sessions.