You are on page 1of 28

Annex-E

FYP Final Report Template

TITLE OF THE PROJECT

Final Year Project Report


by

Names

In Partial Fulfillment
Of the Requirements for the degree
Bachelors of Science (CS/SE)

Sukkur IBA University,


Sukkur, Sindh Pakistan
(2019)
[Diagnosing Epilepsy Using EEG]
by
<Zoha Zulfiqar, Muhammad Waqar>
SUBMITTED TO THE DEPARTMENT OF
COMPUTER SCIENCE IN PARTIAL
FULFILLMENT OF THE REQUIREMENTS FOR
THE DEGREE OF

BACHELOR OF SCIENCE IN COMPUTERR


SCIENCE / SOFTWARE ENGINEERING

at
the

SUKKUR IBA University

Month, YYYY

© YYYY <Group Members>. All rights reserved .

The author hereby grants permission to Sukkur IBA to


reproduce and distribute publicly paper and electronic
copies of this thesis and grant others the right to do so.

Signature of Author(s)

<Group Members>

Certified by: Internal Examiner


<Name>,
<Designation>, <Department>

External Examiner
<Name>,
<Designation>, <Department & Organization>
Accepted by:
<Name>,
<Designation>, <Department>
DECLARATION

We hereby declare that this project report entitled “Diagnosing Epilepsy Using EEG”
submitted to the “CS Department”, is a record of an original work done by us under the
guidance of Supervisor “NAME” and that no part has been plagiarized without citations.
Also, this project work is submitted in the partial fulfillment of the requirements for the
degree of Bachelor of Computer Science.

Team Members Signature

Zoha Zulfiqar ______________

Muhammad Waqar ______________

Name ______________

Name ______________

Name ______________

Supervisor: Signature

Dr. Abdul Rehman ______________


Gilal

Date:
______________
Place:
______________
DEDICATION

ACKNOWLEDGEMENTS
TABLE OF CONTENT

LIST OF FIGURES

LIST OF TABLES
ABSTRACT

A sudden, uncontrolled disturbance in the brain, causing periods of unusual behavior,


sensations, and loss of awareness, usually known as a seizure. It happens due to different
reasons like lack of sleep, drugs and brain tumor, but the most common cause is epilepsy.
Epilepsy may stem from changes in the brain’s development, wiring, or chemicals. Doctors
don’t know exactly what causes it, but it can start after an illness or damage to the brain.

About 1 in 26 people will develop epilepsy at some point during their lifetime. There are
around 180,000 new cases of epilepsy each year. About 30% occur in children. Children
and elderly adults are the ones most often affected. It's estimated that about 1.2 percent of
U.S. people have active epilepsy. This comes out to about 3.4 million people nationwide.

Doctors can have a difficult time diagnosing epilepsy. Your doctor may recommend
certain tests. The tests may include blood testing, CT scan, MRI, and EEG tests, and a
toxicology screening to test for drugs, poisons, or toxins.

An electroencephalogram (EEG) can help your doctor diagnose a seizure. This test
measures your brain waves. Viewing brain waves during a seizure can help your doctor
diagnose the type of seizure.

The purpose of this project is to determine epilepsy of a patient using EEG signals. The
sensors will record the brainwaves and determine the changes happening in the brain. The
data collected from the sensors, will help the doctors examine the seizures and conclude if
the seizure is epileptic or non-epileptic. This process can replace the time taking procedure
of taking all the tests manually. For the patient, the cost and time will be reduced.
Chapter 1

INTRODUCTION
1.1 Overview
In this chapter, a detailed introduction is provided to describe the main purpose of the project,
what it actually is, why it is necessary and where it can be used, what problems can be solved
through this project. It starts from a thorough explanation of what Epilepsy is and why does it
happen, then it comes to how the people around the world are affected from it and how this
project will deal with the problems that people face while diagnosing epilepsy.

1.2 Introduction

1.2.1 Epilepsy

