You are on page 1of 34

BCI CONTROLLED FES SYSTEM FOR COMPLETE

NEUROREHABILITATION OF POST-STROKE
PATIENTS
A PROJECT REPORT

Submitted by
PERUMAL.D
SARATH RAJ.R
RAJASEKAR.V

Under the guidance of

Dr. Thiyam Deepa Beeta

in partial fulfillment for the award of the degree

of

BACHELOR OF TECHNOLOGY
in
BIOMEDICAL ENGINEERING

DECEMBER 2021

1
BONAFIDE CERTIFICATE

Certified that this project report “BCI CONTROLLED FES SYSTEM FOR
COMPLETE NEUROREHABILITATION OF POST-STROKE
PATIENTS” is the bonafide work of “PERUMAL.D (18UEBM0017),
SARATHRAJ.R(18UEBM0025) and RAJASEKAR.V(18UEBM0021)” who
carried out the project work under our supervision.

INTERNAL SUPERVISOR
Dr.THIYAM DEEPA BEETA
Assistant Professor
Department of BME

HEAD OF THE DEPARTMENT


Dr. MASOODHU BANU. N.M
Professor
Department of BME

Submitted for minor project report viva-voce examination held


on………………………….

INTERNAL EXAMINER EXTERNAL EXAMINER

2
ACKNOWLEDGEMENT

We express our deepest gratitude to our respected Founder Chancellor and President
Col. Prof. Dr. R. RANGARAJAN B.E. (EEE), B.E. (MECH), M.S (AUTO). DSC,
Chancellor and Founders President Dr. R. SAKUNTHALA RANGARAJAN M.B.B.S.,
Chairperson Managing Trustee and Vice President.

We are very much grateful to our beloved Vice Chancellor Prof. S. Salivahanan B.E.
(ECE), M.E. (COMMUNICATION SYSTEMS), Ph.D. (Madurai Kamaraj University), for
providing us with an environment to complete our project successfully.

We obligated to our beloved Registrar Dr. E. KANNAN M.E., Ph.D., for providing
immense support in all our endeavors.

We thankful to our esteemed Dean Academics Dr. A. T. Ravichandran Ph.D., for


providing a wonderful environment to complete our project successfully.

We are very thankful to our beloved Dean School of Electrical and Communications
Dr. V. JayasankarPh.D.,for providing us with an environment to complete our project
successfully.

We record indebtedness to our Head of the Department Dr. MasoodhuBanu. N.M


Ph.D.,for immense care and encouragement towards us throughout the course of this project.

A special thanks to our Project Coordinators Dr. MasoodhuBanu. N.M and


Dr.Paramasivam, for their valuable guidance and support throughout the course of the project.

We also take this opportunity to express a deep sense of gratitude to our Dr.Thiyam
Deepa Beeta for their cordial support, valuable information and guidance. We thank our
department faculty, supporting staffs, parents, and friends for their help and guidance to
complete this project.

3
ABSTRACT

Nowadays, strokes are one of the growing causes of mortality and many people remain with
motor sequelae and troubles in their daily activities. To treat these motor sequelae, some other
alternative rehabilitation techniques are needed. Functional Electrical stimulation is
commonly used for improving the neuromuscular activities for stroke-affected subjects. A
Brain-Computer Interface (BCI) system can translate the brain signals to control external
devices.

In this work, a signal processing algorithm is developed for classifying the motor imagery
brain signals which can be used for controlling FES devices. In our proposed algorithm, we
have used a shrinkage covariance matrix for computing the common spatial pattern (CSP)
features instead of using the normal covariance matrix. Linear Discriminate Analysis(LDA)
classifier is used for classifying the two motor imagery classes. The output classes from LDA
are given to the Raspberry pi 3B to control the operation of the external device. It is observed
that the performance is more by using the shrinkage covariance matrix compare to the normal
covariance matrix which can increase the efficiency of the system. In the future, this algorithm
can be used for the classification of multiple classes which in turn can control the FES devices.
This system will be useful for the person who lost their functional activities because of the
stroke.

4
TABLE OF CONTENTS

CHAPTER NO TITLE PAGE NO

ABSTRACT 4

LIST OF TABLE 5

LIST OF FIGURES 6

