Mean Threshold and ARNN Algorithms for Identification of Eye Commands in an EEG-Controlled Wheelchair

This paper represented Autoregressive Neural Network (ARNN) and meant threshold methods for recognizing eye movements for control of an electrical wheelchair using EEG technology. The eye movements such as eyes open, eyes blinks, glancing left and glancing right related to a few areas of human brain were investigated. A Hamming low pass filter was applied to remove noise and artifacts of the eye signals and to extract the frequency range of the measured signals. An autoregressive model was employed to produce coefficients containing features of the EEG eye signals. The coefficients obtained were inserted the input layer of a neural network model to classify the eye activities. In addition, a mean threshold algorithm was employed for classifying eye movements. Two methods were compared to find the better one for applying in the wheelchair control to follow users to reach the desired direction. Experimental results of controlling the wheelchair in the indoor environment illustrated the effectiveness of the proposed approaches.


Introduction
Human brain plays an important role in controlling all body activities [1].Moreover, it is a complex structure, in which there are about around 100 billion neurons which communicate from one to another with or without external excitations to make control decisions (cognition, motion, pattern recognition, etc.).For these reasons, noninvasive technologies such as EEG, functional Magnetic Resonance Imaging (fMRI) and functional Near-infrared Spectroscopy (fNIRS) have been investigated to quantify motor processing function of human brain [2][3][4].Thus the exploration of these technologies can allow us to perform rehabilitative problems or brain simulator leading to improve or recover the motor/cognitive functions of tetraplegic patients with spinal cord injuries and degenerative nerve diseases.
In recent years, EEG technology has quickly developed and also attracted many researchers related to human brain.Many Brain-computer Interface (BCI) applications as well as Brain-based diagnoses have been successfully represented, in which BCI problems have been investigated to implement on human in recent years.In particular, a BCI system can allow people to communicate and to control external devices [5][6][7].It means that one can translate brain activities into messages or commands to control devices [8][9][10].Blankertz et al. devel-oped the non-invasive BCI system, in which the key features were considered to predict the laterality of upcoming left vs. right hand movements to produce the result of very high information transfer rate.
An EEG system has been used to measure delta signal of human brain corresponding to eye blinks [11].However, to determine the problem of eye activities, a threshold algorithm was employed to control electric wheelchair.In this paper, we develop a neural network model [12][13][14], in which the inputs of the network are AR coefficients [15] which were determined based on the filtered EEG signals using a Hamming lowpass filter from the identified outputs of the network.In addition, a threshold algorithm is employed to find the mean thresholds for eye movements.In this research, two of these methods will be compared to determine the best one to control the wheelchair.

Data Acquisition
Data at Fp1, F7, F8 areas of human brain were obtained from an Active-Two system as shown in Figure 1.Nine subjects (males and females, average age: 22 ± 5.33) were invited to participate into this study.The subjects informed consents agreement after reading and understanding of the experiment protocol and the EEG tech- nique.Offline data were obtained at some positions such as at Fp1, F7, F8, CMS and DRL (see Figure 2) on head of each subject through the Active-Two system.The subjects were instructed to perform their eye activity times (opening eyes, blinking two eyes, glanced left, glanced right), each subject performed his/her eye activity in 5 seconds.