Seizures, abnormal movements or behavior due to unusual electrical activity in the brain, are
symptoms of epilepsy. But not all seizures mean that a person have epilepsy. Sometimes trauma,
low blood sugar (hypoglycemia), low blood sodium, high fever, or alcohol or drug abuse can
also cause seizures. [1] The main symptom for epileptic seizures is that it would cause an
abnormal electrical activity in brain. More specifically, our brain cells communicate through
electrical signals – orderly pattern. But in epileptic seizures, these signals become abnormal and
cause an electrical storm in brain.

Normally there are two types of Epilepsy

1. Focal Epilepsy
2. Generalized Epilepsy

Human brain has two parts – each one is known as hemisphere. Focal epilepsy only effects on
hemisphere of the brain. But unlike focal epilepsy, generalized epilepsy effects the complete
brain.
Figure 1: Types of Epilepsy

By monitoring brain’s electrical signals, we can identify if the seizure was epileptic or non-
epileptic.

1.2.1 EEG (Electroencephalogram)


An EEG test is a noninvasive method to monitor brain’s electric activity by placing electrodes on
specific parts along the scalp. Among other methods of diagnosing epilepsy, EEG test is
considered to be a better and effective method.

A doctor may suggest different tests such as:

 Electroencephalogram (EEG)
 Computerized tomography (CT) scan
 Magnetic resonance imaging (MRI)
 Positron emission tomography (PET)
 Single-photon emission computerized tomography (SPECT)
 Neuropsychological tests
 Blood tests
 A toxicology screening to test for poisons, toxins or drugs
All of these tests are expensive and time taking when they are done manually by a doctor. This
project is supposed to provide a way to do an EEG test which is not expensive and can be done
easily and quickly.

Basically, a human brain produces 5 different types of brainwaves caused by electrical impulses
that can be recorded in an EEG test, these waves are:
1. Alpha brainwaves: The frequency is from 9 to 14 cycles per second and it shows when a
person’s mind in a calm and peaceful state like meditating.
2. Beta brainwaves: the frequency is from 15 to 40 cycles per second and it shows when a
person’s mind is involved in strong mental activities like engaging in a conversation.
3. Theta brainwaves: the frequency is slow, ranging from 5 to 8 cycles per second and it
shows when a person’s focus is drifted and is probably daydreaming like driving to a
place he goes everyday so he doesn’t need to focus much on the path.
4. Delta brainwaves: the slowest frequency, from 1 to 3 cycles per second and highest in
amplitude, it shows when a person is sleeping.
5. Gamma brainwaves: the fastest frequency, ranging from 39 to 42 cycles per second and it
represents a mind’s consciousness and level of concentration such as information
processing, perception, attention and memory.

Figure 2: Brainwaves

Since gamma waves are the fastest, they are most useful to determine different brain disorders
such as Alzheimer disease, schizophrenia, injuries, and in our case, epilepsy. During a seizure,
the brainwaves get disrupted and cause sudden bursts of electrical impulses, targeting a brain’s
consciousness. EEG sensors will detect the gamma waves from the brain to find out if the seizure
is epileptic or non-epileptic.

Figure 3: A headset with EEG sensors

After that, the brain signals will be filtered or processed to cancel the noise. Once all the noise is
filtered out, then these signals will be evaluated based on a deep learning trained model, that will
predict the seizure to be epileptic or not. After all the processing, the final results will be saved
on the cloud and also shared with the doctors.

1.2.3 Deep Learning


When an EEG test is done, the doctor recognizes certain patterns of the brain activity to conclude
if it is epilepsy or not. To make it easier for them, our project is trained on a deep learning model
on EEG recordings of epileptic and non-epileptic brain activities to make predictions and
confirm the results.

Instead of using machine learning, this project uses deep learning methods because of the nature
of the dataset. The dataset consists EEG recordings converted into matlab files that act as a 2-
dimentional data just like an image. The model is trained using CNN (Convolutional Neural
Network), which is the most effective for training image data, it works in the same way for
matlab data.