SYMBOLS, ABBREVIATION&NOMENCLATURE 7

1 INTRODUCTION 8

1.1 Brain computer Interface 9


1.1.2 EEG 10
1.5 Need of the project 17

1.6 Scope of the project 17

LITERATURE REVIEW 10
2 AIM AND OBJECTIVES
2.1 Aim 12

2.2 Objectives 12

3 MATERIALS AND METHODOLOGY


3.1 Materials 12
3.2 Methodology 15
3.3 Flow chart of the software part 16

5
4 RESULTS
4.1 Signal Processing Output 17

4.2 Result analysis for CSP algorithm using 19


shrinkage and normal covariance

4.3 Validating signals into Raspberry Pi 22

5 DISCUSSIONS
6 CONCLUSIONS 29
7 REFERENCE 30
BIOGRAPHY

LIST OF TABLES

TABLE NO TITLE PAGE NO

1 Result analysis for CSP algorithm using shrinkage 21


and normal covariance matrix

6
LIST OF FIGURES

FIGURE TITLE PAGE No


No

1 BCI System 10

1.2 Morphology of EEG 11

1.3 10-20 Electrode system 11

3.1 Raspberry pi 3 B 17

3.2 RS232 cable 18

3.3 Jumper wires 18

3.4 Memory card 19

7
3.5 Block diagram 20

3.6 Flow chart 21

3.7 Timing scheme of motor imagery data 21

3.8 Functions of LDA 19

4 Interface setup between BCI and RaspberryPi 24

5.1 Topoplot for left hand side 20

5.2 Topoplot for right hand side 21

7 Interfacing setup between laptop and RaspberryPi 24

SYMBOLS, ABBREVIATIONS&ACRONYM

BCI Brain computer interface


FES Functional electrical stimulation
8
CSP Common spatial pattern
LDA Linear discriminant analysis
CPU Central processing unit
GPU Graphics processing unit
SOC System on chip
RS232 Recommended Standard 232
PSD Power spectral density
ARM Advanced RISC Machines

1.INTRODUCTION

Strokes is one of the major growing cause of mortality and troubles in the daily activities, almost
it was the leading cause of disability in adults. Moreover, strokes are the second cause of death
as per the surveys. According to the 2010 Argentinian National Census of population and
Housing,12% of the surveyed population has partial or permanent disabilities, of which 16% of
those are motor type. Functional electrical stimulation (FES) applies small electrical charges to a
paralyzed muscle to perform its usual movement. It has become one of the commonly used
therapeutic device for rehabilitation. FES can be controlled by using a brain computer interfacing
(BCI) system. Neurorehabilitation is a complex medical process which aims to aid recovery from
a nervous system injury, and to minimize and/or compensate for any functional alternations
resulting from it. BCI-FES can used as a therapeutic tools to improve the recovery of the
voluntary motor control affected by some illness or traumatism.[1]

1.1 BRAIN COMPUTER INTERFACE (BCI)

9
A BCI (brain-computer interface) is technology that sends and receives signals between
the brain and an external device. Brain-computer interfaces are also called brain-machine
interfaces. BCIs collect and interpret brain signals, and then transmit them to a connected
machine that outputs commands associated with the brain signals received. A simplified BCI
definition might describe the technology as “a direct communication link between the brain and
an external device.” This connection is a two-way link (a bidirectional interface). One direction
involves a BCI sending brain activity to a computer, and the computer translating brain activity
into motor commands. Communication can also happen in the other direction — where the
computer sends information directly to the brain of the BCI user. This is called active BCI where
there is a direct brain connection, compared to passive BCI which is non-invasive.[2]

1.1.1 WORKING OF BCI


Our brains are filled with cells called neurons. Every time we think, move, feel or
remember something, our neurons are at work. That work is carried out by biochemical and
electric signals. Scientists can detect those signals and interpret what they mean by using
electroencephalography (EEG) technology. EEG can read signals from the human brain and send
them to amplifiers. The amplified signals are then interpreted by a BCI computer program, which
uses the signals to control a device.[2]

Fig 1.BCI system

