scieee Science in your language
[en] (orig)

Generation of real-time control commands from EEG signals

Author: Franco i Moral, Ferran
Publisher: Universitat Politècnica de Catalunya
Year: 2025
Source: https://upcommons.upc.edu/bitstream/2117/424921/2/TFM_Ferran_Franco.pdf
T eball de Fi de Màs e
Màs e en Neu oenginye ia i Rehabili ació
Gene a ion o eal- ime con ol commands
om EEG signals
REPORT
Au ho : Fe an F anco i Mo al
Di ec o : Joan F ancesc Alonso López
Co-di ec o : And es El-Fakdi Sencianes
Co-di ec o : Alicia Casals Gelpí
Da e: Feb ua y 2025
Escola Tècnica Supe io
d’Enginye ia Indus ial de Ba celona
Pag. 2 Repo
Gene a ion o eal- ime con ol commands om EEG signals Pag. 3
Resum
Les in e ícies ce ell-o dinado (BCI) han es a in es igades du an dècades pel seu
po encial pe con ola disposi ius a a és del moni o a ge de l'ac i i a ce eb al. En
pa icula , els sis emes BCI basa s en Mo o Image y (MI) han demos a una g an
e ec i i a en el camp de la neu o ehabili ació, ja que els pa ons ce eb als gene a s són
simila s als p oduï s du an els mo imen s eals. Aques eball p oposa un p o ocol
dissenya pe adqui i i anali za dades BCI u ili zan el disposi iu Bi b ain He o Helme ,
amb l'objec iu d'explo a el seu ús en aplicacions p àc iques.
El p ojec e o ma pa de POSMOFYA, ac ònim de la Pla a o ma Híb ida Ó esis-Silla
pa a hace compa ible la Mo ilidad, Funcionalidad y Acep abilidad de aplicación en
en o nos domés icos, una pla a o ma híb ida que, com el nom indica, in eg a una cadi a
de odes au oma i zada i un b aç obò ic. L'objec iu inal és pe me e un con ol e icien i
p àc ic en en o ns domès ics. El p o ocol desen olupa es basa en p incipis de obus esa
i p ecisió, amb la in enció de millo a la capaci a de econèixe les in encions de
mo imen dels usua is.
Aques eball s’es uc u a en di e ses ases, inician amb el disseny expe imen al. Amb
l’ús del p og ama i PsychoPy i el p o ocol LabS eaming Laye (LSL), es an es abli
asques de mo o image y en ocades a dues accions especí iques: la lexió del canell d e
i la lexió del canell esque e. Aques es asques es an dissenya pe gene a pa ons
ce eb als associa s a in encions de mo imen cla es, amb l’objec iu d’en ena un sis ema
de Machine Lea ning (ML). L’es a ègia pe me assegu a una cap u a p ecisa i
consis en de les senyals ce eb als, onamen al pe a ança en el desen olupamen
d’aplicacions p àc iques en el ma c del p ojec e.
Els esul a s e lec eixen els desa iamen s de eballa amb senyals EEG. To i que
l'algo isme d'A b e de Decisió aplica a Common Spa ial Pa e ns (CSP) a ob eni una
p ecisió del 42,9% en mode o line i el K-Nea es Neighbo s (KNN) una p ecisió del
51,0% amb ca ac e ís iques basades en la li e a u a, les p ediccions es an mos a
esbiaixades cap a una sola classe. Aques e posa de mani es limi acions en la
disc iminació de senyals i la a iabili a en e sessions.
Malg a les di icul a s, el p ojec e ha p opo ciona lliçons aluoses: la necessi a de
millo a els sis emes EEG i d'explo a ècniques a ançades com CSP egula i za o
mè odes híb ids amb deep lea ning pe augmen a la obus esa i p ecisió. A més, s'han
alida els passos bàsics del pipeline online, indican que una millo op imi zació pod ia
adui -se en aplicacions p àc iques més iables. Aques es oballes no només des aquen
els ep es del camp sinó ambé opo uni a s de millo a pe u u es ece ques.
Pag. 4 Repo
Resumen
Las in e aces ce eb o-compu ado (BCI) han sido in es igadas du an e décadas po su
po encial pa a con ola disposi i os median e el moni o eo de la ac i idad ce eb al. En
pa icula , los sis emas BCI basados en Mo o Image y (MI) han demos ado g an
e ec i idad en el ámbi o de la neu o ehabili ación, ya que los pa ones ce eb ales
gene ados son simila es a los p oducidos du an e los mo imien os eales. Es e abajo
p opone un p o ocolo diseñado pa a adqui i y analiza da os BCI u ilizando el disposi i o
Bi b ain He o Helme , con el obje i o de explo a su uso en aplicaciones p ác icas.
El p oyec o o ma pa e de POSMOFYA, ac ónimo de Pla a o ma Híb ida Ó esis-Silla
pa a hace compa ible la Mo ilidad, Funcionalidad y Acep abilidad de aplicación en
en o nos domés icos, una pla a o ma híb ida que, como su nomb e indica, in eg a una
silla de uedas au oma izada y un b azo obó ico. El obje i o inal es pe mi i un con ol
e icien e y p ác ico en en o nos domés icos. El p o ocolo desa ollado se basa en
p incipios de obus ez y p ecisión, con la in ención de mejo a la capacidad de econoce
las in enciones de mo imien o de los usua ios.
Es e abajo se es uc u a en a ias ases, comenzando con el diseño expe imen al. Con
el uso del so wa e PsychoPy y el p o ocolo LabS eaming Laye (LSL), se es ablecie on
a eas de mo o image y cen adas en dos acciones especí icas: la lexión de la muñeca
de echa y la lexión de la muñeca izquie da. Es as a eas se diseña on pa a gene a
pa ones ce eb ales asociados con in enciones de mo imien o cla as, con el obje i o de
en ena un sis ema de Machine Lea ning (ML). La es a egia pe mi e asegu a una
cap u a p ecisa y consis en e de las señales ce eb ales, undamen al pa a a anza en el
desa ollo de aplicaciones p ác icas en el ma co del p oyec o.
Los esul ados e lejan los desa íos de abaja con señales EEG. Aunque el algo i mo de
Á bol de Decisión aplicado a Common Spa ial Pa e ns (CSP) ob u o una p ecisión del
42,9% en modo o line y el K-Nea es Neighbo s (KNN) una p ecisión del 51,0% con
ca ac e ís icas basadas en la li e a u a, las p edicciones mos a on sesgos hacia una sola
clase. Es o pone de mani ies o limi aciones en la disc iminación de señales y la
a iabilidad en e sesiones.
A pesa de las di icul ades, el p oyec o ha p opo cionado lecciones aliosas: la necesidad
de mejo a los sis emas EEG y explo a écnicas a anzadas como CSP egula izado o
mé odos híb idos con deep lea ning pa a aumen a la obus ez y la p ecisión. Además, se
han alidado los pasos básicos del pipeline online, indicando que una mejo op imización
pod ía aduci se en aplicaciones p ác icas más iables. Es os hallazgos no solo des acan
los e os del campo, sino ambién opo unidades de mejo a pa a u u as in es igaciones.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 5
Abs ac
B ain-compu e in e aces (BCI) ha e been s udied o decades o hei po en ial o
con ol de ices by moni o ing b ain ac i i y. Speci ically, MI-based BCI sys ems (Mo o
Image y) ha e p o en highly e ec i e in he ield o neu o ehabili a ion, as he b ain
pa e ns gene a ed closely esemble hose p oduced du ing ac ual mo emen s. This wo k
p oposes a p o ocol designed o acqui e and analyze BCI da a using he Bi b ain He o
Helme de ice, aiming o explo e i s use in p ac ical applica ions.
The p ojec is pa o POSMOFYA, an ac onym o he Hyb id Pla o m o O hosis-
Wheelchai o ensu e compa ibili y o Mobili y, Func ionali y, and Accep abili y o use in
domes ic en i onmen s. This hyb id pla o m, as i s name sugges s, in eg a es an
au oma ed wheelchai and a obo ic a m. The ul ima e goal is o enable e icien and
p ac ical con ol in domes ic en i onmen s. The de eloped p o ocol is based on p inciples
o obus ness and p ecision, aiming o enhance he abili y o ecognize use s’ mo emen
in en ions.
This wo k is s uc u ed in o se e al phases, beginning wi h he expe imen al design. Using
he PsychoPy so wa e and he LabS eaming Laye (LSL) p o ocol, mo o image y asks
we e de ined ocusing on wo speci ic ac ions: igh w is lexion and le w is lexion.
These asks we e designed o gene a e b ain pa e ns associa ed wi h clea mo emen
in en ions, wi h he goal o aining a Machine Lea ning (ML) sys em. The s a egy
ensu es p ecise and consis en cap u e o b ain signals, essen ial o ad ancing he
de elopmen o p ac ical applica ions wi hin he p ojec amewo k.
The esul s e lec he challenges o wo king wi h EEG signals. Al hough he Decision
T ee algo i hm applied o Common Spa ial Pa e ns (CSP) achie ed a alida ion accu acy
o 42.9% in o line mode, and K-Nea es Neighbo s (KNN) eached 51.0% accu acy wi h
li e a u e-based ea u es, he p edic ions we e biased owa ds a single class. This
highligh s limi a ions in signal disc imina ion and a iabili y be ween sessions.
Despi e he di icul ies, he p ojec has p o ided aluable lessons: he need o imp o e
EEG sys ems and explo e ad anced echniques such as Regula ized CSP o hyb id
me hods wi h deep lea ning o inc ease obus ness and p ecision. Addi ionally, he basic
s eps o he online pipeline we e alida ed, indica ing ha be e op imiza ion could esul
in mo e eliable p ac ical applica ions. These indings no only highligh he ield’s
challenges bu also poin o oppo uni ies o imp o emen in u u e esea ch.

