# Classification of Upper Arm Movements from EEG signals using Machine
Learning with ICA Analysis

Pranali Kokate Sidharth Pancholi Amit M. Joshi Electronics & Commu. Eng.
Electronics & Commu. Eng. Electronics & Commu. Eng. MNIT, Jaipur, India. MNIT,
Jaipur, India. MNIT, Jaipur, India<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

The Brain-Computer Interface system is a profoundly developing area of
experimentation for Motor activities which plays vital role in decoding
cognitive activities. Classification of Cognitive-Motor Imagery activities
from EEG signals is a critical task. Hence proposed a unique algorithm for
classifying left/right-hand movements by utilizing Multi-layer Perceptron
Neural Network. Handcrafted statistical Time domain and Power spectral density
frequency domain features were extracted and obtained a combined accuracy of
96.02%. Results were compared with the deep learning framework. In addition to
accuracy, Precision, F1-Score, and recall was considered as the performance
metrics. The intervention of unwanted signals contaminates the EEG signals
which influence the performance of the algorithm. Therefore, a novel approach
was approached to remove the artifacts using Independent Components Analysis
which boosted the performance.Following the selection of appropriate feature
vectors that provided acceptable accuracy. The same method was used on all
nine subjects. As a result, intra-subject accuracy was obtained for 9 subjects
94.72%. The results show that the proposed approach would be useful to
classify the upper limb movements accurately.

##  1 Introduction

Neurotechnologists are increasingly developing methods and means to integrate
brains and machines, enabling a myriad of real-time applications. The most
significant of them are brain-computer interfaces (BCIs), which can provide
alternative modes of communication and control of external equipment even in
severe situations of impairment. Presently, there has been extensively
research work is going in the deployment of external instrument control
application platforms using real-time BCIs. EEG [1] is now the most accepted
brain signal for practical execution of BCIs because of its long-lasting
usability, high temporal resolution, ease of installation, and low prices.
Human-brain interface is advanced to the point that it can do activities and
achieve functional goals which were previously unlikely to be performed. In
this field, research is developing in all aspects, be it the large scope of
EEG-based BCI [2] controls, the technological depth involved, and its
usability for impaired people and the rest of the population.

In the field of brain controlled applications, the publication of research has
not only addressed medical requirements, but also addressed the demands of
healthy users in their everyday lives. As briefed in Figure 1, the current
growing BCI research comprises user-friendly EEG headsets and EEG signal
analytics which have allowed BCI applications to be expanded to encompass
automation, entertainment, emotion detection, medical automation diagnostics,
neurorehabilitation and more. Every day, new and creative scientific
advancements are being investigated in order to improve the lives of millions
of people all over the world. Many researchers have developed EEG-based BCI
systems to overcome the problem. An Electroencephalogram is created by
collecting and storing electrical signals taken from the brain. EEG assists in
deducing useful information about brain activities.

Figure 1: Various BCI-applications in different areas.

In general, some BCI techniques depend upon peoples’ capacity to acquire
command over their own activity in the brain through biofeedback, whilst other
use classification algorithms that identify EEG sequence associated to certain
voluntary objectives. The first experiments to allow individuals using
feedback through their own activity in the brain were made in the 1960s. The
technology allows people to develop voluntary control of their brain patterns.
It has been observed that following training by EEG biofeedback, volunteers
can identify their own alpha and mu frequency bands. As a result, BCI research
is interdisciplinary in nature, incorporating numerous domains such as brain
physiology, cognitive neuroscience, electrical equipment, data transmission,
data processing, pattern classification, artificial intelligence [3], and so
on. BCI system helps to decode the brain instructions and thus enabling the
control of artificial arms particularly for the people enduring brain stroke,
spinal injury, motor disabilities, and other injuries which lead to lost
feedback mechanism between the brain and other parts of the body muscles.
Furthermore, a BCI uses brain impulses to translate EEG signals into
instructions for controlling external equipment such as desktops, smartphones,
wheelchairs, and prostheses.

###  1.1 Motivation

Amputation of the upper arm results in severe impairment [4]. According to
Dinesh Mohan’s report “Amputee in India," an estimated 4,24,000 persons in
India had arm amputations at or above the wrist. The large percentage of arm
amputations are caused due to trauma, such as workplace mishap or car
accidents. People who have suffered a spinal cord injury, upper body
paralysis, or a stroke lose the communication between the brain and the
muscles tissues leading to arm dis-mobility. Today, BCI system has the
opportunity to profoundly improve the quality of life of those with upper body
disabilities.

To resolve the problem many have developed an EEG-based BCI system to
accomplish reliable performance with active hand-crafted feature extraction of
EEG signal, but its clinical and cost consequences remain insufficient. Many
scholars have attempted to improve accuracy in recent years by employing a
variety of strategies. Since EEG recordings consist of a considerable quantity
of data, signal interpretation and processing are critical. The mathematical
modeling of EEG signals, as well as the extensive use of machine learning
algorithms, are critical in the processing of this data and decision building.
The paper covers the basic knowledge with cutting-edge approach to design a
unique algorithm for the categorization of upper limb movements.

###  1.2 Current Challenges

The interaction among EEG sequence and computer intentions is a machine-
learning challenge because the model must learn how to understand a specified
EEG sequence. As with other learning issues, a training process is required to
tackle this issue, wherein the participant is required to perform pre-
specified mental processes (MAs) and a ML model is now in command of
retrieving the affiliated EEG sequence. After the training process is
complete, the participant must be able to monitor the machine’s activities
with his thoughts. There are various issues with EEG-based BCI devices. One
such issue is while recording signals. They are vulnerable to noise and are
frequently polluted by artifacts. Similarly, EEG collection requires a costly
setup, and when recording, they are interfaced with a variety of signals such
as ocular signals, myoelectric signals, power line signals, and so on. The
removal of them is necessary and requires a proper understanding of the
signal. Feature extraction is difficult for motor Imagery tasks. There are
rapid fluctuations in EEG data, and validation is a difficult challenge.
Understanding and decoding of EEG signal is a critical task.

###  1.3 Research Contributions

The main research contributin have been derived as follows:

  * •

“EEG-based BCI system"[1] is developed for upper Limb Amputees, stroke
patients, and persons enduring motor disabilities. The performance has been
validated on publicly available data set having motor imagery and motor
execution areas. The identification and extraction of relevant signals from
the raw EEG data is achieved with efficient methodology.

  * •

The effective EEG sensor configurations for various BCI applications has been
selected from non-invasive techniques. Moreover, the brain structure has been
studied for effective electrode selection.

  * •

The efficient pre-processing methodology has been adapted for removing
artifacts and cleaning signals.

  * •

The novel classification based Machine Learning model has been proposed for
precise activities identification.

  * •

The deep learning-based framework is designed for an EEG-based BCI system.

###  1.4 Study of Hand Movements based on EEG and EMG approach

Last 20 years, the advancement of brain–computer interfaces (BCI) has
permitted interaction or command over external technology such as computers
and artificial limbs using the electrical signals of the human neurological
system. In a typical BCI setup, the user is directed to visualise movement of
various body parts (for example, right hand or leg motions), and the machine
develops to detect distinct patterns of the synchronously collected EEG
signals. The majority of the signal processing research for the advancement of
EEG-based BCI systems has been designed to extract highly advanced features
from the EEGs and refining/reducing the parameter dimensionality.
Electromyography (EMG) data have primarily been employed in both
rehabilitation and the design of prosthesis and haptic devices [5, 6]. As a
result, EMG remains the most widely used and successful means of linking
humans to machines. BCI (also known as brain–machine interfacing (BMI)) is a
road-map that falls under the umbrella of human–computer interface (HCI),
which connects cognition to actions.

Individuals with serious neuromuscular problems, like brain stem damage,
amyotrophic lateral sclerosis, stroke, and cerebral palsy, may benefit from
BCI systems based on EEG. The EEG signal recording for an upper limb task has
been examined in detailed manner [7]. Electrodes are implanted on the
subject’s head in considerable format to record. To ensure effective
recording, the impedance between the electrode plates and the scalp is
reduced. In 3D space, the person conducted center-out right-handed reaching
action and images (left, right, forward, backward, up, and down). The
participants sat on chairs in front of a desk. A display monitor was set
roughly 60 cm away from the patient on the desk to provide a convenient
display distance. Visual signals in the form of a clue for rest and relevant
navigational signals for reaching activities were displayed. The experiment
was divided into two sessions: motor execution and visualisation. The
individuals performed the motor movement, such as center-out arm extending in
one of the directions, during the motion execution. During the imagery
session, the participants were just required to perform motor imagery.

The P300 wave is a form of Event-Related Potential (ERP) that is thought to be
prominent in making decision, which normally occurs between 250 and 500
milliseconds after the start of a visual clue. Simple Reaction Time (SRT),
similar to the P300 wave, reflects the time lag between visual clue and
reaction. Following the reception of a visual input in the visual cortex,
visual data is conveyed through two distinct channels, namely the ventral and
the dorsal streams. The ventral stream finally reaches the temporal cortex,
which is responsible for picture identification. With the aid of relevant
memory, the visual input is therefore utilized to form the connection between
experiment commands and completing L/R arm movements.

The acquisition of myoelectrical signals are very important [8]. In most
situations, two sensing surfaces (or EMG electrodes) are bipolarly implanted
on the skin. To achieve the expected potential signal, the EMG electrode
should be positioned correctly, and its direction across the muscle is
critical [9]. Surface EMG electrodes should be positioned along of the
muscle’s lengthwise centerline, in between motor unit and the tendon insertion
[10]. The spacing between the electrodes or detecting surfaces should be no
more than 1-2 cm. The electrodes’ longitudinal axis (which travels across both
sensing surfaces) should be proportional to the extent of fibers. Individuals
who have had their left hand amputated should glance at their right hand to
replicate the movements. Despite the ease of acquisition of EMG Signals for
Upper limb movement [11], EEG-based approaches may identify brain activity
modulations that correspond with visual inputs, gaze angle, intentional
intents, and cognitive processes. These benefits prompted the creation of
numerous types of EEG-based systems, which varied based on the cortical
regions monitored, the extracted EEG characteristics, and the sensory
methodology delivering input to participants.

###  1.5 Techniques in BCI: Investigation of EEG and its Counterparts

Differently abled individuals interact with the outside world (humans and
assisting technologies) via brain-computer interface technology, which
translates human neural activity into command signals for neurofeedback and
monitoring purposes. Bioelectrical recordings, which are generated by
analyzing electrophysiological or hemodynamic responses, are important
clinical methods for the construction of the both BCIs. The electrical and
hemodynamic neural activities are collected directly from the cerebral cortex,
either invasively, partially invasively, or noninvasively, to build BCI
systems. Invasive and partially invasive BCI signal acquisition requires the
neurosurgical implantation of micro-electrodes inside the cerebral cortex or
underneath the scalp or the surface of the cerebrum. The following subsections
discusses about the many forms of invasive and non-invasive neuroimaging
methods.

####  1.5.1 Invasive BCI Techniques

  1. 1.

Electrocorticography (ECoG)
ECoG measures brain responses by measuring the electrical activity of neurons
on the cortex’s surface following micro-electrode array implantation. Because
signals are recorded from more proximal and concentrated areas of the brain,
the resulting signals have higher temporal-spatial resolution, signal
amplitude, and spectral bandwidth than noninvasive EEG data. These acquired
signals have high-amplitude signal, less noisy and absent of muscular motion
artifacts. ECoG signal collection has already been used to build a variety of
BCI systems. By studying P300 ERPs and evaluating alpha, beta, or gamma sub-
bands, a team of experts was able to correctly categorise separate voluntary-
involuntary motor motions, cursor control, or operate robotic arm.

  2. 2.