1.1.2 EEG
10
The electroencephalogram (EEG) signal used to measure the electrical activity of the
brain. A number of electrodes are applied to your scalp. the scalp take signal of detect wave the
wave change every action of human. An EEG, it is a test used to detect the abnormalities in our
brain waves. A number of electrodes are applied in the scalp. EEG can used to diagnoses a
number of conditions like epilepsy, sleep disorder and brain tumors. It is also used to confirms
that brain death when someone in persistent coma, and it is safe and painless. An EEG, also be
helpful for treating the following disorders like brain tumor, stoke, Inflammation of the brain,
brain damage from head injury and brain dysfunction from various causes.

1.1.2.1 EEG Rhythm

EEG is commonly recorded at sampling rate sampling rates between 250Hz. The EEG
waves are divided into five major frequency eeg rhythm as delta, theta, alpha, beta and gamma
wave.each rhythm depend on our activity delta (0.5 to 4Hz); theta (4 to 7Hz); alpha (8 to 12Hz)
beta (13 to 30Hz) and gamma (30-100 Hz). The morphology of the EEG wave is shows in Fig
1.2.

Fig 1.2 Morphology of EEG

1.1.2.2 10-20 Electrode System

The 10 20 system is a international recognized method to apply the location electrode of


in scalp. Each Electrodes are identified with labels: the letters correspond to cortical
locations: frontal (F), temporal (T), parietal (P), occipital (O), central (C) and combinations of

11
these to indicate intermediate locations (Fp means frontal polar and corresponds to the anterior
pre-frontal lobe). The 10-20 electrode system was represented in Fig 1.3.

Fig 1.3 10-20 electrode system

1.1.2.3 Motor imagery

The cognitive process of imagining the movement of your own body part without actually
moving that body part classifiers convert discriminative features into different MI tasks such as
left-right hand movement.
1.1.2.4 Topoplot

Topoplot a topographic map of head in 2D circular view.


1.1.2.5 ERD&ERS
In normal participants, event-related desynchronization (ERD) and event-related
synchronization (ERS) are considered to indicate the activation and subsequent recovery of the
motor cortex during planning, executing and completing a movement . ERD and ERS are
different responses of neuronal structures in the brain and are both time-locked to the event. In
patients with neurodegenerative disorders, such as Parkinson's disease (PD) , multiple system
atrophy, progressive myoclonic epilepsy , focal dystonia , and amyotrophic lateral sclerosis , the
spatiotemporal pattern of ERD/ERS is altered. For example, in patients with writer's cramp, beta
ERD in 20–30 Hz frequency bands significantly decreased. It may postulate the involvement of
pyramidal system and basal ganglion in the genesis of ERD/ERS. However, research on
ERD/ERS changes in patients with impaired cerebellar function is scant. Moreover, the

12
mechanism through which cerebellar dysfunction affects the sensorimotor cortical activity is
unclear. 

13
1.2 SIGNAL PROCESSING UNIT
1.2.1 PREPROCESSING
After collecting the EEG signals from online, some denoising and artifact removal
procedures should be applied on them. The ambient noise like 50/60 Hertz power line
interference is the most affecting noise in EEG.[3]

1.2.2 FEATURE EXTRACTION


A set of features are extracted from the EEG signals to make the EEG data applicable for
BCI. EEG signals are assumed to be non-stationary and nonlinear. For translating the EEG data
for BCI systems may be a complex process in feature extraction.[3]

1.2.3 CLASSIFICATION
The extracted feature vectors should be classified. The most popular classifiers used in
BCI are LDA (Linear Discriminative Analysis).[3]

1.2.4 COMMAND ISSUANCE

After classifying the data, the command related to the recognized class is produced
through an appropriate algorithm in order to control a specific device likely blinking LED and
controlling servo motors.[3]

1.3 FES DEVICE


The FES Stimulator is a two channels-controlled stimulator designed to stimulate the
neuromuscular system in order to generate a muscular contraction. This kind of stimulation is
used in many injuries of the Central Nervous System where the muscles and the nerves are
healthy. It has skin surface electrodes and the intensity and duration of the train pulse can be set
easily by the user. The type of current is defined as biphasic symmetric rectangular. The rise and
fall of the stimulation can be adjusted to prevent a sudden contraction that might induce a stretch
reflex of the muscles.[1]

1.4. LITERATURE REVIEW

