heart disease prediction application using neural …

81
HEART DISEASE PREDICTION APPLICATION USING NEURAL NETWORK NUR LAILA NAJWA BINTI JOSDI BACHELOR OF COMPUTER SCIENCE (INTERNET COMPUTING) UNIVERSITI SULTAN ZAINAL ABIDIN 2018

Upload: others

Post on 30-Nov-2021

8 views

Category:

Documents


0 download

TRANSCRIPT

HEART DISEASE PREDICTION APPLICATION

USING NEURAL NETWORK

NUR LAILA NAJWA BINTI JOSDI

BACHELOR OF COMPUTER SCIENCE

(INTERNET COMPUTING)

UNIVERSITI SULTAN ZAINAL ABIDIN

2018

HEART DISEASE PREDICTION APPLICATION USING NEURAL NETWORK

NUR LAILA NAJWA BINTI JOSDI

Bachelor of Computer Science (Internet Computing) with Honours

Faculty of Informatics and Computing

Universiti Sultan Zainal Abidin, Terengganu, Malaysia

AUGUST 2018

iii

i

DECLARATION

I hereby declare that this report is based on my original work except for quotations and

citations, which have been duly acknowledged. I also declare that it has not been

previously or concurrently submitted for any other degree at Universiti Sultan Zainal

Abidin or other institutions.

Name: Nur Laila Najwa Bt Josdi

Date: 8 August 2018

ii

CONFIRMATION

This is to confirm that:

The research conducted and the writing of this report was under my supervision.

Name: En. Mohd Khalid Bin Awang

Date: 8 August 2018

iii

DEDICATION

In the name of Allah, Most Gracious, Most Merciful

Most gratitude to Allah SWT, as for His abundance and bounty, this thesis can be

completed on time. I would like to thanks all the lecturers of Universiti Sultan Zainal

Abidin for their knowledge and supports towards my final year project, Heart Disease

Prediction Applications Using Neural Network.

I am deeply indebted to my supervisor, En Mohd Khalid bin Awang for his invaluable

guidance and advices from the very first preparation. He is indeed a very patient and

knowledgeable lecturer. I would like to thank him for his trust to allow me to proceed

with my final year project even though there have been a few times that I disappoint him.

My special thanks to my beloved parents, Josdi bin Rajab and Rohani binti Yaacob, and

my siblings for their never ending support, prayers and encouragements to me during my

preparation for this thesis.

iv

Thank you to Khairul Asyraf, Ahmad Lukman and Nur Nabilah bt Azman for their help

and guidance in doing my final year project until I successfully complete it. Thank you to

all of my friends and everyone who has contributed to my final year project and thesis,

both directly and indirectly. I am very grateful for my success in completing both my

thesis and final year project

v

ABSTRACT

Heart disease strikes everyone regardless of gender, age or weight. A survey by the

Ministry of Health in 2015 has revealed that one in two Malaysians suffers from high

cholesterol, which contributes to heart disease. As the principal cause of death with

13.2% in 2016, heart diseases seem to be worst from time to time. There should be a

proper initiative to help in preventing this disease. Healthcare industry has a big amount

of data collections but unfortunately, they are not mined properly to extract hidden pattern

and relationship. Moreover, Malaysians sometimes are too busy to keep up their regular

checkup to ensure their health. Some people might be short in time and others might be

short in finance as the cost of clinical test might be burdening. There might also happen

so many times that you need doctors‟ help immediately, but they are not available due to

some reason. Healthcare domain needs data mining technique to improve the efficiency

of analytical methodology to detect and value the relationship within the health profile

intelligently, in the cheapest, fastest and safest way. In realizing this situation, a mobile

application that uses a neural network technique will be used to map a set of input data

onto a set of appropriate output data. Researchers reviewed literature on prediction of

heart disease using data mining techniques and reported that Neural Network technique

vi

overcome all other techniques with higher levels of accuracy. Based on Weka tools, the

accuracy for Neural Network in predicting heart disease are almost 100%. It will help to

generate highly accurate prediction result based on the relationships within some medical

factors using only an application in your smartphone without having to go the hospital

and spending money.

vii

ABSTRAK

Penyakit jantung menyerang semua orang tanpa mengira jantina, umur atau berat badan.

Satu tinjauan oleh Kementerian Kesihatan pada tahun 2015 telah mendedahkan bahawa

satu daripada dua orang rakyat Malaysia mengalami kolesterol tinggi, yang menyumbang

kepada penyakit jantung. Sebagai penyebab utama kematian dengan 13.2% pada 2016,

penyakit jantung kelihatannya paling buruk dari semasa ke semasa. Harus ada inisiatif

yang tepat untuk membantu mencegah penyakit ini. Industri penjagaan kesihatan

mempunyai sejumlah besar koleksi data tetapi malangnya, mereka tidak dilombong

dengan betul untuk mengekstrak corak dan hubungan tersembunyi. Selain itu, rakyat

Malaysia kadang-kadang terlalu sibuk untuk memastikan pemeriksaan biasa mereka

untuk memastikan kesihatan mereka. Sesetengah orang mungkin pendek dalam masa dan

yang lain mungkin pendek dalam kewangan kerana kos ujian klinikal mungkin

membebankan. Mungkin terdapat juga banyak kali anda memerlukan bantuan doktor

dengan segera, tetapi mereka tidak boleh didapati kerana alasan tertentu. Domain

penjagaan kesihatan memerlukan teknik perlombongan data untuk meningkatkan

kecekapan metodologi analitik untuk mengesan dan menghargai hubungan dalam profil

viii

kesihatan dengan cara yang paling murah, paling cepat dan paling selamat. Dalam

merealisasikan keadaan ini, aplikasi mudah alih yang menggunakan teknik rangkaian

neural akan digunakan untuk memetakan satu set data input ke satu set data output yang

sesuai. Penyelidik meneliti kesusasteraan mengenai ramalan penyakit jantung

menggunakan teknik perlombongan data dan melaporkan bahawa teknik Rangkaian