1.3 Background
Around 50 million people worldwide have epilepsy, making it one of the most common
neurological diseases globally. [2] It is characterized by recurrent seizures, which are brief
episodes of involuntary movement that may be focal (partial) or generalized. These seizures
results in excessive electrical discharge in the brain.
Moreover, just one seizure can’t indicates epilepsy – up to 10% people worldwide experience
seizure once in their life. [3] However, epilepsy is defined as having two or more seizures. Also
it is the world’s oldest recognized condition, first recorded almost dating back to 4000 BC. [4]
Despite of being the most common neurological diseases, epilepsy costs a good amount while
diagnosing. Series of expensive tests make it more expensive to be diagnosed. And nearly 80%
of people with epilepsy live in low- and middle-income countries [5], so for them it’s really
difficult afford.
According to the Epilepsy Foundation, epilepsy affects three million people in the U.S. and 50
million worldwide. More specifically, if we talk about Pakistan – every 9.99 (10) out 1000
people are effected by epilepsy.

Figure 4: Prevalence of Epilepsy

According to a study, generalized epilepsy is the most common type of epilepsy in Pakistan. It
affects over 77% of the patients, primary generalized epilepsy affects 59% and secondary
generalized seizure affects 18%. Partial or focal epilepsy affects 9% of the patients, myoclonic
and tonic-clonic affects 5.8%.
Figure 5: types of Epilepsy affected patients in Pakistan

1.4 Problem Statement


The main challenge that is faced by patients as well as for doctors, during EEG tests, is when a
doctor is taking the test, the patient is in a normal condition, which makes it difficult to find the
abnormal activities happening in the brain that epilepsy causes. Sometimes, doctors ask their
patients to stay hungry and to stay sleep deprived before coming for a test, so it may cause a
seizure during the EEG test. But still, the probability of that happening is very low.

EEG tests only works during a seizure, not when a person’s brain is in a normal condition. To
solve that problem, this project can be used by a person whenever it is necessary. It can be used
the minute a person starts to feel like a seizure is going to happen, so that the readings can be
taken immediately from the brain. With that, people having seizures won’t need to go to a doctor
staying hungry and compromising their sleep, which may or may not cause a seizure during a
manual EEG test done by the doctor.

1.5 Scope of the Project


This project is intended to be used by people who experience seizures and want to find out if the
seizures are epileptic or not. In this project, predictions will be made based on a deep learning
model trained on a dataset containing EEG signals of epileptic seizures and non-epileptic
seizures. The dataset contains EEG signal recordings converted into .mat files, for that, we are
using CNN for the deep learning.

After the model is trained, we can test it on real time data using a headset. The headset will
record a person’s brain signals using EEG sensors and then, signals will get processed and then
predicted based on the deep learning model. After that, the predicted results will be sent to an
Android application. In that application, a user can see the predicted results and share the details
with a doctor.

1.6 Objectives
The purpose of this project is to provide a system to diagnose epileptic seizures with a deep
learning model, testing it on real time data using a headset containing EEG signals, and then, an
Android mobile application, in order to show the predicted results to the users so that they can
keep track of their condition.

The main objectives of our project include:

 A deep learning model to make predictions of whether a patient is experiencing an


epileptic seizure or a non-epileptic seizure.
 To use a headset to test the real time brain activity of a patient during seizures and make
predictions based on the deep learning model.
 To create an Android application for users including patient and doctors. A patient can
see his or her status using the application and a doctor can keep track of all the patients’
status of epileptic seizure.
1.7 Chapter Summary
This chapter provided a detailed introduction of the project “Diagnosing Epilepsy Using EEG”,
including a brief overview, introduction, background, problem statement, scope and main
objectives of the whole project.

It covered all the introduction including the main purpose of the project, why it is important,
what problems it can solve, and who can use it. In the next chapter, we provide a detailed
literature review of the project.

Chapter 2

LITERATURE REVIEW
2.1 Overview

This chapter is supposed to provide an insight of related work

2.2 Introduction

There are people who have worked on epilepsy using EEG signals, by writing research papers
related to analyzing data of patients suffering from epilepsy. Most of the time, people who
experience seizures, aren’t aware of the actual cause. It is also difficult for doctors, as the
symptoms vary from person to person. For that purpose, many studies have tried different
approaches to find out the best working solution to detect epilepsy using EEG signals.