14
In previous techniques BCI-FES training platform for rehabilitation on chronic stroke
patients to train their upper limb motor functions by users intention through EEG signals ,
common spatial pattern (CSP) algorithm was applied, by using this algorithm the error rate of the
BCI control was less than 20% after training of 10 sessions. This shows the feasibility for stroke
patients to accomplish the BCI triggered FES rehabilitation training. A BCI-FES system for
stroke rehabilitation is presented. Besides stimulation device, the BCI and EOG systems
supervise how exercises are performed and the patient’s commitment and Oculus Rift headset
facilitates the patient’s immersion in VR (Virtual Reality). By using this system, the patient is
not distracted by the real environment or by events around him. The patient is just immersed in
VR where the virtual therapist tells and shows him how to perform every exercise and a red big
arrow is shown every time. But we can’t make sure the patient is focused most of the time,
sometimes the patient may lost his concentration, so it may give some accuracy error. The
clinical tests are in progress, but the preliminary ones are very encouraging regarding fast
accommodation and satisfaction of each patient. Incorporating BCI with VR required more
money and it requires more training session for patients so that everyone can’t able to afford it.
[4]

Fabien Lotte et al. make the study of Regularizing Common Spatial Patterns to
Improve BCI Designs:Unified Theory and New Algorithms. One of the most popular feature
extraction algorithms for BCI is common spatial patterns (CSPs). Despite its known efficiency
and widespread use, CSP is also known to be very sensitive to noise and prone to overfitting.
The CSP aims at learning spatial filters that maximize the variance of bandpass-filtered EEG
signals from one class while minimizing their variance from the other class. mentioned how to
overcome the sensitivity of CSP to noise and overfitting, one should regularize it. Adding prior
information to CSP, and thus regularizing it, and what are the two levels he used to be. One is
covariance matrix estimators another one is regularizing CSP at the level of the objective
function level.[5]

Vangelis P.Oikonomou et al. performed a comparison between CSP related features and
features based on Power Spectral Density (PSD) techniques .The CSP algorithm performs a
decomposition of the signal though the matrix W, which contains the spatial filters. More
specifically, this algorithm transforms the EEG signal from the original into a new domain which
is occupied by the new channels and it has a better computational performance. So we choosed
15
CSP over PSD. Here they combined the feature extraction(CSP) and the classifier techniques
namely Linear discriminate analysis (LDA) and Super Vector Machine(SVM).While analyzing
the classification results of CSP-LDA and CSP-SVM, We concluded that CSP-LDA gave more
accuracy than CSP-SVM among 10 results. Therefore proceed with CSP-LDA in our proposed
work.[6]

Raoof Masoomi and Ali Khadem was enhanced the LDA-based discrimination of left
and right hand motor imagery. In this work the authors briefly assessed the effect of changing
window length on the misclassification rate. Subsequently, an LDA based wrapper Sequential
Forward Selection(SFS)scheme was, used for selecting optimum subset of features for each data
window. Finally the data windows were classified by LDA. While analyzing the results the
authors reduce the misclassification rate to 10% using just two features. Also, the authors
investigating what kind of features are optimum in which time intervals after cue presentation
and interpreting such results may be an interesting future research subject.[3]

Shrinkage Estimator Based Regularization for EEG Motor Imagery Classification


was done by H. Shenoy et al .In his work he applied shrinkage method for different types of CSP
(normal CSP,filter bank CSP). Most of the conventional techniques for covariance estimation
employ sample covariance estimator. However, it is to be noted that an estimator which is both
well-conditioned and more accurate than sample covariance matrix is needed to achieve robust
performance in small-sample settings. The idea is to use shrinkage estimator instead of the
sample covariance matrix (SΩ) for eigenvalue decomposition in Common spatial pattern
algorithm. While analysing the Percentage Classification accuracies obtained for each subject of
the random data set for the standard CSP and its regularized variants the shrinkage estimator
outperform along with CSP compare to normal covariance. So we planned to proceed with
shrinkage covariance for our proposed work.Yangyang Miao et al. developed the Motor imagery
(MI) based BCI that uses both virtual limbs and functional electrical stimulation (FES) as
feedback to provide patients with a closed-loop sensorimotor integration for motor rehabilitation.
They have used CSP algorithm with Linear Discriminant Analysis Classifier (LDA) for feature
extraction and classification. Those results showed that participants in the BCI group obtained
more improvements than the participants in the control group. This study provides a more
autonomous approach than traditional treatments for stroke rehabilitation. Additional research is
needed to enhance the portability of the BCI-FES system.[8]
16
Haider Abdullah Ali et al. developed the EEG-based Brain Computer Interface
Prosthetic hand using Raspberry Pi 4. This technique includes a stepper motor controlled by
Raspberry Pi 4 to perform actions like open/close movement and holding objects. This system
proves the feasibility of the approach and opens the route for improving the design of the
prototype to attach it to the upper-limb amputation stump. By this system we got the procedure
for how to operate the stepper motor by using Raspberry Pi. Although the major con’s of the
project is, it was costly at the same time it will give accurate and complete control.[9]