Neural mengatasi semua teknik lain dengan tahap ketepatan yang lebih tinggi.

Berdasarkan alat Weka, ketepatan Rangkaian Neural dalam meramal penyakit jantung

hampir 100%. Ia akan membantu untuk menghasilkan hasil ramalan yang sangat tepat

berdasarkan hubungan dalam beberapa faktor perubatan yang hanya menggunakan

aplikasi dalam telefon pintar anda tanpa perlu pergi ke hospital dan membelanjakan

wang.

ix

CONTENTS

DECLARATION i

CONFIRMATION ii

DEDICATION iii

ABSTRACT v

ABSTRAK vii

CONTENT ix

LIST OF TABLE xii

LIST OF FIGURE xiii

CHAPTER I INTRODUCTION

1.1 Project background 1-3

1.2 Problem statement 3-4

1.3 Objectives 4

1.4

1.5

Scopes

Expected Results

4-5

5-6

CHAPTER II LITERATURE REVIEW

2.1 Introduction 7

2.2 Neural Network Concept 7-8

2.3 Neural Network Application 8-9

2.4 Neural Network in Medical 9-10

2.5 Literature Review for Heart Disease Factor 11

2.6 Literature Review for Neural Network in Medical 12

2.7 Literature Review for Mobile Application 13

CHAPTER III

METHODOLOGY

3.1 Introduction 14

3.2 Data Gathering 15

x

3.3 Project Development Methodology

3.3.1 Requirement Analysis Phase 16

3.3.2 Design Phase 16-17

3.3.3 Implementation Phase 17

3.3.4 Testing 18

3.3.5 Deployment and Maintenance 18-19

3.4 Data Provision 19

3.5 Requirement Analysis

3.5.1 Software Requirement 20-21

3.5.2 Hardware Requirement 21

3.6 System Design

3.6.1 Data Model 22-27

3.6.2 Database Design Specification 28-30

3.6.3 Interface Design 31-32

3.6.4 Algorithms 33-34

CHAPTER IV

IMPLEMENTATIONS AND RESULT

4.1 Introduction 35

4.2 System Implementation

4.2.1 Software Component 36

4.3 Interfaces

4.3.1 Homepage 37

4.3.2 Sign in 38

4.3.3 Register new user 39

4.3.4 User profile 40

4.3.5 Update User profile 41

4.3.6 Delete User profile 42

4.3.7 Health Detail Information 43

4.3.8 Prediction Result 44

xi

4.4 Testing

4.4.1 Test Case Sign Up 46

4.4.2 Test Case Sign In 47

4.4.3 Test Case Update User Profile 48

4.4.3 Test Case Delete User Profile 49

4.4.4 Test Case Prediction 50

CHAPTER V

DISCUSSION AND CONCLUSIONS

5.1 Introduction 51

5.2 Result 51

5.3 Project Contribution 52

5.4 Project Constraints 52

5.5 Proposed For Future Work 52-53

5.6 Conclusion 53

REFERENCES 54-56

APPENDIX

Gantt Chart 58

Neural Network Calculation & Database

Declaration

59-64

xii

LIST OF TABLES

TABLE TITLE PAGE

2.1 Literature Review for Heart Disease factors 11

2.2 Literature Review for Neural Network in Medical 12

2.3 Literature Review for Mobile Applications 13

3.1 Type of Attributes 19

3.2 List of Software Requirements 20-21

3.3 List of Hardware Requirements 21

3.4 HDPAUNN Database table 28

3.5 User table 29

3.6 Health information table 29

4.1 Sign up 46

4.2 Sign in 47

4.3 Update user profile 48

4.4 Delete user profile 49

4.5 Prediction 50

xiii

LIST OF FIGURES

FIGURE TITLE PAGE

3.1 Context Diagram 22

3.2 Data Flow Diagram Level 0 22-23

3.3 Data Flow Diagram Level 1 ( Manage user) 24

3.4 Data Flow Diagram Level 1 ( Manage health information) 25

3.5 Data Flow Diagram Level 1 ( Manage prediction) 26

3.6 Entity Relationship Diagram 27

3.7 SQL Script for HDPAUNN database connection 28

3.8 Log in UI 31

3.9 Register UI 31

3.10 Health Detail UI 32

3.11 Result UI 32

3.12 Neural Network 33

3.13 Formula for calculating the neuron‟s output 34

3.14 Formula for normalizing output 34

4.1 Notepad++ 36

4.2 Heart Disease Prediction Apps Homepage 37

xiv

4.3 Heart Disease Prediction Apps Sign In Interface 38

4.4 Heart Disease Prediction Apps Sign up Interface 39

4.5 Heart Disease Prediction Apps User Profile Interface 40

4.6 Heart Disease Prediction Apps Update User Profile

Interface

41

4.7 Heart Disease Prediction Apps Delete User Profile

Interface

42

4.8 Heart Disease Prediction Apps Health Detail Interface 43

4.9 Heart Disease Prediction Apps Result Interface 44

1

CHAPTER 1

INTRODUCTION

1.1 PROJECT BACKGROUND

The rising high-performance computing has benefited numerous disciplines in

finding realistic solutions to their problems. Our health care is no exception to this. Data

mining tools have been developed for effective study of medical information, in order to

assist clinicians in making better diagnosis for treatment purposes. In heart disease

research, data mining technique have performed a significant role. From the different

interpretation between the healthy persons and the heart diseased persons in the already

existing medical data is an appreciable and great approach in the study of heart related

disease classification to find the hidden medical information.

Data mining is the important stage of information discovery in databases, which is

an extraction of implicit, unique, and potentially useful information from data. Neural

network is popularly used to improve performance accuracy. Neural Network is good at

generalizing data without domain knowledge of heart disease prior to training. In

2

addition, by analyzing complex data, Neural Network makes it possible to discover new

patterns and information related to heart disease.

Heart disease describes a range of conditions that affect your heart. Diseases

under the heart disease umbrella include blood vessel diseases such as coronary artery

disease, heart rhythm problems (arrhythmias) and heart defects you're born with