Intracortical Neuron Recording
The electrical activity of neurons is acquired by the intracortical neuron
recording using the single or array of sensors placed in the cortex, i.e.
extremely near to the signal origin. It is an invasive approach which may
produce brain signals with extremely high temporal and spatial resolution.
However, due to higher brain tissue resistance during signal transmission from
deep-implanted electrode to recording equipment, it could suffer from neuron
death or the incorporation of a noise component.

####  1.5.2 Non-Invasive BCI Techniques

Noninvasive BCI data collection measures,the brain activity using exterior
surface electrodes deployed over the scalp of the subject. EEG, MEG, fMRI,
fNIRS, PET, SPECT, and a variety of other noninvasive neuroimaging methods are
employed in BCI research.

  1. 1.

Magnetoencephalography (MEG)
MEG is a noninvasive neurological recording technique that captures the
magnetic activities produced by natural sources like the electrical impulses
of neurons in the brain. Magnetic fields are generated by the passage of
intra-cellular currents, which causes magnetic induction. A precise
superconducting quantum interference device (SQUID) is used to detect and
record magnetic signals in MEG. These sensors are capable of capturing mynute
magnetic fluctuations caused by neuronal rhythms in the brain. MEG captures
magnetic fields that are less contaminated and deteriorated than EEG
electrodes that records electric fields. Despite these benefits and its close
association with EEG, MEG is not a popular brain imaging mode for BCI design.
The main drawback is its non-portability, cost, and complex acquisition
mechanism. Furthermore, MEG signal analysis approaches are primarily concerned
with the characterisation of stimulus-induced neural activity rather than
motor activities.

  2. 2.

Functional Magnetic Resonance Imaging
fMRI is yet another non-invasive technique of brain scanning method that uses
electromagnetic fields to detect and record. The entire procedure is based on
the idea that engagement of any brain area for specific activity is connected
with increased blood flow in the region of interest (ROI). As a result, fMRI
is utilised to assess oxygen levels in blood flow across active brain regions
with changes in local cerebral blood flow and oxygen levels in blood flow.
fMRI has a relatively poor temporal resolution of roughly 1–2 sec. It also
addresses the issue of 3–6 sec physiological delay. As a result, fMRI-BCIs are
unsuitable for high-speed BCI interactions, which are required in practically
all nonclinical applications. Furthermore, the pricey, non-portable, and heavy
MRI scanners are prone to electromagnetic disturbance and dynamic artifacts.

  3. 3.

Functional Near-Infrared Spectroscopy (fNIRS)
The fNIRS is a noninvasive brain wave collection method that uses near-
infrared light to quantify alterations in localised cerebral metabolism while
performing particular neural activity. It is based on optical spectroscopy. To
measure blood flow, near-infrared light can permeate the brain skull up to a
depth of about 1–3 cm beneath the cerebrum surface. The fNIRS measuring
instrument is less costly and transportable, however it has limited brain
scans features. This optical imaging approach cannot reach the inner cortical
areas. It also has a delay in receiving hemo-dynamic responses corresponding
to specific neural activity. Motion artifacts caused by head movements and
obstruction caused by hair may further degrade signal quality and thus the
performance of designed BCI.

  4. 4.

Electroencephalography (EEG)
EEG, which was first reported in 1929 by a German psychiatrist named Berger H.
Uber, includes the capturing of brain electrical impulses by deploying sensors
across various scalp areas. An electrical magnitude (microvolts) vs. period
records are obtained by nonpolarized and interference-free sensors. They are
all positioned over the scalp in such a way that they must acquire brain
response from all of the cerebrum’s regions, including frontal, temporal,
parietal, and occipital. Electro-headcaps with electrodes mounted on them are
frequently used to obtain multi-channel EEG recordings with a huge number of
sensor pairs. EEG is a prominent noninvasive neurodiagnostic technique for
monitoring neural activity with high temporal resolution, or the capacity to
detect changes in neural activity over a short period of time. Conversely,
because the amplitude of neural electrical impulses deteriorates during
transmission from inbuilt cortical areas to scalp areas, it performs poorly in
terms of spatial resolution and SNR. BCI scientists are attempting to lower
the number of sensors necessary to collect neural activity yet maintaining a
high SNR.

Additionally, ECoG and intra-cortical recordings depend on the placement of
micro-electrode grids underneath the cerebrum and inside the cortical areas of
the brain, respectively. Magneto-encephalography measures magnetic fields
associated with particular brain actions. While fMRI measures minor
fluctuations in blood oxygen levels caused by associated neural actions.
Likewise, fNIRS assesses cellular function in the cortical region of the brain
by measuring the hemo-dynamic optical response. Researchers have successfully
used all of these neuro-imaging modes to construct BCIs. ECoG and
intracortical recordings, on the other hand, are intrusive techniques of
signal collection that need embedded electrodes. The dependability, safety in
surgical operations, consistency of function, and ease of these approaches are
key considerations. MEG and fMRI are linked with extremely strong magnetic
fields and are limited by the highly costly and immobility of big acquisition
devices. In addition, the brain waves are collected with a limited temporal
resolution. Due to these constrains, these techniques are unsuitable for high-
performance main BCI control systems when evaluated to EEG, a noninvasive
neuro-imaging technique with excellent temporal resolution.

###  1.6 Organization of Paper

This study has aided in the improvement of each main component involved in
Figure 2 including Proper channel selection, pre-processing, Artifact removal,
and new categorization method for motor activities. Python-mne[12] package was
used to avail the knowledge regarding the Brain signals. Also explored the
EEGLAB toolkit available in MATLAB to understand the concept of source
localization.

Figure 2: EEG Based BCI architecture

  * •

Section 2 discusses the various state-of-the-art for EEG signal based on BCI.
This chapter highlights the various forms of machine learning architecture and
data sets for motor imagery and execution class. It also cover all the prior
methods for EEG data processing, signal segmentation, and feature extraction.
Various architectures are studied for deep learning analysis.

  * •

Section 3 elaborates background theory related proposed work. It talked about
frequency waves related with the brain, as well as various forms of noises.
The mathematics underlying ICA-Independent component analysis has been also
explored.

  * •

Section 4 emphasis on a publicly available dataset for motor activities. The
sectiion also covers: 1) the selection of channels is a key task that must be
done correctly. 2) Pre processing is required prior to artefact removal, which
is covered in the length of this chapter. 3) Feature extraction is an
essential step. 4) The proposed model as well as deep learning architectures
are explained.

  * •

Section 5 describes the results along with comparison with state of art work.
The conclusion and future work is discussed in Section 6.

##  2 Literature Review

In this section, various available data sets related to motor imagery and
execution activities are discussed along with several features associated with
EEG signals. Further, It also covers the different Pre-processing technique
and Various classification algorithms from machine learning to deep learning
[13].

The paper introduced an algorithm that classifies for movement of left and
right hands [14]. They considered 9 volunteers for their study. Each
individual would go through a series of 30 trials of elbow and shoulder
movement. The individuals were given visual stimuli to stimulate their
imagination. The experiment lasted 8 seconds in total with stimulus was
delivered at 1sec. Pre-processing was carried using MATLAB software. An IIR
filter with a ripple factor of 1 and a stop band attenuation value of 60 was
adopted. The signal was then routed through a band pass filter with a
frequency range of 8-30 Hz. Only two channels associated with motor cortex and
pre-motor cortex were considered. They extracted entropy and power spectral
density and utilised SVM for classification, achieving an accuracy of 91.25
percent for four classes.

The paper [15] investigated the connectivity pattern between brain areas
during MI task. From the study, they obtained features such as clustering
coefficient, Path Length, Efficiency, Modularity, Betweenness Centrality and
Eigenvectors. They considered the publicly available data set called BCI
Competition IV. The data set consists of 9 test volunteers who were instructed
to visualize movement of their hands, feet, and tongue. The mental task was
carried out with the help of visual cue. Signals were pre-processed using
techniques such as a 50 Hz filter followed by a bandpass filter. These
attributes were transformed into an image for further classification by
repeating the values. The 2D image was further processed using CNN and the
model provided an accuracy of 96.69% for binary classification and multi class
classification had accuracy of 86%.

In paper [16], they proposed a model to categorize right and left hand imagery
movement. There were a total of 80 sets in the data set. They employed 10
channels for their experiment, the visual stimulus was activated every 2
seconds, and the experiment lasted 10 seconds. ICA was used to eliminate
extraneous signals. Following data cleaning, common spatial pattern
characteristics were retrieved. The SVM optimization strategy based on the
Genetic Algorithm was used and achieved an average accuracy of 95%.

The non-linear feature extraction technique related to Higher Order Spectra
(HOS) was retrieved in the paper [17]. They conducted an experiment with
single participant performing random left and right imagined hand and leg
movement using a visual stimulus. For acquisition, 18 channels were considered
for this experimentation. They calculated the Maximum and Entropy value for
both magnitude and phase values of HOS spectra. SVM was utilized as a
classifier, and average multi-class accuracy was 79.14%.

In paper [18], they examined the EEG signals associated to the MI task for
hand movement (controlling hand) in the left and right motions. The PLV (Phase
Lock Value) characteristics of the most important EEG sensor combinations in
the specified frequency range were retrieved as discriminative characteristics
for categorization of hand movement orientations. Data was collected from 12
participants using a 64-channel BrainVision acquisition device. To reduce high
frequency noise, these signals are band passed (0.05-45) Hz. The Naive Bayes
Classifier was used for binary classification. The outcomes are addressed in
terms of the Subject-specific frequency band and the electrode pair. Subject
one achieved the best accuracy of 88.2% in the 4-8 Hz range.

In paper [19], they used a B-Alert EEG headset to acquire the data. The
electrodes were set in a 10-20 channel electrode placement method, and
individuals were asked to visualize hand motions. For this research, three
participants were considered. They were instructed to perform three activities
utilizing a visual stimulus: rest, right-hand movement, and left-hand
movement. After recording of EEG data they are further processed to eliminate
power line artifacts, the recorded EEG data is cleaned using a notch filter in
the frequency range 48 Hz to 52 Hz. The filtered data is then cross-correlated
in order to obtain the necessary cross-correlograms (CC). They derived six
statistical variables from each result cross-correlogram sequence, including
mean, median, mode, standard deviation, minimum, and maximum [19]. SVM was
employed as a classifier. They achieved a cross-validation average accuracy of
78.75%.

EEG sub-bands are connected with different brain states. The most efficient
frequency ranges representing brain processes associated to MI tasks were
discovered by trial and error in this study [20]. The DWT approach was used to
split EEG signals into sub-bands and transform it into images simultaneouslyr.
For their analysis, they employed a publicly available dataset named BCI
Competition 2003. They trained the obtained DWT images using CNN model and
achieved an accuracy of 90.38 percent.

The paper [21] discussed BCI activities that are mostly linked to motor
imagery activities. They utilised a publicly available data set of 13
participants and acquired EEG signals with a sample rate of 512Hz using 64
channels. They concentrated on the actions of the right and left hands. They
extracted seventeen feature vectors from sensor data across a 700-second span.
The characteristics are mean, median, standard deviation, mean absolute
deviation, Signal Interquartile Range, Quantile25, Quantile75 Peak2peak value,
RMS Value, crest Factor, Shape Factor, Impulse Factor, Margin Factor, Signal
Energy, sample skewness, kurtosis and Entropy [21]. They used the minimum
redundancy maximum relevance (MRMR) technique to rank the features. They used
SVM as a classification algorithm and obtained an F1-score of 68.69 %.