But

2.3 Related Work

In 2010, a paper was published named as “Automatic identification of epileptic and background
EEG signals using frequency domain parameters”. In this paper, three different classifiers were
compared to find the most efficient classification from Gaussian Mixture Model, Artificial
Neural Network, and Support Vector Machine. At the end, SVM, along with Burg's method of
estimation, proved to be efficient with an accuracy rate of 93.33%.

In 2011, another paper called “Automatic detection of epileptic EEG signals using higher order
cumulant features” was published. This paper followed a nonlinear higher order spectra (HOS)
approach to extract features and used Support Vector Machine (SVM) for classification which
lead to a 98.5% of accuracy.

In 2014, a paper “Automatic Epileptic Seizure Detection Using Scalp EEG and Advanced
Artificial Intelligence Techniques” was published. In this paper, they used supervised learning to
classify seizure and nonseizure records. According to them, their work was 10% more efficient
then the studies done before.

In 2017, yet another paper got published for Epilepsy Seizure detection using EEG signals. They
processed data used in different researches, using time and frequency domain signals and applied
a Chebyschev filter for preprocessing the signals. They tried different classifiers and compare
them with each other defining their advantages and disadvantages.

Last year, in 2019, “Epileptic Seizure Detection Based o EEG Signals and CNN” was published.
In this study, raw EEG signals are used to classify pre-ictal, inter-ictal, and ictal segments of
epilepsy. By using Convolutional Neural Network and frequency domain signals, they acquired a
higher accuracy rate.

In a recent study, in 2020, “Epileptic seizure detection using EEG signals and extreme gradient
boosting” focuses on which features can be more efficient in detecting epilepsy from EEG
signals. In this paper, they’ve shown how generalized seizures are easier to predict than focal
seizures. Moreover, they suggest which features are more important to diagnose epilepsy.

2.4 Chapter Summary

This chapter provided a

Chapter 3
PROBLEM DEFINITION
3.1 Overview
This chapter highlights the main problem statement, defining what problems can be solved with
this project, who can benefit from it and why it is a better choice than other methods of detecting
epilepsy.

3.2 Problem Definition


Epilepsy is a neurological disorder that affects around 65 million people of the world. There is
no permanent cure for epilepsy and it is certainly very hard to diagnose epilepsy as there are
many other disorders that cause a disruption in brain during seizures and can be confused with
epilepsy. Doctors have to perform different tests on a patient’s brain and it is still hard for them
to find out if the seizures are epileptic or caused by any other problem.

When a doctor performs EEG test on a patient, the results are still hard to interpret. Some doctors
with their expertise, recognize certain patterns of brain activities found in an EEG but most of
the time, they are not completely sure of their assumptions.

The chances of misdiagnosing epilepsy are very high. Reported misdiagnosis rates vary
substantially with estimates ranging between 2% and 71% []. The variation depends on different
factors such as the method of diagnosis, diagnostic criteria and the expertise of the doctor.

A population based study mainly in adults found a misdiagnosis rate of 23% []. Another study,
conducted on behalf of the Trust's management by the British Pediatric Neurology Association
(BPNA) concluded that 31.8% of subjects diagnosed with epilepsy had been misdiagnosed [], the
subjects were children in that study.

Each year more than 90,000 people in England and Wales are wrongly given a diagnosis of
epilepsy, a new study has estimated. This scale of misdiagnosis may be resulting in unnecessary
costs of as much as £138m (€205m; $257m) a year, it says [].

Misdiagnosing epilepsy can lead to a number of problems. To help doctors in diagnosing


epilepsy, this project can be a helping hand for them, to make sure that there assumptions are
right, the predictions based on a trained model of EEG data can help them reach the accurate
conclusion.
Chapter 4

METHODOLOGY

The purpose is to provide a system that diagnoses the epilepsy using EEG signals through a
headset. Basically, we are using a dataset of EEG signals that is converted into MATLAB files,
taken from Epilepsy Foundation System.
At first, we read and analyze the data. We found the data as .mat files of EEG signals from 15
channels each containing 10 minutes of readings.

