The SSVEP-Based BCI Text Input System Using Entropy Encoding Algorithm

The so-called amyotrophic lateral sclerosis (ALS) or motor neuron disease (MND) is a neurodegenerative disease with various causes. It is characterized by muscle spasticity, rapidly progressive weakness due to muscle atrophy, and difficulty in speaking, swallowing, and breathing. The severe disabled always have a common problem that is about communication except physical malfunctions. The steady-state visually evoked potential based brain computer interfaces (BCI), which apply visual stimulus, are very suitable to play the role of communication interface for patients with neuromuscular impairments. In this study, the entropy encoding algorithm is proposed to encode the letters of multilevel selection interface for BCI text input systems. According to the appearance frequency of each letter, the entropy encoding algorithm is proposed to construct a variable-length tree for the letter arrangement of multilevel selection interface. Then, the Gaussian mixture models are applied to recognize electrical activity of the brain. According to the recognition results, the multilevel selection interface guides the subject to spell and type the words. The experimental results showed that the proposed approach outperforms the baseline system, which does not consider the appearance frequency of each letter. Hence, the proposed approach is able to ease text input interface for patients with neuromuscular impairments.


Introduction
The neurodegenerative disease or spinal cord injury always reduces the muscle ability and results in difficulties in speaking, swallowing, and breathing.The life quality of people with the above disease is always greatly reduced.Therefore, it would make them find difficulty in performing even simple activities, such as communicating with other people.Although these severely disabled lost many human functions, they still have healthy eyes and brain which can help them see and think.In order to better provide the needs of these severely disabled, a lot of high technology assistive devices have been developed in recent years.There is an interactive method by brain computer interface (BCI) technology proposed in this paper to help the disabled communicate with other people.
A BCI connects human brain to computer or other devices by attaching electrodes on the human scalp.In general, we can acquire the electroencephalography (EEG) and extract several features from the EEG signals by using BCI technology.The BCI technology will help people to send messages or commands to the outside world or devices without saying any word [1].Besides, BCI technology is noninvasive and it would ease the uncomfortableness of subject with motor neuron disease when the subject accepts EEG acquisition [2][3][4][5].
Previous studies on BCI topic use event-related potential (ERP) method associated with either physical or mental occurrence in time.Event-related potential often includes the  and  rhythms, slow cortical potential, P300-evoked potential, and the steady-state visually evoked potential (SSVEP) [2].The visually evoked potential (VEP) is a form of 2 Mathematical Problems in Engineering slow cortical potential, which is a visual stimulus, such as an alternating checkerboard pattern displayed on the screen to elicit evoked potential, such as an alternating checkerboard pattern, [6].Chen et al. developed a BCI-controlled LEGO page turner by using VEP technology [7].The BCI control page turner proved that EEG recognition rate of the system is high enough to be used in practical application, but the duration for each trial was about 7 to 12 seconds.
Recently, the BCI technology is utilized in mental text input systems by using different methods of EEG recognition, such as P300, motor imagery, and steady-state evoked potential (SSVEP) [8,9].The BCI based text input system using P300 is one of the earliest types of BCI.For such interface, the user needs to select a command in the row and the column from a matrix [10].It needs longer EEG recognition time generally because P300 needs more raw EEG data for recognition.In order to reduce the response time and increase the signal-to-noise ratio, SSVEP had been widely used in BCI.SSVEP is an oscillatory EEG wave that appears in the occipital lobe of the subject's brain in response to visual stimuli modulated at a certain frequency [3].The frequency of EEG signal in the occipital lobe matches that of the visual stimulus and its harmonics when using SSVEP method [2,4].Xu et al. and Yin et al. proposed a mental text input system by combining P300 and SSVEP [11,12].Obermaier et al. used spontaneous EEG signal to implement a mental text input system [13].But the number of stimulating frequencies used in a SSVEP-based BCI application should be larger than the number of commands [14].Thus, the performance of these approaches would be greatly reduced when the number of commands is increased.Therefore, a multilevel selection interface is needed to reduce the number of stimulating frequencies and then the recognition rate of a text input system can be improved.
An entropy encoding algorithm is a lossless data compression scheme and it could assign a unique prefix-free code to each unique symbol.The length of each code word is approximately proportional to the negative logarithm of the probability.Therefore, the most common symbols use the shortest codes [15][16][17].For the SSVEP-based BCI text input system, the code length of a letter represents how and how many times to select a letter from the multilevel letter options.An entropy encoding algorithm such as Huffman coding can find a minimal prefix code if the probability distribution of source symbol sets is known [15].Therefore, entropy encoding algorithm is able to efficiently generate the structure of multilevel selection.Besides, in order to increase the efficiency of binary selection, -ary coding method was proposed to represent large source of letter [17].Thus, integrating an entropy encoding algorithm would greatly improve the efficiency of multilevel selection.
In this study, a multilevel selection interface using entropy encoding algorithm is applied to a SSVEP-based BCI text input system.In order to improve the accuracy of SSVEPbased BCI, a multilevel selection interface is proposed to reduce the candidates of a decision model.For the purpose of improving the efficiency of multilevel selection interface, the letters are arranged to fit a tree structure by using an entropy encoding algorithm, which considers the appearance frequency of each letter.The Bayesian decision model with Gaussian mixture model is adopted to classify frequency responses.
The rest of this paper is organized as follows.Section 2 describes the entropy encoding algorithm based multilevel selection interface for a SSVEP-based BCI text input system, including EEG feature extraction, design of multilevel selection interface, and Bayesian decision model with Gaussian mixture model.Section 3 presents the results of a series of experiments examining the performance of the proposed approach.In Section 4, the conclusion and recommendations for future research are presented.