###  2.1 Research Gap

The research gaps from literature have been observed as follows:

  * •

There are EEG signal acquisition devices available in the market, but they are
quite expensive and complex to handle. The cost rises as the number of
channels increases. The number of channels is important since it influences
the categorization outcome.

  * •

There are few studies in the literature that discuss the proper selection of
electrodes, and even fewer research discuss regarding the source of
information flow as per electrodes. Because the proper selection of electrode
may affect the accuracy due to loss of vital information. The study must be
done on selection and information flow through electrode.

  * •

The fundamental disadvantage of EEG signals is that they are vulnerable to
both external and other biological influences. There must be a thorough
discussion as well as some conventional ways for removing the tainted noises.
Validation of the applied procedures is required.

  * •

For the EEG-based categorization of motor activity, there is a significant gap
between offline processing and online validation. The current work technology
has been verified in the laboratory only, which has the requirement of
complicated system.

##  3 Background Theory

Several types of waves associated with the brain have been explored, followed
by an understanding of numerous forms of artifacts and their classification.
Learned about the ICA methodology, which aids in the removal of artifacts.
Later, ideas were comprehended related to machine learning and deep learning.
Finally, investigated the artificial generation of EEG signals with GANs and
the usage of Autoencoders on CNN architecture.

###  3.1 Brain Rhythms

According to the [22], The amplitudes and frequencies of brain impulses shift
from one state of a human to the next, such as sleep and awareness. Brain
Rhythms are related with five primary brain waves. These frequency bands,
which have both low and high frequencies, are known as:
$1.Alpha(\alpha)\\\ 2.Theta(\theta)\\\ 3.Beta(\beta)\\\ 4.Delta(\delta)\\\
5.Gamma(\gamma)$

  * •

Delta waves have frequencies ranging from 0.5 to 4 Hz. These waves are mostly
associated with deep sleep. In general, it may be confused by artifact signals
caused due large muscles of the neck and jaw.

  * •

Theta waves line within the range of 4 to 7.5 Hz. These waves are generally
associated with consciousness slips towards drowsiness, deep meditation. They
play an important role in infancy and childhood. These waves are generally
studied while examining maturation and emotional studies.

  * •

Alpha waves are present in the posterior part of the head, often over the
occipital area of the brain. These sinusoidal waves have a frequency range of
8-13 Hz. These waves are commonly connected with relaxed awareness and lack of
attention. When the subjects’ eyes are closed, they form this pattern. These
have a greater amplitude over the occipital region and an amplitude less than
50 $\mu V.$

  * •

Beta wave’s electrical activity lies within the range of 14-26 Hz. This brain
rhythm is often linked to active thinking, active attention, and problem
solving. An individual in a panic state has a higher amplitude. These are more
common in the frontal and central areas. The beta wave’s amplitude is less
than 30 $\mu V.$

  * •

Gamma wave’s frequencies are above 30 Hz mainly up to 45 Hz. These are known
as rapid beta waves. The gamma wave band has also been shown to be an
excellent indicator of brain event-related synchronisation (ERS) and may be
used to indicate right and left index movement. Figure 3 shows the different
frequency bands associated with brain.

Figure 3: Frequency band associated with Brain rhythms

###  3.2 Artifacts Classification

During the neurological acquisition process, some peripheral electrical and
muscle patterns are taken up in addition to neuronal patterns. These artifacts
are repeated temporal and spatial patterns that come from non-cerebral areas
and detract from the gathered neural responses. The existence of artifacts may
worse the classification process’s performance. As a result, identifying and
removing artifacts is necessary prior to further signal processing.
The classification of EEG artifacts which causes interference in the signals
has been discussed [23]. EEG artifacts are generally categorized as:

  1. 1.

Physiological: Artifacts created by peripheral electrical and muscle activity.

  2. 2.

Non-physiological Artifacts generated by interference from electromagnetic
sources.

Physiological Artifacts:
EEG data collected from certain brain areas are susceptible to artifacts
induced by bio-electrical activity such as unintentional eye movement or eye
blink known as EoG, electromyographic (EMG) muscle movements and muscle
contractions electrocardiograph (ECG) artifacts, pulse artifacts.
Eye Movement Artifacts:
Whenever the eyes blink, it generates potential due to charge in variations.
As a significant potential difference is formed between the positively charged
cornea and negatively charged retina, eye blinking causes very high-intensity
brain patterns. These physiological artifacts, such as eye movements, are
particularly prominent in the cerebrum’s frontal lobes.
ECG artifacts:
ECG artifacts are mostly induced by the powerful muscle dipoles induced by
atria and ventricular contraction and expansion. These rhythmic patterns
interfere with brain waves and can have a magnitude up to ten times that of
EEG waves. This artifact may be identified by its fixed wave pattern, which
consists of the P-QRS-T complex.
Pulse artifacts:
When the electrode is mounted over a pulsing blood vessel, pulse artifacts
occur. The artefact has a consistent wave pattern and is immediately
identifiable. Moving muscles adjacent to the scalp, such as the forehead and
neck muscles, causes muscular movement artifacts to appear across the temporal
and frontal scalp areas.
Non-physiological Artifacts:
External electromagnetic disturbances, such as power-line interference with
frequencies of 50/60 Hz, variations in electrode resistance, cable movements,
and a low-intensity battery of the acquisition unit, mostly affect EEG
signals.
Power-line interface:
Main power lines cause power-line interference due to alternating current
sources such as electronic gadgets.

Figure 4: Different types of artifacts[23]

Demodulation Artifacts:
High-frequency waves, such as radio/microwaves, produce artifacts at
frequencies greater than 10 Hz. These high-frequency waves interfere with low-
frequency EEG pulses during demodulation. If the person rubs their feet, shoes
against the floor, or their hands against each other while recording, the
ground potential may rise.

Because of lateral movement between electrodes, friction occurs, resulting in
tribo-electric charges on the electrode surface. When electrodes with
inadequate resistance connections are employed, these artifacts predominate.
Internal sources may lead to the formation of shot, flicker, or thermal
sounds, which can cause fluctuations in acquired brain potentials [23]. The
representation of various artifacts are presented in Figure 4 [24].

####  3.2.1 Artifact Detection

EEG artifact detection requires accurate analysis of incoming brain signals
across certain time frames, as well as the use of amplitude outsets to
identify the artifacts. For example, the length of muscular artifacts is
shorter when compared to EEG patterns, but they are unpredictable in both time
and amplitude. However, identifying artifacts is critical for subsequent pre-
processing of collected brain signals to extract significant brain activity
information. Artifacts can be detected by carefully studying collected EEGs
over a given time frame and using amplitude threshold methods [25].

EEG artifacts detection is a crucial task and the different techniques are
discussed briefly. The paper used Haar basis discrete wavelet transform to
separate ocular artifacts [25]. Furthermore, in the paper, they proposed MAD
for Muscle artifacts detection, which calculated the proportion of energy in
the 30-100 Hz frequency band to the whole EEG signal. While they estimated
Kurtosis which is capturing the ’peak’ state of the Transmission line
Artifacts.

Next, The paper converted an EEG signal into a two-dimensional image and they
used two classes first as pure EEG signals which are free from ocular
artifacts and another class contaminated with ocular artifacts [26]. These
images are given to the training model for classification. Here the judging
parameter is the Mean Square Error (MSE).

Further, The paper [27] calculated the wavelet ICA of the EEG signal where ICA
decomposes the EEG signal into independent components. Then they calculated a
set of features including Kurtosis, Variance, Shannon’s entropy. These
features were divided into training and testing datasets and provided to the
SVM model. The result produced contaminated IC’s which were further dropped
the IC’s and inverse ICA was applied on the EEG signals [27, 26].

###  3.3 Independent Component Analysis (ICA)

EEG signals are the combination of different signals and Independent
components analysis (ICA) is a method for evaluating independent source
signals from a collection of recordings in which the source signals were
combined in unfamiliar proportions. For example, it has been considered a
common example of blind source separation [28]. For this, Let’s consider three
musical instruments playing in the same room, and the three microphones
recording the performance here it must noted that each microphone is
accumulating sound of all three instruments, but at different levels. One must
somehow try to "unmix" the recorded signals from three different microphones
so that end up getting separated recordings, separating the sound from each
instrument.

The similar analogy was used to fits EEG/MEG analysis: while recording EEG
signals gets affected by different artifacts link blinks, heartbeats, activity
in different areas of the brain. It must be noted that these source signals
must be statistically independent and non-gaussian so that it is possible to
separate the source signals using ICA, and after separating must be possible
to re-combine the sensor signals after removing the contaminated part. The
data is captured as linear sums of separate components derived from spatially
specified sources. The goal here is to generate N independent source signals
from N linearly mixed acquired signals recorded by the N electrodes as per
Equation (1) [29].

$x=As$ (1)

Here A is unknown mixing matrix. Here the critical issue in ICA is to find the
un-mixing matrix W. Which is nothing but the pseudo-inverse $A^{-1}$ and s are
the sources which are independent to each other statistically.

$y=Wx$ (2)

Specific methods across the time series determine the independence of the
basis vectors y. In order to solve Equation (2), It is assumed that the mixing
process is linear. W may be thought of as a spatial filter matrix that inverts
the mixing matrix linearly. The maximising of non-Gaussianity is used to
determine independent components Wx[28].

There are various types of ICA algorithms [28] some of which are discussed
here: fastica, Picard, and infomax. FastICA and Infomax are both inequitably
extensive use; Picard is the latest (2017) algorithm that is supposed to
converge faster than FastICA and Infomax and is more robust than other
algorithms.

###  3.4 Fundamental Concepts

####  3.4.1 Neural Network

A Neural Network is made up of a large number of artificial neurons that are
connected using a specific network architecture [30]. The neural network’s
primary goal is to convert inputs into meaningful outputs [31]. One input
layer, one output layer, and a number of hidden layers make up a Neural
Network architecture [32, 33].

Figure 5: Neural Network Architecture

####  3.4.2 Convolution

Convolution is a mathematical operation that is done on two input functions.
It returns the point-wise product of the two input functions as an integral.
With regard to the other function, it may be viewed as a modified version of
the original functions [32].

Figure 6: Convolution Example

Consider the 5x5 matrix in Figure 6, with 0s or 1s as elements. As a filter,
another 3x3 matrix, similarly made up of 0s and 1s, is utilised in the
picture. These two matrices can be understood as the convolution function’s
two inputs. The convolved feature is obtained by conducting element-wise
multiplication by sliding the filter over the original picture.

####  3.4.3 Convolution Neural Networks

Convolutional Neural Networks (CNNs) are stacked layers of convolutions with
non-linear activation functions such as tanh or ReLU. Each node in the current
layer is connected to every node in the next layer in a neural network.
Convolutional filters, on the other hand, are employed in CNNs to slide over
the nodes in the input layer and subsequently compute the output [32]. The
output of each layer of the network is computed using different convolutional
filters. When the network sees the training data, it learns which filters to
employ automatically.

Figure 7: Convolution Neural Network Example

####  3.4.4 Recurrent Neural Networks

Recurrent Neural Networks (RNN) are neural networks that execute the same job
for each element of the input sequence. The RNN’s output is determined by the
current element as well as prior calculations. RNNs have a memory that stores
all of the preceding data’s information [32].

####  3.4.5 Long short-term memory