Pag. 6 Repo
Gene a ion o eal- ime con ol commands om EEG signals Pag. 7
Con en s
RESUM ______________________________________________________ 3
RESUMEN ___________________________________________________ 4
ABSTRACT ___________________________________________________ 5
CONTENTS ___________________________________________________ 7
GLOSSARY __________________________________________________ 9
LIST OF FIGURES ____________________________________________ 10
LIST OF TABLES _____________________________________________ 12
1. PREFACE _______________________________________________ 14
1.1. How he p ojec o igina ed ........................................................................... 14
1.2. Mo i a ion ..................................................................................................... 14
2. INTRODUCTION __________________________________________ 15
2.1. P oblem S a emen ...................................................................................... 15
2.2. Jus i ica ion .................................................................................................. 16
2.3. Scope ........................................................................................................... 16
2.4. P e equisi es ................................................................................................ 16
2.5. Objec i es .................................................................................................... 17
3. THEORETICAL FRAMEWORK ______________________________ 18
3.1. Mo emen -Limi ing Diso de s ...................................................................... 18
3.2. Elec oencephalog aphy (EEG) ................................................................... 18
3.2.1. F equency Bands ............................................................................................ 19
3.2.2. 10-20 sys em .................................................................................................. 20
3.3. B ain-Compu e In e aces (BCI) ................................................................. 21
3.4. O e iew o Mo o Image y-Based BCIs...................................................... 22
3.4.1. Challenges in MI signal Classi ica ion ............................................................. 22
3.4.2. D y EEG Sys ems in BCIs ............................................................................... 22
3.4.3. Applica ions in Assis i e Technologies ............................................................ 23
3.5. Key Fea u es ................................................................................................ 23
3.5.1. Gene ic Fea u es based on Li e a u e ............................................................. 23
3.5.2. Common Spa ial Pa e ns (CSP)..................................................................... 25
3.5.3. Limi a ions ....................................................................................................... 25
3.6. Lab S eaming Laye (LSL) p o ocol ............................................................ 27
3.7. PsychoPy ..................................................................................................... 29
Pag. 8 Repo
4. METHODOLOGY AND EQUIPMENT__________________________ 30
4.1. Pa icipan s .................................................................................................. 30
4.2. Expe imen al Design .................................................................................... 30
4.3. Signal Acquisi ion ......................................................................................... 31
4.4. Expe imen al pa adigm ................................................................................ 31
4.4.1. So wa e .......................................................................................................... 32
4.5. EEG P ep ocessing ..................................................................................... 39
4.6. Fea u e ex ac ion ........................................................................................ 40
4.6.1. Li e a u e based ea u es ................................................................................ 40
4.6.2. Common Spa ial Pa e ns ............................................................................... 41
4.6.3. Summa y o Fea u e Ex ac ion Implemen a ion ............................................. 41
4.7. Machine Lea ning Analysis .......................................................................... 42
4.7.1. Fea u es Based on Li e a u e .......................................................................... 42
4.7.2. Common Spa ial Pa e ns ............................................................................... 44
5. RESULTS _______________________________________________ 46
5.1. Li e a u e-Based Fea u es ........................................................................... 46
5.1.1. Da a O e iew ................................................................................................ 46
5.1.2. Fea u e Ex ac ion and Analysis ...................................................................... 47
5.1.3. Classi ica ion Resul s ...................................................................................... 50
5.2. Common Spa ial Pa e ns (CSP) ................................................................. 53
5.2.1. Da a O e iew ................................................................................................ 53
5.2.2. Fea u e Ex ac ion and Analysis ...................................................................... 53
5.2.3. Classi ica ion Resul s ...................................................................................... 55
6. DISCUSSION ____________________________________________ 58
6.1. Li e a u e-based Fea u es ............................................................................ 58
6.2. Common Spa ial Pa e ns (CSP) ................................................................. 59
6.3. Compa ison o Classi ie Pe o mance ........................................................ 59
7. LIMITATIONS AND FUTURE WORK __________________________ 61
8. PLANNING ______________________________________________ 63
9. ENVIRONMENTAL IMPACT ANALYSIS _______________________ 64
10. ECONOMIC ANALYSIS ____________________________________ 65
11. CONCLUSIONS __________________________________________ 66
12. ACKNOWLEDGMENTS ____________________________________ 67
13. BIBLIOGRAPHY __________________________________________ 68
14. ADDITIONAL BIBLIOGRAPHY ______________________________ 75
Gene a ion o eal- ime con ol commands om EEG signals Pag. 9
Glossa y
TFM T eball i de g au (Final Mas e Thesis in Ca alan)
EEG Elec oencephalog aphy
BCI B ain-Compu e in e ace
MI Mo o Image y
ICA Independen Componen Analysis
SCI Spinal co d inju y
ALS Amyo ophic la e al scle osis
LSL Lab s eaming laye
ML Machine lea ning
SVM Suppo ec o machine
KNN K-Nea es Neighbo s
RMS Roo Mean Squa e
PTP Peak- o-Peak Ampli ude
POSMOFYA Pla a o ma Híb ida Ó esis-Silla pa a hace compa ible la Mo ilidad,
Funcionalidad y Acep abilidad de aplicación en en o nos domés icos.
PNS Pe iphe al Ne ous Sys em
CNS Cen al Ne ous Sys em
SCI Spinal Co d Inju y
LAN Local A ea Ne wo k
NTP Ne wo k Time P o ocol
XDF Ex ensible Da a Fo ma
Pag. 16 Repo
2.2. Jus i ica ion
Gi en he a iabili y in EEG signal quali y, he ques ion a ises as o whe he i is possible
o c ea e a BCI sys em wi h D y EEG helme s. D y EEG helme s ha e been ac i ely
esea ched by mul iple s udies ying o ind i his echnique can be able o p o ide good
esul s compa ed wi h we EEG helme s [11,12,13].
In addi ion o add essing he limi a ions o d y EEG sys ems, his p ojec is jus i ied by he
g owing demand o non-in asi e, po able, and use - iendly solu ions in
neu o ehabili a ion and assis i e echnologies [14]. We EEG helme s, while p o iding
high-quali y signals, equi e labou -in ensi e p epa a ion and main enance, limi ing hei
applicabili y in daily li e scena ios and la ge-scale implemen a ions [15]. D y EEG sys ems
o e a p ac ical al e na i e by signi ican ly educing se up ime and enabling b oade
adop ion, p o ided hei pe o mance can be op imized [15].
2.3. Scope
The scope o his p ojec is o de elop and alida e a d y EEG-based BCI sys em ha
se es as an addi ional con ol ool o he POSMOFYA ini ia i e. This sys em is designed
o demons a e accep able accu acy in pe o ming MI asks, wi h he long- e m aim o
in eg a ing and es ing i on he ac ual POSMOFYA wheelchai . Tempo ally, he p ojec
spans om ini ial algo i hm design o expe imen al alida ion wi hin con olled
en i onmen s. The spa ial applica ion ocuses on assis i e de ice in eg a ion, ensu ing
compa ibili y wi h exis ing POSMOFYA componen s.
Recognizing he ime cons ain s o his hesis, he echnological ocus is on es ablishing a
ounda ional pipeline ha includes signal acquisi ion, p ep ocessing, classi ie aining,
and eal- ime classi ica ion. This p ojec aims o p o ide a i s app oach o a d y EEG-
based BCI sys em, s uc u ed as a modula amewo k wi h clea ly de ined componen s.
Each block o he sys em is designed o se e as a ounda ion o u he e inemen and
op imiza ion in subsequen esea ch. While his wo k does no ex end o ha dwa e
p oduc ion o la ge-scale deploymen , i emphasizes he impo ance o laying a scalable
g oundwo k ha can e ol e o e ime. By p io i izing usabili y, adap abili y, and
con inuous imp o emen , his p ojec seeks o con ibu e o he b oade goal o de eloping
mo e accessible and e ec i e BCI-d i en assis i e echnologies.

Gene a ion o eal- ime con ol commands om EEG signals Pag. 17
2.4. P e equisi es
Se e al p e equisi es we e es ablished o ensu e he p ojec ’s easibili y and success:
- Equipmen Selec ion: The Bi b ain He o Helme was chosen o i s d y elec ode
echnology, which simpli ies se up while p o iding high- esolu ion EEG signal
acquisi ion. U ilizing d y elec ode echnology o e s an economical and e icien
solu ion o he p oblem being add essed.
- So wa e Tools: PsychoPy was selec ed o expe imen design, while he
LabS eaming Laye (LSL) was employed o synch onized da a collec ion and
s eaming.
- Signal P ocessing Knowledge: Familia i y wi h EEG p ep ocessing echniques,
such as il e ing, a i ac emo al, and ea u e ex ac ion me hods (e.g., E en -
Rela ed Desynch oniza ion (ERD) and E en -Rela ed Synch oniza ion (ERS)),
was essen ial. This expe ise was acqui ed du ing he Mas e ’s p og am in
Neu oenginee ing and Rehabili a ion, wi h his p ojec se ing as he inal mas e ’s
hesis.
- Machine Lea ning Expe ise: Familia i y in implemen ing classi ie s o eal- ime
signal decoding was c ucial, wi h a ocus on algo i hms sui able o EEG da a,
such as Suppo Vec o Machines (SVMs) and neu al ne wo ks.
2.5. Objec i es
In his explo a o y p ojec , he goal is o de elop a obus BCI sys em using a d y EEG
helme o con ibu e o he POSMOFYA p ojec . The speci ic objec i es a e:
- Signal Acquisi ion and Analysis: Design a p o ocol o acqui ing and analysing
mo o image y (MI) da a using he Bi b ain He o Helme , ocusing on wo
mo emen classes: igh w is lexion and le w is lexion.
- Machine Lea ning In eg a ion: Implemen a machine lea ning pipeline o eal- ime
classi ica ion o MI signals, ensu ing accu a e and eliable p edic ions o con ol
asks.
- Usabili y and P ac icali y: Demons a e he easibili y o using d y elec ode EEG
sys ems in p ac ical applica ions by op imizing se up e iciency wi hou
comp omising signal quali y, pa ing he way o in eg a ion wi h he POSMOFYA
wheelchai in u u e i e a ions.
Pag. 18 Repo
3. Theo e ical F amewo k
This chap e p o ides a ho ough o e iew o he ounda ional knowledge essen ial o
unde s anding he esea ch conduc ed in his wo k. I begins by de ining neu omuscula
diso de s and explo ing he ools designed o add ess he mo emen limi a ions hey
impose. The discussion hen shi s o he p inciples o EEG, i s ole in B ain-Compu e
In e aces (BCI), and he signi icance o Mo o Image y (MI). Fu he mo e, he chap e
examines he ools and me hodologies employed in BCI de elopmen , along wi h he key
ea u es in eg al o wo king wi h MI and BCI sys ems.
3.1. Mo emen -Limi ing Diso de s
Mo emen diso de s ep esen a complex g oup o neu ological condi ions encompassing
a wide spec um o impai men s, anging om educed mo emen (hypokinesia) o
excessi e mo emen (hype kinesia) [16]. While Pa kinson’s disease is o en ega ded as
he classical example o mo emen diso de , many o he pa hologies all wi hin his
ca ego y. Fo ins ance, Hun ing on’s disease, a condi ion wi h a s ong gene ic basis, also
quali ies as a mo emen diso de [16].
In addi ion o hese classic examples, condi ions such as spinal co d inju y (SCI) can also
be classi ied as mo emen -limi ing diso de s. SCI in ol es a lesion o he spinal co d
esul ing om causes such as alls, mo o ehicle acciden s, o ac s o iolence. These
inju ies lead o a ying deg ees o dys unc ion in senso y, mo o , and au onomic unc ions
due o he pa ial o comple e loss o communica ion be ween he b ain and body egions
below he si e o inju y [17,18,19]. SCI is u he associa ed wi h a ange o seconda y
complica ions o a ying se e i y, signi ican ly a ec ing quali y o li e and con ibu ing o
inc eased mo bidi y and mo ali y [17,19].
3.2. Elec oencephalog aphy (EEG)
Elec oencephalog aphy (EEG) is a non-in asi e neu ophysiological me hod ha
measu es he b ain's elec ical ac i i y h ough elec odes placed on he scalp. I cap u es
he synch onous i ing o la ge popula ions o neu ons, o e ing a empo ally p ecise
measu e o b ain unc ion wi h millisecond esolu ion [20].
Despi e he de elopmen o ad anced imaging echniques, EEG emains a co ne s one in
clinical and esea ch applica ions. I is indispensable o e alua ing seizu es,
dis inguishing seizu e ypes, and in es iga ing condi ions ha mimic seizu es. Addi ionally,
i is employed in assessing coma ose pa ien s, moni o ing encephalopa hies, and
explo ing senso y, pe cep ual, and cogni i e p ocesses. [21]
Gene a ion o eal- ime con ol commands om EEG signals Pag. 19
The elec ical p ope ies o he b ain we e i s disco e ed by English scien is Richa d
Ca on in 1875, and app oxima ely 50 yea s la e , Ge man psychia is Hans Be ge
eco ded he i s human EEG, ma king a pi o al ad ancemen in neu oscience [22, 23].
3.2.1. F equency Bands
The equency ange o in e es in EEG eco dings ypically spans om 0.5 o 30 Hz.
Since he ea ly use o his echnology, i e equency hy hms ha e been iden i ied as
being associa ed wi h di e en ypes o b ain ac i i y [24].
 Del a hy hm (0.5–4 Hz): Cha ac e ized by high-ampli ude wa es, hese a e
