Research Article  Open Access
The SSVEPBased BCI Text Input System Using Entropy Encoding Algorithm
Abstract
The socalled 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 steadystate 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 variablelength 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.
1. 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–5].
Previous studies on BCI topic use eventrelated potential (ERP) method associated with either physical or mental occurrence in time. Eventrelated potential often includes the and rhythms, slow cortical potential, P300evoked potential, and the steadystate visually evoked potential (SSVEP) [2]. The visually evoked potential (VEP) is a form of 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 BCIcontrolled 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 steadystate 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 signaltonoise 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 SSVEPbased 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 prefixfree 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–17]. For the SSVEPbased 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 SSVEPbased 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 SSVEPbased 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.
2. Methods
In this section, a SSVEPbased 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.
2.1. 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 is the offset from the axis and is the amplitude of the data set. , , and are the mean of , width of the function, and the modification factor, respectively. is then defined asThe error function in (1) is an error function and is defined as
After removing the drift phenomenon of , a 2nd order bandpass filter is used to limit the frequency range of to the subject’s responses on visual stimulation. Then, the SavitzkyGolay filter, , is adopted to smooth the signal and reduce noise and it is defined aswhere 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 aswhere and is the length of . Then the power spectrum can be calculated as
2.2. 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 largescale English corpora, can be found in previous study [21] and the letters were tabulated and divided into upper and lowercase 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.
2.3. 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 aswhere is a model of th option. According to Bayesian theory, (9) can be derived asThe 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
In this study, a Gaussian probability density function in dimension space is used to model the probability and then it can be written aswhere and are the mean and variance.
3. 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 SSVEPbased 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 bandpass filter with cutoff 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.
3.1. 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 aswhere , , 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!(2)Sphinx of black quartz, judge my vow!(3)Just keep examining every low bid quoted for zinc etchings.(4)How razorback jumping frogs can level six piqued gymnasts!(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.(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.

3.2. Experimental Results of SSVEPBased BCI Text Input System
In this subsection, the performance of proposed SSVEPbased 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 signaltonoise 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.
(a)
(b)
3.3. 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 aswhere 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 aswhere is the time duration to input all testing letters.
The ITR were 31.9 bits/min, 39.04 bits/min, and 42.62 bits/min for baseline, EEA, and EEA_D, respectively, after the experiments for the SSVEPbased 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.
4. Conclusions
In this study, the entropy encoding algorithm was proposed to improve the efficiency of multilevel selection interface for the SSVEPbased 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 SSVEPbased BCI text input system. Meanwhile, the SSVEPbased 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.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgment
The authors would like to thank the Ministry of Science and Technology of the Republic of China, Taiwan, for financially supporting this research under Contract MOST 1032221E218009 and MOST 1032218E218002.
References
 D. J. McFarland and J. R. Wolpaw, “Braincomputer interfaces for communication and control,” Communications of the ACM, vol. 54, no. 5, pp. 60–66, 2011. View at: Publisher Site  Google Scholar
 R. Carabalona, F. Grossi, A. Tessadri, P. Castiglioni, A. Caracciolo, and I. de Munari, “Light on! Real world evaluation of a P300based braincomputer interface (BCI) for environment control in a smart home,” Ergonomics, vol. 55, no. 5, pp. 552–563, 2012. View at: Publisher Site  Google Scholar
 J. Wolpaw, N. Birbaumerc, D. McFarlanda, G. Pfurtschellere, and T. Vaughana, “Braincomputer interfaces for communication and control,” Clinical Neurophysiology, vol. 113, pp. 767–791, 2002. View at: Publisher Site  Google Scholar
 P. Morias, “Playing Chess by thinking,” Brain Computer Interfaces over EEG, 2012, http://bciovereeg.blogspot.tw/2012/04/playingchess.html. View at: Google Scholar
 Y. J. Chen, A. R. A. See, and S. C. Chen, “SSVEPbased BCI classification using power cepstrum analysis,” Electronics Letters, vol. 50, no. 10, pp. 735–737, 2014. View at: Publisher Site  Google Scholar
 J. V. Odom, M. Bach, C. Barber et al., “Visual evoked potentials standard (2004),” Documenta Ophthalmologica, vol. 108, no. 2, pp. 115–123, 2004. View at: Publisher Site  Google Scholar
 S.C. Chen, W.J. Hong, Y.C. Chen, S.C. Hsieh, and S.Y. Yang, “The page turner controlled by BCI,” in Proceedings of the 6th World Congress of Biomechanics (WCB '10), pp. 1534–1537, Singapore, August 2010. View at: Publisher Site  Google Scholar
 H. Cecotti, “Spelling with noninvasive Brain–Computer Interfaces—current and future trends,” Journal of Physiology Paris, vol. 105, no. 1–3, pp. 106–114, 2011. View at: Publisher Site  Google Scholar
 C.W. Chen, C.C. K. Lin, and M.S. Ju, “Hand orthosis controlled using braincomputer interface,” Journal of Medical and Biological Engineering, vol. 29, no. 5, pp. 234–241, 2009. View at: Google Scholar
 L. A. Farwell and E. Donchin, “Talking off the top of your head: Toward a mental prosthesis utilizing eventrelated brain potentials,” Electroencephalography and Clinical Neurophysiology, vol. 70, no. 6, pp. 510–523, 1988. View at: Publisher Site  Google Scholar
 M. Xu, H. Qi, B. Wan, T. Yin, Z. Liu, and D. Ming, “A hybrid BCI speller paradigm combining P300 potential and the SSVEP blocking feature,” Journal of Neural Engineering, vol. 10, no. 2, Article ID 026001, 2013. View at: Publisher Site  Google Scholar
 E. Yin, Z. Zhou, J. Jiang, F. Chen, Y. Liu, and D. Hu, “A novel hybrid BCI speller based on the incorporation of SSVEP into the P300 paradigm,” Journal of Neural Engineering, vol. 10, no. 2, Article ID 026012, 2013. View at: Publisher Site  Google Scholar
 B. Obermaier, G. R. Müller, and G. Pfurtscheller, “Virtual Keyboard Controlled by Spontaneous EEG Activity,” IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 11, no. 4, pp. 422–426, 2003. View at: Publisher Site  Google Scholar
 H.J. Hwang, J.H. Lim, Y.J. Jung, H. Choi, S. W. Lee, and C.H. Im, “Development of an SSVEPbased BCI spelling system adopting a QWERTYstyle LED keyboard,” Journal of Neuroscience Methods, vol. 208, no. 1, pp. 59–65, 2012. View at: Publisher Site  Google Scholar
 D. A. Huffman, “A method for the construction of minimumredundancy codes,” Proceedings of the IRE, vol. 40, no. 9, pp. 1098–1101, 1952. View at: Publisher Site  Google Scholar
 B. Roark, R. Beckley, C. Gibbons, and M. FriedOken, “Huffman scanning: using language models within fixedgrid keyboard emulation,” Computer Speech and Language, vol. 27, no. 6, pp. 1212–1234, 2013. View at: Publisher Site  Google Scholar
 G. Navarro and N. Brisaboa, “New bounds on $D$ary optimal codes,” Information Processing Letters, vol. 96, no. 5, pp. 178–184, 2005. View at: Publisher Site  Google Scholar  MathSciNet
 A. Savitzky and M. J. E. Golay, “Smoothing and differentiation of data by simplified least squares procedures,” Analytical Chemistry, vol. 36, no. 8, pp. 1627–1639, 1964. View at: Publisher Site  Google Scholar
 P. Martinez, H. Bakardjian, and A. Cichocki, “Fully online multicommand braincomputer interface with visual neurofeedback using SSVEP paradigm,” Computational Intelligence and Neuroscience, vol. 2007, Article ID 94561, 9 pages, 2007. View at: Publisher Site  Google Scholar
 Y. J. Chen and J. L. Wu, “A novel speech enhancement using forwardbackward minima controlled recursive averaging,” Journal of the Chinese Institute of Engineers, vol. 37, no. 3, pp. 395–406, 2014. View at: Publisher Site  Google Scholar
 M. N. Jones and D. J. K. Mewhort, “Casesensitive letter and bigram frequency counts from largescale English corpora,” Behavior Research Methods, Instruments, and Computers, vol. 36, no. 3, pp. 388–396, 2004. View at: Publisher Site  Google Scholar
 I. Volosyak, “SSVEPbased BremenBCI interface—boosting information transfer rates,” Journal of Neural Engineering, vol. 8, no. 3, Article ID 036020, 2011. View at: Publisher Site  Google Scholar
Copyright
Copyright © 2015 YeouJiunn Chen et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.