Brain Computer Interface for Micro-controller Driven Robot Based on Emotiv Sensors

A Brain Computer Interface (BCI) is developed to navigate a micro-controller based robot using Emotiv sensors. The BCI system has a pipeline of 5 stages-signal acquisition, pre-processing, feature extraction, classification and CUDA inter-facing. It shall aid in serving a prototype for physical movement of neurological patients who are unable to control or operate on their muscular movements. All stages of the pipeline are designed to process bodily actions like eye blinks to command navigation of the robot. This prototype works on features learning and classification centric techniques using support vector machine. The suggested pipeline, ensures successful navigation of a robot in four directions in real time with accuracy of 93 percent.

B RaIn computer interfaces are systems which act as a communication channel between the human brain and an external device. In the first international meeting on Brain Computer Interface (BCI) technology, BCIs have been de-fined as an aid to users' communication and also control channels which do not vary on the brain's normal output of peripheral nerves and muscles [1]. Brain Computer Interfaces is a growing field which has added a new dimension to Human Computer Interaction. BCI development comes mainly from the concern of creating a novel interaction channel between users, especially those who are unable to control or operate on their muscular movements. The motivation for this proposal is to work for people who have neurological disorder such as Amyotrophic Lateral Sclerosis (ALS) [2], referred to as Lou Gehrig's disease, Dystonia and Ataxia. Patients suffering from such severe disorders are unable to perform any muscular movement and in order to help them, we have devised this prototype which shall help the patients in physical movements in the form of a wheel chair [3]. Brain Computer Interface systems acquire signals in the form of energy potential (electroencephalogram signals) which are processed and sent to an external device. Previously, noninvasive brain computer interfaces' systems have significantly reduced labor and cost, such as in BCI2000 which facilitates applications for various domains such as biomedical engineers, computer scientists, environment and investigators [4]. Another system has been developed which is a software controller that is matched with the individual's residual motor abilities [5]. It was a rehabilitation program carried out in a house-like simulation. In current progress, F.Gallan, M. Nuttin and E. Lew have developed an asynchronous and non-invasive which tested patients through experiments to work on brain computer interface in an environment which is complex and aids sound analysis [6]. In a recent developed system of brain computer interface in the University of Bremen, the makers of the project made a human machine interface (HMI)semi-autonomous robot by the name of FRIEND II which was executed and compiled by the MASSiVE control architecture [7]. Learning from these projects, this paper present a brain computer interface system where we are applying machine learning technique, support vector machine to the visual patterns of the signals to navigate a robot using an Arduino Duemilanove microcontroller [8]. In order to extract signals for the brain computer interface, we use an Emotive Headset which captures neuro-signals [9]. After fetching signals from the brain, we de-noise or filter the noise and unwanted signal interruptions from the input signals. Later we apply Support Vector Machine algorithm to classify signals to intents of our choice in order to navigate a robot. We used an Arduino Duemilanove microcontroller to transfer the output signals in order to control the robot using imagined movements.