ypically obse ed in in an s o du ing slow-wa e sleep in adul s.
 The a hy hm (4–8 Hz): Linked o d owsiness in adul s and eenage s, his
hy hm is mo e p onounced in child en. I is also associa ed wi h pleasu able
s a es and is p edominan ly ound in he pa ie al and empo al lobes.
 Alpha hy hm (8–13 Hz): P esen in awake, elaxed indi iduals, his hy hm is
associa ed wi h eye closu e and b ain-wide inhibi ion con ol. When occu ing o e
he mo o co ex, i is e e ed o as he mu hy hm, which is no ably supp essed
du ing mo o ac ions.
 Be a hy hm (13–30 Hz): Ac i e du ing s a es anging om calm ale ness o mild
obsessi e ocus, his hy hm is associa ed wi h ac i e hinking, a en ion, ocus,
and bo h physical and high-concen a ion ac i i ies.
Fig 1. EEG hy hms [25]
Pag. 20 Repo
3.2.2. 10-20 sys em
The 10-20 sys em is a globally ecognized s anda d o elec ode placemen on he scalp.
I s p ima y pu pose is o p o ide a s anda dized app oach o EEG acquisi ion, ensu ing
s udies can be consis en ly ep oduced and accu a ely analysed [26].
The numbe s "10" and "20" e e o he pe cen age dis ances be ween adjacen
elec odes, measu ed ela i e o he o al on - o-back o igh - o-le span o he head.
See Fig. 2.
Fig 2. 10-20 sys em [27]
In addi ion o he 10-20 sys em, se e al o he elec ode placemen sys ems a e used o
EEG eco dings, depending on he desi ed spa ial esolu ion and applica ion [28]:
 10-10 Sys em: An ex ension o he 10-20 sys em, o e ing highe esolu ion wi h
81 posi ions o mo e de ailed scalp co e age.
 10-5 Sys em: A u he e inemen o he 10-10 sys em, p o iding e en mo e
elec ode posi ions o enhanced p ecision.
 High-Densi y Sys ems: These include se ups like he EGI 64 and 128-channel
Geodesic Senso Ne s, designed o ad anced s udies equi ing de ailed spa ial
esolu ion.
 Cus omizable Placemen : Tailo ed elec ode a angemen s a e used in speci ic
esea ch o clinical applica ions, pa icula ly in neu o echnology.
 Ea -Based Sys ems: Specialized se ups ocused on de ec ing equency
componen s using senso s placed in o a ound he ea s.
These sys ems allow o lexibili y and p ecision ailo ed o he speci ic needs o a ious
EEG s udies and applica ions.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 21
3.3. B ain-Compu e In e aces (BCI)
A b ain-compu e in e ace (BCI) sys em es ablishes a di ec communica ion pa hway
be ween he b ain and an ex e nal de ice [29]. These sys ems ha e been unde
de elopmen o decades, wi h he choice o BCI echnology la gely dic a ed by i s
in ended applica ion [30]. Among he non-in asi e BCI pa adigms epo ed in he
li e a u e, he mos p ominen and e ec i e app oaches a e based on e oked esponses
(P300), s eady-s a e isually e oked po en ials (SSVEP), and mo o image y (MI) [31].
Despi e his, esea ch ocusing on EEG-based MI o lowe limb mo emen s in BCI-
con olled applica ions emains ela i ely limi ed [32, 33]. Many such s udies ha e been
con ined o o line scena ios due o he complexi ies in ol ed in he mo emen s and he
expe imen al se ups, which o en gene a e EEG signals ha di e signi ican ly om hose
ob ained in ealis ic online en i onmen s [34].
Fig 3. B ain-Compu e In e ace scheme [35]
BCI ope a es ollowing ou main s ages [36]:
1. Signal Acquisi ion and P e-P ocessing: B ain signals a e eco ded
using senso s and ampli ied o p epa e hem o u he p ocessing.
Fil e ing may also be applied o enhance desi able cha ac e is ics and
educe noise.
2. Fea u e Ex ac ion and Selec ion: The eco ded signals a e analysed o
iden i y speci ic ea u es ha co ela e wi h he use ’s in ended ac ions.
3. Fea u e T ansla ion: These ex ac ed ea u es a e hen ans o med in o
ac ionable commands o he ou pu de ice.
4. Con ol In e ace: The ope a ion o he de ice p o ides eedback o he
use , c ea ing a closed-loop con ol sys em.

Pag. 22 Repo
3.4. O e iew o Mo o Image y-Based BCIs
Mo o Image y (MI) is a men al p ocess whe e indi iduals simula e mo o mo emen s
wi hou physically execu ing hem. This men al ehea sal igge s simila neu al pa e ns o
hose o ac ual mo emen s, which can be cap u ed non-in asi ely using EEG. MI-based
BCIs ha e demons a ed immense po en ial in enabling mo o ehabili a ion, enhancing
neu oplas ici y, and p o iding con ol mechanisms o obo ic sys ems [37, 38].
Key elemen s o MI-based BCIs include:
 E en -Rela ed Desynch oniza ion (ERD) and Synch oniza ion (ERS): These
neu al pa e ns, de ec able h ough EEG, se e as bioma ke s o mo o in en ion
and a e c ucial o ea u e ex ac ion [38, 39].
 Machine Lea ning o Classi ica ion: Mode n app oaches employ deep lea ning
and adi ional classi ie s o decode MI signals. Deep lea ning me hods, such as
Con olu ional Neu al Ne wo ks (CNNs), ha e shown p omising esul s in handling
EEG's high-dimensional and noisy na u e [39].
3.4.1. Challenges in MI signal Classi ica ion
Despi e signi ican ad ancemen s, se e al challenges pe sis :
 Noise and A i ac s: EEG signals a e highly suscep ible o a i ac s om muscle
mo emen s, eye blinks, and en i onmen al ac o s [39].
 In e -subjec Va iabili y: Di e ences in neu al pa e ns ac oss indi iduals
necessi a e obus and gene alizable classi ie s [37,39].
 Real-Time P ocessing: Achie ing low-la ency and accu a e signal decoding is