The long short-term memory (LSTM) network is a sort of recurrent neural
network that can learn and recognise long-term dependencies and is utilised as
a block of hidden layers [34]. The LSTM is a recurrent network in and of
itself, as it contains recurrent connections identical to those seen in a
traditional RNN. The gating mechanism in an LSTM block is made up of four
parts: a cell, an input gate, an output gate, and a forget gate. The cell is
in charge of remembering values over arbitrary time intervals, which is why
LSTM uses the word memory. Each of the three gates can be compared to a
traditional artificial neuron in a feed-forward neural network, in that they
compute activation using a weighted sum activation function [32].

Figure 8: LSTM Data Flow

LSTM are commonly used in sequence tasks to extract required information.
Attention based LSTM are given priority since it will remember what it wants
to remember.

####  3.4.6 Activation Functions

An activation function is used in neural networks to evaluate the output of a
specific node for a given input set of nodes from the preceding layer. There
are several types of activation functions, both linear and non-linear [32].
Some of the most prevalent are listed below.
Hyperbolic tangent or tanh:
The hyperbolic tangential function is a non-linear activation function given
by:

Figure 9: Tanh function

Tanh is a widely used activation function. Its popularity stems from its high
gradient, which makes it a superior choice for network back propagation.
Tanh’s first order derivative is provided by Equation (3):

$\begin{split}f^{\prime}\left(x\right)=1-f\left(x\right)^{2}\end{split}$ (3)

Rectified Linear Unit or ReLU:
The positive component of the input is defined as the ReLU activation
function. It is expressed mathematically as:

$\begin{split}f\left(x\right)=0\hskip 8.0ptfor\hskip 8.0ptx<0\end{split}$ (4)

Figure 10: ReLU function

Because it increased the performance of deep learning models, ReLU is also one
of the most extensively utilised activation functions for deep neural
networks.
Softmax:
The Softmax activation function is mostly employed in the neural network’s
final output layer, which is employed for multi-class categorization. The
softmax function returns a probability distribution across the number of
target variables, with the class with the greatest probability value estimated
as the final output [32].

####  3.4.7 Optimizer

Adam Optimizer:
Adam optimization is a stochastic gradient descent approach based on the
adaptive estimate of first- and second-order moments. According to the study
[35], the approach is computationally efficient, requires minimal memory, is
insensitive to diagonal re scaling of gradients, and is well suited for big
data/parameter issues. Adam optimizer’s characteristics are as follows [36]:

  1. 1.

learning_rate: A Tensor vector or a floating point value. 0.001 is the default
value.

  2. 2.

beta_1: A float value or a tensor of constant floats. The rate of exponential
decline for first-moment estimations.

  3. 3.

beta_2: A float value or a tensor of constant floats. The rate of exponential
decline for 2nd moment estimations.

  4. 4.

epsilon: A small constant for numerical stability.

###  3.5 Artifical EEG generation using Generative Adversarial Nets (GANs)

BCI has always been a source of concern, significant data-related issues,
including a lack of adequate data as well as data corruption. The use of GANs
[37] for time-series data creation is a new and developing field that must
first be evaluated for viability. Researchers explore the performance of GANs
in producing artificial electroencephalogram (EEG) signals. The findings
indicate that GAN-generated EEG signals have temporal, spectral, and spatial
properties similar to genuine EEG. There have been a few recent efforts to use
GANs for EEG data. Recent developments in CNN, as well as successful
deployments for EEG tasks, prompted us to select CNN over frequently used
autoregressive models for time-series data creation. CNN-based GANs are
composed of two NN: the generator (G) and the discriminator (D).

Figure 11: The overall framework of EEG generation using GANs[37].

The overall concept is influenced by game theory, in which two players strive
to beat one other. G’s goal in GANs is to produce synthetic data, whereas D’s
task is to determine which samples are actual and which are generated. G’s
training goal is to ultimately deceive the discriminator so that the
discriminator can no longer differentiate between the actual and produced
data. In other words, the produced samples are quite similar to the actual
samples. The D and G neural network is trained using actual EEG data. The
trained G network is then fed random noise as input.

As a consequence, the G network creates the simulated EEG from random input.
It is therefore critical to assess the performance of GANs by extracting and
evaluating the properties of the produced EEG. To do so, the actual and
produced EEG of each channel were plotted over time. In addition, the
topographic maps of the real and produced EEGs were computed using the fast
furrier transform (FFT) to improve interpretation of the data. Figure 11
depicts an overview of the suggested technique.

###  3.6 Autoencoders

The term "autoencoding" refers to a data compression technique in which the
compression and decompression functions are 1) data-specific, 2) lossy, and 3)
learnt automatically from examples rather than created by a person.
Furthermore, neural networks are utilised to implement the compression and
decompression functions in virtually all instances where the word
"autoencoder" is used.

Figure 12: Frame work for Autoencoders

Autoencoders are a form of Feedforward Network in which the input and output
is similar. Autoencoders compress the data into a lower-dimensional form, use
to recreate the output. The code, also known as the latent-space
representation, is a compact “summary” or “compression” of the input. Encoder,
code, and decoder are the three parts of an autoencoder. The encoder
compresses the input and generates the code, which the decoder subsequently
uses to recreate the input. Three things are needed to create an autoencoder:
an encoding technique, a decoding technique, and a loss function which
compares the output to the target. Mostly used loss function is mean square
error(MSE). Figure 12 shows the framework for the autoencoders.

Table 1: Implementation of autoencoder on the CNN model  Layer (type) | Output Shape | Param #
---|---|---
InputLayer | [(None, 24,24,1)] | 0
Conv2D | (None,24,24,16) | 160
MaxPoolingLayer | (None,12,12,16) | 0
Conv2D | (None,12,12,8) | 1160
MaxPoolingLayer | (None,6,6,8) | 0
Conv2D | (None,6,6,8) | 584
MaxPoolingLayer | (None,3,3,8) | 0
Conv2D | (None,3,3,8) | 584
UpSamplingLayer | (None,6,6,8) | 0
Conv2D | (None, 6,6,8) | 584
UpSamplingLayer | (None,12,12,8) | 0
UpSamplingLayer | (None,24,24,8) | 0
Conv2D | (None, 24,24,1) | 73

Autoencoders were implemented on the CNN model, as illustrated in Table 1. In
this case, an input of 24x24 is passed to the encoder, which compresses the
picture to generate an image with a compressed dimension of (3x3), which is
then passed to the decoder to duplicate the input. Before training an
autoencoder, four hyperparameters were explored:

  * •

Code size: number of nodes in the middle layer.

  * •

Number of layers: The autoencoder can have as many layers.

  * •

Number of nodes per layer: Since the layers are piled one after the other,
this autoencoder design is known as a stacked autoencoder. Stacked
autoencoders are typically shaped like a "sandwich." With each consecutive
layer of the encoder, the number of nodes per layer drops and then rises in
the decoder.

  * •

Loss function: MSE was used for multi-class classification and for binary
class, Binary cross-entropy was used as loss function.

##  4 Proposed Methodology

The section discusses about data set, followed by the methodology for
electrode selection. Further, the pre- processing approaches have been
elaborated, followed by artifact identification and rejection. Finally, the
feature extraction methodology in several domains has been deliberated in the
further section.

###  4.1 Dataset

The paper focuses on upper arm amputees and there are different dataset
available111http://bnci-horizon-2020.eu/database/data-sets
222http://www.bbci.de/competition/iv/. The data set utilized has been
discussed below333https://www.physionet.org/content/eegmmidb/1.0.0/.

####  4.1.1 EEG Motor Movement/Imagery Dataset

In this paper, an EEG Motor Movement/Imagery dataset was employed. The samples
were gathered using a BCI 2000 device on 109 participants. Three exercises
were performed by the subjects: rest (T0), left hand movement (T1), and right
hand movement (T2). Each experiment consisted of 15 repetitions, with T0 being
followed by a visual stimulus, with T1 or T2 being chosen at random. The data
was in EDF+ format, with 64 EEG channels that were captured at 160 samples per
second. Figure 13 and Figure 14 show the raw EEG signals for motor Imagery and
motor execution class respectively for both right hand and left hand
movements. Figure 15 shows annotations T0, T1, T2. Here T0 depicts that the
subject is at rest,while the T1 and T2 period replicates to the onset of real
or imagined left first movement or right fist movement respectively [25]. Here
each subject was asked to perform 14 tasks. Among 14 tasks only 6 tasked were
considered. Here it is to observed that 3,7 and 11 runs represent motor
execution class while 4,8 and 12 runs represent motor imagery class.

Figure 13:  Raw EEG signals for motor imagery class for left and right hand
movements Figure 14: Raw EEG signals for motor Execution class for left and
right hand movements Figure 15: Image represents the annotations T0, T1, T2

####  4.1.2 Montage

64 electrodes were used for recording EEG signals using 10-10 international
system. Figure 16 depicts the placement of 64 electrodes in a 10-10
international pattern, with the exception of Nz, F9, F10, FT9, FT10, A1, A2,
TP9, TP10, P9, and P10. The numbers underneath each electrode name represents
the sequence in which they occur in the recordings.

Figure 16: Placement of 64 electrodes in 10-10 international manner

###  4.2 Selection of electrodes

Proper selection of electrodes is important as it can alter the accuracy [1].
The paper explained the flow of information through electrodes at certain
intervals. Others [38], on the other hand, they tried selecting different
electrodes randomly and obtained different accuracy for randomly selected
electrodes. But this method may not give the proper classification. The
subsequent part explains, the flow of information at various points in time,
as stated in the study [1]. During the experiment. At t=0 sec, the individuals
are exposed to a visual stimulus. Sensor pairs in the anterior-frontal
(AF3-AF4 and AF7-AF8), parietal-occipital (PO3-PO4 and PO7-PO8), as well as
occipital (O1-O2) lobes revealed the greatest traits at this stage.

The P300 wave is a form of Event-Related Potential(ERP) that is thought to be
prominent in decision-making and typically lasts for 250 ms to 500 ms on the
commencement of visual input. Another parameter Simple reaction Time (SRT)
represents the time lag between visual stimulus and response. According to the
discussion, the estimated time of SRT was $231\pm 27ms.$ At t=0.25 sec sensor
pairings in the frontal- temporal (FT7-FT8) and temporal-parietal (TP7-TP8)
lobes became increasingly prominent. The visual information is sent via two
distinct streams, namely the ventral and dorsal streams [24]. The ventral
stream travels to the temporal cortex, which is primarily responsible for
picture identification. The visual stimulus is then used to create the
connection between the experiment instructions and the L/R hand movement. When
contrasted to t = 0 sec, sensor pairs in the central-parietal (CP3-CP4 and
CP5-CP6) and Parietal lobes (P1-P2, P3-P4, and P5-P6) reveal relevant
characteristics at t=0.25 sec. At t=0.5 sec, the electric impulse in the
parietal lobes shrinks, indicating the conclusion of information flow in the
dorsal stream. As a result, sensor pairs in the central-parietal lobe
(CP1-CP2, CP3-CP4, and CP5-CP6) shows distinct characteristics. Sensor pairs
in temporal (T7-T8 and T9-T10), frontal (F7-F8), and anterior-frontal
(AF7-AF8) lobes revealed discriminant for L/R hand motions at t=0.75 sec..The
primary cortex is accountable for the execution of all voluntary actions [39].
Therefore, electrodes near the motor cortex area was considered. As a result,
after understanding the flow of information through each electrode. Table 2
shows the selected electrode for the study [1].