Two BCI-based motor learning strategies are under study. The first strategy,
similar to the early studies with BCI technologies to reduce seizure frequency, is to train patients
to produce more normal brain activity (E.g., as measured by specific EEG features). The
hypothesis is that by influencing CNS plasticity that produces more normal activity, more normal
CNS function will be restored and thus motor control will improve. The second strategy uses
brain activity to activate a device that assists movement by improving motor function, this
movement is postulated to produce sensory input that induces CNS plasticity and leads to
restoration of normal motor control[10].

1.5 NEED OF THE PROJECT

There is a scientific proofs of certain neurological rehabilitation strategies which helps in


the motor functional recovery of people who have had a stroke, but a significant number of them
will keep this disease which will require continuous assistance to succeed in daily activities.
Therefore, the need to develop a rehabilitative system for continuous assessment is need. The
BCI controlled FES system can be used for the same. This motivates us to develop this project.
[1]

1.6 SCOPE OF THE PROJECT

The implementation of new therapeutic tools which facilate the reintegration, autonomy
in daily life and social inclusion of this important population is needed. These innovation
therapeutic systems should be reliable and easy to setup, to facilitate its daily clinical use in
health institutions or hospitals. This idea will also help the start-up BCI companies.

17
2. AIM AND OBJECTIVES

2.1 AIM
To develop a robust signal processing algorithm and interfacing with a neuro-

rehabilitative devices.

2.2 OBJECTIVES
1. To collect online dataset and pre-processing
2. To develop feature extraction techniques and classification of motor imagery EEG signal
3. To validate the features with a topographic plot
4. To interface the output control signal with Raspberry pi to control neuro rehabilitative
devices.

3. MATERIALS AND METHODOLOGY

3.1MATERIALS

3.1.1 RASPBERRY PI

As shown in fig 3.1 raspberry pi 3 B, there are three series of Raspberry Pi, and several
generations of each have been released. Raspberry Pi SBCs feature a Broadcom system on a chip
with an integrated ARM(Advanced RISC Machines) compatible central processing unit and on-

chip graphics processing unit , while Raspberry Pi Pico has a RP2040 system on chip with an
integrated ARM-compatible central processing unit.

18
Fig 3.1 Raspberrry pi 3

3.1.2 RS232 CABLE


As shown in fig 3.2 RS232 cable First and foremost, it is a form of serial data transmission. At
one time, it was the most used form of data transmission. You will probably recognize the

standard 9 pin DB9 cable. Simply put, a RS232 connection transmits signals using a positive
voltage for a binary 0 and a negative voltage for a binary 1

Fig 3.2 RS232 cable

3.1.3 Jumper wires

As shown in fig 3.3 Jumper wires are simply wires that have connector pins at each end,
allowing them to be used to connect two points to each other without soldering. Jumper wires are
typically used with breadboards and other prototyping tools in order to make it easy to change a
circuit as needed. We use male to female connector connect between RS232cable and raspberry

pi.

19
Fig 3.3.Jumper wires

3.1.4 Memory card

As shown in fig 3.4 A memory card or memory cartridge is an electronic data storage


device used for storing digital information, typically using flash memory . Memory card use to
install software in raspberry pi and used for write a firmware for interface between matlab and
raspberry pi.

Fig 3.4: Memory card

20
3.2 METHODOLOGY

