Improvement of classification accuracy in a phase-tagged steady-state visual evoked potential-based brain computer interface using multiclass support vector machine

Background Brain computer interface (BCI) is an emerging technology for paralyzed patients to communicate with external environments. Among current BCIs, the steady-state visual evoked potential (SSVEP)-based BCI has drawn great attention due to its characteristics of easy preparation, high information transfer rate (ITR), high accuracy, and low cost. However, electroencephalogram (EEG) signals are electrophysiological responses reflecting the underlying neural activities which are dependent upon subject’s physiological states (e.g., emotion, attention, etc.) and usually variant among different individuals. The development of classification approaches to account for each individual’s difference in SSVEP is needed but was seldom reported. Methods This paper presents a multiclass support vector machine (SVM)-based classification approach for gaze-target detections in a phase-tagged SSVEP-based BCI. In the training steps, the amplitude and phase features of SSVEP from off-line recordings were used to train a multiclass SVM for each subject. In the on-line application study, effective epochs which contained sufficient SSVEP information of gaze targets were first determined using Kolmogorov-Smirnov (K-S) test, and the amplitude and phase features of effective epochs were subsequently inputted to the multiclass SVM to recognize user’s gaze targets. Results The on-line performance using the proposed approach has achieved high accuracy (89.88 ± 4.76%), fast responding time (effective epoch length = 1.13 ± 0.02 s), and the information transfer rate (ITR) was 50.91 ± 8.70 bits/min. Conclusions The multiclass SVM-based classification approach has been successfully implemented to improve the classification accuracy in a phase-tagged SSVEP-based BCI. The present study has shown the multiclass SVM can be effectively adapted to each subject’s SSVEPs to discriminate SSVEP phase information from gazing at different gazed targets.