(congenital heart defects), among others. Heart disease has been the leading cause of

death in Malaysian since the early 1980s. According to the latest WHO data published in

May 2014 Coronary Heart Disease Deaths in Malaysia reached 29,363 or 23.10% of total

deaths, affecting all ages and both sexes. Heart disease had been the leading cause of

death in 2016 with 13.2%, followed by pneumonia (12.5%), cerebrovascular diseases

(6.9%), transport accidents (5.4%) and malignant neoplasm of trachea, bronchus & lung

(2.2%).What is of concern is that the age of onset of heart disease in Malaysia is younger

compared to our neighbors and some western nations.

Therefore, to increase emphasis on preventing atherosclerosis by modifying risk

factors, evidence suggests a number of risk factors for heart disease such as age, gender,

high blood pressure, high serum cholesterol levels, smoking and other factors to be used

as the variables that will trigger an output. To prevent this heart disease from being spread

wider, early diagnoses are needed.

Diagnosis is complicated and important task that needs to be executed accurately

and efficiently. The diagnosis is often made, based on a doctor‟s experience and

knowledge. This leads to unwanted results such as errors, delayed treatments and

excessive medical costs of treatments provided to patients.

3

Since most people have limited time limitations, they have not been able to

commit themselves to the health of their bodies. They would feel that periodic check-ups

are not important as long as they are not attacked by any illness.

Therefore, an automatic medical diagnosis application would be exceedingly

beneficial. This is an attempt to present how artificial neural network techniques can be

deployed to help in generating highly accurate prediction result using only a convenient

click on a smartphone that would give user the same result for a fraction of the price and a

fraction of the time.

1.2 PROBLEM STATEMENT

There are some problems that can cause the development of this application.

First, people are not aware about the regular factors that can lead to heart disease even

though it can be controlled by them. The factors such as smoking, exercising and healthy

diet are supposedly should be fully controlled by humans. If he or she takes good care of

these factors, they are able to reduce the risk for the heart disease.

Secondly, our healthcare industry as hospitals and clinics accumulate a huge

amount of patient data over the years. These data provide a basis for the analysis of risk

factors for many diseases. Unfortunately, they are not mined properly to extract hidden

pattern and relationships among clinical and diagnosis data.

4

Lastly, Malaysia Department Statistic in January 2017 had shown that three out

of four Malaysians work, including all age range. For those workers who require extra

time and a very high commitment to their work, they may not have enough time to follow

a regular check-up at the hospital to ensure their body is in good health. Another

challenge in healthcare organizations such as hospitals and medical centers is the

provision of quality services at affordable costs. The costs of the clinical test are quite

high so some people might short in finance so they will miss their check-up. These kinds

of constraints might delay some people from getting an early diagnosis.

All these constraints triggered to the development of this application as it can

ease many people and doctors to have early diagnosis on heart disease.

1.3 OBJECTIVES

There are several objectives for the development of this application including:

i. To determine the factor that lead to heart disease

ii. To predict the heart disease with its factors using data mining

iii. To develop a heart disease prediction mobile application that can help user to get

instant prediction on their health

1.4 SCOPES

The scopes for this project are including:

5

1. User

i. Insert their health information consisting of several factors that can lead to

heart disease.

2. Developers

ii. Insert/update required data to make prediction

3. Application

i. The application is focused on prediction of heart disease based on several

factors in Malaysia.

ii. The application required user to insert their health information consisting of

several factors that can lead to heart disease.

iii. The application will predict whether the users have a heart disease or not after

user has complete filling their health details using neural network.

1.5 EXPECTED RESULTS

Based on the objectives of the development for this project, this application will be run as

below:

i. This application are based on Android platform

ii. This application will help user to diagnose their heart disease with fraction of

price and fraction of time

iii. This application can predict the heart disease accurately

6

iv. This application can help the user to aware of the factors that leads to heart

disease

7

CHAPTER 2

LITERATURE REVIEW

2.1 INTRODUCTION

This chapter discusses the literature review and research about the system that has

similar functionality with this heart disease application. In section 2.2, we describe the

concept of neural network. For section 2.3 and 2.4, the discussion is about neural network

application and neural network in medical respectively. In 2.5, 2.6 and 2.7, we compare

the heart disease factor, use of neural network in medical and health mobile application

using some recent article and journal respectively.

2.2 NEURAL NETWORK CONCEPT

Neural networks are parallel computing devices, which is basically an attempt to

make a computer model of the brain. The main objective is to develop a system to

perform various computational tasks faster than the traditional systems. These tasks

include pattern recognition and classification, approximation, optimization, and data

clustering. Artificial Neural Network (ANN) is an efficient computing system whose

central theme is borrowed from the analogy of biological neural networks. ANNs are

also named as “artificial neural systems,” or “parallel distributed processing systems,” or

8

“connectionist systems.” ANN acquires a large collection of units that are interconnected

in some pattern to allow communication between the units. These units, also referred to

as nodes or neurons, are simple processors which operate in parallel.

Every neuron is connected with other neuron through a connection link. Each connection

link is associated with a weight that has information about the input signal. This is the

most useful information for neurons to solve a particular problem because the weight

usually excites or inhibits the signal that is being communicated. Each neuron has an

internal state, which is called an activation signal. Output signals, which are produced

after combining the input signals and activation rule, may be sent to other units.

2.3 NEURAL NETWORK APPLICATION

Character Recognition - The idea of character recognition has become very

important as handheld devices like the Palm Pilot are becoming increasingly

popular. Neural networks can be used to recognize handwritten characters.

Image Compression - Neural networks can receive and process vast amounts of

information at once, making them useful in image compression. With the Internet

explosion and more sites using more images on their sites, using neural networks

for image compression is worth a look.

Stock Market Prediction - The day-to-day business of the stock market is

extremely complicated. Many factors weigh in whether a given stock will go up or

9

down on any given day. Since neural networks can examine a lot of information

quickly and sort it all out, they can be used to predict stock prices.

Traveling Salesman’s Problem - Interestingly enough, neural networks can solve