The online input data BCI motor imagery data was taken as input data. The signal
processing units consists of preprocessing, feature extraction and classification. First the input
data is bandpass filtered in particular frequency band (7-30Hz). The filtered signal is used for
extracting the required features. Later the extracted features are classified using classifier. The
class output from the classifier is transmitted to RaspberryPi to controlling of the external device
can be done using RaspberryPi based on the class output.

3.2.1 Block diagram

Fig 3.5 The detailed block architecture of our project

21
3.2.2 FLOW CHART OF THE SOFTWARE PART

Fig 3.6: Flow chart

In this step, the acquired signals will be filtered in the particular frequency band
using Butterworth bandpass filter of 5th order, and the band frequency is from 7-30Hz. The
filtered signals will be used for extracting the features and the features will be classified using a
proper classifier. The signal processing workflow shown in Fig.3.6

3.2.1.DATA SET COLLECTION


The online data set was taken from BCI competition (data set Ⅳ 2a) Here the segment
length of the data was 2.5 seconds our time window starts 0.5s after the cue. In Fig 3.7 we
attached the time scheme of the motor imagery data. By using cross validation technique, we
separate the dataset into 10 folds for calculate the mean accuracy. One fold is used for testing
and the remaining nine fold is used for training.

22
Fig 3.7. Timing scheme of motor imagery data

3.2.2. BUTTERWORTH FILTER

The Butterworth bandpass filter 5th order and the band frequency 7-30Hz was
implemented during the preprocessing stage. The Butterworth filter provides a response that is
no ripple and maximally flat in the passband and stopband. It provides good average transient
characteristics and expense wide transition region from band pass to band stop thus enable a
good compromise between amplitude response selectively.

3.2.3. COMMON SPATIAL PATTERN (CSP)

CSP is the most effective feature extraction algorithm for classification of two class
motor imagery movement. It maximizes the variance of one class as well as minimizes the
variance of other class. The variance of the signal represents the band power of the signal. Let us
T
consider the EEG signals x ( t )=[ x1 ( t ) , x 2 ( t ) , … .. xn ( t ) ] recorded using n channels during the left
and right hand MI movements. The main objective of CSP algorithm is to compute spatial filters
that discriminate the two MI movements by maximizing the ratio of the variance of signals
between the two classes.[6] The CSP objective function can be considered as a Rayleigh quotient
maximization problem as:

T
min w Σ w
J ( w )= T 1 … … .1
max w Σ2 w

where wϵ R n is the spatial filter to be optimized, Σ 1and Σ 2 denotes the average covariance
matrices of class 1 and class 2. The covariance matrix of x(t) with zero mean for class c is given
by

T
1
Σc = ∑ ¿¿
T t =1

The solution of Eqn. 1 is computed by solving the Generalized Eigenvalue (GEV) decomposition
of

Σ 1 w1=λ Σ 2 w1 … … .3

23
where λ denotes the eigenvalues. The eigenvectors are sorted based on their discriminative
abilities. The eigenvector with the largest eigenvalue is considered to have highest discriminative
ability than the others. The spatial filters W =[w 1 ,… … w p ] (where p is the total number of filters
selected) for both the classes are obtained by selecting p/ 2eigenvectors with greatest and
smallest eigenvalues.[5]

3.2.4. SHRINKAGE MATRIX

The shrinkage covariance estimation consists on finding a biased estimator that