Methods
In this section, a SSVEP-based BCI text input system is presented to improve performance beyond that of previously proposed methods.First, the power spectrum of EEG is extracted and used to represent the evoked response of a user.Second, the letters are optimally arranged as a tree structure and used to design the multilevel selection interface.Finally, the Bayesian decision model with Gaussian mixture model is used to decide the correct selection.The procedure of proposed approach is described in the following subsections.Feature extraction is presented in Section 2.1.Then, the design procedure of multilevel selection interface is described in Section 2.2.The Bayesian decision model with Gaussian mixture model is then described in Section 2.3.

Feature Extraction.
In this subsection, the features used in this study are presented.For a EEG signal, , an exponentially modified Gaussian function based on nonlinear curve fit model, (), is used to remove the drift phenomenon of EEG signal.The () is defined as where  0 is the offset from the -axis and  is the amplitude of the data set.  , , and  0 are the mean of , width of the function, and the modification factor, respectively. is then defined as The error function erf(⋅) in ( 1) is an error function and is defined as After removing the drift phenomenon of , a 2nd order band-pass filter is used to limit the frequency range of  to the subject's responses on visual stimulation.Then, the Savitzky-Golay filter, (), is adopted to smooth the signal and reduce noise and it is defined as where   and   are the number of samples before and after each considered sample at time , respectively.  is the weighting coefficients of a filter, which can keep higher moments [18,19].
To estimate the evoked response, the power spectrum of (⋅) can be calculated by using fast Fourier transform [20] which can be written as where  ∈ {0, 1, ...,  − 1} and  is the length of (⋅).Then the power spectrum can be calculated as

Design of Multilevel Selection Interface.
The procedure to design a multilevel selection interface is illustrated in this subsection.The frequencies of used letters, which were calculated from several large-scale English corpora, can be found in previous study [21] and the letters were tabulated and divided into upper-and lower-case letter.Since the probability of a letter is derived from the letter appearance frequency, the probability should meet the condition of the following equation: where () and  are the probability of th letter and the number of letters used in a text input system, respectively.For multilevel selection interface, there are 5 block options used to represent the selections.In these options, 4 options are used to select a letter or a group of letters.The 5th option is "SPACE" and "BACK command" for the first and other level, respectively.The "BACK command" enables a user to back a previous level when he/she makes a wrong selection.An example of multilevel selection interface is shown in Figure 1.The option number 0 to 3 in the level 1 contains every letter.In the levels 2 and 3, the options number 0-3 only contain the letter in the chosen box on levels 1 and 2, respectively.Multilevel selection interface is shown on Figure 1 and the letters for each option of level 1 are sequentially assigned to the options.The results of level 2 and level 3 assumed that the option 0 of level 1 and level 2 is selected.
The purpose of allocating the letter position into the optimal option block can effectively reduce the selecting times of multilevel selection interface and then the entropy encoding algorithm is able to find an optimal allocation of letters.Thus, an entropy encoding algorithm proposed by Huffman is integrated to find an assignment of letter and is denoted by EEA.In this approach, -ary Huffman coding with  equal to 4 is used to provide 4 selections.Furthermore, Navarro and Brisaboa had shown that the average length of codes for an encoding algorithm can be effectively reduced by adding dummy letters with zero probability.Therefore, the dummy letters with zero probability are considered in this study (denoted by EEA D) and then the number of letters modeled by EEA D (denoted by   ) can be calculated by the following equation: where  and  are any integer number and the number of options at each node.