4.1 Overview
This chapter provides a detailed --- of how the project is developed, the strategies, methods and
tools used to develop the complete project.

Here is a step by step flow of the project development:

 At first, a headset placed on a person’s head during a seizure will record the EEG from
the brain.

4.2 Process Flow
4.3 Project Development Methodology
We will use EEG sensors to get data/signals from the brain. The data then will be stored on the
cloud and will be sent to the mobile device, where the application will receive the data and
predict the results by using trained model. Then the results will be shown on the android
application and will be stored on cloud as well. The purpose of storing the results on the cloud is
to show the complete report and epileptic history of the patient. The report

Chapter 5
DETAILED DESIGN AND ARCHITECTURE

5.1 SYSTEM ARCHIECTURE


This section should provide a high-level overview of how the functionality and responsibilities
of the system were partitioned and then assigned to subsystems or components.

Don't go into too much detail about the individual components themselves (there is a subsequent
section for detailed component descriptions). The main purpose here is to gain a general
understanding of how and why the system was decomposed, and how the individual parts work
together to provide the desired functionality.

At the top-most level, describe the major responsibilities that the software must undertake and
the various roles that the system (or portions of the system) must play. Describe how the system
was broken down into its components/subsystems (identifying each top-level
component/subsystem and the roles/responsibilities assigned to it). Describe how the higher-
level components collaborate with each other in order to achieve the required results. Don't
forget to provide some sort of rationale for choosing this particular decomposition of the system
(perhaps discussing other proposed decompositions and why they were rejected). Feel free to
make use of design patterns, either in describing parts of the architecture (in pattern format), or
for referring to elements of the architecture that employ them.

If there are any diagrams, models, flowcharts, documented scenarios or use-cases of the system
behavior and/or structure, they may be included here (unless you feel they are complex enough
to merit being placed in the Detailed System Design section). Diagrams that describe a particular
component or subsystem should be included within the particular subsection that describes that
component or subsystem.

5.1.1 Architecture Design Approach


Describe the architectural design approach.

5.1.2 Architecture Design


Provide and describe a figure that depicts the overall system architecture. Develop a modular
program structure and explain the relationships between the modules to achieve the complete
functionality of the system. This is a high level overview of how responsibilities of the system
were partitioned and then assigned to subsystems. Identify each high level subsystem and the
roles or responsibilities assigned to it. Describe how these subsystems collaborate with each
other in order to achieve the desired functionality. Don’t go into too much detail about the
individual subsystems. The main purpose is to gain a general understanding of how and why the
system was decomposed, and how the individual parts work together. Provide a diagram
showing the major subsystems and data repositories and their interconnections. Describe the
diagram if required.

5.1.3 Subsystem Architecture


Provide a decomposition of the subsystems in the architectural design. Supplement with text as
needed. You may choose to give a functional description or an object oriented description.

For a functional description, put top level data flow diagram (DFD) and structural decomposition
diagrams. For an OO description, put subsystem model, object diagrams, generalization
hierarchy diagram(s) (if any), aggregation hierarchy diagram(s) (if any), interface specifications,
and sequence diagrams here.

5.2 DETAILED SYSTEM DESING


Most components described in the System Architecture section will require a more detailed
discussion. Other lower-level components and subcomponents may need to be described as well.
Each subsection of this section will refer to or contain a detailed description of a system software
component. The discussion provided should cover the following software component attributes:

5.2.1 Classification

The kind of component, such as a subsystem, module, class, package, function, file, etc. ....

5.2.2 Definition

The specific purpose and semantic meaning of the component. This may need to refer back to the
requirements specification.

5.2.3 Responsibilities
The primary responsibilities and/or behavior of this component. What does this component
accomplish? What roles does it play? What kinds of services does it provide to its clients? For
some components, this may need to refer back to the requirements specification.

5.2.4 Constraints