the traveling salesman problem, but only to a certain degree of approximation.

Medicine, Electronic Nose, Security, and Loan Applications - These are some

applications that are in their proof-of-concept stage, with the acceptation of a

neural network that will decide whether or not to grant a loan, something that has

already been used more successfully than many humans.

2.4 NEURAL NETWORK IN MEDICAL

Neural Networks are used experimentally to model the human cardiovascular

system. Diagnosis can be achieved by building a model of the cardiovascular system of

an individual and comparing it with the real time physiological measurements taken from

the patient. If this routine is carried out regularly, potential harmful medical conditions

can be detected at an early stage and thus make the process of combating the disease

much easier.

A model of an individual's cardiovascular system must mimic the relationship

among physiological variables (i.e., heart rate, systolic and diastolic blood pressures, and

breathing rate) at different physical activity levels. If a model is adapted to an individual,

then it becomes a model of the physical condition of that individual. The simulator will

10

have to be able to adapt to the features of any individual without the supervision of an

expert. This calls for a neural network.

Another reason that justifies the use of ANN technology is the ability of ANNs to

provide sensor fusion which is the combining of values from several different sensors.

Sensor fusion enables the ANNs to learn complex relationships among the individual

sensor values, which would otherwise be lost if the values were individually analysed. In

medical modeling and diagnosis, this implies that even though each sensor in a set may be

sensitive only to a specific physiological variable, ANNs are capable of detecting

complex medical conditions by fusing the data from the individual biomedical sensors.

This model could be used to monitor employees in hazardous environments like

fire-fighters. The system could be used to determine whether firemen have recovered

sufficiently from the last inhalations of smoke to be allowed to enter smoke-filled

environments again.

The advantages that such a system can offer are obvious. People can be checked

for heart diseases quickly and painlessly and thus detecting any disease at an early stage.

Of course, the system doesn't eliminate the need for doctors since a human expert is more

reliable.

ANNs have a lot to offer to modern medicine. At the moment they are mainly used

for pattern recognition using images but experiments are being done in using ANNs to

model parts of the human body. The high computation rates of ANNs are vital to

telemedicine which is a 'hot' research area at the moment. Neural networks will never

11

replace human experts but they can help in screening and can be used by experts to

double-check their diagnosis.

2.5 LITERATURE REVIEW FOR HEART DISEASE FACTOR

AUTHOR/YEAR RESEARCH TITLE FACTORS LEAD TO

HEART DISEASE

Uyar, K., & İlhan, A.

(2017)

Diagnosis of heart disease

using genetic algorithm

based trained recurrent

fuzzy neural networks

-Coronary problem

-High blood pressure

-Diabetes

-MRI Electrocardiogram

-Echocardiography

-Physical examination

-Exercise stress test

Hoare, E., Stavreski, B.,

Kingwell, B. A., &

Jennings,

G. L.

(2017)

Australian adults'

behaviours, knowledge

and perceptions of risk

factors for heart disease: A

cross-sectional study

-High blood pressure

-High cholesterol

-Hereditary heart problems

-Poor diet

-Physical inactivity

-Smoking

-Obesity

-Stress

Table 2.1: Literature Review For Heart Disease Factor

12

2.6 LITERATURE REVIEW FOR NEURAL NETWORK IN MEDICAL

AUTHOR/YEAR RESEARCH TITLE OBJECTIVES

He, L., Li, H., Holland, S.,

Yuan, W., Altaye, M., &

Parikh, N.

(2018)

Early prediction of

cognitive deficits in very

preterm infants using

functional connectome

data in an artificial neural

network framework

To build an unsupervised

SSAE model using functional

connectome data from 884

subjects in autism brain

imaging data exchange

database (ABIDE) to

discover low-dimensional

latent representations/features

from the original high-

dimensional data

Vidaki, A., Ballard, D.,

Aliferi, A., Miller, T. H.,

& Barron, L. P.

(2017)

DNA methylation-based

forensic age prediction

using artificial neural

networks and next

generation sequencing

To use age-specific DNA

methylation patterns to

generate an accurate model

for the prediction of

chronological age using data

from whole blood

Table 2.2: Literature Review For Neural Network In Medical

13

2.3 LITERATURE REVIEW FOR MOBILE APPLICATION

AUTHOR/YEAR RESEARCH TITLE DESCRIPTION

Amutha, A. J., Padmajavalli,

R., & Prabhakar, D.

(2018)

A Novel Approach for the

Prediction of Treadmill Test

in Cardiology using Data

Mining Algorithms

implemented as a Mobile

Application

To develop a mobile app

called “TMT Predict” to

predict the results of

Treadmill Test(TMT), using

Data Mining techniques

applied to a clinical dataset

using minimal clinical

attributes

Tuon, F. F., Gasparetto, J.,

Wollmann, L. C., & de

Moraes, T. P.

(2017)

A biopsy of Breast Cancer

mobile applications: state

of the practice review

To characterize breast

cancer apps from the two

major smartphone app

stores (iOS and Android).

Apps that matched the

keywords “breast cancer”

were identified and data was

extracted using a structured

form. Reviewers

independently evaluated the

eligibility and

independently classified the

apps.

Table 2.3: Literature Review For Mobile Application

14

CHAPTER 3

METHODOLOGY

3.1 INTRODUCTION

This chapter discusses the methodology used in developing Heart Disease

Prediction Application using Neural Network. A good and successful project stems out

from a well planned and executed project management methodology. Successful project

management is characterized by good planning, effective scoping and resourcing, realistic

expectations of outcomes and strong management support. The more complex a project,

the more important it is to have rigor applied to its project management through the

adoption and use of a project management methodology. For this project development,

we have used System Development Life Cycle (SDLC) in order to assist from initiation

until the closure. SDLC serves as a guide to the project and provides a flexible and

consistent medium to accommodate changes, and perform the project to meet project‟s

objectives. SDLC creates a structure for the development teams to be able to design,

create and deliver high quality software by defining various tasks that need to happen.