Table 2: Selection of electrodes Sr.No. | Sensor Pair | Brain Lobe | Sensor Pair | Brain Lobe
---|---|---|---|---
1 | FC5-FC6 | Frontal Central | F5-F6 | Frontal
2 | FC3-FC4 | Frontal Central | F7-F8 | Frontal
3 | FC1-FC2 | Frontal Central | F1-F2 | Frontal
4 | C3-C4 | Central | T7-T8 | Temporal
5 | CP5-CP6 | Central Parietal | T7-T8 | Temporal
6 | CP3-CP4 | Central Parietal | T9-T10 | Temporal
7 | CP1-CP2 | Central Parietal | TP7-TP8 | Temporal Parietal
8 | FP1-FP2 | Frontal Parietal | P5-P6 | Parietal
9 | AF7-AF8 | Anterior Frontal | P3-P4 | Parietal
10 | AF3-AF4 | Anterior Frontal | P1-P2 | Parietal
11 | PO7-PO8 | Parietal Occipital | PO3-PO4 | Parietal Occipital
12 | O1-O2 | Occipital | Cz-Cpz | central electrodes

###  4.3 Pre-processing

After obtaining the EEG data, these waves are pre-processed to decrease noise
in the EEG signals and to increase particular brain information of certain
activity patterns from the raw EEG recordings. After selecting 46 electrodes
they were pre-processed using two filters as mentioned below. MNE package is a
dedicated package for EEG signal processing, EEG artifact detection and
removal, and source localization, it is been used exclusively for the
processing and visualization of EEG signals.

  1. 1.

Notch filter: It removes the power line interference using a notch filter of
50 Hz.

  2. 2.

Band-pass filter: It was used to let frequencies ranging from 0.5 to 40 Hz to
pass through, decreasing artifacts and denoising. The range chosen also keeps
the critical information safe [18].

Figure 17: Categorization of pre-processing filters[23].

###  4.4 Artifacts Detection and Rejection

The acquired EEG signals are usually corrupted with different artifacts and it
is really important to reject them. Removal of artifacts is an extremely
critical task. Two techniques were used for the study. First, the signals were
inspected using EEGLAB tool. EEGLAB tool 444https://eeglab.org/tutorials/ is
an inbuilt tool in MATLAB having functions that helped to understand EEG
signals and to determine the artifacts more concretely. Before applying ICA on
the data to be cleaned, it was observed that a high pass filter between 1 to 2
Hz and no low-pass filter appears to be the best choice to enhance ICA
disintegration’s. ICA is susceptible to low-frequency tones and hence requires
the data to be high-passed and separated before fitting. The FASTICA technique
was used for 46 components and was applied to the data. The number of
components in this case refers to the number of main components (from the pre-
whitening PCA stage) that are provided to the ICA algorithm during fitting.
The ICA components are then sent into the ICA algorithm, which produces the
un-mixing matrix.

Figure 18 and Figure 19 show the topological plots for all 64 channel using
EEGLAB tool which also shows the labels indicating which type of artifact.
using visual inspection one can reject contaminated IC’s but this method
consumes more time. Here, there are 109 subjects and inspecting each and every
subject is a complex process and hence it is difficult to use the EEGLAB tool
for the elimination of the artifacts.

Figure 18: Topological ICA plots for first 35 channels for the first subject
[40]. Figure 19: Topological ICA plots for other remaining channels for the
first subject [40].

####  4.4.1 ICA in MNE-Python

The novel algorithm is implemented to remove the undesired signals from the
EEG signal and to obtain clean signal. The Python MNE module is used to build
the method. The block diagram for ICA-based artifact removal is shown in the
Figure 20.

Figure 20: Block diagram for ICA analysis in MNE-Python[12]

Following are steps to detect artifacts and clean EEG signal:

  1. 1.

ICA Fit operation

  2. 2.

ICA detect

  3. 3.

Applying algorithm on IC’s to exclude contaminated IC’s

  4. 4.

ICA exclude

  5. 5.

ICA apply

Figure 21 demonstrates the methodology for detecting and removing ICA-based
artifacts. As it is previously explained, ICA must be routed via a 1 Hz high
pass filter. Before using the fit operation PCA components must be defined
which will statistically un-mix the signals and obtain various components
related to the signals. As discussed earlier, the numerous IC’s related to EEG
signals were examined using EEGLAB tool in MATLAB. Different independent
Components related with EEG signals were examined which were contaminated with
various types of signals such as: 1. Power line signal 2. Ocular Signal 3.
Muscle related signals and so on.

Figure 21: Algorithm for artifact detection and removal

It is proposed that PCA components must be smaller than the number of channels
chosen for the investigation. 46 channels are chosen for the study. Hence
Using the ICA.fit approach, it fitted 30 PCA independent components. The
Independent components can be seen as illustrated in Figure 22. Neurological
experts visually examine these waves related to Independent Component and can
detect various kind of artifacts linked with the EEG signals. Using the above
approach tainted ICs can be ruled out. But the complexity increases as the
number of subject increases. As a result, the novel approach was employed
which is discussed in the further section.

Figure 22: ICA components for subject 0, 1, 2 and 3

Two algorithms were implemented for the analysis. Firstly, monitored the IC’s
related to EEG channels and subsequently calculated statistical parameters
such as 1. Variance 2. Skewness 3. kurtosis 4. Z-score for kurtosis of IC’s.
The $2^{nd}$ strategy utilized the MNE package’s inbuilt command, ICA detect,
which has certain attributes such as variance, Kurtosis, Skewness, and
Person’s linear Correlation coefficient with a specified threshold. The above
parameters’ thresholds are set in accordance with [41]. In article [41] they
have calculated the threshold values for these attributes, which is discussed
in more detail in further section.

###  4.5 Artifact Detection Measures

  1. 1.

Variance
The large value of Variance intimates the presence of muscular artifacts, eye
blinks, or big transient noise signals.

  2. 2.

Skewness
It is the third-order central moment that indicates a measure of the degree of
asymmetry of a distribution. Higher value intimates IC’s polluted with ocular
artifacts.

  3. 3.

Kurtosis
Peaks in the Waves are characterized by kurtosis value. The greater the value
more is the transient muscle or cardiac activity.

  4. 4.

Entropy
It denotes the likelihood of identifying amplitude values in a magnitude
distribution in $i^{th}$ IC. Higher entropy values symbolize more
complications.

  5. 5.

Pearson’s Linear Correlation
To discriminate between ocular and cardiac activity in groups of ICs,
Pearson’s Linear was used as Correlation coefficients between each IC.

Threshold values for the above central moments and linear correlation is $\pm
3.5$ and $>=0.5$ respectively.

Variance, kurtosis, and skewness were used as evaluation criteria in the first
method. As it was already stated in upper section that kurtosis is a vital
parameter. In this section, a brief analysis of kurtosis and its z-score is
performed according to [41]. If the value of Kurtosis is greater than 8.83 and
z-score of kurtosis greater that 0.23 then IC’s suffer from EoG or ocular
artifacts.

The second technique employed all the previously described attributes related
to ica.detect_artifacts methods such as eog_criterion, skewness, kurtosis,
variance, and entropy. After going through the documentation it is to be
observed that the method ica.detect_artifact is just for experimentation and
further research is required. The in-built technique for identifying faulty
components is shown in Figure 23. This method specifies which channels should
be discarded. Figure 24 displays the detection of an eye blink artifacts using
in-buit functions [41].

Figure 23: Syntax for ICA detection Figure 24: Detection of Ocular artifact

###  4.6 Signal Segmentation

In order to develop an acceptable data segmentation method, two major
components must be carefully considered: window size and the degree of overlap
among two successive window fragments. The window size is a balance between
accuracy of classifier and classification reaction time. Classification
performance improves as window size grows. Nonetheless, classification size,
must be kept as short as possible in order to meet rigorous real-time
performance requirements. After examining various window size and segment
overlap a decision was made to consider 560 samples per window having a stride
of 1 for feature extraction. This window size reduced the time complexity and
improved the outcomes. According to [1], 2 sec window period and 50% overlap
is considered. However, for the assessment, a window size of 3.5 seconds and
the rate at which the window moved was selected as shown in Figure 25 .

Figure 25: Feature extraction method based on overlapping window.

###  4.7 Feature Extraction

After detailed discussion on artifacts detection and removal in this section
feature extraction techniques were carried. The technique of representing
obtained and pre-processed EEG data using compressed and linked signal values
is known as feature extraction. These features are nothing but feature
vectors. EEG signals are non-linear, non-Gaussian, and non-stationary. Hence
the features are obtained from 4 domains of EEG signal representation.

  1. 1.

Time domain depiction of an EEG signal

  2. 2.

Frequency domain depiction of an EEG signal

  3. 3.

Time and frequency domain depiction of an EEG signal

  4. 4.

Spatial domain depiction of an EEG Signal[24].

Different State-of-art techniques for feature extraction were observed and
conclusion was made to utilize only time and frequency domain.

####  4.7.1 Time domain feature Extraction

In papers [21], [1] they have worked on certain statistical features [42].
Five features in the time domain is represented below:

  1. 1.

Mean

$\begin{split}\mu&=\frac{1}{N}\sum_{i=1}^{N}x_{i}\end{split}$ (5)

Solving equation (5) for mean in a moving average manner having window size of
560 samples in one window.

  2. 2.

Variance

$\begin{split}\alpha^{2}=\dfrac{1}{N}\sum^{N}_{i=1}\left(x_{i}-\mu\right)^{2}\end{split}$
(6)

Solving equation (6) for variance in a moving window having window size of 560
samples in one window.

  3. 3.

Skewness

$\begin{split}S&=\begin{aligned}
\dfrac{1}{N}\sum^{N}_{i=1}\left(x_{i}-\mu\right)^{3}\\\
\overline{\left(\dfrac{1}{N-1}\sum^{N}_{i=1}\left(x_{i}-\mu\right)^{2}\right)}^{3/2}\end{aligned}\end{split}$
(7)

Equation (7) is the third-order central moment that indicates a measure of the
degree of asymmetry of a distribution called Skewness [29].

  4. 4.

Kurtosis

$\begin{split}K&=\begin{aligned}
\dfrac{1}{N}\sum^{N}_{i=1}\left(x_{i}-\mu\right)^{4}\\\
\overline{\left(\dfrac{1}{N-1}\sum^{N}_{i=1}\left(x_{i}-\mu\right)^{2}\right)}^{2}\end{aligned}-3\end{split}$
(8)

Peaks in the Waves are characterized by kurtosis value. Here kurtosis is a
proven statistical feature for classification. Equation (8) shows the formula
for Kurtosis.

  5. 5.

Absolute Area under signal

$\begin{split}A=\int^{b}_{a}\left|f\left(x\right)\right|dx\end{split}$ (9)

Equation (9) shows the formula for area under signal which is one of the vital
feature for classification.

####  4.7.2 Frequency domain feature Extraction

Certain specific frequency domain characteristics were chosen from a review
paper [43]. Frequency domain analysis is also necessary since a frequency
representation of an EEG signal gives some helpful information about the
signal’s patterns. The Power Spectral Density (PSD) equation (10) and the
normalized PSD (by the total power) are commonly used to derive
characteristics encapsulating the power partition at each frequency. This
section summarises the PSD characteristics for the extraction purpose.

$\begin{split}S_{xn}\left(W\right)=\lim_{T\rightarrow\infty}E\left[\left|\widehat{X}\left(W\right)\right|^{2}\right]\end{split}$
(10)

  1. 1.

Peak Frequency
It is the frequency at which the PSD of the highest average power in the full-
width-half-max (FWHM) band has the greatest magnitude.

  2. 2.

Peak Amplitude
Here Peak Amplitude represents the highest value of spectral density.

Figure 27 and Figure 28 show the Power spectral Density for both motor Imagery
and Execution. Tabel 10 shows the values associated with the feature vectors
in raw form these are not yet normalized.

####  4.7.3 Feature Selection approach

Figure 26: Feature Ranking using Random Forest