minimizes the mean square error (MSE) under a certain norm. To minimize the MSE, a convex
linear combination between two covariance matrix estimators is proposed. In table (1). we
compared the accuracy of both shrinkage covariance matrix and covariance matrix.[

3.2.5 LINEAR DISCRIMINATIVE ANALYSIS(LDA)

Linear discriminant analysis (LDA) or discriminant function analysis is a generalization


of Fisher's linear discriminant, a method used in statistics, pattern recognition, and machine
learning to find a linear combination of features that characterizes or separates two or more
classes of objects or events. The resulting combination may be used as a linear classifier or, more
commonly, for dimensionality reduction before later classification.

LDA works when the measurements made on independent variables for each observation are
continuous quantities. When dealing with categorical independent variables, the equivalent
technique is discriminant correspondence analysis.

Discriminant analysis is used when groups are known a priori (unlike in cluster analysis). Each
case must have a score on one or more quantitative predictor measures, and a score on a group
measure. In simple terms, discriminant function analysis is classification - the act of distributing
things into groups, classes or categories of the same type.

Suppose two classes of observations have means μ1 , μ 2 and covariances  Σ 1 Σ 2. Then the linear
⃗⃗
combination of features ❑ w . ⃗x will have means ⃗ μi and variances ⃗
w.⃗ w for i=0,1. Fisher
wT Σi ⃗
24
defined the separation between these two distributions to be the ratio of the variance between the
classes to the variance within the classes:

σ 2between (⃗
w.⃗
μ1−⃗w.⃗μ 0)2 (⃗
w .(⃗ μ 0)) 2
μ1−⃗
S= = =
σ 2within ⃗ T
w Σ ⃗w +⃗
T
w Σ ⃗ w ⃗
T
w (Σ + Σ ) ⃗
w
1 0 0 1

This measure is, in some sense, a measure of the signal-to-noise ratio for the class labelling. It
can be shown that the maximum separation occurs when
−1
w α (Σ 0 + Σ 1) (⃗
⃗ μ 1−⃗
μ0 )

When the assumptions of LDA are satisfied, the above equation is equivalent to LDA. Note that
the vector ⃗
w  is the normal to the discriminant hyperplane. However, if projections of points from
both classes exhibit approximately the same distributions, a good choice would be the
hyperplane between projections of the two means ⃗
w.⃗
μ0 and ⃗
w.⃗
μ1 . In this case the parameter c
in threshold condition⃗
w . ⃗x >c   can be found explicitly:

1 1 T −1 1 T −1
w. (⃗
c= ⃗ μ 1 )= ⃗
μ 0+ ⃗ μ 1− ⃗
μ1 Σ 1 ⃗ μ Σ ⃗ μ
2 2 2 0 0 0
3.2.6 HARDWARE INTERFACE

The output of the first block is a character which is used to activate the FES device. For
doing this, hardware based on Raspberry technology and software based on MATLAB’s
environment have been designed. The hardware is a portable embedded system with a
RaspberyPi which is a credit card size computer. It has 40 digital input/output pins It simply
connects to a computer with a USB cable. The Raspberry Pi can be programmed with the python
code for receiving the validated class signal via serial port. Fig 5. shows the interfacing setup
between BCI and Raspberry Pi.

25
Fig 4. Interface setup between BCI and RaspberryPi

MATLAB tool was able to perform the preprocessing techniques and after plotting the topoplot,
the class signals respectively left hand and right hand are validated into raspberry pi for blinking
the LED ON and OFF. The interface was done by using MATLAB add ons namely MATLAB
support package for RaspberryPi hardware.

4.RESULTS

4.1. SIGNAL PROCESSING OUTPUT

Fig 5.1,Fig 5.2 respectively represent the comparative topographic maps for the feature
extracted using normal covariance matrix and shrinkage covariance matrix for left hand and right
hand motor imagery task of a single subject. The results correspond to activities related to motor
imagination of left/right and both hands. It can be observed that Event-Related
Desynchronization (ERD) patterns associated to hand´s motor imagery are visualized for left
hand motor imagery and right hand motor imagery. Furthermore, it is observed that the
localization of ERD patterns appears in opposite side of cortical regions. Besides, during the
imagination of right hand, cortical regions associated with other mental activities were also
activated.[1]

26
Fig 5.1 Topoplot for left hand side

Fig 5.2 Topoplot for right hand side

4.2 Result analysis for CSP algorithm using shrinkage and normal covariance
matrix

Table 1. Result analysis for CSP algorithm using shrinkage and normal covariance matrix

S1 S2 S3 S4 S5 S6 S7 S8 S9 Mean

Accuracy

27
Shrinkage 58.3 45.3 89.6 87.0 15.3 78.6 68.6 99.0 58 66.7
covariance

Normal 68 35 80 66.3 45 48 68.1 98.2 68 64.4


covariance

Table 1. shows the performance comparison of the CSP algorithm using shrinkage and normal
covariance matrix. The performance analysis is done for nine subjects using both the method and
finding out the mean accuracy. While analyzing the table, the CSP along with shrinkage
covariance gave 66.7% whereas the normal covariance gave 64.4%. This shows that CSP using
shrinkage method outperformed the CSP using normal covariance.

4.3 VALIDATING SIGNALS INTO RASPBERRYPI

The output classes from the signal processing are given to the Raspberry pi 3B to control the
operation of the external device. The Fig 6. Shows the interfacing setup between the laptop and
RaspberryPi. Here the signal processing unit command signals are transmitted via the serial port
by using UART/TTL connector. In RaspberryPi it has a python command for receiving the
signals via serial port.

28
Fig 7. Interfacing setup between laptop and RaspberryPi

5.CONCLUSION

In this work, we have developed a signal processing algorithm for classification motor
imagery movement for two class. The performance of CSP using shrinkage covariance and
normal covariance is been compared. It is observed that the CSP using shrinkage covariance
matrix outperform the CSP using normal covariance matrix. The obtained result have been
validate using the topoplot and by comparing the mean accuracy of both the system. The class
output obtained can be send to the raspberry pi and can be used for controlling any external
devices. In future, this class output will be used for controlling the FES devices that can be used
for improving the motor activity for stoke patient

29
6.REFERENCE:

[1].Jure, F. A., Carrere, L. C., Gentiletti, G. G., & Tabernig, C. B. (2016, April). BCI-FES system for neuro-
rehabilitation of stroke patients. In Journal of Physics: Conference Series (Vol. 705, No. 1, p. 012058).
IOP Publishing..

[2].https://www.emotiv.com/bci-guide/

[3].http://dx.doi.org/10.1109/KBEI.2015.7436077

[4].Fei Meng et al., "BCI-FES training system design and implementation for rehabilitation of stroke
patients," 2008 IEEE International Joint Conference on Neural Networks (IEEE World Congress on

Computational Intelligence), 2008, pp. 4103-4106, doi: 10.1109/IJCNN.2008.4634388. NCE:

[5]. Lupu, R. G., Irimia, D. C., Ungureanu, F., Poboroniuc, M. S., & Moldoveanu, A. (2018). BCI and FES
based therapy for stroke rehabilitation using VR facilities. Wireless Communications and Mobile
Computing, 2018.

[6].Lotte, F., & Guan, C. (2010). Regularizing common spatial patterns to improve BCI designs: unified
theory and new algorithms. IEEE Transactions on biomedical Engineering, 58(2), 355-362.

[7].Oikonomou, V. P., Georgiadis, K., Liaros, G., Nikolopoulos, S., & Kompatsiaris, I. (2017, June). A
comparison study on EEG signal processing techniques using motor imagery EEG data. In 2017 IEEE
30th international symposium on computer-based medical systems (CBMS) (pp. 781-786). IEEE.

30
[8].Shenoy, H. V., Vinod, A. P., & Guan, C. (2015, December). Shrinkage estimator based regularization
for EEG motor imagery classification. In 2015 10th International Conference on Information,
Communications and Signal Processing (ICICS) (pp. 1-5). IEEE.

[9].Miao, Y., Chen, S., Zhang, X., Jin, J., Xu, R., Daly, I., ... & Jung, T. P. (2020). BCI-based rehabilitation
on the stroke in sequela stage. Neural Plasticity, 2020.

[10].Schalk, G., & Mellinger, J. (2010). Introduction to Brain-Computer Interfacing Using BCI2000.


Springer.

[11].McMahan, T., Parberry, I., & Parsons, T. D. (2015). Modality specific assessment of video game
player’s experience using the Emotiv. Entertainment Computing, 7, 1-6.

[12]. Tabernig, C. (2011). Estimulación eléctrica funcional. Study book of “Equipamiento para terapia y
rehabilitación”, Facultad de Ingeniería, Bioingeniería, UNER, abril.

[13].Elstob, D., & Secco, E. L. (2016). A low cost EEG based BCI prosthetic using motor imagery. arXiv
preprint arXiv:1603.02869.

[14].Beyrouthy, T., Al Kork, S., Korbane, J. A., & Abouelela, M. (2017). EEG mind controlled smart
prosthetic arm a comprehensive study. Advances in Science, Technology and Engineering Systems
Journal, 2(3), 891-899.

[15].Daly, J. J., & Wolpaw, J. R. (2008). Brain–computer interfaces in neurological rehabilitation. The


Lancet Neurology, 7(11), 1032-1043.

31
32
33

You might also like