II. Related woRk
A brief overview of the work and research done on brain computer interface systems helps us gauge the current development.
It has been used in 2003 as a clinical application to study patients with motor impairment [10]. Their objective was to see whether a patient with a severe cerebral palsy was able to control a brain computer interface system. The research concluded with the patients being able to produce distinct EEG patterns with an accuracy of 70 percent. This technique based on EEG biofeedback helped improve actual levels of communication ability for patients with physical disorders. This application with the use of 'tele monitoring-assisted' BCI facilities served as a motivation to complete this project. In 2000, University of California, San Diego conducted a research which explored imagination on mu rhythms and readiness potentials which yielded to major classification using pattern recognition techniques [11].The authors of the research concluded that mu rhythm can not only be changed or modulated by self-generated movement but by virtually imagining the movement. The study also concludes that self-generated limb actions have distinct properties from single limb movements. Such kind of practical BCI systems use identification and its classifying with pattern recognition techniques.
In the initial days of brain computer interface, volunteers were asked in 2004 to navigate through a 2 dimensional maze using their thought processes which was further aided using high field MRI scanner [12]. The authors understood real time fMRI to construe the spatial distribution of brain functions as commands of brain computer interface. With a high field MRI scanner, activities of the brain were segregated into 4 distinct functional tasks which were translated into commands for four directional cursors. This work helped us in understanding how to divide signals in four patterns.
In 2003, Georgia State university brainLab validated brain computer interface interactions with respect to real life ap-plications such as in communication, creative expression and environment [13]. The authors used methods of Human Com-puter Interaction to train brain computer interface systems to real world scenarios wherein they also discuss challenges of having cumulative BCI outputs with human computer interface paradigms to achieve best interaction. This research used and tested various domains to validate interactions completed by BCI systems. This paper motivated us to improve and enhance the quality of life for those with neurological disorders such as ALS. BCI2000 was a system developed in 2004 which could conduct multiple applications using one system [4]. Such an application varies on comparisons of different brain signals, algorithms and its output formats. BCI2000 can successfully aid biomedical engineers, computer scientists and people from various professions in the practical usage of an online operation of brain computer interface. Its documentation helped us understand the multi-domain features of existing brain computer interface.
Initially, two macaque monkeys were trained to perform movements related to limbs [14]. Using bilateral electromyography, the authors concluded the presence of a neural representation which can be successfully out in a brain-machine interface. Monkeys have been used in other projects too where they have completed tasks successfully using Brain computer interface systems [15].
In the review of the first international meeting on brain computer interface technology, the members discussed that the pivotal element in every brain computer interface system is the algorithm which converts or translates electro physiological input from a given set of users to control external devices. Existing BCI systems work on the transformation rate of 10-25 b/min [1] and such achievement can be enhanced using only improved signal processing, user training and more efficient algorithms.

III. tools and technology used
1. Emotiv headset [16]: A sensor headset by Emotiv is used for practical and commercial usage in research applications for brain computer interface. Emotiv heaset in our project is used to detect libraries such as mental commands, and facial expressions. 4. Open ViBe [17]: The signals acquired from the sensors are then filtered in Open ViBe scenarios which helps in processing of the input. Open ViBe acts as a base for signal processing of the fetched input.
5. MATLAB [18]: After processing signals we used support vector machine algorithm using LIBSVM library to pro-cess the input signals to intents of our choice. The intents were classified to numerals which help in providing input to Arduino micr-controller. 6. LIBSVM [19]: LIBSVM is an open source machine learning library which is written in C++, and it implements SMO algorithm for kernelised support vector machines for use of classification and regression. An SVM also uses a discriminant hyperplane to identify classes. However, concerning SVM, the selected hyperplane is the one that maximizes the margins, i.e., the distance from the nearest training points (see Figure 1). Maximizing the margins is known to increase the generalization capabilities. As RFLDA, an SVM uses a regularization parameter C that enables accommodation to outliers and allows errors on the training set. Such an SVM enables classification using linear decision boundaries, and is known as linear SVM. This classifier has been applied, always with success, to a relatively large number of synchronous BCI problems. However, it is possible to create nonlinear decision boundaries, with only a low increase of the classifiers complexity, by using the kernel trick. It consists in implicitly mapping the data to another space, generally of much higher dimensionality, using a kernel function K(x, y). The kernel generally used in BCI research is the Gaussian or Radial Basis Function (RBF) kernel. 7. Arduino Duemilanove [8]: The Arduino Duemilanove is a microcontroller which is powered by any USB connection or with external supply. These kits help in developing digital devices for the physical world. In our project we have developed the microcontroller to build a robot for its navigation using imagined movements. Fig. 2. Arduino micro-controller. 8. CUDA (Compute Unified Device Architecture) [20]: We used a dll file of CUDA where the code was imported. The CUDA platform was used to enhance the efficacy of the system while using in real time and remove time lag. Our project of a BCI system followed the given chronology for execution: • Fetching of signals from Emotiv Epoch sensors: Here we use sensors to acquire brain signals (in the form of EEG) which also includes articulates, noise and unwanted elements [21].
• Filtering and signal processing: In order to utilise data received from brain, it is imperative that we remove all noise from the signals which may have come possibly due to sweat, heart beats or hair on the scalp. This achieved using filters in the Open ViBe platform [22].