c i ical o p ac ical applica ions [38].
This p ojec builds upon hese heo e ical ounda ions, le e aging ad ancemen s in EEG
echnology and machine lea ning o add ess hese challenges and push he bounda ies o
MI-based BCI applica ions.
3.4.2. D y EEG Sys ems in BCIs
The ansi ion om we o d y EEG sys ems add esses se e al challenges in p ac ical
applica ions, such as se up complexi y and use com o . S udies ha e highligh ed he
easibili y and accu acy o d y sys ems, demons a ing hei capabili y in cap u ing MI-
ela ed signals [38]. These sys ems ensu e po abili y and ease o use, making hem
sui able o eal-wo ld en i onmen s [40].
Gene a ion o eal- ime con ol commands om EEG signals Pag. 23
3.4.3. Applica ions in Assis i e Technologies
MI-based BCIs a e inc easingly used in assis i e echnologies, pa icula ly o con olling
obo ic wheelchai s and a ms. The in eg a ion o BCIs wi h mobili y solu ions has been
ex ensi ely esea ched, wi h emphasis on eal- ime con ol, adap abili y, and use
accep ance [39, 40]. Fo ins ance, EEG-based con ol sys ems ha e been deployed in
na iga ing eal-wo ld en i onmen s and pe o ming complex asks like objec manipula ion
using obo ic a ms [38, 39].
3.5. Key Fea u es
Unde s anding he co e ea u es o BCI sys ems is c ucial o hei e ec i e design and
applica ion. To de elop a unc ional and accu a e BCI sys em, speci ic ea u es mus be
selec ed o se e as inpu o machine lea ning algo i hms. This sec ion is di ided in o wo
subsec ions: he i s add esses Gene ic Fea u es based on Li e a u e, emphasizing
commonly ecognized cha ac e is ics and me hodologies epo ed in academic esea ch.
The second explo es in o Common Spa ial Pa e ns (CSP), a widely adop ed echnique
o ea u e ex ac ion and classi ica ion in BCI sys ems [41, 42]. Toge he , hese
subsec ions p o ide a comp ehensi e ounda ion o selec ing and u ilizing ea u es
essen ial o building obus BCI sys ems.
3.5.1. Gene ic Fea u es based on Li e a u e
The success o BCI sys ems in MI asks elies on he abili y o iden i y and ex ac obus
EEG ea u es. These ea u es, can be d awn om ime, equency and en opy domains
and hey o e signi ican insigh s in o neu al ac i i y. Many pape s appea ed on he las
yea s ying o ind which a e o could be some o he mos in e es ing ea u es o s udy MI
and ha e a success ul BCI sys em [43,44,45,46,47,48]. He e a e some o he mos
commonly used ea u es:
Table 1. Commonly used EEG ea u es o BCI sys ems based on MI [43,44,45,46,47,48].
Fea u es De ini ion
Time domain Fea u es
Roo Mean Squa e (RMS) P o ides an es ima e o he signal’s ampli ude and
is used o e alua e o e all signal s eng h [43,44].
Peak- o-Peak Ampli ude (PTP) Assesses ampli ude a iabili y, aiding in iden i ying
neu al ac i i y di e ences ac oss MI s a es [44,45].
Pag. 24 Repo
F ac al Dimension (FD), Hu s Exponen ,
Skewness and Ku osis
These me ics measu e he complexi y and
s a is ical p ope ies o EEG signals, essen ial o
dis inguishing MI pa e ns [43,46].
F equency Domain Fea u es
Del a, The a, Alpha, Be a and Gamma Powe These equency bands a e closely associa ed wi h
cogni i e and mo o asks, wi h changes obse ed
du ing MI in he co esponding mo o and senso y
egions [44,45].
Powe Spec al Densi y (PSD) Commonly used o quan i y e en - ela ed
desynch oniza ion/synch oniza ion (ERD/ERS)
du ing MI asks [43,45].
En opy and Complexi y Fea u es
Sample En opy, Shannon En opy and
Pe mu a ion En opy
These measu es quan i y i egula i y and
unp edic abili y in EEG, o e ing insigh s in o neu al
dynamics using MI [44,46,47].
Lempel-Zi Complexi y Re lec s he comp essibili y o EEG signals,
highligh ing hei andomness and unde lying
neu al p ocessing e iciency [45,46].
Ad anced Fea u e Ex ac ion Techniques
Common Spa ial Pa e ns (CSP) A widely used me hod o spa ial il e ing, CSP
e ec i ely disc imina es be ween MI asks by
op imizing he a iance o EEG signals [45,46,47].
Wa ele T ans o m (WT) O en combined wi h CSP, WT enhances ea u e
ex ac ion by decomposing EEG signals in o he
ime- equency domain [45,46].
These EEG ea u es ha e been ex ensi ely alida ed in a ious MI-based BCI
amewo ks, showcasing hei u ili y in imp o ing classi ica ion accu acy and sys em
pe o mance. Addi ionally, in eg a ing hese ea u es in o mode n machine lea ning
me hods ampli ies hei e ec i eness in eal-wo ld applica ions [43, 44, 45, 46].
Gene a ion o eal- ime con ol commands om EEG signals Pag. 25
3.5.2. Common Spa ial Pa e ns (CSP)
Among he ad anced echniques o EEG ea u e ex ac ion, Common Spa ial Pa e ns
(CSP) s ands ou as one o he mos powe ul and widely used me hods in he domain o
BCIs [49]. CSP is speci ically designed o ex ac disc imina i e spa ial ea u es by
op imizing he a iance di e ences be ween wo o mo e classes o mo o image y asks
[49]. This op imiza ion enables e ec i e spa ial il e ing o EEG signals, o en leading o
signi ican imp o emen s in classi ica ion accu acy o mo o image y asks [50].
CSP ope a es by lea ning spa ial il e s ha maximize he a iance o one class while
minimizing i o ano he . This app oach emphasizes he spa ial pa e ns mos ele an o
he di e ences in b ain ac i i y associa ed wi h he mo o asks. By ans o ming he EEG
da a in o a space whe e hese pa e ns a e highligh ed, CSP acili a es he ex ac ion o
ea u es ha a e highly in o ma i e o classi ica ion [51].
O e he yea s, CSP has seen nume ous a ia ions and enhancemen s o add ess i s
limi a ions, such as suscep ibili y o noise, o e i ing in high-dimensional da a, and
dependence on speci ic expe imen al se ups.
- Fil e Bank CSP (FBCSP) inco po a es band-pass il e ing o isola e equency
bands o in e es , o en imp o ing obus ness [50].
- Regula ized CSP (R-CSP) applies egula iza ion echniques o mi iga e
o e i ing, especially in da ase s wi h a small numbe o ials [51].
- Riemannian Geome y-based CSP (RG-CSP) p ojec s co a iance ma ices on o
a Riemannian mani old, le e aging he in insic geome ic p ope ies o hese
ma ices o enhance ea u e ex ac ion [51].
Recen esea ch has also in eg a ed CSP wi h deep lea ning amewo ks o combine i s
ea u e ex ac ion capabili ies wi h he pa e n ecogni ion s eng h o neu al ne wo ks.
These hyb id app oaches ha e shown p omise in imp o ing classi ica ion accu acy and
educing dependency on manual ea u e enginee ing [50].
3.5.3. Limi a ions
Fi s ly, he equen use o heal hy subjec s in BCI s udies can lead o un ealis ic esul s,
as i has been shown ha a ge use s (e.g., indi iduals wi h mo o disabili ies) ypically
pe o m wo se [51].
Addi ionally, MI-BCIs equi e use s o unde go ex ensi e aining sessions o calib a ion,
which can become excessi ely ime-consuming. This p olonged aining o en leads o
a igue, u he diminishing pe o mance, pa icula ly in pa ien s [52].
Pag. 32 Repo
The use o w is lexion and ex ension o mo o image y asks was selec ed as i in ol es
ewe muscles, making i mo e sui able o un ained pa icipan s. While hand opening and
closing a e o en used in MI-based BCI s udies o hei unc ional ele ance, simila
accu acy is achie ed wi h w is mo emen s [64]. These design choices align wi h p io MI
s udies ha ha e highligh ed he impo ance o simplici y and epea abili y in ask
selec ion o achie ing eliable neu al pa e ns.
Addi ionally, es ing-s a e da a was eco ded on sepa a e days o cap u e he pa icipan 's
baseline neu al ac i i y. This phase consis ed o six sessions, wi h each session
comp ising 10 minu es o eco ding di ided equally in o 5 minu es wi h eyes open and 5
minu es wi h eyes closed.
The inal da ase , he e o e, consis ed o s uc u ed da a om 10 days o mo o image y
asks and 6 sessions o es ing-s a e eco dings. This mul i-day, mul i-condi ion app oach
had he in en ion o p o ide a obus da ase o analysis, enabling he di e en ia ion o
ask-speci ic neu al pa e ns om baseline ac i i y and accoun ing o po en ial day- o-day
a iabili y in b ain ac i i y. Such a da ase should ensu e eliabili y in de ec ing sub le
changes in neu al ac i i y while suppo ing he de elopmen o accu a e and gene alizable
BCI sys ems.
4.4.1. So wa e
The Bi B ain He o helme suppo s in eg a ion wi h a ious BCI applica ions beyond i s
de aul sui e, hanks o i s a ailable APIs (e.g., Py hon, C++, and o he in e aces) o da a
access and p ocessing. Fo he pu pose o de eloping a mo o image y (MI) expe imen , i
was necessa y o design an expe imen al p o ocol ha could gene a e MI igge s (le
and igh ) and ensu e hei synch oniza ion wi h EEG da a. PsychoPy was employed o
c ea e his p o ocol, p o iding p ecise iming and alignmen be ween he p esen ed s imuli
and he eco ded neu al signals.
Fig 7. W is lexion and ex ension [65]

Gene a ion o eal- ime con ol commands om EEG signals Pag. 33
4.4.1.1. PsychoPy
To adminis e he expe imen al asks, a cus om expe imen al pipeline was de eloped
wi hin PsychoPy (see sec ion 3.7), enabling he design o a mo o image y expe imen
based on he guidelines ou lined in poin 4.4. The s uc u e shown in Fig. 8 was
implemen ed o o ganize he ask sequence.
Fig 8. PsychoPy pipeline ollowed o ob ain EEG MI da a in his p ojec .
Pipeline Explana ion
1. LSL De ini ion: The ini ial s age es ablishes he connec ion be ween he EEG
eco ding so wa e and he PsychoPy ool ia he Lab S eaming Laye (LSL).
Du ing his s ep, he LabReco de [61] so wa e is used o synch onize he da a
s eams (see sec ion 3.6).
2. Pause: A e con i ming he connec ion, pa icipan s a e p omp ed o p ess he
"space" key o p oceed o he nex s age. This ensu es ha he pa icipan is eady
be o e he ask begins (see Fig. 9.A).
3. P esen a ion: A his s age, pa icipan s a e p esen ed wi h he ins uc ions o he
ask. The ollowing message is displayed on he sc een:
"Welcome. Please hink o mo ing he hand indica ed by he blue a ows ha will
appea ." This s ep ensu es pa icipan s unde s and he ask be o e p oceeding
(see Fig. 9.B).
4. Fixa ion: A ixa ion c oss is displayed on he sc een o 10 seconds (see Fig. 9.C).
This s ep se es o cen e he pa icipan 's a en ion and p epa e hem o he ask.
5. Task Loop: Following he ixa ion phase, he main ask is epea ed 40 imes in a
loop. Depending on he speci ic exe cise being conduc ed, he pa icipan s a e
shown a blue a ow poin ing ei he o he le , he igh , o in a andomized
di ec ion (see Fig. 9.D and Fig 9.E). Pa icipan s a e ins uc ed o imagine
Pag. 34 Repo
ex ending hei hand in he di ec ion indica ed by he a ow. This p ocess is
pe o med h ough a 2.5 second ime. The inclusion o h ee di e en ypes o
asks—le -hand mo emen , igh -hand mo emen , and andom di ec ion—
p o ides di e se neu al da a o analysis. (see Fig 10.C and 10.D)
6. Closu e: A he end o he ask, a message is displayed on he sc een:
"Thank you o you ime." This message signals he conclusion o he expe imen
and o mally ending he ask.
Fig 9. Images ha can appea on he ask om he PsychoPy pipeline ha has been ollowed.
A B
C D
E F
Gene a ion o eal- ime con ol commands om EEG signals Pag. 35
In addi ion o he ask pipeline desc ibed, he s udy included a baseline eco ding phase o
accoun o he pa icipan 's " es ing-s a e" neu al ac i i y (see Fig 11). This phase was
conduc ed in wo condi ions: 5 minu es wi h eyes open and 5 minu es wi h eyes closed.
Du ing he eyes-open condi ion, he pa icipan was ins uc ed o ocus on a ixa ion c oss
displayed on he sc een, while in he eyes-closed condi ion, he pa icipan was asked o
elax wi hou any isual s imuli. This baseline da a was essen ial o p ep ocessing, as i
acili a ed he iden i ica ion and emo al o noise and a i ac s inhe en o he d y EEG
helme . By compa ing ask- ela ed signals o hese baseline eco dings, he analysis
aimed o isola e mo o - ela ed neu al pa e ns wi h g ea e accu acy.
B. Fixa ion ou ine
C. Fixa ion-loop ou ine
A. P esen a ion ou ine
D. T ial ou ine
E. T ial ou ine
Fig 10. PsychoPy ou ine blocks
Pag. 36 Repo
Fig 11. PsychoPy pipeline ollowed o ob ain es ing-s a e EEG da a in his p ojec
This PsychoPy pipeline s a s as he o he one, he only di e ences a e ela ed wi h he
ollowing poin s:
1. P esen a ion: A his s age, pa icipan s a e p esen ed wi h he ins uc ions o
he ask. The ollowing message is displayed on he sc een:
"Welcome, please s and s ill and elax. When 'EO' appea s on he sc een, keep
looking a i . When i changes o 'EC,' close you eyes and wai un il he end o he
es o open hem again. Thank you." This s ep ensu es pa icipan s unde s and
he ask be o e p oceeding (see Fig. 12.A).
2. Fixa ion_EO: A ixa ion c oss will appea on he sc een o 5 minu es (see Fig.
12.B). Du ing his ime, he pa icipan is ins uc ed o main ain ocus on he c oss
un il he nex block appea s.
3. Hold_Up: Pa icipan s a e p esen ed wi h ins uc ions o close hei eyes. The
ollowing message is displayed: "Now le 's change o EC. You will wai he e o 5
minu es. Please se you ime ." Since he ask was pe o med by a single subjec
wi hou ex e nal moni o ing, he pa icipan was allowed ime o se a 5-minu e
ime o know when o inish he eyes-closed block. (see Fig. 12.C).
4. Fixa ion_EC: A ixa ion c oss will appea on he sc een o 5 minu es (see Fig.
12.D). Howe e , he pa icipan will no see his image because hei eyes should
emain closed du ing his block.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 37
Fig 12. Images ha can appea on he ask om he PsychoPy pipeline ha has been ollowed o
es ing-s a e.
A B
C D
5