(SSVEP)-based BCI has been widely mentioned due to its high information transfer rate (ITR) (~70 bits/min), little training, and high accuracy [3,4]. SSVEP is sinusoidal-type electroencephalogram (EEG) signal generated by the human visual cortex that is synchronized and phase-locked to user's attended repetitive visual stimulation [5][6][7]. SSVEP-based BCIs place EEG electrodes in the vicinity of the occipital area and recognize user's gazed target by analyzing the frequency or phase characteristics of the measured SSVEPs.
SSVEP-based BCIs can be at least divided into two categories in terms of coding techniques, one is the frequency-coded SSVEP-based BCI and the other is the phasetagged SSVEP-based BCI [2,[8][9][10][11]. Among current SSVEP-based BCIs, most SSVEPbased BCIs are frequency-coded systems. These frequency-coded systems utilize multifrequency flickers to induce subject's SSVEPs. Each visual target has a corresponding frequency which can be recognized on the estimated spectra, and the target number depends on how many frequencies are used for visual stimulation [8][9][10]. Nevertheless, due to the amplitude-frequency characteristic of SSVEP, some frequency ranges with poor SSVEP signal-to-noise ratio (SNR) should be excluded which usually results in a limited visual target number. In contrast, the phase-tagged system permits visual flickers to flash at the same frequency but being tagged with different phases. Accordingly, phase-tagged SSVEP systems have been developed to extend the available target number for SSVEP-based BCIs [2,[4][5][6][7][8][9][10][11][12].
Several phase-tagged SSVEP-based BCIs have been developed. Lee et al. [2] implemented an eight-target system with flickering frequency set at 31.25 Hz, and averaged over an amount of wave cycles (sixty cycles) to achieve 95% accuracy. Jia et al. [12] developed a frequency and phase mixed coding technique, and found a phase mismatch between the phase difference of visual stimuli and the phase difference of measured SSVEP. Shyu et al. [13] designed a SSVEP-controlled hospital bed nursing system on FPGA platforms. Chang et al. [14] proposed stepping delay flickering sequence (SDFS) to achieve a phase-tagged SSVEP-based BCI independent of SSVEP phase calibration. Zhu et al. [4] accurately analyzed the phase synchrony between SSVEP and the flashing timing of visual stimulator measured from a photodiode. They concluded the variation of the phase difference between the flashing timing of visual stimulator and SSVEP, which might be caused by the phase deviations of visual stimulator. The variability is also called jitter, defined as the standard deviation of measured latencies [15]. Lopez-Gordo et al. [16] utilized phase-tagged amplitude modulation to drive four checkboard stimuli, and manifested the requisite of a calibration procedure for classifying the four targets. Though the SSVEP phase has been reported as an effective feature to implement SSVEP-based BCIs, nevertheless, the variation of the phase difference between visual stimuli and measured SSVEP, caused by the phase deviation of the visual stimulus [4,16,17], individual's emotional condition [18], selective attention [19], nicotine [20], anticipatory anxiety [21], etc., could cause deterioration in the detected accuracy. Therefore, an effective phase classification approach to account for each individual's phase difference of SSVEP is needed so that a reliable phase-tagged SSVEP-based BCI can be achieved.
This study presented a multiclass support vector machine (SVM)-based approach to cope with SSVEP phase variation in the use of a phase-tagged SSVEP-based BCI. SVM was originally introduced by Vapnik and its co-workers at AT&T Bell Laboratories [22][23][24][25]. It has shown its transcendent performance in many applications [26], such as object identification [27], speaker identification [28], text categorization [29], etc. Input data in SVM is mapped into high-dimensional feature space and a hyperplane is determined to completely separate the input vectors into non-overlapping classes [30][31][32][33]. In this paper, the amplitude and phase features of SSVEPs, collected in every 4 cycles at 20 Hz flickering frequency from gazing at different phase-tagged flickers, were extracted to train the multiclass SVM classifier. The trained multiclass SVM was then utilized to discriminate subject's gazed targets. The multiclass SVM data classification using complex non-linear decision boundaries could be helpful to improve the statistical classification performance in phase-tagged SSVEP-based BCI design.

A. Subjects and EEG preparation
Twenty subjects (ten males and ten females), ages from 23 to 37 years old, were recruited to participate in this study. Each subject had corrected Snellen visual acuity of 6/6 or better, with no history of clinical visual disease. Table 1 lists the demographic data of the participants. The research was carried out in compliance with Helsinki declaration. All subjects gave informed consent, and the study was approved by the Ethics Committee of Institutional Review Board (IRB), Taipei Veterans General Hospital, Taiwan. All measurements were noninvasive and the subjects were free to withdraw at any time without any penalty. One unipolar EEG channel was used by attaching an electrode (Oz (+)) placed at Oz position with respect to a reference electrode (Oz (−)) placed at the right mastoid. The ground electrode was placed in the frontal position (Fpz). These EEG electrode placements were based on the international EEG 10-20 system [34]. Oz EEG signals were amplified, pre-filtered within 0.1~100 Hz (PowerLabTM, ADInstrument, Castle Hill, NSW, Australia), and digitized at 1 KHz (NI-USB 6259E, National Instrument) for further processes. The EEG recordings in all subjects were done by the same technician to minimize operation errors.

B. System architecture and visual stimulus
Four light-emitting diodes (LED) (part number: LYBSB93W1303R012BP, LedTech Electronics Co., Taiwan; rise time < 50 μs; wavelength ranging from 400 to 700 nm), covered with thin white paper diffusers, were utilized as visual stimuli located on the four corners of a stimulus panel. A small cross was inlaid at the center of each visual stimulus to facilitate subject's eye fixation. All LEDs were flickering at 20 Hz achieved by alternative ON and OFF states, in which the luminance of ON and OFF states were 168.7 candelas (cd/m 2 ) and 8.1 cd/m 2 , respectively, measured by a luminance meter where θ i is the phase delay, t i is the latency for achieving θ i , T = 1 / f, and f = 20 Hz. Figure 1a shows the system architecture of our phase-tagged SSVEP-based BCI. The stimulus panel was 60 cm in front of the participant. The four visual stimuli, tagged with 0°, 90°, 180°and 270°, were labeled as 'LED 1 ' , 'LED 2 ' , 'LED 3 ' , and 'LED 4 ' , respectively. The flickering sequences for driving the four visual stimuli are shown in Figure 1b. The phase lags of 0°, 90°, 180°and 270°are generated by manipulated time delays of 0 ms, 12.5 ms, 25 ms and 37.5 ms, respectively, in the four flickering sequences (see Equation (1)). The    flickering sequences were generated by a microprocessor (C8051F120, Silicon Laboratories Inc., USA), programmed with Keil IDE software. The flash onsets (from OFF states to ON states) in the flickering sequences served as trigger events for the subsequent process.

C. Experimental tasks
All subjects were requested to participate in a classification study and an application study. In the classification study, each subject was requested to gaze at each of the four visual stimuli for 60 seconds. After gazing at each visual stimulus, subjects were asked to take a 1 min rest. Another 60 seconds were also recorded from subject's resting state while keeping his/her eyes open. We took the first halves (30 seconds) of the five recordings (i.e., four gaze recordings and one eye-opened resting-state (non-gaze) recording) for multiclass SVM training, and the other halves of the five recordings were used to test the feasibility of multiclass SVM in classifying different conditions. Since accurate classification usually depends on correct information of input data, statistical Z-test was applied to the input vectors (see below) obtained from each gaze condition of training data and those input vectors which rejected the null hypothesis (p < 0.05) were excluded from multiclass SVM training. In the application study, the subjects were instructed to shift their eyes to target the four visual stimuli for 80 trials (20 trials for each visual stimulus) in randomized order. Each trial contained the following steps: (1) An onscreen message (↖: LED 1 ; ↗: LED 2 ; ↙: LED 3 ; ↘: LED 4 ), located at the central position of the stimulus panel, was presented to instruct the subject to gaze at a designated visual stimulus; (2) The subject kept gazing at the designated visual stimulus until the subject received an auditory biofeedback. If the recognized gazed target was correct (i.e., the same as the one instructed by on-screen message), the auditory feedback would be a beep sound. Otherwise, a buzz sound would be generated to inform the subject of the wrong detection; (3) The subject perceived the auditory biofeedback, then shifted his/her gaze back to central position to prepare for next on-screen message. The experimental paradigm of the application study for each trial is shown in Figure 2.

Extraction of SSVEP amplitude and phase features
Oz EEG signals were bandpass-filtered within 17-23 Hz to obtain SSVEP responses by means of applying a causal Butterworth filter (6th-order, IIR Butterworth filter). The frequency components of SSVEPs at 20 Hz were extracted in every 4 cycles using Fourier method with 75% overlapped sliding Hamming window. The frequency component at i th time window can be expressed as: in which F i is the frequency component at i th time window, s i [n] is the bandpass filtered data of i th time window, K (K = 200) represents the sliding Hamming window length, and f s (f s = 1 KHz) and f 0 (f 0 = 20 Hz) are the sampling frequency and visual stimulus flickering frequency. The amplitude and phase features of frequency component F i are arranged as an input vector, denoted as x i , subjected to input points of multiclass SVM classification. The input vector x i is represented as where | ⋅ | is the absolute value operator, ∠ (F i ) = tan − 1 (Im{F i }/Re{F i }) is the phase angle of F i , and Im{F i } and Re{F i } are imaginary and real values of F i , respectively. In the classification study, one-minute Oz EEG signals were recorded for each condition. There were 2985 input vectors obtained from each subjects, including the four gaze and one resting-state (non-gaze) conditions. In the application study, the beginning 0.5 s transition time (10 input vectors) in each trial (see Figure 2) was excluded to avoid the contamination of eye-motion artifact.

Classification of SSVEP amplitude and phase features using multiclass SVM
We adopted "one-against-all" multiclass SVM which constructs one binary SVM for each class to distinguish samples of one class from samples of all remaining classes [26,[35][36][37].
In this study, the first-half (30 s) input vectors obtained from each condition (597 input vectors for each condition; 2985 input vectors in total) in the classification study were used as input data to train the multiclass SVM for each subject. The trained multiclass SVM was used to evaluate the classification performance in the classification study and to detect the gazed targets in the application study. The amplitude and phase features of training data were arranged into a 2 × N (N = 2985) matrix for the multiclass SVM training. The multiclass SVM was constructed by a set of binary SVMs to map input data into output space. The classification of multiclass SVM was done by finding the class with maximum output among all binary SVMs. It is worthy to notice that the multiclass SVM should be retrained at the beginning of each session due to the consideration of inter-session variability in SSVEPs.

Determination of effective epoch for user's gaze condition
Since SSVEP is time-locked and phase-locked signal contingent to the flickering timing of subject's gazed target [34], user's non-gaze condition will result in uncertainties in the detected SSVEP phases. SSVEPs induced from a phase-tagged visual stimulus have centralized phase distribution at the visual stimulation frequency, while resting-state Oz EEG signals usually have phase distribution, measured at the same frequency, randomly distributed over 0°to 360°. Accordingly, the discrepancy of phase distribution can be used to discriminate gaze condition from non-gaze condition in the use of a phase-tagged SSVEP-based BCI. In this paper, Kolmogorov-Smirnov (K-S) test was adopted to collect sufficient SSVEP phase information for gaze-target detections. K-S test is a non-parametric method to determine if two sample sets are different from each other [38,39]. Therefore, we reasonably assume the resting-state phases, measured at the flickering frequency of visual stimulus, of Oz EEG signals were uniformly distributed over a full cycle. The effectiveness of gaze-target information for a sample set can be examined by checking whether its phase distribution is away from uniform distribution or not. The length of an effective epoch for gaze-target detection was initially set at Z (Z = 10) input vectors and sent to K-S test to check its nonuniformness. If the data set could not reject the null hypothesis (i.e., p value > 0.01), one more input vector was added in the epoch. Once a data set passed K-S test, the data set was defined as an effective epoch. For each input vector in an effective epoch, a classification output was given by the trained multiclass SVM. The gazed target for each effective epoch was then identified using a plurality voting system by finding the class which gained a majority of votes. The overall flowchart of signal processing is shown in Figure 3.
Filtering raw Oz EEG signal within 17-23 Hz, anchored to the trigger signals.
Extracting 20 Hz frequency components of filtered signal in every four cycles using FFT method.
Organizing the phase features from Z input points into a vector for the following K-S test.
Checking whether the phase information from the K input points is significantly different from uniform distribution (p value < 0.01, K-S test)?
Determining the K input pints as an effective epoch and sending the input points of the effective epoch for multiclass SVM classification.
Identifying the gazed target by finding the class which gains a majority of votes in a plurality voting system.

No
Arranging the amplitude and phase features of frequency components obtained from each time window into input vector x=[|F| F] T .
Setting Z=10 as initial epoch length for K-S test.

Z=Z+1
Sending the corresponding command to activate external devices.

Figure 3
The signal processing flowchart of the proposed system. window, and the amplitude and phase features of frequency components were arranged into input vectors for multiclass SVM classifications. Figure 4b demonstrates the difference of phase distributions obtained from the four gaze conditions (0°, 90°, 180°, 270°) and one resting-state (non-gaze) condition in subject 1. Each phase distribution was the phase features of frequency components gathered from 30-s recording in different condition. It can be observed that the phase distribution recorded from the restingstate condition (right-lower panel in Figure 4b) is a uniform distribution which can be distinguished from other gaze conditions using K-S test. In our classification study, one half of the recorded data was used for multiclass SVM training, and the other half was used for multiclass SVM testing. Figure 5 shows the decision surfaces of trained multiclass SVMs in classifying the five classes (four gaze and one resting-state (non-gaze) conditions) in subject 1 and 6. The solid lines are the decision boundaries to separate each class from others. Colors code the outputs of  decision function of the trained multiclass SVM. The clear decision boundaries illustrate the feasibility of using the SSVEP amplitude and phase features in classifying different gaze conditions when operating a phase-tagged SSVEP-based BCI. Table 2 presents the detected accuracies of multiclass SVM testing in the classification study. The averaged effective epoch lengths were from 0.59 s to 0.77 s; the averaged accuracies were from 87.18% to 97.70%; compared to the conventional epoch-average method with 14 cycles being averaged (detection interval = 0.7 s) [2], the detection accuracies were from 60.71% to 82.62% for 20 subjects. The overall accuracies were 93.49% vs. 70.70% (multiclass SVM testing vs. the conventional epoch-average method) which demonstrates the superiority (p < 0.01, Wilcoxon signed rank test) of using multiclass SVM in improving the SSVEP-based BCI performance.

Results
To quantify the on-line performance of multiclass SVM, a command transfer rate (CTI) and an information transfer rate (ITR) are introduced in addition to the accuracy. The CTI is defined as the total experimental time (T total ) divided by the number of total execution commands, and the ITR is defined as [1,40]: where S is the total number of visual flickers (S = 4) and P is the accuracy.

Discussion
Among the current assistive technologies, the BCI has drawn the greatest attention due to its independent of peripheral neuromuscular activities. A BCI recognizes the patterns of brain waves induced from elaborately designed task, and then translates the brain waves into control commands. However, since human brain is a complex system which usually exhibits remarkable inter-individual variability [12,[41][42][43][44], therefore, choosing a robust classifier with flexibility to adapt inter-individual difference is crucial for an effective BCI. In this study, we adopted multiclass SVM to classify five conditions, including four gaze and one resting-state (non-gaze) conditions, in the use of a phase-tagged SSVEP-based BCI. The amplitude and phase information of SSVEPs were transformed into feature vectors for SVM training as well as classification. This is the first SVM study on the classification of phase-tagged SSVEP-based BCIs. The study results have shown the feasibility of the proposed system, which demonstrates an effective classifier could play an important role in designing a reliable BCI. It has been mentioned several times in the literature that the amplitude of SSVEP can be used to discriminate the evoked SSVEP from background physiological activities. For example, Wu et al. [45] defined an SSVEP signal-to-noise ratio (SNR) in which comparing the SSVEP power divided by averaged power of the selected frequency window. Midderdorf et al. [46] applied an amplitude threshold for SSVEP to control a binary switch. However, it is difficult to judge subject's gaze condition only from the information of SSVEP amplitude, owing to each subject has his/her own SSVEP amplitude-frequency characteristic which results in the SSVEP responses varying with different visual stimulation frequencies. Moreover, the inter-subject variation in background physiological activities also makes uncertainties in discriminating gaze condition from non-gaze condition if only SSVEP amplitude is used.  Accordingly, in addition to SSVEP amplitude, we also took the information of SSVEP phase into account. Due to the advantages of time-locked and phase-locked characteristics of SSVEP, the SSVEPs generated from the subject's gaze condition usually result in a centralized phase distribution. In contrast, the EEG phases obtained from subject's resting-state (non-gaze) condition are irrelevant to flickering onsets of visual stimuli. Figure 6 shows the 20 Hz phases of Oz EEG signals obtained from the gaze and the resting-state (non-gaze) conditions in twenty subjects. The EEG phases were calibrated to the mean phase of SSVEP phases from gazing at LED 1 (θ 1 = 0°) in each subject for the purpose of cross-subject comparison. Figure 6a e show the calibrated phases of Oz EEG signals at 20 Hz when subjects were gazing at LED 1 , LED 2, LED 3 , LED 4 , and resting-state (non-gaze) condition for thirty-second recordings (597 fast Fourier transform (FFT) time windows in each subject, FFT window length = 200 ms, window overlapping = 75%; twenty subjects pooled), respectively. The solid lines show the mean phases, while the dashed lines indicate the mean plus/minus the standard deviations (i.e., mean ± SD) over the twenty subjects. The phase distributions obtained from the four gaze conditions (Figure 6a d) showed significant differences with uniform distributions (p < 0.001, K-S test). The phase distribution checked by K-S test showed no statistical difference with uniform distribution (p > 0.05) in Figure 6e. It echoes the decision surface of multiclass SVM results in Figure 5, in which the non-gaze class presented a uniform distribution spanning over 0 degree to 360 degree with low amplitude at stimulation frequency. It also endorses the feasibility of using phase distribution to discriminate gaze condition from non-gaze condition.
Since brain waves are dynamic activities which are contingent upon variations in a subject's performance and state, linked to fluctuations in expectation, attention, arousal, and task strategy [47][48][49][50][51][52], the generation of command output from an EEG interval involving SSVEP-unrelated information may sometimes cause unexpected pitfalls in BCI operation. To prevent the outputs of trained multiclass SVM from oversensitivity to input data, the present study generated command outputs from effective epochs. An effective epoch was determined to define the length of input data, containing sufficient SSVEP information for a valid BCI output, by checking the phase distribution of input points using K-S test. The input vectors in a determined effective epoch were sequentially inputted into a trained multiclass SVM in each subject, and the multiclass SVM outputs generated from those input vectors were gathered to produce a valid output through a plurality voting process. The plurality voting process determined the valid output by finding the visual target which gained a majority of votes from the multiclass SVM outputs of all input points in the effective epoch, so that the accuracy and specificity of the proposed BCI could be improved.
In our previous publication [2], subject's gazed target was identified using the phase feature of SSVEP only. Besides, the SSVEP was averaged over a large amount of epochs (~30 epochs) to increase SNR and the confidence of phase detection. The epochaverage process caused a long detection time (4.83 s/command) and resulted in the consequence of low ITR. In contrast, in this multiclass SVM study, both the amplitude and phase features of SSVEP were used and extracted in every 4 cycles. Input data (amplitude and phase features of SSVEP) were mapped into high-dimensional feature space by SVM kernel to achieve better classification. Owing to the input of dual features and the benefit of multiclass SVM in classification, the averaged detection time  Figure 6 The phase distribution of SSVEPs at 20 Hz obtained from the gaze and the resting-state (non-gaze) conditions in twenty subjects using Fourier method. The phase distributions obtained from the four gaze conditions (ad) showed significant differences with uniform distributions (p < 0.001, Kolmogorov-Smirnov (K-S) test), while the phase distribution checked by K-S test showed no statistical difference with uniform distribution (p > 0.05) in (e).
(T total /Num total ) in our application study (see Table 3) is 1.63 s/command which is greatly shorter than the detection time in our previous study. The present study focuses on testing the capability of using multiclass SVM to identify subject's gazed targets by classifying amplitude and phase features of SSVEPs. However, according to some previous literatures, the phase of SSVEP can be influenced by the jitter of stimulator triggers [15,17], strategic planning, organized searching [53], memory load [54], emotional arousal [55], adaption of long-term stimulation [56], etc. Training a new classifier has to be learned at the beginning of each session or adopting on-line phase recalibration methods may be possible solutions to account for this phase drift problem in our current design. The issue of recalibrating on-line SSVEP phase can be referred to our previous publication [43] which utilized a biphasic stimulation approach to account for the phase drift of SSVEP during flicker stimulation. Our future work will combine this multiclass SVM method with on-line phase re-calibration technique to improve its applicability.

Conclusions
In this paper, a multiclass SVM-based classification approach is proposed to discriminate subjects' gazed targets for communication purposes. Subjects shifted their gazes at different visual stimuli, and the amplitude and phase information of the induced SSVEP were extracted for multiclass SVM to recognize the gazed targets. The salient features of the proposed system are: (1) the amplitude and phase features were used to classify four gaze and one resting-state (non-gaze) conditions; (2) the effective epoch was determined to define the length of input data, containing sufficient SSVEP information for a valid BCI output; (3) SVM outputs generated from input vectors of effective epochs were gathered to produce valid outputs through a plurality voting process. The system demonstrates its feasibility with ITR performance in healthy subjects. In future studies, the efficiency and reliability of this system for patients with motor neuron diseases should be further investigated.