The life cycle defines a methodology for improving the quality of software and the

overall development process.

15

3.2 DATA GATHERING

The data used for this project is collected from UCI Machine Learning Repository.

Statlog (Heart) Data Set contains 13 attributes (which have been extracted from a larger

set of 75) with 270 observations and no missing values. However, only 7 attributes were

used for this project.

Then, the dataset is preprocessed to convert its format to .arff as Weka only can

process dataset with .arff and .csv only. Weka is a collection of machine learning

algorithms for data mining tasks. The algorithms can either be applied directly to a

dataset or called from your own Java code. Weka contains tools for data pre-processing,

classification, regression, clustering, association rules, and visualization. It is also well-

suited for developing new machine learning schemes.

After the preprocessing, the next step is to classify the training set using Multi-Layer

Perceptron (MLP) with 1 hidden layer. The dataset is trained for several times until its

accuracy achieved the maximum point. Then, the weights of all the attributes can be taken

to calculate the prediction. Until then, the development of the application started with

Waterfall Model.

3.3 Project Development Methodology

The selected methodology to be used for developing this application is Waterfall

model, which is the first SDLC approach that is used for software development. Waterfall

model is simple and easy to understand and use. It is easy to manage due to the rigidity of

the model where each phase has specific deliverables and a review process. In this model

16

phases are processed and completed one at a time and its phases do not overlap. Waterfall

model works well for smaller projects where requirements are very well understood.

3.3.1 Requirement Analysis Phase

Software Development Life Cycle begins with Requirement Analysis phase,

where there is a discussion about the requirements of the software and hardware that is

needed to achieve the goal. The aim of the requirement analysis phase is to capture the

detail of each requirement and to make sure everyone understands the scope of the work

and how each requirement is going to be fulfilled. The problem statement, objectives,

scopes and expected result were identified in this phase.

3.3.2 Design Phase

The next stage of Software Development Life Cycle is the Design phase. During

this phase, we start the high-level design of the software and applications to be able to

deliver each requirement.

The technical details of the design is discussed and various parameters such as

risks, technologies to be used, capability of the team, project constraints, time and budget

are reviewed and then the best design approach is selected for the product.

17

The selected architectural design, defines all the components that needs to be

developed, communications with third party services, user flows and database

communications as well as front-end representations and behavior of each components.

Context Diagram (CD), Data Flow Diagram (DFD) and Entity Relationship

Diagram (ERD) is crucial in this phase as it can help to illustrate how the applications

work as the flow in every process is shown. However, there might be changes during the

implementations phase based on user requirements.

3.3.3 Implementation Phase

After the requirements and design activity is completed, the next phase of the

Software Development Life Cycle is the implementation or development of the software.

In this phase, we start to code according to the requirements and the design discussed in

previous phases.

We create the necessary data in the database, the necessary interfaces and GUI to

interact with the back-end all based on guidelines and procedures defined.

We also write unit tests for each component to test the new code that have been

written, review each other‟s code, create builds and deploy software to an environment.

This cycle of development is repeated until the requirements are met.

18

3.3.4 Testing Phase

Testing is the last phase of the Software Development Life Cycle before the

software is used. During testing, we start to test the system against the requirements.

The aim is to find defects within the system as well as verifying whether the

application behaves as expected and according to what was documented in the

requirements analysis phase or not. The test can be done using a test script to execute

each test and verify the results, or using exploratory testing which is more of an

experience based approach.

However, it is possible that defects are identified in the testing phase. Once a

defect is found, we will identify the details of the issue and if it is a valid defect, it will be

fix and create a new version of the software which needs to be verified again.

This cycle is repeated until all requirements have been tested and all the defects

have been fixed and the software is ready to be used.

3.3.5 Deployment and Maintenance Phase

It is right to deploy to production where we can use the application once the

software has been fully tested and no high priority issues remain in it.

19

If an issue is encountered in the production we will notify it and depending on

how severe the issue is, it might either require a hot-fix which is created in a short period

of time or if not very severe, it can wait until the next version of the software.

3.4 Data Provision

The dataset is collected from UCI Machine Learning Repository. Statlog (Heart)

Data Set has 270 instances and 13 attributes where the attributes are as below:

Attribute Names Attributes Character

Age Real

Sex Binary

Chest pain type Nominal

Resting Blood Pressure Real

Fasting Blood Sugar >120 Mg/Dl Binary

Resting Electrocardiographic Results Nominal

Maximum Heart Rate Achieved Real

Table 3.1: Type of attribute

20

3.5 Software and Hardware Requirement

The table below shows the software and hardware needed in Heart Disease Prediction

Application using Neural Network

3.5.1 Software Requirement

Software Description

Windows 8 Operating system used to store all the

applications, documentations, files and

tools needed

Cordova Platform used to build android-based

mobile application

Microsoft Word 2010 Documentation of the proposal

Lucid Chart Online platform for sketching figures and

diagrams including ERD, DFD and CD

Web browsers Software to gather dataset for heart disease

prediction

Notepad++ Integrated Development Environment for

writing codes

21

Weka 3.8 Data mining tools to implement data

mining algorithm in Java language

Table 3.2: List of software requirements

3.5.2 Hardware Requirement

Hardware Description

Asus-X454L Laptop used for documentation and

developing mobile application with

specification as below:

Intel® Core ™ i3-5005U

[email protected] 2.00GHZ

4.00GB RAM

500GB HDD

64-bit operating system, x64

based processor

Printer HP Deskjet 2520hc Print out documentation and files

OPPO A33f Android mobile phone to run application

Table 3.3: List of hardware requirements

22

3.6 System Design

3.6.1 Data Model

3.6.1.1 Context Diagram

The context diagram below shows the overall process in Heart Disease Prediction

Application using Neural Network. There are two external entities, user and ZWeka. The

user will fill in user details and log in to access the application. User can manage their

health details and update their prediction details. The application will give the prediction

result to the user after the user has finished filling in their health detail. Weka will provide

the prediction weight to be used by the application to produce prediction result.

Figure 3.1: Context Diagram

