Adaptive CSP with Subspace Alignment for Subject-To-Subject Transfer in Motor Imagery Brain-Computer Interfaces
Total Page:16
File Type:pdf, Size:1020Kb
IEEE Proceedings of the 6th International Winter Conference on Brain-Computer Interface Adaptive CSP with subspace alignment for subject-to-subject transfer in motor imagery brain-computer interfaces Yiming Jin Mahta Mousavi Virginia R. de Sa Computer Science and Engineering Electrical and Computer Engineering Department of Cognitive Science Shanghai Jiao Tong University UC San Diego UC San Diego Shanghai, China La Jolla, CA, USA La Jolla, CA, USA [email protected] [email protected] [email protected] Abstract—In brain-computer interfaces, adapting a classifier signals [5], [6]. Previous adaptive CSP methods rarely check from one user to another is challenging but essential to reduce the distribution of extracted features after updating the covari- training time for new users. Common Spatial Patterns (CSP) ance matrix. A subtle change in the covariance matrix may is a widely used method for learning spatial filters for user specific feature extraction but the performance is degraded when lead to significant difference between source and target data applied to a different user. This paper proposes a novel Adaptive filtered by CSP. To reduce domain variance of output data, we Selective Common Spatial Pattern (ASCSP) method to update the propose a novel Adaptive Selective Common Spatial Pattern covariance matrix using selected candidates. Subspace alignment (ASCSP) method that selects the most appropriate candidates is then applied to the extracted features before classification. The to update the covariance matrix without resulting in a great proposed method outperforms the standard CSP and adaptive CSP algorithms previously proposed. Visualization of extracted change to the distribution of extracted features. Subspace features is provided to demonstrate how subspace alignment alignment [7] is then applied to the extracted features before contributes to reduce the domain variance between source and final classification to further reduce the domain variance. target domains. Keywords—BCI, motor imagery, transfer learning, CSP, sub- II. DATASET AND METHOD space alignment A. Dataset I. INTRODUCTION To test our methodology, we used data from 6 participants from the study previously published in [8]. In this study, par- A brain-computer interface (BCI) is a platform that can ticipants were instructed to perform kinesthetic motor imagery interpret a user’s brain signals, such as those reflected in of their left or right hand to control a cursor to hit a target on electroencephalogram (EEG) signals, and send commands to a screen in front of them. In each trial, a cursor was presented the external world. Performing real or imagined movements at the center of the monitor and the target at either end - the will elicit different neural patterns which can be detected center was three cursor steps away from each end. After 1.5 by BCI. BCI-based user specific motor imagery has been seconds the target would vanish to reduce distraction and then widely investigated and common spatial patterns (CSP) has the cursor began to move at the speed of one step per second. been successfully applied to this problem [1]. Participants were led to believe that they controlled the cursor; However, due to the distortion of temporal and local infor- however, the cursor moved based on a pre-determined order mation of brain signals and variance between subjects, it is for the purposes of the original study [8]. difficult to classify EEG patterns in one user using a classifier Data were collected using a 64-channel BrainAmp system trained in another user. To overcome these drawbacks, various (Brain Products GmbH). The electrodes were distributed on modified CSP methods have been proposed to obtain more ro- the cap based on the International 10-20 system. Data were bust filters (see e.g. [2]). There are two main ways to approach collected at 5000 Hz sampling rate but were downsampled the problem: One is to regularize the objective function by to 500 Hz for further analysis. Data were analyzed offline adding a penalty term. Such regularization uses priors to guide in MATLAB and EEGLAB [9]. For further details on the the optimization process toward robust spatial filters. The other pre-processing of the data please refer to [8]. In this study, is to incorporate a weighted average of covariance matrices we use data 150 ms to 950 ms after the cursor movements from other subjects to regularize the current covariance matrix towards the target and only consider the frequency band of [3], [4]. 7-12 Hz as this covers the mu band for motor imagery. Since Inspired by adaptive learning, spatial filters learned by CSP in the pre-processing phase for each participant up to five can be adapted recursively by new incoming unlabeled EEG channels contaminated with muscle and other artifacts were Funding: NSF: SMA1041755, IIS1528214, NIH:NR013500, IBM, Adobe. removed, the common channels shared by all participants were selected, as the same channels are required for subject-to- Based on this equation, the optimal M ∗ is obtained as ∗ 0 subject transfer. M = X XT . This implies that the new coordinate system is S 0 B. Common Spatial Patterns equivalent to Xa = XSXSXT . Subspace alignment domain adaptation algorithm [7] is presented in Algorithm 1. The common spatial pattern (CSP) algorithm was suggested for motor imagery classification by Ramoser et al. [1]. CSP Algorithm 1: Subspace Alignment [7] learns optimal spatial filters that maximize filtered variance for one class and simultaneously minimize filtered variance for Input: Source data S, target data T , reduced dimension d the other class. The ith trial of the pre-processed EEG data Output: Subspace aligned data Sa;TT 1 XS PCA(S; d) for each class is denoted as an M × N matrix Xi(y) with 2 XT PCA(T; d) class label y 2 f1; 2g, where M is the number of channels 0 and N is the number of samples. The averaged normalized 3 Xa XSXSXT 4 S = SX spatial covariance matrix Cy is computed for each class as: a a 5 TT = TXT ny T 1 X Xi(y)X (y) 6 return Sa;TT C = i ; (1) y n trace(X (y)XT (y)) y i=1 i i where ny is the number of EEG trials in class y and T D. Adaptive Selective CSP represents the matrix transpose operator. The optimal set of CSP filters can be found to maximize the following Rayleigh With the help of CSP and SA, a novel adaptive selective quotient: CSP (ASCSP) is proposed. Current adaptive CSP methods T WCyW ignore the change of the distribution of the CSP filtered fea- max T : (2) tures extracted after updating the covariance matrices. ASCSP W (C1 + C2)W checks the variance of CSP filtered data before updating the This problem can be solved by the generalized eigenvalue covariance matrix and selects the probable candidate trials problem in the form: WC = ΛWC , where Λ is a 1 2 from target data that maintain the similarity of source and diagonal matrix containing eigenvalues of C−1C sorted in 2 1 target distribution. descending order and the matrix W consists of corresponding Given EEG trials Xs = fXs1 [ Xs2 g from source subject eigenvectors. With the transformation matrix W , X(y) is labeled with left (class 1) and right (class 2) respectively spatially filtered to obtain: Z = WX(y). First and last m and unlabeled trials Xt from target subject, C and C are rows of Z are selected to discriminate the two classes. Feature 1 2 initialized as averaged normalized covariance matrices from vector of rth spatial filter is constructed as: Xs1 and Xs2 using Eq. (1). var(z ) f = log r ; (3) The first step of ASCSP is to select candidate trial xi from r P2m t j=1 var(zj) X for class 1. CSP filters are trained from source labeled data and applied to both source (Xs) and target (Xt) data to extract where var() is the variance calculator and z (r=1,..,2m) is r logarithmic features. Subspace alignment is then applied to the rth row of Z. The logarithmic transformation makes the the logarithmic features to reduce domain discrepancy. Linear distribution of f more similar to Gaussian. r Discriminant Analysis (LDA) is trained upon the extracted C. Subspace Alignment features in source aligned subspace and then predicts the Fernando et al. [7] proposed a domain adaptation algorithm label in the target aligned subspace. If the prediction is class based on unsupervised subspace alignment (SA). This algo- 1 then this trial is selected as the candidate to update the rithm is part of our proposed method to reduce the variance covariance matrix later, otherwise another trial is picked and between source and target domains. Given source data yS and tested sequentially until a label of class 1 is obtained. target data yT , source subspace XS and target subspace XT After selecting the candidate xi for class 1, candidate xj for are generated from the eigenvectors of these input data by class 2 is chosen from remaining Xt. New covariance matrices ~ ~ PCA. Then the given data are projected to the subspaces by C1 and C2 are obtained from: the operations ySXS and yT XT . A linear transformation M is learned to map the source subspace to the target subspace new C1n1 cov(xi) by minimizing a Bregman matrix divergence: C1 + ; n1 + 1 trace(cov(xi))(n1 + 1) ∗ 2 M = argminM jjXSM − XT jjF ; (4) new C2n2 cov(xj) C2 + ; (6) 2 n2 + 1 trace(cov(xj))(n2 + 1) where jj · jjF is the Frobenius norm. Because the Frobenius norm is invariant to orthonormal operations, the objective where cov() calculates the covariance matrix. CSP is trained s function can be rewritten as: with C~1 and C~2 and applied to both source X and target 0 0 t ~ ∗ 2 X data.