Pag. 38 Repo
Da a acquisi ion was synch onized using he Lab S eaming Laye (LSL) p o ocol,
ensu ing p ecise iming and seamless in eg a ion be ween he EEG sys em and he
PsychoPy ool. Du ing each session, eal- ime moni o ing was employed o ensu e da a
quali y, allowing o any necessa y adjus men s o main ain signal in eg i y and educe
noise. This app oach gua an eed he eliabili y and accu acy o he eco ded neu al da a,
suppo ing subsequen analysis and in e p e a ion.
Fig 13. Bi b ain Viewe app main sc een isualiza ion
This s uc u ed sequence was designed o ensu e cla i y, consis ency, and obus da a
collec ion while op imizing he pa icipan ’s expe ience.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 39
4.5. EEG P ep ocessing
The collec ed EEG da a unde wen comp ehensi e p ep ocessing o emo e noise and
a i ac s, ensu ing i s sui abili y o subsequen analysis. These s eps we e implemen ed
using Py hon, a e sa ile and widely-used p og amming language enowned o i s obus
lib a ies and ools in da a analysis, signal p ocessing, and scien i ic compu ing. The codes
used in o de o ollow his pipeline can be ound on he Gi hub eposi o y [66]. Below a e
he a ious s eps ollowed o p ep ocess he da a:
1. Da a Loading and In eg a ion: EEG da a s eams we e loaded om .xd iles
using he pyxd lib a y, ensu ing synch oniza ion wi h e en ma ke s p o ided by
he Lab S eaming Laye (LSL). Each s eam's sampling a e, channel coun , and
da a shape we e logged o e i y in eg i y.
2. Baseline Co ec ion: A 10-second baseline signal was calcula ed om he ini ial
samples o he EEG da a (in on-line mode). The a e age baseline alue was
sub ac ed om he en i e da ase o co ec o baseline shi s and minimize low-
equency d i s (in o line mode).
3. Band-Pass and No ch Fil e ing: A band-pass il e (0.3–30 Hz) was applied o
e ain neu al ac i i y wi hin he equency ange ele an o mo o image y [50].
Addi ionally, a no ch il e was used o elimina e 50 Hz line noise caused by
elec ical in e e ence.
4. Independen Componen Analysis (ICA): Fas Independen Componen
Analysis (Fas ICA) was pe o med on he EEG da a o isola e and emo e
a i ac s, such as eye blinks o muscle mo emen s. Fas ICA was speci ically
chosen o his p ep ocessing s ep due o i s sui abili y o eal- ime applica ions,
allowing a i ac emo al o be pe o med online. This ensu ed ha ask- ela ed
neu al signals we e p ese ed and no con amina ed by ex aneous noise, while
enabling e icien p ep ocessing in dynamic expe imen al se ups.
5. E en Iden i ica ion and Segmen a ion: E en ma ke s embedded in he da a
s eams we e iden i ied and ma ched o he co esponding expe imen al
condi ions. EEG da a was segmen ed in o 1.5-second epochs based on hese
ma ke s, aligning he neu al da a wi h he mo o image y asks (e.g., le -hand,
igh -hand, o andom ials).
6. Uni o m Leng h Adjus men : To ensu e consis ency in da a dimensionali y, all
1.5-second epochs we e ei he unca ed o ze o-padded o main ain a ixed
numbe o samples ac oss ials.
Pag. 40 Repo
7. Da a S o age: P ocessed da a and e en labels we e sa ed in .json iles o
u he analysis. Addi ionally, il e ed aw da a and ICA- il e ed da a we e sa ed in
. i iles o ep oducibili y and compa ibili y wi h MNE-based pipelines.
4.6. Fea u e ex ac ion
Fea u e ex ac ion plays a c i ical ole in iden i ying and isola ing pa e ns wi hin EEG da a
ha co ela e wi h mo o image y asks. This p ocess is essen ial o he success o EEG
mo o image y classi ica ion and was ca ied ou using wo complemen a y s a egies:
Li e a u e-Based Fea u es and Common Spa ial Pa e ns (CSP). Bo h me hods aimed
o enhance he disc imina i e powe o he da a, p o iding obus ep esen a ions o
subsequen classi ica ion asks. Below is an explana ion o each app oach.
4.6.1. Li e a u e based ea u es
Fea u es commonly epo ed in EEG s udies we e ex ac ed o cap u e bo h ime-domain
and equency-domain p ope ies o he signals [43,44,45,46,47,48]:
1. Time-Domain Fea u es
 Roo Mean Squa e (RMS): This ea u e e alua es he o e all s eng h o he EEG
signal and is commonly used in mo o image y esea ch.
 Peak- o-Peak Ampli ude (PTP): Measu es he a iabili y in signal ampli ude,
p o iding insigh s in o he dynamic ange o neu al ac i i y.
2. F equency-Domain Fea u es
 Powe Spec al Densi y (PSD): The PSD was calcula ed o key equency
bands (del a, he a, alpha, be a, gamma) o isola e mo o image y- ela ed
oscilla ions.
3. En opy and Complexi y Measu es
 Sample En opy: Quan i ies he i egula i y in neu al signals, which may indica e
he complexi y o cogni i e p ocessing.
 Lempel-Zi Complexi y: Measu es andomness in EEG da a, e lec ing neu al
p ocessing e iciency.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 41
4.6.2. Common Spa ial Pa e ns
CSP is a popula me hod o ex ac ing disc imina i e spa ial ea u es om EEG signals,
speci ically designed o mo o image y classi ica ion [48, 49, 50]. The echnique
op imizes spa ial il e s o enhance he a iance o one class (e.g., le -hand image y)
while supp essing he a iance o he o he class (e.g., igh -hand image y). Key aspec s
include:
 Va iance Op imiza ion: CSP maximizes a iance o one class while minimizing
i o he o he .
 Spa ial Pa e n Iden i ica ion: I highligh s pa e ns mos ele an o
classi ica ion.
 Regula iza ion: Va ian s like Regula ized CSP (R-CSP) mi iga e o e i ing by
in oducing cons ain s in high-dimensional da ase s.
CSP calcula ion was pe o med h ough a Py hon code ha ollows he nex pipeline:
1. P ep ocessing: Applies ICA, baseline co ec ion, and il e ing.
2. E en Segmen a ion: Spli s he EEG da a in o 1.5-second segmen s based on
e en ma ke s.
3. CSP T aining and T ans o ma ion:
o Compu es spa ial il e s.
o Applies hese il e s o he segmen ed da a o ex ac CSP ea u es.
4. Sa ing Resul s: S o es CSP ea u es and co esponding labels o machine
lea ning classi ica ion.
4.6.3. Summa y o Fea u e Ex ac ion Implemen a ion
The ea u es we e ex ac ed using a Py hon-based implemen a ion, designed o suppo
bo h online and o line wo k lows. This dual-mode app oach ensu es compa ibili y wi h
eal- ime expe imen al se ups and pos hoc analyses, le e aging he ollowing s eps:
1. Da a Acquisi ion: EEG signals we e s eamed li e ia LSL o eal- ime
p ocessing o e ie ed om p e- eco ded . i iles o o line analyses.
2. Baseline Sub ac ion: A baseline co ec ion s ep was pe o med o no malize he
EEG da a and mi iga e low- equency d i s.
3. Fil e ing: Band-pass and no ch il e s we e applied o e ain ask- ele an
Pag. 48 Repo
 Alpha and Be a Powe : The equency ea u es (Alpha and Be a powe ) exhibi
highly skewed dis ibu ions wi h signi ican ou lie s. Howe e , bo h his og ams and
box plo s e eal ha hese ea u es a e concen a ed nea he lowe ange,
showing minimal di e en ia ion be ween mo o image y classes in he obse ed
da a (see Figu es 16 and 17).
igh
le
side
le igh
side
Fig 16. His og am and Box plo o alpha powe by side (in z-sco es)
Fig 17. His og am and Box plo o be a powe by side (in z-sco es)
(Hz) (Hz)

Gene a ion o eal- ime con ol commands om EEG signals Pag. 49
 En opy Fea u es: Sample en opy and pe mu a ion en opy show mo e