23

3.6.1.2 Data Flow Diagram Level 0

Figure 3.2: Data Flow Diagram Level 0

Data Flow Diagram (DFD) Level 0 consist of four main processes. The first

process is manage user where user will fill in user detail to be store in user profile data

store. User can manage health information by providing their health details to be store

in health profile data store. The user also can manage prediction by submitting their

health details to prediction profile data store and the data store will later respond by

24

giving out their prediction result requested by user. The prediction result then will be used

for managing knowledge by WEKA before the knowledge details then be sent to

knowledge profile.

3.6.1.3 Data Flow Diagram Level 1 (Manage user)

Figure 3.3: Data Flow Diagram Level 1 (Manage User)

The Data Flow Diagram Level 1 (Manage User) is specifically designed for user

management. Users need to register the application and fill in the registration details.

Then, they can log in to the application by submitting the email and password created by

them in register process previously. Users can update their profile and all this process

will be store in user profile data store.

25

3.6.1.4 Data Flow Diagram Level 1 (Manage Health Information)

Figure 3.4: Data Flow Diagram Level 1 (Manage Health Information)

The Data Flow Diagram Level 1 (Manage Health Information) is specifically

designed for health details management. Users can add and update their health details

and the data will then be store in health profile and prediction profile data store.

26

3.6.1.5 Data Flow Diagram Level 1 (Manage Prediction)

Figure 3.5: Data Flow Diagram Level 1 (Manage Prediction)

The Data Flow Diagram Level 1 (Manage Prediction) is specifically designed for

prediction management. Users can check their prediction result after completing the

health details and the prediction result will be store in prediction profile data store

27

3.6.1.6 Entity Relationship Diagram

Figure 3.6: Entity Relationship Diagram

28

3.6.2 Database Design Specification

A database is a collection of information that is organized so that it can be easily

accessed, managed and updated.

Data is organized into rows, columns and tables, and it is indexed to make it easier to find

relevant information. Data gets updated, expanded and deleted as new information is

added. Databases process workloads to create and update themselves, querying the data

they contain and running applications against it. There are 2 table required to develop the

record for Heart Disease Prediction Application using Neural Network (HDPAUNN)

which are user and health_information.

Table 3.4: HDPAUNN Database Table

Below is the SQL Script for database connection:

Figure 3.7: SQL Script for HDPAUNN database connection

29

The following table is in HDPAUNN database:

Table 3.5: User table

This table consists of 7 attributes which are id_user as unique, username, email, address,

phonenumber, password and reenter password.

Table 3.6: health_information table

this table comprises of 12 attributes which are health_id as unique, username as foreign

key, prediction date (date where user have their diagnose), age, sex, chestpaintype, rbp

30

(rest blood pressure), fbp (fast blood pressure), maxhr (maximum heart rate), rest_ecg