• Extraction of significant features:
This allows significant parts of signals acquired to be discriminated and differentiated from others as features in our Brain Computer Interface system [23].

• Classification of signals:
In this process a set of features are assigned classes which can be in correspondence to the navigation required from brain signals.
• CUDA processing and interfacing: In this step we interface all platforms to get the application working, and enhance the speed of the application by interfacing the final end user application on a CUDA platform [20].
Various challenges were faced by us in developing an application based on Brain Computer Interface system such as: • Acquisition of brain signals from the sensor device Emotiv Epoch requires an expert who has used such sensors before.
A key challenge for us was to set up the device in order to get valuable output [9].
• The delay in transmission of messages after classifying was more than 2 seconds (before applying CUDA) which made it difficult for us to read the final output since they were not corresponding to the input we were giving in a real time scenario [24].

Iv. BRaIn coMPuteR InteRface systeM PRocessIng stePs to end useR aPPlIcatIon
In this section, the paper discusses various steps of a brain computer interface pipeline.
We discuss fetching and acquisition of brain signals in sub-section IV-A, followed by de-noising methods in sub-section IV-B, extraction of valuable features and its classification in sub-section IV-C, subsequent classification of signals in sub-section IV-D.

A. EEG Signal Acquisition Paradigm
Signals are fetched by an Emotiv EPOC [25] which is a wireless and multiple channeled neuro-head-gear which has 14 sensors to detect electric signals detected from brain. It is used to acquire EEG signals. The Emotiv headset follows International10-20 locations: AF3, F7, F3,  FC5, T7, P7, O1, O2, P8, T8, FC6, F4, F8, AF4 [26]. A BCI simulator is configured to present the visual stimulus to the user while the EEG data is being collected. The simulator specified the number classes and trials for each class, along with the limits for the duration of trials. For training the classifier, eye movements were defined as the classes and 30 trials were conducted for each class in a random sequence, with each trial lasting from 1.5-3.5 seconds. For collecting labelled EEG data Graz motor Imagery BCI simulator is used which displays certain arrows according to the number of classes defined and on each arrow an intent has to be performed. The acquisition client collected the EEG data while the stimulus was presented to the user using the simulator. Event markers indicate the time instants to mark the beginning and end of trials. The data acquired was passed to a visualizer and also written into a generic stream writer module that dumped the OpenVibe stream to a binary file, with markers indicating the start and end of a trial, the appearance of the arrow and the fixation cross.

B. Pre-processing
For de-noising of data, the emotiv provides software which completes basic signal processing at a threshold frequency of 85Hz, which is then continued by applying a high pass filter with a threshold value of 0.15 Hz. For pre-processing the EEG signals, the Emotiv headset provides basic signal processing which includes low pass filtering of the EEG data with a cut-off frequency at 85 Hz, followed by a high pass filter with a cut-off at 0.16 Hz. Finally, a notch filter is applied at 50-60 Hz is applied to remove the noise due to supply lines interference. Further, our application involves identification of the following intents: eye blinks, right eye wink and left eye wink. These intents are identified by EEG activity in the alpha frequency band, hence we perform band-pass filtering of the EEG signals in the range of 1 to 4 Hz.
In our application, butterworth filter is used for band-passing the signals generated.
A Butterworth filter of order n at threshold frequency D0 has the frequency as depicted in Equation 1.

C. Feature Extraction and Classification
This section discusses our feature extraction techniques where we use band power of signals to differentiate signals from each other. The reason why we used band power features and visual patterns against traditional features is given in [27].
Logarithmic value of band power features is taken to derive the EEG signals as X, the feature matrix vector as FV of a size of [channelsX1] is calculated as given in Equation 2. (2) The band-power of the EEG signal is used as a fea-ture, which is simple to compute and computationally inexpensive. Computation of band-power as a feature has been previously used in BCI systems. We compute the band-power features from EEG signals of a trial, represented as a matrix X of size [channelsXsamples] (where channels represent the number of channels of the recorded EEG data and samples is determined by the sampling rate of the EEG acquisition device multiplied by the length of the time window in which the trial data is taken) After obtaining features we used LIBSVM for classification which is an open-source implementation of Support Vector Machine [28]. There is comparison of classification accuracies using two classifiers: LDA and SVM. In case of multi-class LDA the accuracy is low and so to improve multi-class classification accuracy SVM is used. The trained classifier is used to identify eye blinks in an online session for the subject.