Bayesian Decision Model.
For an input EEG signal, a power spectrum, , is estimated and used to decide a selection, ŵ, from options of multilevel selection interface.The decision model is based on posterior probability and is defined as ŵ = arg max where   is a model of th option.According to Bayesian theory, (9) can be derived as The () is a constant and (  ) is assumed to be a uniform distribution in this study.Thus, () and (  ) can be omitted without affecting the decision and then (10) can be rewritten as ŵ = arg max In this study, a Gaussian probability density function in -dimension space is used to model the probability (  | ) and then it can be written as where  and Σ are the mean and variance.

Experimental Results and Discussion
To evaluate the proposed approach, the number of options used in multilevel selection interface is set to be 5. Besides, the letters used in this SSVEP-based BCI text input system can be categorized into four groups, including 26 uppercase letters, 26 lowercase letters, 10 numbers (from 0 to 9), and 4 special letters (comma, dot, question mark, and exclamation mark).The subjects were visually stimulated by using an LCD screen and the visual stimulator flickering at five frequencies from 6 Hz to 10 Hz with 1 Hz increment.Then, the EEG signals were measured using electrodes placed at the Oz, A1, and A2 (ground) in accordance with the international EEG 10-20 system.The sampling rate and the frame size were set to be 1 k Hz and 1000, respectively.Besides, a 2nd order band-pass filter with cut-off frequencies between 5 and 30 Hz is used to limit the frequency range of the EEG signals to the subject's responses on visual stimulation.

Experimental Results of Multilevel Selection Interface.
To evaluate the performance of different multilevel selection interface, the average message length is adopted and it can be derived as where  av , (), and () are average message length, probability of th letter, and message length of th letter, respectively.In this study, the arrangement of letters can be modeled as a tree structure.Therefore, an approach, which does not consider the appearance frequency of each letter, was treated as a baseline system and was used to compare with the proposed approaches EEA and EEA D. In the baseline system as shown in Figure 1, the majority of the letters were distributed inside each option block on the level 1.All the numbers, uppercase letters, and lowercase letters were put inside the left three option blocks of level 1, while the special letters were put inside the fourth option block of level 1.Each option block of level 1 contained 16 letters, while each option block of level 2 and level 3 contained 4 letters and 1 letter, respectively.For EEA D, there were 66 letters used in the text input system and  was 4. Thus, the  of ( 8) was 21 in this study.
The codes of letters for baseline, EEA, and EEA D multilevel selection interface were shown in Tables 1, 2, and 3, respectively.These codes represented the selection order chosen by the subject on each level.For example, a letter "D" on baseline system is encoded as "011." It means that the subject should choose options 0, 1, and 1 on level 1, level 2, and level 3, respectively, if the subject wants to type letter "D." When it is expressed as a tree structure, the result is shown in Figure 2.
To compare the performance of baseline system, EEA, and EEA D, the experimental results expressed as average, minimum, and maximum length of codes were shown in Table 4.The average lengths of codes were 3.03, 2.63, and 2.42 for baseline, EEA, and EEA D, respectively.We also can find that the minimum code length of EEA and EEA D was 2, which was smaller than the minimum code length of baseline approach.However, the maximum code length of EEA and EEA D was 7, which was larger than that of baseline approach.Thus, to minimize the average length of codes for EEA and EEA D, the entropy encoding algorithm needs to increase the length of codes for letters with low appearance frequency.Next, the proposed approaches are examined by using two types of sentences which are pangram and nonpangram.A pangram is a sentence that contains all letters of the alphabet.The testing pangrams are shown as follows.
(1) Bored?Craving a pub quiz fix?Why, just come to the Royal Oak!
(3) Just keep examining every low bid quoted for zinc etchings.
(5) Grumpy wizards make toxic brew for the evil queen and Jack.
The testing nonpangrams (NP) are shown as follows.
(1) Life is not about getting and having, it is about giving and being.
(2) Whatever the mind of man can conceive and believe, it can achieve.
Letter "D"  (3) Strive not to be a success, but rather to be of value.
(4) Two roads diverged in a wood, and I took the one less traveled by, And that has made all the difference.
(5) I attribute my success to this, I never gave or took any excuse.
The experimental results for pangram and nonpangram were shown in Table 5.For pangrams, the average lengths of codes were 3.04, 3.03, and 2.78 for baseline, EEA, and EEA D, respectively.The average lengths of codes for nonpangrams were 3.04, 2.55, and 2.33 for baseline, EEA, and EEA D, respectively.When the sentence is nonpangrams, it is clear that the performance of EEA can be greatly improved from 3.03 to 2.55 (2.78 to 2.33 for EEA D).Therefore, the appearance frequencies of letters are very important for nonpangrams.For a text input system, the nonpangrams match the writing or spelling in real world.Thus, the proposed approaches EEA and EEA D are able to greatly improve the performance of a text input system.