To investigate the involvement of several features, The paper [1] estimated
the significance of each feature through the use of Random Forest (RF) for
feature ranking. And according it, the first top three features were skewness,
mean, and area under signal [43]. Figure 26 displays the relevance of each
characteristic when Random Forest (RF) is used to rank features. Here it is
been examined that, the features like mean, skewness, variance, kurtosis, area
under curve, peak frequency, and peak amplitude have a role in enhancing the
performance of a classification model. It can be seen that characteristics
like min, max, and zero crossing have less relevance when compared to the
selected parameters. As a result, it can observed that the most vital key
features were chosen for classification.

Figure 27: Power Spectral Density for Motor execution class Figure 28: Power
Spectral Density for Motor Imagery Class

###  4.8 Normalization

The normalization with Z-score is represented by Equation (11)

$\begin{split}z=\dfrac{x-\mu}{\sigma}\end{split}$ (11)

The features were normalized using Z-score for this an in-built library
Sklearn was used. Sklearn has a class called StandardScalar which contains
fit_transform to Normalize the values.

  * •

z= Standard value

  * •

x= observed value

  * •

$\mu$= mean of the sample

  * •

$\sigma$= standard deviation of the sample

###  4.9 Proposed Model

Here the proposed model used Multi-layer Perceptron Artificial Neural Networks
(MLP) [44]. The Neural Network model used was basically a sequential model
having:

  * •

A input layer having 700 Perceptrons having RELU as activation function.

  * •

Input size depends upon the number of features utilized, Seven features in the
data-set were utilized, five in time domain and two from frequency domain.
Hence the input size=(input_shape,)

  * •

Six hidden layers were implemented having 128, 128, 64, 64, 32, 32 neurons
having relu as activation function for each. By default kernel initializer is
’glorot uniform’ and bias initializer is zeros. One can change according to
its algorithm.

  * •

Number of units(neurons) in the output layer depends upon the number of
classes. The classifier used was softmax. Four classes are discussed below:

    1. 1.

Left & Right hand movement for motor execution

    2. 2.

Left & Right hand movement for motor imagery

  * •

Adam as optimizer was utilized having
$lr=0.001,beta_{1}=0.9,beta_{2}=0.999,epsilon=1e-07.$ Sparse Categorical
Cross-entropy was used as a loss function.

  * •

It implemented two metric parameters one Accuracy and other Mean Square Error
for evaluating the model.

  * •

From Figure 29 it can be referred, the architecture of proposed ANN model.

Figure 29: Proposed ANN-model architecture

###  4.10 Deep Learning

In this section, the implementation of deep learning was observed on
previously discussed data-set. In referred paper[45] to enhance the domain
knowledge and to implement it simultaneously. Deep learning algorithms have
been attempted since they provide better performance due to their
automatically learning capability through features from large size of data
[46].

The sliding window technique with a distinct window size of 21 having a stride
of 21 hence converting into small fragments. Combining these small fragments
created an 2D-Matrix. The deep learning algorithm was implemented only on
first subject. First the pre-processing and normalization was done on the
data-set and converted it into an image.

####  4.10.1 Model Architecture

  * •

Using the segmentation approach, transformed the 1D signal into a 2D format.
The image’s dimensions were (21, 21, 1).

  * •

The image was feed to Batches of Convolution layers having kernel size of
(3x3) and also used MaxPooling layers to reduce the dimensional of an image.

  * •

Similarly the two more layers arranged in the above mentioned manner having 64
and 128 units. All three CNN layers are converged into one layer called
flatten.

  * •

After flattening the layers they are interconnected to Fully connected layers
called Dense layer having 1024 units activation function as ’relu’ and dropout
rate as 0.5.

  * •

These fully connected layers connected back again to Dense layers of 1024
units and dropout rate as 0.5 followed by output layer of 4 neurons having
softmax as classifier. Here categorical cross-entropy and Adam optimizer was
implemented and metric parameter has accuracy.

##  5 Results and Discussion

In this part, the performance of the proposed algorithm is discussed on the
selected data set. Examination of the results for artifact removal approach
was carried further. Later, Investigation of the performance of feature
vectors in several domains was carried and choose the optimal domain for
testing our algorithm. The same strategy for 9 participants after successfully
removing extraneous signals from EEG recordings and choosing appropriate
feature vectors. A brief discussion regarding the outcomes for these subjects
are carried out. Lastly, the performance of the proposed model was compared to
deep learning model.

###  5.1 Artifact removal using ICA

  * •

As mentioned in previous sections, for Artifacts Detection, the utilized
approach that computed the kurtosis, skewness, variance, and z-score of
kurtosis.

  * •

Table 3, 4 shows the results which displays the contaminated Independent
Components for Motor Imagery and Motor Execution respectively.

  * •

Threshold for Varaiance, Skewness and Kurtosis is $\pm 3.05$ and Threshold
value of Z-score of Kurtosis is 0.23.

  * •

The contaminated and non-contaminant ICs are shown in two tables below. As an
example: It is evident from the independent components in Table 3 that the ICs
12,13,14,15,18,19 may be excluded. The kurtosis value exceeds the onset value,
and the Z-score value exceeds the limit.

  * •

Furthermore, it can be observed that the equivalent results in the case of
Motor Execution Class. For Variance of IC’s for 18 and 19 is -3.27878 and
-3.51884. The values are greater than set threshold.

  * •

From the above mentioned approach, bad Independent Components were removed.
After discarding the contaminated IC’s. An ICA.apply method was performed
which mixes all the Independent Components of EEG signal. Hence, it
successfully removed artifacts associated with brain wave and obtained clean
EEG patterns.

Table 3: ICA detection for Motor Imagery  Sr.No. | Variance | Skewness | Kurtosis | Z-Score | Result
---|---|---|---|---|---
1 | 0.034742 | 0.108255 | -0.383753 | -0.725933 | *
2 | 0.0343778 | 0.0130993 | -0.626377 | -0.807453 | *
3 | 0.0226487 | 0.200304 | -0.775486 | -0.857553 | *
4 | 0.0176305 | 0.243581 | -0.812049 | -0.869838 | *
5 | 0.02656 | -0.450154 | 1.34709 | -0.144385 | *
6 | 0.0293302 | 0.247553 | 1.05753 | -0.241674 | *
7 | 0.0321314 | 0.408744 | 0.822696 | -0.320576 | *
8 | 0.032728 | 0.422592 | 0.482036 | -0.435035 | *
9 | 0.0287436 | 0.463421 | -0.0855045 | -0.625724 | *
10 | 0.0253485 | 0.400195 | -0.436871 | -0.743781 | *
11 | 0.0194755 | 0.11406 | -0.856049 | -0.884621 | *
12 | 0.0749796 | -2.52961 | 8.80182 | 2.360347 | #
13 | 0.0543406 | -2.60722 | 9.06572 | 2.449017 | #
14 | 0.0601778 | -3.06529 | 11.5707 | 3.290666 | #
15 | 0.0701443 | -1.39425 | 4.1624 | 0.801538 | #
16 | 0.0664136 | -1.33049 | 3.78757 | 0.675599 | #
17 | 0.0375335 | -0.707176 | 0.721974 | -0.354418 | *
18 | 0.0364201 | -1.67454 | 3.93 | 0.723453 | #
19 | 0.0495347 | -3.35156 | 12.4 | 3.569295 | #
20 | 0.0473867 | -0.12192 | -0.146448 | -0.646201 | *
$*$ Not Contaminated
# Contaminated
Table 4: ICA detection for Motor Execution  Sr.No | Variance | Skewness | Kurtosis | Z-Score | Result
---|---|---|---|---|---
1 | 0.0257566 | -1.25491 | 1.60076 | -0.304928 | *
2 | 0.0256388 | -0.823197 | 0.0381866 | -0.698148 | *
3 | 0.0185465 | -0.572666 | 0.801421 | -0.506080 | *
4 | 0.0149535 | -0.405297 | 0.745096 | -0.520255 | *
5 | 0.0209963 | 0.417453 | -0.144257 | -0.744060 | *
6 | 0.0227839 | 0.00712086 | 0.210892 | -0.654687 | *
7 | 0.0236176 | -0.458646 | 0.588885 | -0.559565 | *
8 | 0.0240898 | -0.776216 | 0.946091 | -0.469674 | *
9 | 0.0212467 | -0.627045 | 0.66175 | -0.541229 | *
10 | 0.0200463 | -0.275208 | 0.331227 | -0.624404 | *
11 | 0.016156 | 0.00076477 | 0.0478366 | -0.695720 | *
12 | 0.124933 | -2.91501 | 12.3423 | 2.398167 | #
13 | 0.0926662 | -3.31493 | 14.1188 | 2.845225 | #
14 | 0.110129 | -3.31426 | 13.7095 | 2.742223 | #
15 | 0.098688 | -2.33557 | 9.37312 | 1.650985 | #
16 | 0.0933006 | -2.35998 | 9.61372 | 1.711530 | #
17 | 0.044788 | -1.9429 | 7.49195 | 1.177589 | *
18 | 0.0537186 | -3.27878 | 13.4315 | 0.672277 | #
19 | 0.094339 | -3.51884 | 15.0059 | 3.068464 | #
20 | 0.0461517 | 0.114449 | 4.09738 | 0.323346 | #
* Not Contaminated
# Contaminated

###  5.2 Effect of window size and segment overlap

The effect of various window sizes and segmentation overlap is shown in Table
5. Several segment sizes (0.5, 1.0, 1.5, 2.0, 2.5, 3.5, 4 seconds) and overlap
(75 percent and 90 percent) were tested to find the best window size and best
overlap for feature extraction. These were used to evaluate the model’s
performance. Table 5 provides the best results for a window size of 3.5
seconds that is resulting roughly 560 samples per window size and a stride of
1. Using Table 5 concluded that selected window size and overlap increased the
performance and therefore, these segment parameters were utilized to extract
feature vectors. Google colab was used for testing window size and overlap for
feature extraction. All of this testing was done in an online runtime
environment. The specifications of the environment was 12GB of RAM and 64GB of
storage space. Finally using this approach concluded the optimal segmentation
size and fragment overlap.

Table 5: Effect of window size and overlapping over performance  Sr.No. | Window Size | Overlap | Duration for | Accuracy | Validation Accuracy
---|---|---|---|---|---
| (sec) | % | extracting samples | % | %
1 | 0.5 | 90 | 3m 52sec | 55.39 | 31.99
2 | 1 | 75 | 45sec | 69.14 | 36.56
3 | 1 | 90 | 1m 25sec | 55.27 | 36.20
4 | 2 | 75 | 17.38sec | 86.10 | 40.65
5 | 2 | 90 | 38.73sec | 77.60 | 43.49
6 | 2.5 | 75 | 24.76sec | 78.25 | 37.96
7 | 2.5 | 90 | 1m 2sec | 66.55 | 39.88
8 | 3.5 | 50 | 3.6sec | 90.53 | 47.82
9 | 3.5 | 99 | 1m 14sec | 97.39 | 94.23
10 | 4 | 90 | 38.84sec | 75.09 | 43.66

###  5.3 Comparison of accuracy for different domains

After observing the results for artefact removal in the preceding section. The
performance of feature vectors were observed in this section using our
proposed method. To begin, it is limited to a single subject to determine the
accuracy in different domains. The extraction of features and the selection of
relevant vectors is a vital step [47]. As a result, rather than picking a
domain at random, Conducted some experiments, observed the results, and then
made a decision.