D. Transferring Signals to a Robot
Once we fetched the signals from an acquisition device, and process it on MATLAB, we interface it on a CUDA platform to remove data lag and then navigate a simple robot using Arduino, an open source development plat-form [29]. We accelerated our C++ code by moving the computationally intensive portions of code to an NVIDIA GPU. In addition to providing drop-in library acceleration, we were able to efficiently access the massive parallel power of a GPU with a some syntactic elements and calling functions from the CUDA Runtime API such as global kernel function. In this step we also assigned the final output of the classifier to control an external device. We sent the output to an Arduino which is used to control the movement of a servo motor. After obtaining processed signals from Matlab (with the use of OpenViBe), we use the data to move a simple robot with the help of arduino, an open source development platform . In this project, an Arduino Due Milanove was used with two motors, wheels and wires. The robot followed the output which was fed through MATLAB into the Arduino once a connection was built using a USB cable.
The results and test cases are shown in Table I.

v. Result and accuRacy
In this section, we discuss the tests undertaken at each step of the BCI pipeline and detailed summary of test cases: • Acquisition of signals from device-The input signals were fetched from Emotiv Epoch sensor by 10 users where each one of them took 20 readings each of every intent (left eye blink, right eye blink, both eyes blink, neutral state). Out of the 800 recordings, we were successfully able to catch 785 recordings, which gives us the accuracy of 98 percent.
• De-noising and filtering of data-In this step, we took all 800 signals received by multiple users and converted into meaningful data by applying band pass filter. All signals were successfully denoised giving us an accuracy of 100 percent.
• Feature extraction and classification-Using band power features, we applied support vector machine algorithm using LIBSVM to classify intents. out of the 800 signals, we were successfully able to classify 730 input signals which gives us an accuracy of 91 percent.
• Output on Arduino platform through MATLAB-After processing and classification, out of the 730 signals which were given as input to the Arduino Due Milanove micro-controller, only 681 signals were converted into successful actions by the robot for navigation. The basic challenge in this step was the interfacing with a considerable time lag ( 6 seconds) of MATLAB, Arduino platform and Open ViBe in a real time system. This challenge was met by integrating on a CUDA platform which using parallel processing made the system faster by reducing the time lag to 0.5 seconds. The accuracy achieved in this step is 93 percent.
• Over all accuracy of the system is the sum average of all above mentioned accuracies ie. 95 percent. This result is discussed in Table 1.

vI. conclusIon and futuRe woRk
This project provides a real-time, easy to use imple-mentation of a Brain Computer Interface system which can identify multiple states without a time lag of more than 0.5 seconds. This system does not require individual training, and has high accuracies in achieving classifica-tion. Its future work involves development of medical aid for those with neurological diseases based on EEG signals for different intents.

acknowledgMent
This work would not have been possible without the support of Centre for Development of Advanced Computing, Noida for their help in the usage of Emotiv headset.

Parth Gargava
Parth Gargava is Research and Development Engineer at Centre for development of Advanced Computing. He is also Vice President from Jaypee Institute of Inormation Technology, Student Council. He got is bachelor degree in Technologi at Jaypee institute of information technology. He is currently working in his doctoral thesis.

Dr. Krishna Asawa
Dr. Krishna Asawa working with Jaypee Institute of Information Technology, Noida, India since 2003. During her teaching career of about 16 years, she pursued and experienced teaching subjects like Data Structures, Algorithm Analysis and Design, Artificial Intelligence, Soft Computing, Distributed Databases, Computer Architecture and Organization, Logic Programming, Theory of Computation, Database System, Human Computer Interaction, Cryptography, Management Information System. Apart from teaching, she is an active researcher and currently advisor of 4 research scholars. She is also a member of technical program committee of referred Journals and Conference Proceedings. She is actively involved in curriculum planning, syllabus design, editing and reviewing text books at an engineering graduate level. She has been an organizing member of workshops and conferences, organized by the CSE department of JIIT. She has also served as an external examiner and adjunct instructor at the other Universities.