Experimental Results of SSVEP-Based BCI Text Input
System.In this subsection, the performance of proposed SSVEP-based BCI text input system was examined.12 subjects (10 males and 2 females), who have normal vision and had no history of any neurological or psychological disorders, were asked to participate in the experiments.The average age of the subjects is 20.9 and 21.5 years old for males and females, respectively.
In this experiment, the evoked responses of the visual stimulation from 6 Hz to 10 Hz with 1 Hz increment are used to represent the five options in multilevel selection interface.Then the Bayesian decision models were used to recognize  the evoked EEG signal of the subject due to these letter options.The experimental results were shown in Figure 3 and the average recognition rate was 89.50%.It is clear that the accuracy of 4 kinds of visual stimulation frequencies from 6 Hz to 9 Hz was higher than 85% and then it can be applied to a practical application.However, the accuracy of 10 Hz is lower than those of other visual stimulation frequencies.An example of evoked EEG signals was shown in Figure 4 and then it was observed that the signal-to-noise rate of 7 Hz is higher than that of 10 Hz.Thus, it would greatly reduce the performance of the text input system.To overcome this disadvantage, the blinking frequency 10 Hz should be assigned to an option block, which includes the infrequently used letters or special marks in a BCI text input system.Thus, in this study, the blinking frequency 10 Hz was assigned to the 5th option block on level 1 which includes the "SPACE" and "BACK" commands.

Experimental Results of Proposed Approach.
The performance of proposed approach was examined by using the information transfer rate (ITR).The ITR used in this study is based on Wolpaw method, which is presented by Volosyak [22], and then it can be defined as where  is the accuracy of the EEG recognition.The unit of ITR is then expressed as bits per trial.It is clear that   is greatly dependent on recognition rate and the response time of a system.Therefore, the ITR considering response time is used in this study and it is defined as where  is the time duration to input all testing letters.The ITR were 31.9bits/min, 39.04 bits/min, and 42.62 bits/min for baseline, EEA, and EEA D, respectively, after the experiments for the SSVEP-based BCI text input system.It is clear that the ITR can be improved by arranging the order of the letters in a multilevel selection interface.According to the entropy encoding algorithm, the input times for a letter with high appearance frequency can be effectively reduced and then the ITR can be effectively improved.In this experiment, the accuracy of an option (blinking frequency is 10 Hz) is lower than other option blocks (blinking at 6 Hz, 7 Hz, 8 Hz, and 9 Hz) and it can be regarded as an infrequent option block for allocating the letters or special marks with low appearance inside.So, the ITR is not seriously affected by the entropy encoding algorithmin this study.However, when the accuracy is quite different for each option, the ITR would be greatly affected and the accuracy should be considered in a multilevel selection interface.

Conclusions
In this study, the entropy encoding algorithm was proposed to improve the efficiency of multilevel selection interface for the SSVEP-based BCI text input system.The entropy encoding algorithm was successfully used to improve the efficiency of the tree structure of multilevel selection interface according to the appearance frequency of each letter.The Bayesian decision model with Gaussian mixture model was able to recognize the input options and provided the appropriate EEG recognition.The experimental results demonstrated that the proposed EEA and EEA D, new letters arrangements in option blocks of BCI, outperform baseline arrangement.
The proposed EEA and EEA D could be applied to a practical application and improve the text input speed and performance of the SSVEP-based BCI text input system.Meanwhile, the SSVEP-based BCI text input system can solve the communication problems for the severely disabled such as amyotrophic lateral sclerosis, cerebral palsy, and spinal cord injury.In the future, the recognition accuracy of evoked EEG signal stimulated with different visual stimulation frequencies should be considered to improve the performance of entropy encoding algorithm for a multilevel selection interface.

Figure 1 :
Figure 1: An example of multilevel selection interface.

Figure 2 :
Figure 2: An example to represent a letter "D" with code "011" in tree structure.

Figure 3 :
Figure 3: The experimental results of proposed SSVEP-BCI based text input system.

Figure 4 :
Figure 4: The examples of evoked signals for (a) 7 Hz and (b) 10 Hz.

Table 1 :
The encoding results of baseline system.

Table 2 :
The encoding results of EEA.

Table 3 :
The encoding results of EEA D.

Table 4 :
The experimental results expressed as average, minimum, and maximum length of codes for different approaches.

Table 5 :
The average length of codes for pangrams and nonpangrams.