Following factors were considered: the statistical metrics are 1. Mean 2.
Variance 3.skewness, 4.kurtosis, and 5.area under the peak. The data-set was
divided into 80:20 training and validation sets. This also aided in avoiding
over-fitting. It was trained using 100 epochs and a batch size of 64 and
attained an accuracy of 72.55 %. While Table 6 depicts the validation and test
accuracy.

Table 6: Accuracy for different sets of features Domains | Accuracy | Validation Accuracy | Test Accuracy
---|---|---|---
| % | % | %
Time domain features | 72.55 | 70.60 | 70.21
Frequency domain features | 45.90 | 45.97 | 46.3851
Time and frequency domain features | 96.02 | .94.67 | 94.431

Frequency domain analysis is particularly important since a frequency
representation of an EEG signal gives some relevant information about the
signal’s patterns. Two features of Power Spectral Density: 1. Maximum
frequency 2. Peak Amplitude. Using these parameters, the proposed model was
trained and obtained an accuracy of 45.90% for identical hyper parameters such
as epochs with 100 and batch-size 64.
Eventually integrated the two domains, frequency domain features and time
domain features, and attained an accuracy of 95.97 percent. It is apparent
that by merging the two domains, improved the performance. It is important to
remember that these features were normalised and that all pre-processing was
completed prior to feature extraction. All above techniques were applied all
on 9 participants for validation, and the outcomes are discussed in the
following section.

Table 7: Performance Metrics for time-frequency domain | Precision | Recall | F1-Score | support
---|---|---|---|---
Class 0 | 0.9594 | 0.9186 | 0.9386 | 17132
Class 1 | 0.9349 | 0.9670 | 0.9507 | 17248
Class 2 | 0.9561 | 0.9371 | 0.9465 | 17278
Class 3 | 0.9272 | 0.9530 | 0.9399 | 17155
accuracy |  |  | 0.9440 | 68813

The Accuracy v/s Epochs and Loss v/s Epochs plots for the Time-frequency
domain combined result, time domain performance, and frequency domain outcome
are shown in the Figure 30. The validation plot is virtually identical to the
real plot, indicating that the model is not over-fitting. These graphs also
suggested in determining the learning rate of the Adam optimizer, which is one
of the hyper parameters. Table 7 shows performance Metrics for Subject one in
time and frequency domain.

Figure 30: Graph for Accuracy and loss vs epochs for Time-Frequency domain,
Time domain and frequency domain

###  5.4 Performance evaluation on different subjects.

Till now, a single subject was tested and came to conclusions concerning
channel selection, various artefact removal strategies, different domain
feature extraction, and the relevance of each on an individual scale for
feature. The single subject’s results was validated employing the intra-
subject validation methodology. Each subject’s EEG data went through the same
method and in Intra-subject Validation schemes, each individual subject’s EEG
data will be processed. Each subject will be evaluated separately. Same
methodology was applied on these subjects, Only time and frequency domains
were considered, which gave good results earlier. Table 8 shows performance of
different subjects and mean accuracy obtained was 94.77%. Figure 31 depicts
the performance of nine subjects in terms of accuracy and loss v/s epochs.
Figure 32 depicts the performance of nine subjects in terms of Validation
Accuracy and loss v/s Epochs.

Table 8: Performance evaluation on different subjects Subjects | Accuracy | Validation Accuracy | Test Accuracy
---|---|---|---
| (%) | (%) | (%)
Subject-1 | 96.02 | 94.55 | 94.431
Subject-2 | 93.58 | 92.12 | 91.09
Subject-3 | 96.10 | 94.51 | 94.12
Subject-4 | 93.01 | 90.75 | 91.75
Subject-5 | 93.28 | 91.47 | 91.01
Subject-6 | 95.95 | 94.98 | 93.02
Subject-7 | 96.72 | 94.51 | 94.29
Subject-8 | 93.44 | 90.94 | 91.09
Subject-9 | 94.02 | 91.88 | 91.91
Figure 31: Accuracy V/s Epochs and Loss V/s Epochs for Nine Subjects Figure
32: Validation-Accuracy V/s Epochs and Validation-Loss V/s Epochs for Nine
Subjects

###  5.5 Comparison of Proposed model Performance with Deep Learning
performance

The deep-learning architecture was compared with the proposed model. All of
the above pre-processing processes were taken into account when developing
this method. Only single subject was considered for the evaluation, since the
training process was time-consuming. The signals were segmented before being
transformed to images and fed into the CNN-architecture as discussed earlier.

Table 9: Performance Metrics for Deep Learning Architecture | Precision | Recall | F1-Score | support
---|---|---|---|---
Class 0 | 0.8594 | 0.8186 | 0.8386 | 228
Class 1 | 0.86 | 0.82 | 0.89 | 215
Class 2 | 0.82 | 0.89 | 0.80 | 233
Class 3 | 0.89 | 0.87 | 0.83 | 203
Accuracy |  |  | 0.83 | 879

Additionally the data was normalised before training and divided the data set
into training and validation sets in an 80:20 ratio having batch size 128. The
raw data was stored into a pickle file during the training phase. Validation
accuracy and accuracy was checked using model-checkpoint callbacks and saved
the best performing model in the .h5 file. As a result, the finest model was
saved. Hence, no need to train the data-set again and again after completion
of this step. The overall-accuracy for deep learning model [27] is 95.41% and
the validation accuracy is 86.76% for 200 epochs. After comparison of deep
learning model with the proposed model. It can be concluded that the proposed
model outperformed and consumed less time while training. Precision, Recall,
F1-Score was calculated for evaluation for Deep learning Architecture which is
shown in Table 9.

###  5.6 Comparison with State of Art Work

Table 10: Comparison with available State-of-the-art  Ref. | Year | Feature | Tasks | Classifier | Decoding
---|---|---|---|---|---
No. |  | Extraction |  |  | Performance(%)
[14] | 2016 | Power Spectral Density, | MI Right and, | SVM | (Class-2)
|  | Entropy | Left Hand Mt. |  | Accuracy-91.25
[48] | 2016 | MEMD, CSP | MI Right and | SVM | (Class-2)
|  |  | Left Hand Mt. |  | Accuracy 83.3
[49] | 2017 | AFA, GLCM | MI | SVM,KNN | (Class-2) (SVM+
|  | DM |  | LDA Bayes | AFA)-Acc:89.29
[16] | 2017 | CSP | MI | SVM | (Class-2)
|  |  |  |  | Accuracy:95
[15] | 2018 | Connectivity | MI, ME | CNN | (Class-2)96.69
|  | pattern |  |  | (Class-4)86%
[17] | 2018 | Maximum | MI | SVM | (Class-2)
|  | Entropy-HOS |  |  | Accuracy:79.14
[18] | 2019 | Phase Lock | MI | Naive | (Class-2)
|  | Lock Value |  | Bayes | Accuracy:88.2
[19] | 2019 | Mean,Median,Std | MI Rest,Right and | SVM | (Class-3)
|  | mode,min,max of CCS | Left Hand Mt. |  | Accuracy:78.75
[50] | 2019 | 1D to 2D | MI | CNN | (class-2)
|  |  |  |  | Acc:71.82$(\pm 4.2)$
[51] | 2020 | 2D- | MI | Inception | (class-2)
|  | spectrogram |  | V3 | Acc:83.79$(\pm 3.49)$
[1] | 2020 | Mean,Variance,Entropy | MI, ME | Attention+ | (class-4)
|  | Pkp,PSD,etc |  | LSTM | Acc:83.2($\pm.12$)
[21] | 2020 | 17-statistical | MI | SVM | (Class-2)
|  | features |  |  | F1-score:68.69
Ours | 2021 | Mean,Var,Skewness | MI,ME, Right | MLP-NN | (Class-4)
|  | Kurtosis,Area,PSD | & Left Hand Mt. | CNN+LSTM | 1-Acc: 96.02
|  |  |  |  | 9-Acc: 94.47
|  |  |  |  | CNN- Acc: 86.76

The performance of the algorithm is compared with previous related work. The
results show that our algorithm has best accuracy with more activities
classification.

##  6 Conclusions and Future Scope

A unique algorithm is presented for classifying left and right movements from
EEG signals. EEG signals are prone to contaminate and unwanted signals.
Successful removal of contamination is done using ICA and a novel approach is
developed and implemented. A detailed study of different types of artifacts
and also detailed discussed were carried out on how they affect the signal.
After successful elimination of artifacts and pre-processing, feature
extraction is carried in both domains that is time, as well as frequency
domains, and performance in different domains, are compared simultaneously.
The algorithm outperformed when both domains feature vectors were included.
The intra-subject validation scheme was used to validate on different
subjects. Finally, resembled the execution of the proposed model with the deep
learning model. From the research, it can be concluded that artifact removal
is an essential step. While evaluating the model for EEG signals both time and
frequency domain must be considered.

Furthermore, auto-encoders, can be explored to increase the classification
performance. The further GANs may explored to generate EEG signals
artificially to classify some complex activities. Different feature extraction
techniques may be explored using deep learning to evaluate the performance on
pre-trained Network. A proper validation strategy for EEG-based categorization
has the potential to be developed in the future. There must be a detailed
discussion and a consistent technique for removing artifacts. Training
requires the development of new inventive schemes that take less time and have
a faster reaction time. The future research will primarily concentrate on the
real-time implementation of the technology.

