Professional Documents
Culture Documents
By
Patel Harshad S.
(130420704010)
Supervised by,
Prof.(Dr.) Maulin Joshi
(Phd., Professor)
A Thesis Submitted to
Gujarat Technological University
in Partial Fulfillment of the Requirements for
the Degree of Master of Engineering
in Electronics & Communication
DECEMBER 2014
Department
Of
Electronics & Communication Engineering
Sarvajanik College of Engineering & Technology
Dr R.K. Desai Road,
Athwalines, Surat - 395001, India
CERTIFICATE
This is to certify that research work embodied in this thesis entitled Neuro-fuzzy Based
Heart Diseases Diagnosis was carried out by Mr. Harshadkumar Shnakarbhai Patel
(130420704010) at Sarvajanik College of Engineering and Technology for partial
fulfillment of M.E. degree to be awarded by Gujarat Technological University. This
research work has been carried out under my supervision and is to my satisfaction.
Date:
Place: Sarvajanik College of Engineering and Technology,Surat.
Professor
Electronics & Communication
Department
Sarvajanik College of
Engineering & Technology
Seal of Institute
ii
Declaration of originality
I hereby certify that I am the sole author of this thesis and that neither any part of this
thesis nor the whole of the thesis has been submitted for a degree to any other University
or Institution.
I certify that, to the best of my knowledge, my thesis does not infringe upon anyones
copyright nor violate any proprietary rights and that any ideas, techniques, quotations, or
any other material from the work of other people included in my thesis, published or
otherwise, are fully acknowledged in accordance with the standard referencing practices.
Furthermore, to the extent that I have included copyrighted material that surpasses the
bounds of fair dealing within the meaning of the Indian Copyright Act, I certify that I
have obtained a written permission from the copyright owner(s) to include such
material(s) in my thesis and have included copies of such copyright clearances to my
appendix.
I declare that this is a true copy of my thesis, including any final revisions, as approved
by my thesis review committee.
Date:
Pl ace: Sarvajanik College of Engineering and Technology, Surat
Signature of Student :
Name of Student
: Patel Hrashadkumar S.
Enrollment No
: 130420704010
Signature of Guide
Name of Guide:Prof. (Dr.) Maulin M. Joshi
iii
Acknowledgement
I would like to express my deep sense of gratitude to my guide, Prof. (Dr.) Maulin M.
Joshi for imparting me valuable guidance and priceless suggestions during the
dissertation and in creating such an excellent report and also for his full dedication and
devotion of time.
I would further like to thank our Head of Department, Prof. Niteen B. Patel and all the
faculty members for giving me this opportunity. I also wish to communicate my deep
sense of gratitude and thanks to the Almighty God.
I would like to express thanks, gratitude and respect to my parents for giving me valuable
advice and support at all times and in all possible ways. Last but not least,
Acknowledgement will not be over without mentioning a word of thanks to all my friends
& my family members who have provided immeasurable support throughout this journey.
Yours Sincerely
Patel Harshad S.
iv
Table of Contents
1.
Introduction ................................................................................................................. 1
1.1 Scope ......................................................................................................................... 1
1.2 Motivation ................................................................................................................. 2
1.3 Organization of thesis ............................................................................................... 2
2.
3.
Literature Review...................................................................................................... 19
3.1 Prediction of nasopharyngeal carcinoma recurrence by neuro-fuzzy techniques. [3]
....................................................................................................................................... 19
3.1.1 Single input Rule module method (SIRMs)..................................................... 19
3.1.2 Functional-type single input rule modules connected fuzzy inference method
(F-SIRMs) ................................................................................................................. 20
3.1.3 A generalized neural network-type single input rule modules connected fuzzy
inference method (G-NN-SIRMs) ............................................................................ 21
3.2 Effective diagnosis of heart disease through neural networks ensembles. [4] ......... 22
3.3 The reevaluate statistical results of quality of life in patients with cerebrovascular
disease using adaptive network-based fuzzy inference system. [5] ............................... 22
3.3.1 Adaptive Neuro fuzzy inference system .......................................................... 23
4. Implementation ............................................................................................................. 26
REFERENCES ..................................................................Error! Bookmark not defined.
List of Figure
Figure 2-1 Basic Neural Model [2] .................................................................................... 4
Figure 2-2 Feed- forward or acyclic network with single layer [1]................................ 5
Figure 2-3 fully connected feed forward or acyclic network with one hidden layer
and one output layer [1]. .................................................................................................... 6
Figure 2-4 Fuzzy System [2] .............................................................................................. 8
Figure 2-5 Architecture of ANFIS [5]............................................................................. 10
Figure 3-1 Architecture of F-SIRMs [3] ......................................................................... 20
Figure 3-2 Architecture of G-NN-SIRMs [3] ................................................................. 21
Figure 3-3 Block representation of proposed ANFIS structure for input/output
variables.[5] ....................................................................................................................... 23
vi
List of Table
Table 2-1 Attributes description .................................................................................... 11
Table 2-2 Age ................................................................................................................... 13
Table 2-3 Cholesterol ...................................................................................................... 14
Table 2-4 Blood Pressure................................................................................................ 15
Table 2-5 Heart rate........................................................................................................ 15
Table 2-6 Blood Sugar .................................................................................................... 16
Table 2-7 Electrocardiography ...................................................................................... 16
Table 2-8 Old Peak.......................................................................................................... 17
Table 2-9 Thallium Scan ................................................................................................ 17
Table 2-10 Output ........................................................................................................... 18
vii
Acronyms
NN
Neural Network
RBF
FF
MLP
Multilayer Perceptron
MSE
ANN
BP
Back Propagation
SIRMs
F-SIRMS
ANFIS
viii
Abstract
Medical diagnosis where by any application can be incorporated with help of Artificial
Neural Network (ANN), usually called neural network (NN), Adaptive neuro-fuzzy
inference system(ANFIS),the functional type single input rule modules connected fuzzy
inference method(F-SIRMs Method) and the functional and neural network type SIRMs
method(F-NN-SIRMs method).
Automation of classification through the use of computers is common practice today,
reaping tremendous benefits. The example in medical diagnosis, involves the
classification of various diseases considering the number of attributes .In this I can
classify pattern using different technique. In this project it is planned to apply Neurofuzzy based network for specific application using simulation platform. Results could be
analyzed further and compared with other existing methods. In this work, different
attributes are given to the Neuro-fuzzy based network to generate single output classify
person into normal or person with possibility of number of heart attack already occurred.
After training the network with sufficient number of training pair derived from standard
data set, testing is done on the various cases that shows the effectiveness of proposed
approach.
ix
1. Introduction
A major challenge, facing healthcare organizations (hospitals, medical centers) is the
provision of quality services at affordable costs. Quality service implies diagnosing
patients correctly and administering treatments that are effective. Integration of clinical
decision support with computer-based patient records could reduce medical errors,
enhance patient safety, decrease unwanted practice variation, and improve patient
outcome. In spite of the rapid development of pathological research and clinical
technologies, people die suddenly due to arrhythmias and heart diseases. The aim of the
present study is to identify the combination of clinical and a laboratory noninvasive
variable, easy to obtain in most patients, that best predicts the occurrence of heart
diseases. Taking cardiologists as gold standard it is aimed to minimize the difference by
means of machine learning tools. From exhaustive and careful experimentations, it is
observed that proposed Neural Network (NN) classifiers ensures true estimation of the
complex decision boundaries, remarkable discriminating ability and does outperform the
statistical discriminate analysis and classification tree rule based predictions.
Clinical decisions are often made based on doctors intuitions and heuristics experience
rather than on the knowledge rich data hidden in the database. This practice leads to
unwanted biases, errors and excessive medical costs which affects the quality of service
provided to patients. A number of techniques have been used for identification of heart
diseases including waveform analysis, time frequency analysis, complexity measures,
Neuro, Fuzzy, Neuro-fuzzy, Radial Basis Function (RBF) NN and a total least square
based Prony modeling algorithm.
1.1 Scope
Artificial neural network are finding many uses in medical diagnosis. They are actively
being used for such applications as locating previously undetected patterns in mountains
of research data, controlling medical devices based on biofeedback, and Detecting
characteristics in medical imagery. The system uses neural network for model estimation
and classification of Normal and several heart diseases based on the attributes.
1.2 Motivation
In face of uncertainty of heart disease symptoms even experienced cardiologists need
complimentary assistance from intelligent decision system to arrive at precise diagnosis
of cardiac disease.
2. Basic Theory
2.1 Introduction of Neural Network
A neural network is artificial representation of human brain that tries to stimulate its
learning process. Traditionally the neural word referred to biological neurons in the
nervous system that transmit information. Artificial neural network is interconnected
groups of artificial neurons that use mathematical model that uses mathematical model or
computational model for information processing based or connectionist approach to
computation. The artificial neural network is made up of interconnecting artificial
neurons that uses properties of biological neural network.
Artificial neural network is an adaptive system that changes its structure based on external
and internal information that flows to network. In information technology, a neural network
is a system of programs and data structures that approximates the operation of the human
brain. A neural network usually involves a large number of processors operating in parallel,
each with its own small sphere of knowledge and access to data in its local memory.
Typically, a neural network is initially "trained" or fed large amounts of data and rules about
data relationships .A program can then tell the network how to behave in response to an
external stimulus (for example, to input from a computer user who is interacting with the
network) or can initiate activity on its own (within the limits of its access to the external
world).
Machine learning is the field of research devoted to the formal study of learning systems.
This is a highly interdisciplinary field which borrows and builds upon ideas from statistics,
computer science, engineering, cognitive science, optimization theory and many other
disciplines of science and mathematics. One of the most significant attributes of a neural
network is its ability to learn by interacting with its environment or with an information
source. Learning in a neural network is normally accomplished through an adaptive
procedure, known as a learning rule or algorithm, whereby the weights of the network are
incrementally adjusted so as to improve a predefined performance measure over time.
It is basically defined as, Learning is a process by which the free parameters of a neural
network are adapted through a process of stimulation by the environment in which the
network is embedded. The type of learning is determined by the manner in which the
parameter in which the parameter changes takes place. This is carried out through a
number of sequential events:
The neural network is stimulated by an environment.
The neural network undergoes changes in its free parameters as a result of this
simulation.
The neural network responds in a new way to the environment because of the
changes that have occurred in its internal structure.
The above procedure is collectively known as the learning algorithm. There is a variety
of learning algorithms such as supervised learning, semi-supervised learning, reinforced
learning, unsupervised learning, etc.
Where
(1)
Figure 2-2 Feed- forward or acyclic network with single layer [1]
The second class of a feed-forward neural network distinguishes itself by presence of one
or more hidden layer, whose computation nodes are correspondingly called hidden units
or hidden neuron. The function of hidden neuron is to intervene between external input
and network output in some useful manner. By adding one or more hidden layer, the
network is enabling to extract higher order statistics. The source nodes in the input layer
of the network supply respective elements of the activation pattern which constitute the
input signal apply to the neurons in second layer. The output signals of the second layer
are used as an input to the third layer and so on for the rest of the network. The neural
network in the Figure 2.3 is fully connected in the sense that every node in the each layer
of the network is connected to the every other node in adjacent forward layer.
Figure 2-3 fully connected feed forward or acyclic network with one hidden layer and one output
layer [1].
Fuzzy System
A Block Diagram of Fuzzy System Is shown in figure 2-4.
Fuzzy Inference: combines the facts obtained from the Fuzzification with the rule base
and conducts the Fuzzy reasoning process.
Defuzzification: Translate results back to the real world values.
fuzzy sets in the antecedent part. Here, the bell-shaped membership function is used.
Layer 2 is the rule layer. It calculates the rule firing strength from the product of all
incoming signals. These rule firing strengths are normalized in layer 3. This layer is thus
called the normalization layer. Layer 4 is the defuzzification layer. The product of
normalized rule firing strength from layer 3 and a first-order polynomial function of its
inputs is calculated. The last layer is the output layer. It produces the crisp output as the
summation of all incoming signals.
ANFIS is a hybrid learning algorithm in which it combines the least-square estimator and
the gradient descent method. In the forward pass, premise parameters are fixed. The leastsquare estimator is used for determining parameters in the consequent part. In the
backward pass, the consequent parameters are instead fixed. The gradient descent method
is then applied in order to adjust parameters of the antecedent parts.
10
Classes:
Class0: Normal person
Class1: First stroke
Class2: Second stroke
Class3: End of life
Table 2-1 Attributes description
Sr.no
Attribute
Description
Range
Age
Age in year
Continuous
Gender
(1=male, 0=female)
0,1
cp
1,2,3,4
Trestbps
Continuous
Hg)
5
Chol
Continuous
Fbs
0,1
mg/dl)
(1=true , 0= false)
7
Restecg
Resting electrocardiographic
result
11
0, 1, 2
-value 0: normal
-value1: having ST-T wave
abnormality (T wave inversions
and/or ST
Elevation or depression of >
0.05mV)
-value 2: Showing probable or
definite left ventricular
Hypertrophy by Estes 'criteria
8
Thalach
Continuous
Exang
0, 1
0=no)
10
Old peak
ST depression induced by
Continuous
Slope
1, 2, 3
segment
-value 1: up sloping
-value 2: flat
-value 3: down sloping
12
Ca
Continuous
coloured by fluoroscopy
13
Thal
12
3, 6, 7
Input Field
Range
Linguistic
Representation
Age
<38
Young
33-45
Mid
40- 58
Old
52>
Very Old
Chest Pain: This input field has four Chest Pain types: Typical Angina, Atypical Angina,
Non Angina, and Asymptomatic. One Patient can have only one type of Chest Pain at a
time.
To represent Chest Pain,
1= Typical Angina,
2 = Atypical Angina,
3= Non Angina
4 = Asymptomatic.
13
Cholesterol: This input field influences the result much more comparing to other input
fields. Cholesterol can be Low Density Lipoprotein (LDL) and High density Lipoprotein
(HDL). In our system, we only consider LDL. However, it is possible to consider HDL
instead of LDL. We use only one type at a time. This field has four fuzzy sets. Each
fuzzy variable is associated with membership function. The range of the fuzzy sets for
Cholesterol is given in Table 2.
Table 2-3 Cholesterol
Input field
Range
Linguistic
Representation
Low
188-250
Medium
217-307
High
281>
Very High
Gender: This input Field has two representations (Male and Female).
1 represents male
0 indicates female.
Blood Pressure: Another important risk factor is Blood Pressure. It
can be Systolic,
Diastolic and Mean types. In our system, we consider Systolic Blood Pressure. It is
possible to choose any type of Blood Pressure. This field has four fuzzy sets. The ranges
for the Linguistic variable representation are given in Table 2-4. The membership
function is calculated based on the range.
14
Linguistic
Representation
Blood
Pressure
< 134
Low
127- 153
Medium
142-172
High
154>
Very High
Heart rate: This field has three fuzzy sets. Each Linguistic representation is associated
with membership function. The ranges for each linguistic representation are given in
Table 2-5.
Table 2-5 Heart rate
Input Field
Heart rate
Range
Fuzzy sets
< 141
Low
111-164
Medium
162>
High
Blood Sugar: This field plays an important role in changing the results. It has two
linguistic representations. Each fuzz variable is associated with membership function
based on the range. The ranges of fuzzy sets are given in Table 2-6.
15
Input Field
Range
Linguistic
Representation
Blood
Sugar
>=120
Yes(1)
<120
No(0)
Input Field
Range
Electrocardiography <0.4
(ECG)
Fuzzy sets
Normal
0.4 - ST_T
1.8
abnormal
1.8>
Hypertrophy
Exercise: This field indicates whether the patient need exercise test. This input field has
two fuzzy sets representations. If the Patient requires an Exercise test then Value 1 is
entered and if the patient does not need Exercise test value zero is entered. The linguistic
representations are
"Yes" for 1
"No" for 0.
16
Old Peak: This field means ST depression induced by exercise relative to rest. The
meaning of ST depression is related to the ECG field. It means previously the patient's T
wave and S wave in the ECG graph paper were down. Old Peak is necessary to assure the
present condition of T wave and S wave of the ECG. It has three fuzzy sets
representation. Each fuzzy variable is associated with membership function. The range
for the fuzzy sets is given in Table 2-8.
Table 2-8 Old Peak
Input Field
Range
Old Peak
Fuzzy sets
<2
Low
1.5 - 4.2
Risk
3.5>
Terrible
Thallium Scan: Thallium scan is the redistribution of heart image. This input field has
three linguistic representations: Normal, Reversible Defect and Fixed Defect. It depends
on the hours that a heart image appears on the screen of the Gamma camera. This Gamma
camera is able to detect radioactive dye in the body. To develop our system we assume
that the linguistic representation of thallium scan in the Normal, the heart image appears
within 3 hours, in fixed Defect heart image appears within 6 hours and in the Reversible
Defect the heart image appears within 7 hours. The linguistic representation for Thallium
scan is given in Table 8.
Table 2-9 Thallium Scan
Fuzzy sets
Normal
Fixed Defect
Reversible
Defect
17
Output: The output is the presence of Heart disease valued from 0(no presence i.e.
Healthy condition) to 3. If the integer value increases then the heart disease risk
increases. We divide the Output fuzzy sets {normal, First stroke, Second Stroke, End of
life}.The ranges and membership function for output variable are given below:
Table 2-10 Output
Output Field
Result
Range
Fuzzy sets
<=1
Normal
0-2
First Stroke
2-4
Second Stroke
3>
End of life
18
3. Literature Review
3.1 Prediction of nasopharyngeal carcinoma recurrence by neuro-fuzzy
techniques. [3]
Neuro-fuzzy techniques for prediction of nasopharyngeal carcinoma recurrence are
mainly focused in this paper. In the study, clinical data of patients with nasopharyngeal
carcinoma were collected from Ramathibodi hospital, Thailand. In total, 495 records
were taken into account. Relevant factors were extracted and employed in developing
predictive models. The results showed that the proposed technique was superior to the
other neuro-fuzzy techniques, stand-alone neural network, and logistic regression and
Cox proportional hazard model. Accuracy and AUC above 80% and 0.8 could be
achieved. To show validity of the proposed technique, two nonlinear problems, i.e.,
function approximation and the XOR classification problems, are studied.
Neuro-fuzzy techniques
Neuro-fuzzy technique unites fuzzy inference system and artificial neural network in
order to achieve an adaptive reasoning capability. The technique can manage imprecise
information and efficiently handle highly nonlinear problems. In general, parameters of
the fuzzy model are learned to provide mapping between training inputoutput pairs.
Three neuro-fuzzy techniques are mainly investigated in this paper.
19
In the figure, each input, xi (i=1, 2), has three corresponding membership functions, Ai1,
Ai2, Ai3, represented by the Gaussian function form. Degrees of the membership function,
hi1, hi2, hi3, are evaluated in layer1.Therefore, this layer is called the fuzzification layer as
in ANFIS model. Layer2 is called the rule module layer. It consists of rule modules. The
number of rule modules is equal to the number of input variables .Each module contains
m associated fuzzy rules as
Rule modules-i: {xi=Aji
Where fji(xi) is a function of input xi.
20
yi = fji(xi)}j=1mi
(2)
Unifying outputs of the associated fuzzy rules, inference result, yi of the ith module can be
determined by
(3)
(4)
Where wi is the weight of the ith rule module. N is the number of input nodes.
21
(6)
Layer 5 is the output layer.it provides the final inference result as,
(7)
Where,
(8)
Is the induced local field of the pth neuron in the output layer. Wo represents weight of the
output. The gradient descent method is employed for adapting parameters in order to
reduce the error function formed by the difference between the target zt and the final
inference result.
The Error Function is given by
(9)
(ANFIS) and these results are compared with statistical results obtained from the same
data.
Figure 3-3 Block representation of proposed ANFIS structure for input/output variables.[5]
Layer 1:
Every node i in this layer is an adaptive node with a node output define by
(10)
(11)
Ai(x) and Bi2(x) can adopt any fuzzy membership function. X (or y) is the input node i
and Ai (or Bi2) is a linguistic label (small, large, etc.)Associated with this node. If the
bell shaped membership function is employed Ai(x) is given by:
23
( x)
1
x c 2
b
a
i
(12)
Ai, bi, ci are the parameter set. Parameters are referred to as premise parameters.
Layer 2:
Every node in this layer is a fixed node .The output is the product of all the incoming
signals.
(13)
Each node represents the fire strength of the rule.
Layer 3:
Every node in this layer is affixed node labeled N. The ith node calculates the ratio of the
ith rules firing strength to the sum of all rules firing strengths:
o w
3
i
w , i 1,2
w w
i
(14)
o w f
4
wi ( p x q y r i )
i
(15)
Wi is the normalized firing strength from layer 3. {Pi, qi, ri} is the parameter set of this
node. These are referred to as consequent parameters.
Layer 5:
The single node in this layer is a fixed node labeled sum, which computes the overall
output as the summation of all incoming signals:
24
wf
o w f
w w
2
5
i
i 1
i 1
(16)
Constructed an adaptive network that has exactly the same function as a Sugeno fuzzy
model.
25
4. Implementation
4.1 Implementation Using Neural Network
MATLAB (Matrix Laboratory) is a programming language and a development environment
for matrix-based computation. Of particular interest to us here is the Neural Network
Toolbox, which constitutes one of the most comprehensive neural network packages
currently available.
Artificial Intelligence involves the training and performance artificial neural networks on the
problem of classifying result on database. In proposed work as shown in below Figure 4.1
training dataset contains 13 attributes as input and one value for target classification. The
descriptions of 13 attributes are as shown in table 4.1.Weight will be updated for reducing
error and finally one network will be created, which will be directly used for testing.
26
27
Second, output values of each of these input patterns are decided based on
experimentation/ by training pairs generated by experts. We have used standard Cleveland data
Neural network is trained accordingly to the training pairs generated and performance
of the network can be checked using proper evaluating function e.g. MSE (mean
square error)
If any correction is required; make adjustment to step no. 3 and then repeat steps.
28
2. Rule Viewer
3. Surface Viewer
29
30
31
Summary
Standard data set is used for such computation Different Neural network adjustable
parameters/transfer functions are fine-tuned by performing number of experiments. With the
help of both neural network and fuzzy system stage of stroke condition in patience is
analyzed.
32
References
Books
1
Papers
3
Mahmut Tokmakcl,Demet
33