symme ical dis ibu ions. Box plo s e eal mino a ia ions in medians be ween
"le " and " igh " classes. Pe mu a ion en opy, in pa icula , appea s o ha e
sligh ly mo e dis inguishable dis ibu ions be ween he wo classes (see Figu es
18 and 19).
The s a is ical and isual analyses o hese ea u es sugges ha while some ea u es
(e.g., RMS, PTP, and en opy measu es) p o ide mode a e sepa abili y, o he s (e.g.,
Alpha and Be a powe ) show conside able o e lap, indica ing limi ed disc imina i e powe
o mo o image y classi ica ion in hei cu en o m.
side
igh
le
side
igh
le
Fig 18. His og am and Box plo o sample en opy by side (in z-sco es)
Fig 19. His og am and Box plo o pe mu a ion en opy by side (in z-sco es)
(Hz)
(Hz)
Pag. 50 Repo
5.1.3. Classi ica ion Resul s
Machine lea ning classi ie s we e e alua ed o analyse he disc imina i e powe o
ex ac ed ea u es in he con ex o mo o image y asks. The analysis included bo h
aining and alida ion phases, u ilizing classi ie s such as Linea Disc iminan Analysis
(LDA), Suppo Vec o Machines (SVM), Decision T ees (DT), and K-Nea es Neighbou s
(KNN). E alua ion me ics, including accu acy, p ecision, ecall, and ROC AUC, we e
calcula ed, alongside isualiza ions like ROC cu es, con usion ma ices, and
classi ica ion epo s.
T aining Phase Resul s
The pe o mance o machine lea ning classi ie s was e alua ed on he aining da ase o
assess hei abili y o lea n pa e ns om he da a. This analysis p o ides insigh s in o how
well each model cap u es he ela ionships be ween ea u es and mo o image y asks,
wi h me ics such as accu acy, p ecision, ecall, and ROC AUC se ing as indica o s o
aining pe o mance.
The ollowing able summa izes he esul s o he machine lea ning classi ie s on he
aining da ase (Table 3). The aining pe o mance me ics a e also isualized in Figu e
20 ( op panel), showing a ba plo compa ison o accu acy, p ecision, ecall, and ROC
AUC o each model. Addi ionally, he co esponding aining ROC cu es o he
classi ie s a e illus a ed in Figu e 21 ( op panel).
Table 3. Machine Lea ning Classi ie s on aining da ase o Li e a u e based ea u es
Classi ie Accu acy (%) P ecision (%) Recall (%) ROC AUC
LDA 60.2 58.9 46.2 0.62
SVM 76.1 75.2 72.1 0.82
DT 85.2 84.1 83.8 0.85
KNN 75.0 74.1 70.9 0.82
Valida ion Phase Resul s
To e alua e he gene aliza ion pe o mance o he classi ie s, hei accu acy, p ecision,
ecall, and ROC AUC we e assessed on he alida ion/ es da ase . This s ep ensu es ha
he models a e no o e i ing o he aining da a and p o ides a ealis ic assessmen o
hei p edic i e capabili ies on unseen da a.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 51
The ollowing able p esen s he pe o mance o he classi ie s on he alida ion/ es
da ase (Table 4). Valida ion pe o mance me ics a e isualized in Figu e 20 (bo om
panel), p o iding a ba plo compa ison o accu acy, p ecision, ecall, and ROC AUC o
he models. The alida ion ROC cu es a e depic ed in Figu e 21 (bo om panel) o u he
illus a e he gene aliza ion pe o mance.
Table 4. Machine Lea ning Classi ie s on alida ion da ase o Li e a u e based ea u es
Classi ie Accu acy (%) P ecision (%) Recall (%) ROC AUC
LDA 50.0 50.0 100.0 0.50
SVM 50.0 50.0 100.0 0.50
DT 50.0 50.0 100.0 0.50
KNN 51.0 50.7 80.4 0.50
Fig 20. T aining s Valida ion Me ics compa ison o Li e a u e Based ea u es
Pag. 52 Repo
Fig 21. T aining s Valida ion ROC Cu es compa ison o Li e a u e Based ea u es
Gene a ion o eal- ime con ol commands om EEG signals Pag. 53
5.2. Common Spa ial Pa e ns (CSP)
5.2.1. Da a O e iew
The EEG da a analysed using Common Spa ial Pa e ns (CSP) we e acqui ed du ing
mo o image y (MI) asks in ol ing igh - and le -hand mo emen s. The da a we e
eco ded o e en sessions, wi h 40 ials pe class pe session. This esul ed in a da ase
comp ising balanced class dis ibu ions o 400 ials each o igh -hand and le -hand
mo o image y.
The CSP ea u es we e ex ac ed by applying spa ial il e s op imized o maximize he
a iance di e ences be ween he wo classes. The da ase was di ided in o:
 T aining Se : 651 ials (60% o he o al da a), balanced ac oss classes.
 Valida ion Se : 240 ials (40% o he o al da a), balanced ac oss classes.
5.2.2. Fea u e Ex ac ion and Analysis
Fea u es Dis ibu ion
The CSP me hod ans o med he EEG da a in o a ou -dimensional ea u e space, wi h
each dimension ep esen ing a spa ial il e op imized o class disc imina ion. The
dis ibu ions o hese ea u es o he aining and alida ion se s we e analyzed and
isualized.
CSP T aining Fea u es
Figu e 22 displays he class dis ibu ion in he aining da ase . The wo classes,
co esponding o mo o image y o igh - and le -hand mo emen s, a e balanced wi h
nea ly equal ep esen a ion in he da ase .
Fig 22. Class Dis ibu ion in
T aining Da a

Pag. 54 Repo
Figu e 23 illus a es he dis ibu ions o he ou CSP componen s ex ac ed om he
aining da ase . Each componen co esponds o a spa ial il e op imized o
disc imina ing be ween he wo mo o image y classes. These his og ams show ha he
CSP ea u es a e well-dis ibu ed, wi h dis inc sepa abili y be ween he classes o ce ain
componen s.
Compa ison o T aining and Valida ion CSP Fea u es
To e alua e whe he he CSP ea u es gene alize ac oss da ase s, Figu e 24 compa es
he densi y dis ibu ions o CSP componen s in he aining and alida ion da ase s.
Fig 23. T aining CSP Fea u e Dis ibu ion
Fig 24. Compa ison o CSP
Fea u e Dis ibu ions (T aining
s. Valida ion)
Gene a ion o eal- ime con ol commands om EEG signals Pag. 55
5.2.3. Classi ica ion Resul s
The classi ica ion pe o mance o he CSP ea u es was e alua ed using ou models:
Linea Disc iminan Analysis (LDA), Suppo Vec o Machine (SVM), Decision T ee (DT),
and K-Nea es Neighbou s (KNN). The esul s o bo h aining and alida ion phases a e
summa ized below.
T aining Phase Resul s
The pe o mance o machine lea ning classi ie s was e alua ed on he aining da ase o
assess hei abili y o lea n pa e ns om he da a. This analysis p o ides insigh s in o how
well each model cap u es he ela ionships be ween ea u es and mo o image y asks,
wi h me ics such as accu acy, p ecision, ecall, and ROC AUC se ing as indica o s o
aining pe o mance.
The ollowing able summa izes he esul s o he machine lea ning classi ie s on he
aining da ase (Table 5). The aining pe o mance me ics a e also isualized in Figu e
25 ( op panel), showing a ba plo compa ison o accu acy, p ecision, ecall, and ROC
AUC o each model. Addi ionally, he co esponding aining ROC cu es o he
classi ie s a e illus a ed in Figu e 26 ( op panel).
Table 5. Machine Lea ning Classi ie s on aining da ase o CSP ea u es
Classi ie Accu acy (%) P ecision (%) Recall (%) ROC AUC
LDA 92.4 94.3 93.7 0.95
SVM 90.6 92.1 92.8 0.93
DT 89.3 91.8 92.4 0.91
KNN 88.1 90.2 89.1 0.89
Valida ion Phase Resul s
To e alua e he gene aliza ion pe o mance o he classi ie s, hei accu acy, p ecision,
ecall, and ROC AUC we e assessed on he alida ion/ es da ase . This s ep ensu es ha
he models a e no o e i ing o he aining da a and p o ides a ealis ic assessmen o
hei p edic i e capabili ies on unseen da a.
The ollowing able p esen s he pe o mance o he classi ie s on he alida ion/ es
da ase (Table 6). Valida ion pe o mance me ics a e isualized in Figu e 25 (bo om
panel), p o iding a ba plo compa ison o accu acy, p ecision, ecall, and ROC AUC o
he models. The alida ion ROC cu es a e depic ed in Figu e 26 (bo om panel) o u he
illus a e he gene aliza ion pe o mance.
Pag. 56 Repo
Table 6. Machine Lea ning Classi ie s on alida ion da ase o CSP ea u es
Classi ie Accu acy (%) P ecision (%) Recall (%) ROC AUC
LDA 38.8 43.4 74.2 0.18
SVM 28.8 31.9 37.5 0.22
DT 42.9 43.5 47.5 0.43
KNN 34.6 39.4 57.5 0.36
Fig 25. T aining s Valida ion Me ics compa ison o CSP Fea u es
Gene a ion o eal- ime con ol commands om EEG signals Pag. 57
Fig 26. T aining s Valida ion ROC Cu es compa ison o CSP ea u es
Pag. 64 Repo
9. En i onmen al impac analysis
The en i onmen al impac o de eloping his p ojec has been e alua ed, conside ing he
esou ces and equipmen u ilized.
In addi ion, he manu ac u ing o hese de ices con ibu es signi ican ly o hei ca bon
oo p in . Fo example, he p oduc ion o elec onic de ices eleases app oxima ely 22.7
kg o CO2 pe kilog am o equipmen . Lap ops, which ypically weigh a ound 2 kg, ha e
an es ima ed manu ac u ing oo p in o 110 kg CO2e. While hese igu es a e subs an ial,
i is impo an o no e ha he equipmen used in his p ojec was no acqui ed speci ically
o his pu pose, he eby educing i s di ec en i onmen al impac on he p ojec .
A key en i onmen al bene i o his p ojec is he use o he Bi b ain He o Helme , which
employs d y elec odes ins ead o disposable adhesi e ones. This elimina es he need o
single-use elec odes, signi ican ly educing was e ypically associa ed wi h EEG da a
acquisi ion. In p ojec s using adhesi e elec odes, hund eds o uni s may be disposed o ,
con ibu ing o en i onmen al deg ada ion. The use o d y elec odes hus ep esen s a
mo e sus ainable and eco- iendly app oach.
Addi ionally, while he ca bon oo p in o manu ac u ing he de ices in ol ed in his
p ojec mus be acknowledged—es ima ed a app oxima ely 1 on o CO2 o 1000€ wo h
o echnology— he de ices we e no acqui ed solely o his p ojec , which mi iga es hei
di ec en i onmen al impac .
Las ly, all anspo a ion ela ed o his p ojec p io i ized public anspo , a oiding p i a e
ehicle use and minimizing a el- ela ed ca bon emissions.