Signal Pre-Processing
In the EEG signal processing, the original signal is passed through a band-pass filter with an impulse response in order to produce the output of the filter, ] [n g .For the convolution operation between the EEG signal and the impulse response of the Hamming low pass filter, it is described as follows: where where ] [n w is the Hamming window and ] [n h denotes the ideal impulse response.
To reject influence by voltage drift, the output signal is calculated using the following formula: In this paper, the number of the EEG signal samples is N = 1024.The original signal and the filtered signal at position of F8 are processed as shown in Figure 3.
After filtering noise by the filter, the filtered EEG signals corresponding to eye events such as opening eyes, blinking eyes, glancing left and glancing right (see

AR Model for Feature Extraction
In this paper, an Autoregression (AR) model is used to extract the features of the EEG signal.In the AR model, coefficients are determined using the equation: where ) (n y is the filtered EEG signal, n = 1, 2, …, 1 a and 2 a are two coefficients of the AR model.In the EEG signals collected at three channels FP1, F7, F8, each channel has two AR coefficients.Hence in four experiments (blinked, opened eyes, glanced left and glanced right), one will create four vectors and each vector has 6 AR coefficients as shown in Table 1.

Neural Network Model
Classification is an important step to determine the activity of the eye.After being extracted the signal features of the eye activities using the AR mode, it produces the coefficients, which will be transmitted directly into back propagation neural networks with two hidden layers (see Figure 6) for training [15].
The back-propagation network is to minimize the error function in the weight space by the reduced gradient method.Because this method of calculating the gradient of the error function at each iteration requires that the error function should be continuous and indivisible.One of the activation function used in this paper is the sigmoid   function, which is described as follows: Consider a back-propagation neural network with n input, m output, contains a number of hidden layer neurons to form the training data set (on -off), in which the desired set, (x 1 ,d 1 ), (x 2 ,d 2 ),..., (x p ,d p ) contains P m × n pair of vectors.The weights will be chosen at random.When the data set x i are trained to create the different output set (O i ,d i ), then the error function E is calculated by the following formula: where P is the number of samples, O is the network output, d denotes the desired output and α is constant.The back-propagation algorithm is used to find the local minima of the error function.Therefore, the gradient of the error function is calculated to change the initial weight values for the network.The weights are the parameters changed to reduce errors and then each weight will increase a typical value: Although there are many rules to optimize the neural networks developed, the network architecture was often derived from trial and error approach.Another factor affecting the convergence of back propagation algorithm is the learning rate, η .With the large value of η , the network will increase the learning rate, but the network with the too large value will not be able to converge.Inversely, small values can ensure the convergence algorithm, but the learning rate is very slow.For this reason, the algorithm with adaptive learning rate is applied and described as follows: and error of learning rate where is the k th learning rate.

Mean Threshold Algorithm
In this project, a threshold algorithm will be applied to determine cases of open eye, two eyes blinking, glanced left, glanced right.The average value M of open eye signals is calculated using the following equation: where y(n) is the set of EEG signals (rejected voltage drift) and N denotes the number of samples.
From Equation ( 9), the standard deviation SD in case of open eye signal can be calculated as follows: ) ) ( ( SD (10) A mean threshold algorithm ThM is built to determine cases of eyes open, eyes blinks, the left and right glance: where a is the coefficient of the standard deviation.This paper shows the detection of eye states based on the change of amplitude of signals with its frequency range (0.5 to 3.5 Hz) at Fp1, F7 and F8 positions.Therefore the mean threshold determined based on EEG signals in the open eye case plays an important role.
To reduce the error of eye blinking recognition, the threshold value ThM was calculated in the case of open eye by comparing with the maximum values in the measured times of eye movements to determine the coefficient a.Therefore, the mean thresholds ThM at the positions F p1 , F 7 and F 8 , were calculated as follows: ( ) Min < <Min =Min OF7,LBF7,BF7 where Max is the maximum amplitude at Fp1 of the eye opening signal (OFp1), right glance signal (RFp1), left glance signal (LFp1) and Max BFp1 denotes the maximum amplitude in the case of blinking eye at Fp1.

Results and Discussion
EEG signals were collected at three channels FP1, F7 and F8, in which each channel is processed to extract features.Mainly two methods of the ARNN model and the mean threshold algorithm were applied to find the best method for the wheelchair control.

Features of Eye Movements Using AR Mode
From the EEG signals of eye movements, each channel has two AR coefficients.Hence one of the eye states created a vector with six AR coefficients as shown in Table 2. Time for an eye activity is less than 1 second, so the eye activity is just set 1 second.The vectors are inputs of the feedforward neural networks.2).
Figure 11 represents six coefficients versus the amplitude of signals.The classification of four coefficient vectors shows that they are the same shape of signals but  their amplitudes are different.These coefficient vectors will be applied to inputs of the neural network model for recognizing the eye activities.

Identification of Eye Movements Using NN
Subjects worked out their tasks for recordings, in which 20 times blink eyes, 15 times glanced left, glanced right 15 times and 20 times to open eyes.Thus, we have a total of 70 vector samples, in which 50 sample vectors (eye blinking_15, glancing left_10, glancing right_10 and opening eyes_10) will be used to train the Artificial Neural Networks (ANNs) and the 20 remaining vectors will be applied to check the training results.
The experiment using a two hidden layers network structure with sigmoid function has its output is a linear function as described in Table 3.In this experiment, the number of hidden layer neurons was chosen as in Table 4, in which the first hidden layer with 15 neurons and the number of neurons in the second hidden layer will be changed for investigating the accuracy of the network.From Table 4, we see that the network with the 25 neurons in the 2 nd hidden layer is the highest with the average accuracy of 94%.
In this paper, the feed forward neural networks with back-propagation learning rule using gradient reduction algorithm were used, in which learning rate is 0.001 (learning rate is the smaller, training time is longer, but the obtained results are more accurate).While the number of iterations is 1000 (the number of iterations is as large as possible, because the error of the network outputs and the real outputs is smaller), the increasing ratio of learning rate is a = 1.07 and the decreasing ratio of learning rate b = 0.7.

Eye Movements Using Mean Threshold
From Equations ( 11), ( 12) and ( 13), one determined the coefficients a, in which 3.5 < a Fp1 < 13.75 and we chose a Fp1 = 11 at the F p1 position for the case of eye blinks and similarly, a F7 = −4 and a F8 = −4 were chosen for the positions, F7 and F8.Based on the values a Fp1 = 11, a F7 = −4 and a F8 = −4, the mean thresholds were calculated as shown in Table 5 In similarity, the mean threshold values were obtained on nine subjects as shown in Table 6.
The mean threshold values were applied into eye tasks and we recognized the eye activities times (see Figure 12).
From Table 7, the ANN method gives the higher performance.However, time for training data is more expensive.Therefore, which method chosen here is dependent on each typical application.
The author et al. applied the SVMs and ANNs for the eye movements using EEG and showed the classification accuracies, in which the SVMs is 90.8% and accuracy of 86.8% is of the ANNs [13].While based on AR coefficients, the ANNs have accuracy of 93.5% and the accuracy of the mean threshold is 86.25% in this paper.This means that our proposed methods are the effectiveness.

Wheelchair Control Strategy
In a Brain-Computer Interface (BCI) system for control of an electric wheelchair as shown in Figure 13, the user was concentrating to drive the wheelchair by the eye movements.Figure 14 shows the directions of the electric wheelchair, in which the wheelchair can be driven to move with commands such as forward, backward, stop, turning left and turning right.
The wheelchair was designed to move with the speed of 5 km/h in the indoor environment.For the smooth movement of the wheelchair, when the wheelchair receives a typical command to move to the left or the right, it was designed to follow a curve around the inflection point of the cubic equation.

Conclusion
This paper investigated an AR neural network algorithm and the mean threshold algorithm in an EEG-controlled  wheelchair for severely disabled people.From original signals, the Hamming low pass filter was applied to produce the frequency bands for feature extraction.The coefficients, which bring the feature of each eye activity, are extracted using the AR model.These coefficients generated the feature vectors for connecting to inputs of the neural network which was employed to recognize the eye movements such as opening eyes, blinking eyes, glancing left and glancing right.After recognizing these characteristics, user can drive the wheelchair to reach the target.Experimental results showed that the wheelchair user can move in the indoor environment.

Figure 1 .
Figure 1.Subject with electrodes for obtaining data on the system.

Fig- ures 4
and 5) are calculated to determine coefficients for the recognition of eye activities using neural networks.

Figure 4 .
Figure 4. (a) Filtered signal y[n] in case of opening eyes; (b) Filtered signal y[n] in case of blinking eyes.

Figure 5 .
Figure 5. (a) Filtered signal y[n] in case of glancing left; (b) Filtered signal y[n] in case of glancing right.

Figure 6 .
Figure 6.The structure of a NN model with two hidden layers.
where the weight vector w is in the network, η denotes the learning rate (constant), w E ∂ ∂ / is the derivative of the error function w.

Figures 7 (
a), 7(b), 8(a) and 8(b) showed the AR model coefficients of the signals corresponding to eye open time at 1 second.From the figures, we see that in the case of eye open and eye blinks, the signals are the same, so the coefficients of three channels are nearly equal.While Figures 9(a), 9(b), 10(a) and 10(b) represent different coefficients of glancing left and right.All different coefficients generate four vectors (in Table

Figure 14 .
Figure 14.The directions of the wheelchair motion.