(resting electrocardiographic result), sum (total for ANN (Artificial Neural Network)

formula and normalize_sum (normalize sum after performing ANN formula where this

process use sigmoid function)

31

3.6.3 INTERFACE DESIGN

Figure 3.8: Log in UI

Figure 3.9: Register UI

Log in UI

To log in, users are required to insert their

username and password. For user who

does not have an account yet, they need to

register by clicking the register link. For

user who already has the account,

clicking the „Login‟ button will redirected

them to health detail page.

Register UI

To register, users are required to fill in

the form provided. By clicking the

„Register‟ button, user will be

redirected to log in page.

32

Figure 3.10: Health Detail UI

Figure 3.11: Result UI

Health Detail UI

In this page, user need to fill in the form

provided with their health information.

After answering all questions, they need to

click the „Predict‟ to get the answer.

Result UI

User will get their prediction answer in this page.

If the output is from 0-0.49, it will say „NO‟

which means no risk of heart disease. If the

output is from 0.5 to 1, it will say „YES‟ which

means there is a risk of heart disease.

33

3.6.4 Algorithm/Technique

Artificial Neural Network is used in predicting the heart disease in this project.

Figure 3.12: Neural Network

Multi-Layer Perceptron

• Input data is provided to input layer for processing, which produces a predicted

output.

• The predicted output is subtracted from actual output and error value is calculated.

• The network then uses a Back-Propagation algorithm which adjusts the weights.

• For weights adjusting it starts from weights between output layer nodes and last

hidden layer nodes and works backwards through network.

34

• When back propagation is finished, the forwarding process starts again.

• The process is repeated until the error between predicted and actual output is

minimized.

• The final result will be between 0-0.49( No risk for heart disease) and 0.5-1( Risk

for heart disease)

Formula for calculating the neuron’s output

Figure 3.13: Formula for calculating the neuron‟s output

Formula for normalizing output

Figure 3.14: Formula for normalizing output

Formula for accuracy

PPV ( Positive Predictive Value) = TP/TP+FP

NPV ( Negative Predictive Value) = TN/TN+FN

Accuracy = TP+TN/TP+FP+FN+TN

35

CHAPTER 1V

IMPLEMENTATION AND RESULT

4.1 INTRODUCTION

Implementation and testing are executed to ensure the applications are built based on user

requirements. A few testing need to be done in order to achieve the main goal. These

testing included unit testing, integration testing ad application testing. Heart disease

prediction application using neural network‟s main function focused on user where user

can create an account, login to the application, view, and update and delete profile and

check their prediction result.

36

4.2 SYSTEM IMPLEMENTATION

4.2.1 SOFTWARE COMPONENT

4.2.1.1 NOTEPAD++

The interface on this system is designed using PHP and HTML, using Notepad++.

Notepad++ is a free (as in "free speech" and also as in "free beer") source code editor and

Notepad replacement that supports several languages. Running in the MS Windows

environment, its use is governed by GPL License.

Figure 4.1: Notepad++

37

4.3 INTERFACES

4.3.1 HOMEPAGE INTERFACE

Figure 4.2: Heart Disease Prediction Apps Homepage

Figure 4.0 shows the homepage interface for the Heart Disease Prediction Application.

This is the first page of the application that is shown when user accesses the application.

User can click on the menu bar on the right-top of the interface

38

4.3.2 SIGN IN

Figure 4.3: Heart Disease Prediction Apps Sign In Interface

Figure 4.1 shows the sign in interface. In this page, users need to sign in by

entering their username and password. However, users need to sign up for an account to

have their own username and password. User can click on the „Sign up now‟ at the

bottom of the page to redirect them to sign up interface.

39

4.3.3 REGISTER NEW USER

Figure 4.4: Heart Disease Prediction Apps Sign up Interface

Figure 4.2 shows the sign up interface for Heart Disease Prediction Application.

This interface is for the new users to create their account. They need to fill in some details

such as name/username, address, email, and password and telephone number. After

clicking the „submit‟ button, the details will be stored in the user data store and user will

be redirected to sign in page.

40

4.3.4 USER PROFILE

Figure 4.5: Heart Disease Prediction Apps User Profile Interface

Figure 4.3 shows user profile interface. All the details that user fill in when sign

up to this application will be displayed in this page. Users can update and delete their

profile.

41

4.3.5 UPDATE USER PROFILE

Figure 4.6: Heart Disease Prediction Apps Update User Profile Interface

Figure 4.4 shows update user profile interface. User will be able to update their

information such as email and password in this page. When the user click the „save

changes‟ button, the localhost will alert a notification saying that „profile updated

successfully‟.

42

4.3.6 DELETE PROFILE

Figure 4.7: Heart Disease Prediction Apps Delete User Profile Interface

Figure 4.5 shows delete user profile interface. User can delete some of their

information in this page. When the user click the „delete button, the localhost will alert a

notification saying that „profile deleted successfully‟.

43

4.3.7 HEALTH DETAIL INFORMATION

Figure 4.8: Heart Disease Prediction Apps Health Detail Interface

Figure 4.6 shows health detail interface. User need to insert their health detail

accurately in the form provided. After completing the detail, user can click the submit

button to get their prediction result.

44

4.3.8 PREDICTION RESULT

Figure 4.9: Heart Disease Prediction Apps Result Interface

Figure 4.7 shows the prediction result interface. It will be either „Beware! You

have a risk of getting heart disease‟ or „You do not have any risk of getting heart disease‟.

45

4.4 TESTING

A test case is a set of condition under which a tester will determine whether an

application, software system or one of its features is working as it was originally

established for it to do. The process of doing test case can help to find out problems on

the system requirements. In a test case, it consists of the component which describes an

input, action, or event and an expected response. All of these are used to determine the

application software system is function properly. The tables below show the test cases for

several processes of the application.

46

4.4.1 Test Case Sign Up

Pre-condition: The user must sign up to enable them to be in the database to access the

system.

Step Action Expected responses Pass/fail Comment

1 Fill “name” field Validate the field Pass Empty field will not

be allowed

2 Fill “address” field Validate the field Pass Empty field will not

be allowed

3 Fill “email” field Validate the field Pass Empty field will not

be allowed

4 Fill “password” field Validate the field Pass Empty field will not

be allowed

5 Fill “reenter

password” field

Validate the field Pass Empty field will not

be allowed

6 Fill “telephone

number” field

Validate the field Pass Empty field will not

be allowed

7 Click “Submit” button Go to Sign In page Pass -

Table 4.1: Sign up

Post-condition: The users are redirected to sign in page

47

4.4.2 Test Case Sign In

Pre-condition: The user must be already in the database to access the system.

Step Action Expected responses Pass/fail Comment

1 Fill “username” field Validate the field Pass Invalid username

cannot access the

application

2 Fill “password” field Validate the field Pass Invalid password

cannot access the

application

3 Click “Submit” button Sign in to

homepage

Pass Validation of

incorrect username

and password is

shown

Table 4.2: Sign in

Post-condition: The users are redirected to homepage

48

4.4.3 Test Case Update User Profile

Pre-condition: The user must be already in the database to access the system.

Step Action Expected responses Pass/fail Comment

1 Click “update” button Direct to update

form

Pass -

2 Update “username”

field

Validate the field Pass Empty field will not

be allowed

3 Update “email” field Validate the field Pass Empty field will not

be allowed

4 Update “telephone

number” field

Validate the field Pass Empty field will not

be allowed

5 Update “password”

field

Validate the field Pass Empty field will not

be allowed

6 Click “Save Changes ”

button

Validate the field

and confirm update

Pass -

Table 4.3: Update user profile

Post-condition:

1. Successful update will be stored in database

2. Display new updated data

49

4.4.4 Test Case Delete User Profile

Pre-condition: The user must be already in the database to access the system.

Step Action Expected responses Pass/fail Comment

1 Click “delete” button Direct to delete

form

Pass -

2 Delete “username”

field

Validate the field Pass Empty field will not

be allowed

3 Delete “email” field Validate the field Pass Empty field will not

be allowed

4 Delete “telephone

number” field

Validate the field Pass Empty field will not

be allowed

5 Delete “password”

field

Validate the field Pass Empty field will not

be allowed

6 Click “Save Changes ”

button

Validate the field

and confirm update

Pass -

Table 4.4: Delete user profile

Post-condition:

1. Selected data will be deleted in database

2. Selected data will be not displayed after it was deleted

50

4.4.5 Test Case Prediction

Pre-condition: The user must be already in the database to access the system.

Step Action Expected responses Pass/fail Comment

1 Choose which “age”

field

Validate the field Pass Empty field will not

be allowed

2 Choose which “sex”

field

Validate the field Pass Empty field will not

be allowed

3 Choose which “chest

pain type” field

Validate the field Pass Empty field will not

be allowed

4 Choose which “fasting

blood sugar” field

Validate the field Pass Empty field will not

be allowed

5 Choose which “resting

blood pressure” field

Validate the field Pass Empty field will not

be allowed

6 Choose which “resting

electrocardiography

result” field

Validate the field Pass Empty field will not

be allowed

7. Choose which

“maximum heart rate”

field

Validate the field Pass Empty field will not

be allowed

8 Click “Submit” button Go to Sign In page Pass -

Table 4.5: Prediction

51

CHAPTER V

DISCUSSION

5.1 INTRODUCTION

This chapter discusses on the project contributions, the constraint of the project and its

development, future works that can be taken into considerations and eventually

conclusions.

5.2 RESULT

There are four expected result which is:

This application is in web application platform

• This application will help user to diagnose their heart disease with fraction of

price and fraction of time

• This application can predict the heart disease accurately

• This application can help the user to aware of the factors that leads to heart

disease

52

5.3 PROJECT CONTRIBUTION

The contribution of this application to the user is they can have a prediction of getting

heart disease with a fraction of price and time. This is because, user do not have to worry

if they do not have enough money or time to get a regular check-up at the hospital. With

the health detail that is filled by the user, neural network will calculate the result based on

its theory and provide result to the user. So, user will likely have an accurate prediction of

their heart‟s health status.

This application can help user to alert on their health status and aware on heart disease

factor, whereas it can be controlled by them. The factors are supposedly can be fully

controlled by humans if they have a healthy lifestyle. If he or she takes good care of these

factors, they are able to reduce the risk for the heart disease.

5.4 PROJECT CONSTRAINTS

Several limitations that might be the project constraint are:

• The application can only predict the presence/absence of the heart disease

• The application cannot tell the user what kind of heart disease they are having

• There are no doctors involved in the application

5.5 PROPOSED FOR FUTURE WORK

The application development will be preceded by developing the real working prototype

using computing tools. There should be any improvements that can be done to upgrade

this application functionality. In future, we recommended the proposed application should

involve doctors where the scope and function of this application can be widen to a phase

53

where user can really depend on this application to have a knowledge of heart disease and

their health status.

5.6 CONCLUSIONS

In a nutshell, Heart Disease Prediction Application Using Neural Network was built to

increase public awareness about the dangers of heart disease and the importance of

getting regular checks to ensure our health status. In addition, the community can also

control the factors that can cause heart disease which can help to reduce the rate of patient

with heart disease in our country.

In overall, the three major objectives of this application development have been achieved

successfully and hopefully this application will benefit all communities and people in our

country.

54

REFERENCES

[1] SHARMILA, S. (2017). Analysis of heart disease prediction using data mining

techniques. International Journal of Advanced Networking & Applications

(IJANA) Volume, 8, 93-95.

[2] Kim, J. K., & Kang, S. (2017). Neural Network-Based Coronary Heart Disease

Risk Prediction Using Feature Correlation Analysis. Journal of Healthcare

Engineering, 2017, 2780501.

[3] Retrieved from http://doi.org/10.1155/2017/2780501

[4] Stergiou, C., & Siganos, D. (2014). Artificial Neural Network in Medicine.

[5] Uyar, K., & İlhan, A. (2017). Diagnosis of heart disease using genetic algorithm

based trained recurrent fuzzy neural networks. Procedia Computer Science, 120,

588-593.

[6] Hoare, E., Stavreski, B., Kingwell, B. A., & Jennings, G. L. (2017). Australian

adults' behaviours, knowledge and perceptions of risk factors for heart disease: A

cross-sectional study. Preventive medicine reports, 8, 204-209.

[7] He, L., Li, H., Holland, S., Yuan, W., Altaye, M., & Parikh, N. (2018). Early

prediction of cognitive deficits in very preterm infants using functional

connectome data in an artificial neural network framework. NeuroImage: Clinical.

[8] Vidaki, A., Ballard, D., Aliferi, A., Miller, T. H., & Barron, L. P. (2017). DNA

methylation-based forensic age prediction using artificial neural networks and

55

next generation sequencing. Forensic Science International: Genetics, 28, 225-

236.

[9] Amutha, A. J., Padmajavalli, R., & Prabhakar, D. (2018). A Novel Approach for

the Prediction of Treadmill Test in Cardiology using Data Mining Algorithms

Implemented as a Mobile Application. Indian Heart Journal.

[10] Giunti, G., Giunta, D. H., Guisado-Fernandez, E., Bender, J. L., &

Fernandez-Luque, L. (2018). A biopsy of Breast Cancer mobile applications: state

of the practice review. International journal of medical informatics, 110, 1-9.

[11] Amir Ghahrai, July 2nd, 2017. Testing Excellence. SDLC phase explained.

Retrieved from https://www.testingexcellence.com/software-development-life-

cycle-sdlc-phases/

[12] Dua, D. and Karra Taniskidou, E. (2017). UCI Machine Learning

Repository Irvine, CA: University of California, School of Information and

Computer Science.

Retrieved from https://archive.ics.uci.edu/ml/datasets/Statlog+%28Heart%29

[13] Mayo Foundation for Medical Education and Research (MFMER), 1998-

2018. Heart disease. Retrieved from https://www.mayoclinic.org/diseases-

conditions/heart-disease/symptoms-causes/syc-20353118

[14] Department of Statistics Malaysia, Official Portal (31, October 2017).

Statistics on Causes of Death, Malaysia, 2017. Retrieved from

https://www.dosm.gov.my/v1/index.php?r=column/cthemeByCat&cat=401&bul_i

56

d=Y3psYUI2VjU0ZzRhZU1kcVFMMThGUT09&menu_id=L0pheU43NWJwR

WVSZklWdzQ4TlhUUT09

[15] Tutorials Point (2018). Artificial Neural Network-Basic Concept.

Retrieved from

https://www.tutorialspoint.com/artificial_neural_network/artificial_neural_networ

k_basic_concepts.htm

[16] Neural Network (2018). Applications of neural networks. Retrieved from

https://cs.stanford.edu/people/eroberts/courses/soco/projects/neural-

networks/Applications/index.html

[17] WEKA (2018). WEKA 3: Data Mining Software In Java. Retrieved from

https://www.cs.waikato.ac.nz/ml/weka/

57

APPENDIX

58

GANTT CHART

59

NEURAL NETWORK CALCULATION & DATABASE DECLARATION

60

61

62

63

64