Any relevant assumptions, limitations, or constraints for this component. This should include
constraints on timing, storage, or component state, and might include rules for interacting with
this component (encompassing preconditions, post conditions, invariants, other constraints on
input or output values and local or global values, data formats and data access, synchronization,
exceptions, etc.)

5.2.5 Composition

A description of the use and meaning of the subcomponents which are a part of this component.

5.2.6 Uses/Interactions

Description of component collaboration with other components. What other components is this
entity used by? What other components does this entity use (this would include any side-effects
this entity might have on other parts of the system)? This concerns the method of interaction as
well as the interaction itself. Object-oriented designs should include a description of any known
or anticipated subclasses, super classes, and meta classes.

5.2.7 Resources

A description of any and all resources that are managed, affected, or needed by this entity.
Resources are entities external to the design such as memory, processors, printers, databases, or a
software library. This should include a discussion of any possible race conditions and/or
deadlock situations, and how they might be resolved.

5.2.8 Processing

A description of precisely how this components goes about performing the duties necessary to
fulfill its responsibilities. This should encompass a description of any algorithms used; changes
of state; relevant time or space complexity; concurrency; methods of creation, initialization, and
cleanup; and handling of exceptional conditions.
5.2.9 Interface/Exports

The set of services (resources, data, types, constants, subroutines, and exceptions) that are
provided by this component. The precise definition or declaration of each such element should
be present, along with comments or annotations describing the meanings of values, parameters,
etc. .... For each service element described, include (or provide a reference) in its discussion a
description of its important software component attributes (Classification, Definition,
Responsibilities, Constraints, Composition, Uses, Resources, Processing, and Interface).

Much of the information that appears in this section is not necessarily expected to be kept
separate from the source code. In fact, much of the information can be gleaned from the source
itself (especially if it is adequately commented). This section should not copy or reproduce
information that can be easily obtained from reading the source code (this would be an unwanted
and unnecessary duplication of effort and would be very difficult to keep up-to-date). It is
recommended that most of this information be contained in the source (with appropriate
comments for each component, subsystem, module, and subroutine). Hence, it is expected that
this section will largely consist of references to or excerpts of annotated diagrams and source
code. Any referenced diagrams or source code excerpts should be provided at any design
reviews.

5.2.10 Detailed Subsystem Design

Provide a detailed description of this software component (or a reference to such a description).
Complex diagrams showing the details of component structure, behavior, or information/control
flow may be included in the subsection devoted to that particular component (although, unless
they are very large or complex, some of these diagrams might be more appropriately included in
the System Architecture section. The description should cover any applicable software
component attributes (some of which may be adequately described solely by a source code
declaration or excerpt).
5.3 CLASS DIAGRAM

5.4 ER DIAGRAM
Chapter 6

IMPLEMENTATION AND TESTING

Explain the methods, tools and techniques used to develop the software. What kind of software
and testing methodologies implemented. Explain core functionalities in narrative format.
Controlled libraries, templates, code walkthroughs,
Explain how the proposed software has been evaluated and compared at runtime with the
original specifications. The Accuracy, Performance and Scalability of the proposed software
must be critically analyzed and should solve identified problem statement.

This project called “Diagnosing Epilepsy using EEG” is software based and it uses a hardware
component as well. The main steps of implementation are as follows:

A headset to record EEG

Chapter 7
RESULTS AND DISCUSSION

A comprehensive evaluation of the solution is presented with supporting figures and graphics.

System testing is performed through a strong testing strategy and the test cases cover all the use
cases.

Chapter 8
CONCLUSION AND FUTURE WORK

Include a brief summary of how the proposed solution is going to/has addressed the problem
statement specified in the introduction section. Provide an overview of what kind of evaluations
were undertaken in order to prove that the solution really solves the problem with evidence on
results findings.

Provide an overview of the recommendations and Include a future directions which is required as
part of the future work.

Chapter 9
REFERENCES

A comprehensive list of references is cited using a standard format.

Ferrie, C. D. (2006). Preventing misdiagnosis of epilepsy. Archives of disease in childhood, 91(3),


206-209.

You might also like