## References

  * [1] Guangyi Zhang, Vandad Davoodnia, Alireza Sepas-Moghaddam, Yaoxue Zhang, and Ali Etemad.  Classification of hand movements from eeg using a deep attention-based lstm network.  IEEE Sensors Journal, 20(6):3113–3122, 2019.
  * [2] Sarah N. Abdulkader, Ayman Atia, and Mostafa-Sami M. Mostafa.  Brain computer interfacing: Applications and challenges.  Egyptian Informatics Journal, 16(2):213–230, 2015.
  * [3] Sidharth Pancholi and Amit M Joshi.  Improved classification scheme using fused wavelet packet transform based features for intelligent myoelectric prostheses.  IEEE Transactions on Industrial Electronics, 67(10):8517–8525, 2019\.
  * [4] Sidharth Pancholi and Amit M Joshi.  Electromyography-based hand gesture recognition system for upper limb amputees.  IEEE Sensors Letters, 3(3):1–4, 2019.
  * [5] Jain P. Varghese A. Joshi Amit M. Pancholi, S.  A novel time-domain based feature for emg-pr prosthetic and rehabilitation application.  In In 2019 41st Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), pages 5084–5087. IEEE, 2019\.
  * [6] Sidharth Pancholi and Amit M Joshi.  Advanced energy kernel-based feature extraction scheme for improved emg-pr-based prosthesis control against force variation.  IEEE Transactions on Cybernetics, 2020.
  * [7] Ji-Hoon Jeong, Kyung-Hwan Shim, Dong-Joo Kim, and Seong-Whan Lee.  Brain-controlled robotic arm system based on multi-directional cnn-bilstm network using eeg signals.  IEEE Transactions on Neural Systems And Rehabilitation Engineering, 28(5):1226–1238, 2020.
  * [8] Muhammad Zahak Jamal.  Signal acquisition using surface emg and circuit design considerations for robotic prosthesis.  Computational Intelligence in Electromyography Analysis-A Perspective on Current Applications and Future Challenges, 18:427–448, 2012\.
  * [9] Sidharth Pancholi and Amit M Joshi.  Portable emg data acquisition module for upper limb prosthesis application.  IEEE Sensors Journal, 18(8):3436–3443, 2018.
  * [10] Sidharth Pancholi and Amit M Joshi.  Time derivative moments based feature extraction approach for recognition of upper limb motions using emg.  IEEE Sensors Letters, 3(4):1–4, 2019.
  * [11] Amit M. Joshi Pancholi Sidharth.  Intelligent upper-limb prosthetic control (iulp) with novel feature extraction method for pattern recognition using emg.  Journal of Mechanics in Medicine and Biology, 2021.
  * [12] https://mne.tools/stable/auto_tutorials/preprocessing/40_artifact_correction_ica.html.
  * [13] Amit M. Joshi Pancholi, Sidharth and Deepak Joshi.  A robust and accurate deep learning based pattern recognition framework for upper limb prosthesis using semg.  arXiv preprint arXiv:2106.02463, 2021.
  * [14] Shubham Singla, S. N. Garsha, and Somsirsa Chatterjee.  Characterization of classifier performance on left and right limb motor imagery using support vector machine classification of eeg signal for left and right limb movement.  In 2016 5th International Conference on Wireless Networks and Embedded Systems (WECON), pages 1–4, 2016.
  * [15] Leila Mousapour, Fateme Agah, Soorena Salari, and Marzieh Zare.  A novel approach to classify motor-imagery eeg with convolutional neural network using network measures.  In 2018 4th Iranian Conference on Signal Processing and Intelligent Systems (ICSPIS), pages 43–47. IEEE, 2018.
  * [16] Su Jing and Xie Yun.  Off-line analysis of motor imagery electroencephalogram.  In 2017 First International Conference on Electronics Instrumentation Information Systems (EIIS), pages 1–6, 2017.
  * [17] LAGDALI Salwa et al.  Classification of left and right hand movement from eeg signals by hos features.  In 2018 9th International Symposium on Signal, Image, Video and Communications (ISIVC), pages 314–317. IEEE, 2018.
  * [18] VK Benzy and AP Vinod.  Classification of motor imagery hand movement directions from eeg extracted phase locking value features for brain computer interfaces.  In TENCON 2019-2019 IEEE Region 10 Conference (TENCON), pages 2315–2319. IEEE, 2019.
  * [19] Md Abu Shahid Chowdhury and Dabasish Kumar Saha.  Processing of motor imagery eeg signals for controlling the opening and the closing of artificial hand.  In 2019 4th International Conference on Electrical Information and Communication Technology (EICT), pages 1–5. IEEE, 2019.
  * [20] Hasan Polat and Mehmet Siraç Özerdem.  Automatic detection of cursor movements from the eeg signals via deep learning approach.  In 2020 5th International Conference on Computer Science and Engineering (UBMK), pages 327–332, 2020.
  * [21] Muhammad Yeamim Hossain and ABMSU Doulah.  Detection of motor imagery (mi) event in electroencephalogram (eeg) signals using artificial intelligence technique.  In 2020 IEEE East-West Design & Test Symposium (EWDTS), pages 1–6. IEEE, 2020.
  * [22] Saeid Sanei.  Adaptive processing of brain signals.  John Wiley & Sons, 2013.
  * [23] Dipali Bansal and Rashima Mahajan.  EEG-Based Brain-Computer Interfaces: Cognitive Analysis and Control Applications.  Academic Press, 2019.
  * [24] Michelle De Haan and Megan R Gunnar.  Handbook of developmental social neuroscience.  Guilford Press, 2009.
  * [25] Chenbei Zhang, Yong Lian, and Guoxing Wang.  Arder: An automatic eeg artifacts detection and removal system.  In 2020 27th IEEE International Conference on Electronics, Circuits and Systems (ICECS), pages 1–2. IEEE, 2020.
  * [26] Najmeh Mashhadi, Abolfazl Zargari Khuzani, Morteza Heidari, and Donya Khaledyan.  Deep learning denoising for eog artifacts removal from eeg signals.  arXiv preprint arXiv:2009.08809, 2020.
  * [27] Chong Yeh Sai, Norrima Mokhtar, Hamzah Arof, Paul Cumming, and Masahiro Iwahashi.  Automated classification and removal of eeg artifacts with svm and wavelet-ica.  IEEE journal of biomedical and health informatics, 22(3):664–670, 2017.
  * [28] Jurgen Dammers, Michael Schiek, Frank Boers, Carmen Silex, Mikhail Zvyagintsev, Uwe Pietrzyk, and Klaus Mathiak.  Integration of amplitude and phase statistics for complete artifact removal in independent components of neuromagnetic recordings.  IEEE Transactions on Biomedical Engineering, 55(10):2353–2362, 2008\.
  * [29] Irene Winkler, Stefan Debener, Klaus-Robert Müller, and Michael Tangermann.  On the influence of high-pass filtering on ica-based artifact reduction in eeg-erp.  In 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), pages 4101–4105, 2015.
  * [30] Prateek Jain, Amit M Joshi, Navneet Agrawal, and Saraju Mohanty.  iglu 2.0: A new non-invasive, accurate serum glucometer for smart healthcare.  arXiv preprint arXiv:2001.09182, 2020.
  * [31] Amit M Joshi, Prateek Jain, Saraju P Mohanty, and Navneet Agrawal.  iglu 2.0: A new wearable for accurate non-invasive continuous serum glucose measurement in iomt framework.  IEEE Transactions on Consumer Electronics, 66(4):327–335, 2020\.
  * [32] Pankti Kansara.  Visual question answering.  2018\.
  * [33] Prateek Jain, Amit M. Joshi, and Saraju P. Mohanty.  iglu: An intelligent device for accurate noninvasive blood glucose-level monitoring in smart healthcare.  IEEE Consumer Electronics Magazine, 9(1):35–42, 2020.
  * [34] Geetanjali Sharma, Abhishek Parashar, and Amit M Joshi.  Dephnn: A novel hybrid neural network for electroencephalogram (eeg)-based screening of depression.  Biomedical Signal Processing and Control, 66:102393, 2021.
  * [35] Diederik P Kingma and Jimmy Ba.  Adam: A method for stochastic optimization.  arXiv preprint arXiv:1412.6980, 2014.
  * [36] Sashank J Reddi, Satyen Kale, and Sanjiv Kumar.  On the convergence of adam and beyond.  arXiv preprint arXiv:1904.09237, 2019.
  * [37] Fatemeh Fahimi, Zhuo Zhang, Wooi Boon Goh, Kai Keng Ang, and Cuntai Guan.  Towards eeg generation using gans for bci applications.  In 2019 IEEE EMBS International Conference on Biomedical & Health Informatics (BHI), pages 1–4. IEEE, 2019.
  * [38] Shiliang Sun, Changshui Zhang, and Yue Lu.  The random electrode selection ensemble for eeg signal classification.  Pattern Recognition, 41(5):1663–1675, 2008.
  * [39] Jamie Ward.  The student’s guide to cognitive neuroscience.  Routledge, 2019.
  * [40] Oostenveld R Onton J Delorme A, Palmer J.  Tutorials for understanding eeg siganls, 2021.
  * [41] Jurgen Dammers, Michael Schiek, Frank Boers, Carmen Silex, Mikhail Zvyagintsev, Uwe Pietrzyk, and Klaus Mathiak.  Integration of amplitude and phase statistics for complete artifact removal in independent components of neuromagnetic recordings.  IEEE transactions on biomedical engineering, 55(10):2353–2362, 2008\.
  * [42] Jaspreet Kaur, Sidharth Pancholi, and Amit M Joshi.  Detection of lung cancer with the fusion of computed tomography and positron emission tomography.  In International Conference on Next Generation Computing Technologies, pages 944–955. Springer, 2017.
  * [43] Poomipat Boonyakitanont, Apiwat Lek-Uthai, Krisnachai Chomtho, and Jitkomut Songsiri.  A review of feature extraction and performance evaluation in epileptic seizure detection using eeg.  Biomedical Signal Processing and Control, 57:101702, 2020.
  * [44] Prateek Jain, Amit M Joshi, and Saraju P Mohanty.  iglu 1.0: An accurate non-invasive near-infrared dual short wavelengths spectroscopy based glucometer for smart healthcare.  arXiv preprint arXiv:1911.04471, 2019.
  * [45] Zheng Li.  Electroencephalography signal analysis and classification based on deep learning.  In 2020 5th International Conference on Information Science, Computer Technology and Transportation (ISCTT), pages 119–125. IEEE, 2020.
  * [46] Sidharth Pancholi, Amit M Joshi, and Deepak Joshi.  A robust and accurate deep learning based pattern recognition framework for upper limb prosthesis using semg.  arXiv preprint arXiv:2106.02463, 2021.
  * [47] Manjunath Tadalagi and Amit M Joshi.  Autodep: automatic depression detection using facial expressions based on linear binary pattern descriptor.  Medical & Biological Engineering & Computing, pages 1–16, 2021\.
  * [48] Sanjoy Kumar Saha and Md. Sujan Ali.  Data adaptive filtering approach to improve the classification accuracy of motor imagery for bci.  In 2016 9th International Conference on Electrical and Computer Engineering (ICECE), pages 247–250, 2016.
  * [49] Muhammed Al-Suify, Walid Al-Atabany, and Mohamed A. A. Eldosoky.  Classification of right and left hand movement using nonlinear analysis.  In 2017 13th International Computer Engineering Conference (ICENCO), pages 282–285, 2017.
  * [50] Neethu Robinson, Seong-Whan Lee, and Cuntai Guan.  Eeg representation in deep convolutional neural networks for classification of motor imagery.  In 2019 IEEE International Conference on Systems, Man and Cybernetics (SMC), pages 1322–1326. IEEE, 2019.
  * [51] Nijisha Shajil, M Sasikala, and AM Arunnagiri.  Deep learning classification of two-class motor imagery eeg signals using transfer learning.  In 2020 International Conference on e-Health and Bioengineering (EHB), pages 1–4. IEEE, 2020.

## Authors’ Biographies

Pranali Kokate is a M.Tech student at Malaviya National Institute of
Technology (MNIT). She has one year of industrial experience in Embedded
Systems. Her current research interests include Machine Learning, Brain-
Computer Interface, Deep Learning, Embedded Systems, Embedded Linux and
Industrial Internet of Things.

Sidharth Pancholi (GS’18) received the Masters from Thapar University,
Patiala, India, in 2016. He has completed his PhD work with Malaviya National
Institute of Technology, Jaipur, India. Currently, he is working as a Research
Associate with the Indian Institute of Technology, Delhi, India. He has worked
as a reviewer of technical journals such as IEEE Transactions/ journals and
served as Technical Programme Committee member for IEEE conferences. He also
received CSIR Travel fellowship and CSSTDS Travel fellowship to attend IEEE
Conference EMBC 2019. He has two years of industry experience. His current
research interests include biomedical signal processing, neural
rehabilitation, Brain computer interface, Human-machine interface, prosthetic
device development, and embedded systems.

Amit M. Joshi (M’08) has completed his M.Tech (by research) in 2009 and
obtained Doctoral of Philosophy degree (Ph.D) from National Institute of
Technology, Surat in August 2015. He is currently an Assistant Professor at
National Institute of Technology, Jaipur since July 2013. His area of
specialization is Biomedical signal processing, Smart healthcare, VLSI DSP
Systems and embedded system design. He has published six book chapters and
also published 50+ research articles in peer reviewed international
journals/conferences. He has served as a reviewer of technical journals such
as IEEE Transactions, Springer, Elsevier and also served as Technical
Programme Committee member for IEEE conferences. He also received UGC Travel
fellowship, SERB DST Travel grant and CSIR Travel fellowship to attend IEEE
Conferences in VLSI and Embedded System. He has served session chair at
various IEEE Conferences like TENCON -2016, iSES-2018, ICCIC-14. He has
already supervised 18 M.Tech projects and 14 B.Tech projects in the field of
VLSI and Embedded Systems and VLSI DSP systems. He is currently supervising
six Ph.D. students.