Gene a ion o eal- ime con ol commands om EEG signals Pag. 65
10. Economic analysis
A desc ip ion o he budge spen on his s udy, in ol ing pe sonal, so wa e, ma e ial and
o ice- ela ed cos s is de ailed below.
Table 7. Pe sonal cos s o he s udy
Table 8. So wa e cos s
Table 9. Ma e ial cos s
Table 10. O ice ela ed cos s
Pag. 66 Repo
11. CONCLUSIONS
This p ojec explo ed he easibili y o de eloping a B ain-Compu e In e ace (BCI)
sys em using a d y EEG helme o classi y mo o image y (MI) asks. The esul s highligh
bo h he po en ial and limi a ions o such sys ems. The classi ica ion pe o mance di e ed
depending on he app oach used.
Fo li e a u e-based ea u es, he K-Nea es Neighbo s (KNN) algo i hm achie ed a
alida ion accu acy o 51.0%. Howe e , he con usion ma ices indica ed signi ican
limi a ions, as he model p edominan ly p edic ed a single class, educing i s p ac ical
disc imina i e abili y. On he o he hand, applying Common Spa ial Pa e ns (CSP)
ea u es wi h a Decision T ee classi ie showed some imp o emen , achie ing a alida ion
accu acy o 42.9%. While his app oach demons a ed be e balance in p edic ions, i s ill
aced challenges ela ed o gene aliza ion and o e i ing.
The use o a d y EEG sys em in oduced no able obs acles. Signal quali y was
comp omised due o he sensi i i y o d y elec odes o noise and a i ac s, which a ec ed
he eliabili y o ea u e ex ac ion and classi ica ion. Fu he mo e, a iabili y in EEG
signals ac oss sessions and e en wi hin he same day posed addi ional challenges. This
a iabili y, in luenced by ac o s such as elec ode placemen and pa icipan s a e,
highligh ed he impo ance o obus calib a ion p o ocols o ensu e consis ency.
Al hough he p ojec included unc ional code o eal- ime es ing, he low accu acies
achie ed by he ained models limi ed hei p ac ical applica ion. As a esul , online es s
we e no ex ensi ely conduc ed, as hey did no o e meaning ul insigh s. Despi e hese
limi a ions, his wo k p o ides a ounda ion o u u e ad ancemen s in BCI sys ems.
In eg a ing mo e ad anced EEG echnologies, imp o ed ea u e ex ac ion me hods, and
obus machine lea ning echniques could signi ican ly enhance sys em eliabili y and
adap abili y, pa ing he way o mo e p ac ical and impac ul applica ions in assis i e
echnologies.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 67
12. Acknowledgmen s
I would like o exp ess my deepes g a i ude o he indi iduals who ha e been c ucial in
he success ul comple ion o his p ojec .
Fi s , a huge hanks o my mas e ’s p ojec Di ec o , Joan F ancesc Alonso López, o
sha ing his expe ise, o e ing his suppo , and always guiding me in he igh di ec ion.
His help has been c ucial in shaping his wo k.
I also wan o deeply hank my Co-di ec o , And es El-Fakdi Sencianes, o his dedica ion,
encou agemen , and cons an mo i a ion. His suppo kep me going, e en when hings
go ough, and his guidance made a huge di e ence in eaching ou goals.
A big hank you as well o my Co-di ec o , Alicia Casals Gelpí, and he es o he obo ics
eam, o hei guidance and o gi ing me he ools and acili ies o make his p ojec
happen.
Las ly, I’m g a e ul o my pa ne , my amily, and my closes iends. You lo e, suppo ,
and encou agemen we e exac ly wha I needed whene e hings el o e whelming. Thei
p esence and unde s anding ha e been a sou ce o s eng h du ing challenging imes,
and I am g a e ul o hei lo e and belie in me.
Pag. 68 Repo
13. Bibliog aphy
[1] h ps://www.bi b ain.com/es/p oduc os-neu o ecnologia/d y-eeg/he o
[2] R. Sha ma, M. Kim, and A. Gup a, “Mo o image y classi ica ion in b ain-machine
in e ace wi h machine lea ning algo i hms: Classical app oach o mul i-laye
pe cep on model,” *Biomed. Signal P ocess. Con ol*, ol. 71, p. 103101, 2022, doi:
10.1016/j.bspc.2021.103101.
[3] H.-J. Hwang, J.-H. Lim, Y.-J. Jung, H. Choi, S.-W. Lee, and C.-H. Im, “De elopmen
o an SSVEP-based BCI spelling sys em adop ing a QWERTY-s yle LED keyboa d,”
J. Neu osci. Me hods, ol. 208, no. 1, pp. 59–65, Ap . 2012, doi:
10.1016/j.jneume h.2012.04.011.
[4] A. C. Lopes, G. Pi es, and U. Nunes, “Assis ed na iga ion o a b ain-ac ua ed
in elligen wheelchai ,” Rob. Au on. Sys ., ol. 61, no. 3, pp. 245–258, Ma . 2013,
doi: 10.1016/j. obo .2012.11.002.
[5] T. Ca lson and J. R. Millán, “B ain-con olled wheelchai s: a obo ic a chi ec u e,”
IEEE Rob. Au om. Mag., ol. 20, no. 1, pp. 65–73, Ma . 2013, doi:
10.1109/MRA.2012.2229936.
[6] J. L. Collinge , B. Wodlinge , J. E. Downey, W. Wang, E. C. Tyle -Kaba a, D. J.
Webe , e al., “High pe o mance neu op os he ic con ol by an indi idual wi h
e aplegia,” Lance , ol. 381, no. 9866, pp. 557–564, Feb. 2013, doi:
10.1016/S0140-6736(12)61816-9.
[7] G. Huang, Z. Zhao, S. Zhang, Z. Hu, J. Fan, M. Fu, J. Chen, Y. Xiao, J. Wang, and
G. Dan, “Disc epancy be ween in e - and in a-subjec a iabili y in EEG-based
mo o image y b ain-compu e in e ace: E idence om mul iple pe spec i es,”
F on . Neu osci., ol. 17, p. 1122661, 2023, doi: 10.3389/ nins.2023.1122661.
[8] J. Ma, B. Yang, W. Qiu, Y. Li, S. Gao, and X. Xia, “A la ge EEG da ase o s udying
c oss-session a iabili y in mo o image y b ain-compu e in e ace,” Sci. Da a, ol.
9, no. 1, 2022, doi: 10.1038/s41597-022-01647-1
[9] A. Piszcz, I. Rojek, and D. Mikołajewski, “Impac o Vi ual Reali y on B ain–
Compu e In e ace Pe o mance in IoT Con ol—Re iew o Cu en S a e o
Knowledge,” Appl. Sci., ol. 14, no. 22, p. 10541, 2024, doi: 10.3390/app142210541.
[10] A. Palumbo, V. G amigna, B. Calab ese, and N. Ielpo, “Mo o -Image y EEG-Based
BCIs in Wheelchai Mo emen and Con ol: A Sys ema ic Li e a u e Re iew,”
Senso s, ol. 21, no. 18, p. 6285, Sep. 2021, doi: 10.3390/s21186285.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 69
[11] T. O. Zande , M. Lehne, K. Ihme, S. Ja ze , J. Co eia, C. Ko he, B. Pich , and F.
Nijboe , “A d y EEG-sys em o scien i ic esea ch and b ain-compu e in e aces,”
F on . Neu osci., ol. 5, p. 53, May 2011, doi: 10.3389/ nins.2011.00053.
[12] T. O. Zande , L. M. And eessen, A. Be g, M. Bleuel, J. Pawli zki, L. Zawallich, L. R.
K ol, and K. G amann, “E alua ion o a d y EEG sys em o applica ion o passi e
b ain-compu e in e aces in au onomous d i ing,” F on . Hum. Neu osci., ol. 11, p.
78, 2017, doi: 10.3389/ nhum.2017.00078.
[13] C. Guge , G. K ausz, and G. Edlinge , “B ain-compu e in e ace con ol wi h d y
EEG elec odes,” 2011.
[14] M. Spüle , “A high-speed b ain-compu e in e ace (BCI) using d y EEG elec odes,”
PLoS ONE, ol. 12, no. 2, p. e0172400, 2017, doi: 10.1371/jou nal.pone.0172400.
[15] H. Hin ichs, M. Scholz, A. K. Baum, J. W. Y. Kam, R. T. Knigh , and H. Heinze,
“Compa ison be ween a wi eless d y elec ode EEG sys em wi h a con en ional
wi ed we elec ode EEG sys em o clinical applica ions,” Sci. Rep., ol. 10, no. 1,
2020, doi: 10.1038/s41598-020-62154-0.
[16] Chaudhu i, P. K. R., & Ondo, W. (2010). “Mo emen diso de s in clinical p ac ice.
Sp inge ”. h ps://books.google.es/books?id=bW8sPxMAG3AC
[17] M. N. Ha ch, T. R. Cushing, G. D. Ca lson, and E. Y. Chang, “Neu opa hic pain and
SCI: Iden i ica ion and ea men s a egies in he 21s cen u y,” J. Neu ol. Sci., ol.
384, pp. 75–83, Jan. 2018, doi: 10.1016/j.jns.2017.11.018.
[18] R. Shiao and C. A. Lee-Kubli, “Neu opa hic Pain A e Spinal Co d Inju y:
Challenges and Resea ch Pe spec i es,” Neu o he apeu ics, ol. 15, no. 3, pp. 635–
653, Jul. 2018, doi: 10.1007/s13311-018-0633-4.
[19] E. M. Hagen and T. Rekand, “Managemen o Neu opa hic Pain Associa ed wi h
Spinal Co d Inju y,” Pain The ., ol. 4, no. 1, pp. 51–65, Jun. 2015, doi:
10.1007/s40122-015-0033-y.
[20] G. A. Ligh , L. E. Williams, F. Minow, J. Sp ock, A. Rissling, R. Sha p, N. R.
Swe dlow, and D. L. B a , “Elec oencephalog aphy (EEG) and e en - ela ed
po en ials (ERPs) wi h human pa icipan s,” Cu . P o oc. Neu osci., ol. Chap e 6,
pp. Uni 6.25.1–24, Jul. 2010, doi: 10.1002/0471142301.ns0625s52. PMID:
20578033; PMCID: PMC2909037.
[21] A. Rayi and N. I. Mu , "Elec oencephalog am," in S a Pea ls [In e ne ], T easu e
Island (FL): S a Pea ls Publishing, 2024 Jan–. A ailable om:
h ps://www.ncbi.nlm.nih.go /books/NBK563295/.

