Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Mohamed
Sami Mohamed
Omar
Mai
Mohamed Project Team
Nada
Mohamed
Ahmed
Mamdoh
http://bci2.k-space.org
Brain Computer Interface
BCI
Supervisors
Prof.Dr Abu Bakr M. Youssef
http://bci2.k-space.org
Assistant Prof.Dr Yasser M.Kadah
Motivation for BCI Research
There are , more than 200,000
patients live with the motor sequelae
of serious injury.
Locked-in Syndrome
Neurological diseases may lead to
paralysis of the entire motor system .
Unable to use their muscles and
therefore cannot communicate their
needs, wishes, and emotions.
http://bci2.k-space.org
Reason of BCI
• Allow a user to communicate with a
computer through his Brain
http://bci2.k-space.org
The Dream
http://bci2.k-space.org
Dream vs. Reality
• Dream BCI
– Think to whatever you want
– Without recognition errors
– Whenever you want
• Physiological problems
– No thought sensor
– Partial brain knowledge
– Noisy signals
• Solutions in the BCI community
(reality)
– Limited thought
– Limited recognition accuracy
http://bci2.k-space.org
BCI community
About 60 research groups
About 300 researchers
Increasing published papers
140
127
120
100
80
60 SCI paper
48
40
20
2 4
0
1985-1990 1991-1995 1996-2000 2001-2004
http://bci2.k-space.org
Our Goals
1.
1. Recording
Recording Brain
Brain Signal
Signal Using
Using EEG
EEG electrodes.
electrodes.
2.
2. Isolation
Isolation between
between subject
subject and
and electronic
electronic circuit
circuit
3.
3. Designing
Designing Data
Data Acquisition
Acquisition System
System
4.
4. Signal
Signal Selection
Selection
5.
5. Interfacing
Interfacing with
with Computer
Computer by
by Soundcard
Soundcard
6.
6. Implementing
Implementing real
real time
time analysis
analysis Classification
Classification data
data
BCI Categories
http://bci2.k-space.org
General scheme
3. Online Feedback
High level
commands
Feedback
Control
Application
interface
Mental
state
Electrical activity
Bio- Pre- Feature Classification
sensor processing extraction
The brain
On the computer
1. Data Acquisition 2. BCI System
http://bci2.k-space.org
Medical Introduction
Nervous System
Motor Brain
CNS
CNS
Spinal
Cord
Nervous
Nervous System
System
Cranial
Nerves
PNS
PNS
Sensory
Spinal
Nerves
http://bci2.k-space.org
Human Brain
http://bci2.k-space.org
EEG
Electroencephalography or EEG is the
measurement of neural activity within the
brain.
http://bci2.k-space.org
EEG Signal
http://bci2.k-space.org
EEG Wave Band
parietal and
Occupation occipital frontal lobes. ______
http://bci2.k-space.org
Data Acquisition
http://bci2.k-space.org
Overview
Electrode
Isolation Pre Amplifier
Electrode
Isolation Pre Amplifier
Gain Matlab
MUX Amplifier LPF Sound Card Workspace
Electrode
Isolation Pre Amplifier
Latch
Electrode Pre Amplifier
Isolation
Parallel Port
Electrode
Isolation Pre Amplifier
http://bci2.k-space.org
Biopotential Sensors
1. Gold electrode.
2. Silver electrode.
http://bci2.k-space.org
Isolation
Medical procedures usually expose the patient to more
hazard than at home or workplace.
http://bci2.k-space.org
Continue
Isolation
In our design we used the PC817 due to:
Its low turn-on and off time and high.
Isolation voltage between input.
http://bci2.k-space.org
Instrumentation Amplifier
Amplifying differential input
• Lower cost
• High accuracy
• Low noise
• High Gain Ability
http://bci2.k-space.org
AD620 Schematic
http://bci2.k-space.org
Signal Selection
Multiplexer:
Select data from two or more data sources into a single channel.
http://bci2.k-space.org
M54HC4051 Schematic
http://bci2.k-space.org
Latch
Change output state only in response to
data input
http://bci2.k-space.org
SN74LS373 Schematic
http://bci2.k-space.org
Signal Filtering
A low-pass filter is a Filter that passes low frequensy
Component well, reduces frequencies higher than the
cutoff frequency.
We use active 2nd order low pass filter we used UA741 IC.
LPF Schematic
http://bci2.k-space.org
Parallel Port
The Parallel Port is the most commonly used port for interfacing home made projects
•Hardware Properties
http://bci2.k-space.org
Sound Card
A sound card is a Computer PCI Card that can input and output Sound under control
of computer programs
General characteristics
1-Sound Chip
2- multi-channel Dacs & A/D 3-ROM or Flash memory
Color Function
Lime Analog line level output for the main stereo
green signal (front speakers or headphones).
Pink Analog Microphone input.
Light
Analog Line level input.
blue
http://bci2.k-space.org
Continue
Sound Card
Internal
Block
Why we choose Sound Card
• Fixed and Low Cost Acquisition Card
• Easy in Implementation and installation
• Ability to Convert from Analog to Digital with very high
accuracy and vise versa
• Easy Communication with Matlab
• Ability to detect low Frequencies
• Sampling Data in wide rang (8000 to 44100)
• Better than designing new Interfacing System and this
System in Situation to not work because of hardware
troubleshooting
http://bci2.k-space.org
Acquiring Data with a Sound Card
http://bci2.k-space.org
Data Acquisition Programs
Online Each
Drawing
Signal Channel Online
With
with Online Classifier
Selection
Filtering Plotting
http://bci2.k-space.org
1st Release
http://bci2.k-space.org
2nd Release
http://bci2.k-space.org
3rd Release
http://bci2.k-space.org
4th Release
http://bci2.k-space.org
Analytic methods
Signal
Signal Feature
Feature Statistical
Statistical
preprocessing
preprocessing extraction
extraction classification
classification
http://bci2.k-space.org
Signal Preprocessing
Noisy signal • Power line 50/60
? • Eye movements Hz
• Other movements • Electrode contact
Background
Experiment brain activity Physiologic Environmental
protocol noise noise
Mental Measured
task signal
Offline Online
Type of work
F
Feature available Visual O/P
Test next feature
T
Classification
Red Green
Test classifier
http://bci2.k-space.org
Offline Dataset
BCI
BCI Competition
Competition 2003
2003 Data
Data Set
Set Ia:
Ia: ‹self-regulation
‹self-regulation of
of SCPs›
SCPs› provided
provided by
by University
University of
of
Tuebingen,Germany,
Tuebingen,Germany, Dept.
Dept. of
of Computer
Computer Engineering
Engineering (Prof.
(Prof. Rosenstiel)
Rosenstiel)
Datasets were taken from a healthy subject he was asked to move a
cursor up and down on a computer screen.
Data
6 EEG electrodes are used referenced to the vertex electrode Cz
•Channel 1: A1-Cz (A1 = left mastoid)
•Channel 2: A2-Cz (right mastoid)
•Channel 3: 2 cm frontal of C3
•Channel 4: 2 cm parietal of C3
•Channel 5: 2 cm frontal of C4
•Channel 6: 2 cm parietal of C4
Sampling rate of 256 Hz.
http://bci2.k-space.org
Continue
Offline Dataset
During every trial, the task was visually presented by a highlighted
goal at the top or bottom of the screen to indicate negativity or
positively from second 0.5 until the end of the trial. The visual
feedback was presented from second 2 to second 5.5. Only this 3.5
second interval of every trial is provided for training and testing.
Every line of a matrix contains the data of one trial. The first column codes the
class of the trial (0/1).
•Note
For our implementation we constructed the test set from the train
set. That was done by selecting 100 trails from class 0 and 100 trails
from class 1.
http://bci2.k-space.org
Offline Dataset
Continue
Approach
We used MATLAB (release 13) for analysis.
We separated the channels of each class to be 135x896
matrix for channels in class 0 and 133x896 matrix for class 1
channels.
For each EEG channel, we plotted the time-domain and
frequency-domain averages across trials for each class.
Note
In our online BCI approach, we constructed our own
dataset which consist of training set & testing set.
The training set was used to tune the parameters of the
classification algorithm.
We also applied all the pre-processing techniques as in the
offline work.
http://bci2.k-space.org
Feature Extraction
http://bci2.k-space.org
Choosing Features
Time Domain Features
mean
Variance
http://bci2.k-space.org
Continue
Welch method
Estimate the power spectral density (PSD) of a signal using
Welch is done using Pwelch Matlab function
Form features vector
Channel 1 feature vector
Signal 1 Std1
Std2
Signal2
Std3
Signal3 Class 0 Std4
Class 0
Signal4 :
: :
: :
: :
: :
: :
Class 1 Class 1 :
:
:
: :
http://bci2.k-space.org
Continue
mean1 Var1
Class 0
mean2 Var2
mean3 Var3
mean4 Var4
. .
Class 1
. .
http://bci2.k-space.org
Multi dimension feature vector
Channel 1
Channel 6
Channel 2
Channel 5
http://bci2.k-space.org
Hypothesis Test
Perform Hypothesis testing for the
difference in means of two samples.
[H, P, Ci]=ttest2(X,Y)
H=0 no significance
H=1 significance
http://bci2.k-space.org
Signal Classification Techniques
Classifier
Minimum
Bayes K-NN
Distance
http://bci2.k-space.org
Classifier input
Class 0 Class 0
Class 1 Class 1
Minimum Distance Classifier
Algorithm
1. Group the design set into (n) class
2. Estimate the sample mean for each class.
3. A test sample is classified by assigning it to the class
which has the nearest mean vector.
4. Error rate is estimated by the percentage of misclassified
samples
http://bci2.k-space.org
Bayes Classifier
Algorithm
Compute Gaussian distribution of each class (p.d.f)
Compute probabilities of sample (a)
F( a Є f0) & F( a Є f1)
K-Nearest Neighbor (KNN)
Algorithm
1. Obtain distances between
test sample and all
samples in the design set
2. Sort obtained distance
values in ascending
ordered array.
3. Assigns the test sample to
the majority class in the
subset.
4. Error rate is estimated by
the percentage of
misclassified samples
Results
Dataset Ia results
http://bci2.k-space.org
Dataset Ia Best results
FFT feature (amplitude of 20 HZ)
Pwelch feature
http://bci2.k-space.org
Our Dataset Best Results
FFT feature (amplitude of 20 HZ)
Pwelch feature
http://bci2.k-space.org
BCI challenge
http://bci2.k-space.org
Conclusion & Future
• In our project we built a simple BCI ,which
separated between left and right hand movement
• System worked on online & offline data set
• Online data pass through different stages:
Filtration
Amplification
Interfacing with computer using soundcard
Analysis and classify
http://bci2.k-space.org
Conclusion & Future
Completely paralyzed patients can use a BCI to realize a
spelling system (virtual keyboard) to install a new non
muscular communication channel.
http://bci2.k-space.org
Online Demo
Thank You