Pag. 70 Repo
[22] L. F. Haas, “Hans Be ge (1873–1941), Richa d Ca on (1842–1926), and
elec oencephalog aphy,” J. Neu ol. Neu osu g. Psychia y, ol. 74, no. 1, p. 9, Jan.
2003, doi: 10.1136/jnnp.74.1.9. PMID: 12486257; PMCID: PMC1738204.
[23] M. Tudo , L. Tudo , and K. I. Tudo , “Hans Be ge (1873–1941)–po ijes
elek oence alog a ije [Hans Be ge (1873–1941)– he his o y o
elec oencephalog aphy],” Ac a Med C oa ica, ol. 59, no. 4, pp. 307–313, 2005.
C oa ian. PMID: 16334737.
[24] M. Roohi-Azizi, L. Azimi, S. Heysiea alab, and M. Aamid a , “Changes o he b ain’s
bioelec ical ac i i y in cogni ion, consciousness, and some men al diso de s,” Med.
J.Islam. Repub. I an, ol. 31, no. 1, p. 53, 2017.
[25] P. Campisi, D. La Rocca, and G. Sca ano, “EEG o au oma ic pe son ecogni ion,”
Compu e (Long. Beach. Cali )., ol. 45, no. 7, pp. 87–89, 2012.
[26] R. Lesse and T. W. Pic on, “Ame ican Elec oencephalog aphic Socie y Guidelines
o S anda d Elec ode Posi ion Nomencla u e1,” J. Clin. Neu ophysiol., ol. 8, no. 2,
pp. 200–202, 1991.
[27] N. Fold a y-Schae e and M. M. G igg-Dambe ge , “Iden i ying in e ic al and ic al
epilep ic ac i i y in polysomnog ams,” Sleep Med. Clin., ol. 7, no. 1, pp. 39–58,
2012.
[28] G. Reynolds and J. Richa ds, “Co ical sou ce localiza ion o in an cogni ion,” De .
Neu opsychol., ol. 34, no. 3, pp. 312–329, 2009.
[29] N. T iana-Guzman, A. D. O juela-Cañon, A. L. Ju inico, O. Mendoza-Mon oya, and
J. M. An elis, “Decoding EEG hy hms o line and online du ing mo o image y o
s anding and si ing based on a b ain-compu e in e ace,” F on . Neu oin o m., ol.
16, 2022, doi: 10.3389/ nin .2022.961089.
[30] F. Lo e and C. Guan, “Regula izing common spa ial pa e ns o imp o e BCI
designs: uni ied heo y and new algo i hms,” IEEE T ans. Biomed. Eng., ol. 58, pp.
355–362, 2011, doi: 10.1109/TBME.2010.2082539.
[31] M. H. Lee, O. Y. Kwon, Y. J. Kim, H. K. Kim, Y. E. Lee, J. Williamson, e al., “EEG
da ase and OpenBMI oolbox o h ee BCI pa adigms: an in es iga ion in o BCI
illi e acy,” Gigascience, ol. 8, pp. 1–16, 2019, doi: 10.1093/gigascience/giz002.
[32] E. V. Bob o a, V. V. Reshe niko a, A. A. F olo , and Y. P. Ge asimenko, “Use o
imagina y lowe limb mo emen s o con ol b ain-compu e in e ace sys ems,”
Neu osci. Beha . Physiol., ol. 50, pp. 585–592, 2020, doi: 10.1007/s11055-020-
00940-z.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 71
[33] V. Asanza, E. Peláez, F. Loayza, L. L. Lo en e-Ley a, and D. H. Pelu o-O dóñez,
“Iden i ica ion o lowe -limb mo o asks ia b ain-compu e in e aces: a opical
o e iew,” Senso s, ol. 22, pp. 1–24, 2022, doi: 10.3390/s22052028.
[34] M. Rod íguez-Uga e, E. Iáñez, M. O íz, and J. M. Azo ín, “Pe sonalized o line and
pseudo-online BCI models o de ec pedaling in en ,” F on . Neu oin o m., ol. 11, p.
45, 2017, doi: 10.3389/ nin .2017.00045.
[35] A. Mo a-Co es, N. Manyako , N. Chume in, and M. Van Hulle, “Language model
applica ions o spelling wi h b ain-compu e in e aces,” Senso s (Basel), ol. 14, no.
4, pp. 5967–5993, 2014.
[36] J. J. Shih, D. J. K usienski, and J. R. Wolpaw, “B ain-compu e in e aces in
medicine,” Mayo Clin. P oc., ol. 87, no. 3, pp. 268–279, 2012.
[37] E. M. Smi h, M. L. To o He nandez, I. D. Ebuenyi, *e al.*, “Assis i e echnology use
and p o ision du ing COVID-19: esul s om a apid global su ey,” *In . J. Heal h
Policy Manag.*, ol. 11, no. 6, pp. 747–756, 2022, doi: 10.34172/ijhpm.2020.210.
[38] Ce adini, M., Lassi, M., Losanno, E., e al. (2023). Feasibili y and Accu acy o a D y
and Wi eless EEG Helme o Uppe Limb Mo o Image y-Based B ain-Compu e
In e aces. IEEE In e na ional Con e ence on Me ology o eX ended Reali y,
A i icial In elligence, and Neu al Enginee ing (Me oXRAINE).
h ps://doi.o g/10.1109/METROXRAINE58569.2023.1040554​:con en Re e e
nce[oaici e:2]{index=2}.
[39] Al ahe i, H., Muhammad, G., Alsulaiman, M., e al. (2023). Deep lea ning echniques
o classi ica ion o elec oencephalog am (EEG) mo o image y (MI) signals: A
e iew. Neu al Compu ing and Applica ions, 35, 14681–14722.
h ps://doi.o g/10.1007/s00521-021-06352-
5​:con en Re e ence[oaici e:3]{index=3}.
[40] Palumbo, A., G amigna, V., Calab ese, B., & Ielpo, N. (2021). Mo o -Image y EEG-
Based BCIs in Wheelchai Mo emen and Con ol: A Sys ema ic Li e a u e Re iew.
Senso s, 21(18), 6285.
h ps://doi.o g/10.3390/s21186285​:con en Re e ence[oaici e:1]{index=1}.
[41] W. Huang, X. Liu, W. Yang, Y. Li, Q. Sun, and X. Kong, “Mo o Image y EEG Signal
Classi ica ion Using Dis inc i e Fea u e Fusion wi h Adap i e S uc u al LASSO,”
Senso s (Basel), ol. 24, no. 12, p. 3755, Jun. 2024, doi: 10.3390/s24123755. PMID:
38931540; PMCID: PMC11207242.
[42] X. Wang, X. Dai, Y. Liu, X. Chen, Q. Hu, R. Hu, and M. Li, “Mo o image y
elec oencephalog am classi ica ion algo i hm based on join ea u es in he spa ial
Pag. 72 Repo
and equency domains and ins ance ans e ,” F on . Hum. Neu osci., ol. 17, 2023,
doi: 10.3389/ nhum.2023.1175399.
[43] N. K. Al-Qazzaz, Z. A. A. Alyasse i, K. H. Abdulka eem, N. S. Ali, M. N. Al-Mhiqani,
and C. Guge , "EEG ea u e usion o mo o image y: A new obus amewo k
owa ds s oke pa ien s ehabili a ion," Compu e s in Biology and Medicine, ol. 137,
2021, doi: 10.1016/j.compbiomed.2021.104799.
[44] W. Yi, S. Qiu, H. Qi, L. Zhang, B. Wan, and D. Ming, "EEG ea u e compa ison and
classi ica ion o simple and compound limb mo o image y," Jou nal o
Neu oEnginee ing and Rehabili a ion, ol. 10, no. 106, 2013, doi: 10.1186/1743-
0003-10-106.
[45] X. Geng, D. Li, H. Chen, P. Yu, H. Yan, and M. Yue, "An imp o ed ea u e ex ac ion
algo i hm o EEG signals based on mo o image y b ain-compu e in e ace,"
Alexand ia Enginee ing Jou nal, ol. 61, no. 11, pp. 4807–4820, 2022, doi:
10.1016/j.aej.2021.10.034.
[46] X. Zhao, D. Liu, L. Ma, Q. Liu, K. Chen, S. Xie, and Q. Ai, "Deep CNN model based
on se ial-pa allel s uc u e op imiza ion o ou -class mo o image y EEG
classi ica ion," Biomedical Signal P ocessing and Con ol, ol. 72, 2022, doi:
10.1016/j.bspc.2021.103338.
[47] W. Huang, X. Liu, W. Yang, Y. Li, Q. Sun, and X. Kong, "Mo o Image y EEG Signal
Classi ica ion Using Dis inc i e Fea u e Fusion wi h Adap i e S uc u al LASSO,"
Senso s (Basel), ol. 24, no. 12, p. 3755, Jun. 2024, doi: 10.3390/s24123755. PMID:
38931540; PMCID: PMC11207242.
[48] X. Wang, X. Dai, Y. Liu, X. Chen, Q. Hu, R. Hu, and M. Li, "Mo o image y
elec oencephalog am classi ica ion algo i hm based on join ea u es in he spa ial
and equency domains and ins ance ans e ," F on ie s in Human Neu oscience,
ol. 17, 2023, doi: 10.3389/ nhum.2023.1175399.
[49] Y. Wang, X. Gao, S. Gao, & Z. Kuang, “Common Spa ial Pa e n Me hod o
Channel Selec ion in Mo o Image y Based B ain-Compu e In e ace,” P oc. IEEE
Eng. Med. Biol. Soc. Con ., pp. 5392–5395, 2005. doi:
10.1109/IEMBS.2005.1615701.
[50] S. Oma i, A. Oma i, & M. Abde ahim, “Mul iple angen space p ojec ion o mo o
image y EEG classi ica ion,” Appl. In ell., ol. 53, pp. 21192–21200, 2023. doi:
10.1007/s10489-023-04551-2.
[51] M. R. Nuwe , “10-10 elec ode sys em o EEG eco ding,” Clin. Neu ophysiol., ol.
129, no. 5, p. 1103, May 2018.
Gene a ion o eal- ime con ol commands om EEG signals Pag. 73
[52] S. Pa k, J. Ha, D. H. Kim, and L. Kim, “Imp o ing Mo o Image y-Based B ain-
Compu e In e ace Pe o mance Based on Senso y S imula ion T aining: An
App oach Focused on Poo ly Pe o ming Use s,” F on . Neu osci., ol. 15, no.
No embe , pp. 1–12, 2021.
[53] N. Pad ield, J. Zabalza, H. Zhao, V. Mase o, and J. Ren, “EEG-based b ain-
compu e in e aces using mo o -image y: Techniques and challenges,” Senso s
(Swi ze land), ol. 19, no. 6, pp. 1–34, 2019.
[54] A. Saibene, M. Caglioni, S. Co chs, & F. Gaspa ini, “EEG-Based BCIs on Mo o
Image y Pa adigm Using Wea able Technologies: A Sys ema ic Re iew,” Senso s,
ol. 23, no. 5, p. 2798, Ma . 2023. doi: 10.3390/s23052798. PMID: 36905004;
PMCID: PMC10007053.
[55] C. Ko he, S. Y. Shi azi, T. S enne , D. Medine, C. Boulay, M. I. G i ich, T. Mullen, A.
Delo me, and S. Makeig, “The Lab S eaming Laye (LSL): A so wa e sys em o
mul imodal eal- ime da a acquisi ion, synch oniza ion, and s o age in neu oscience
applica ions,” bioRxi , 2024. doi: 10.1101/2024.02.13.580071.
[56] h ps://labs eaminglaye . ead hedocs.io/in o/use _guide.h ml
[57] h ps://www.psychopy.o g/
[58] J. W. Pei ce, “PsychoPy—Psychophysics so wa e in Py hon,” J. Neu osci. Me hods,
ol. 162, no. 1–2, pp. 8–13, 2007, doi: 10.1016/j.jneume h.2006.11.017.
[59] S. Pa naik, M. Dash, and S. K. Sabu , “DWT-based ea u e ex ac ion and
classi ica ion o mo o imagina y EEG signals,” 2016 In . Con . Sys . Med. Biol.
ICSMB 2016, no. Janua y, pp. 186–201, 2017.
[60] P. Ri hwik, V. K. Benzy, and A. P. Vinod, “High accu acy decoding o mo o image y
di ec ions om EEG-based b ain compu e in e ace using il e bank spa ially
egula ised common spa ial pa e n me hod,” Biomed. Signal P ocess. Con ol,
ol.72, no. PA, p. 103241, 2022.
[61] J. Kalche , D. Flo zinge , C. Neupe , S. Gölly, and G. P u schelle , “G az b ain-
compu e in e ace II: Towa ds communica ion be ween humans and compu e s
based on online classi ica ion o h ee di e en EEG pa e ns,” Med. Biol. Eng.
Compu ., ol. 34, no. 5, pp. 382–388, 1996.
[62] C. B unne , R. Leeb, G. R. Mülle -Pu z, A. Schlögl, and G. P u schelle , “BCI
Compe i ion 2008-G az da a se A Expe imen al pa adigm.”
[63] A. Suwanna a , S. Pan-ngum, and P. Is asena, “Compa ison o EEG measu emen