8/10/2019 Neuro fuzzy based heart desease diagnosis
1/42
i
Neuro-fuzzy Based Heart Diseases Diagnosis
By
Patel Harshad S.
(130420704010)
Supervised by,
Prof.(Dr.) Maulin Joshi
(Phd., Professor)
A Thesis Submitted toGujarat Technological University
in Partial Fulfillment of the Requirements for
the Degree of Master of Engineering
in Electronics & Communication
DECEMBER 2014
Department
OfElectronics & Communication Engineering
Sarvajanik College of Engineering & Technology
Dr R.K. Desai Road,
Athwalines, Surat - 395001, India
8/10/2019 Neuro fuzzy based heart desease diagnosis
2/42
ii
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.
Prof.(Dr.) Maulin M. Joshi
ProfessorElectronics & Communication
Department
Sarvajanik College ofEngineering & Technology
Prof. Niteen B. PatelHead of Department
Electronics & Communication
DepartmentSarvajanik College of
Engineering & Technology
Dr. Vaishali Mungurwadi,
Principal,
Faculty of Engineering,Sarvajanik College of Engineering & Technology
Seal of Institute
8/10/2019 Neuro fuzzy based heart desease diagnosis
3/42
iii
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 approvedby 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
Institute Code: 042
8/10/2019 Neuro fuzzy based heart desease diagnosis
4/42
iv
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 anddevotion 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.
8/10/2019 Neuro fuzzy based heart desease diagnosis
5/42
v
Table of Contents
1. Introduction ................................................................................................................. 1
1.1 Scope ......................................................................................................................... 1
1.2 Motivation ................................................................................................................. 2
1.3 Organization of thesis ............................................................................................... 2
2. Basic Theory ............................................................................................................... 3
2.1 Introduction of Neural Network................................................................................ 3
2.2.1 Artificial Neuron Model .................................................................................... 4
2.1.2 Feed-Forward Neural Network .......................................................................... 5
2.2 Introduction of Fuzzy Inference System ................................................................... 7
2.3 Introduction of ANFIS .............................................................................................. 9
2.4 Parameter of Heart Diseases Diagnosis .................................................................. 10
2.4.1 Detail Of attributes ........................................................................................... 13
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.
8/10/2019 Neuro fuzzy based heart desease diagnosis
6/42
vi
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 layerand 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
8/10/2019 Neuro fuzzy based heart desease diagnosis
7/42
vii
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
8/10/2019 Neuro fuzzy based heart desease diagnosis
8/42
viii
Acronyms
NN Neural Network
RBF Radial Basis Function
FF Feed Forward Network
MLP Multilayer Perceptron
MSE Mean Square Error
ANN Artificial Neural Network
BP Back Propagation
SIRMs Single Input Rule Modules
F-SIRMS Function Single Input Rule Modules
ANFIS Adaptive Neuro Fuzzy Inference System
8/10/2019 Neuro fuzzy based heart desease diagnosis
9/42
ix
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 Neuro-
fuzzy 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.
8/10/2019 Neuro fuzzy based heart desease diagnosis
10/42
1
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.
8/10/2019 Neuro fuzzy based heart desease diagnosis
11/42
2
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.
1.3 Organization of thesis
Rest of the thesis is organized as follows: Basic theory of neural network, Fuzzy
Inference System, Adaptive Neuro-Fuzzy Inference System (ANFIS) and Parameter of
Heart Diseases Diagnosis is predicted in chapter 2. Brief review of literature survey is
discussed in chapter 3.The implementation of method and analysis are presented in
chapter 4 which is followed by simulation result and comparison in chapter 5 and finally
conclusion.
8/10/2019 Neuro fuzzy based heart desease diagnosis
12/42
3
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 usesproperties 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
8/10/2019 Neuro fuzzy based heart desease diagnosis
13/42
8/10/2019 Neuro fuzzy based heart desease diagnosis
14/42
5
i (1)
Where is a neuron activation threshold.
2.1.2 Feed-Forward Neural Network
The manner in which the neurons of neural network are structured is intimately linked
with learning algorithm used to train network. We therefore speak of learning algorithm
used in design of neural network as begin structured.
a) Single layer feed forward network:
In a layered neural network the neural are organized in a form of layers. In this we have
input layer of source node that project onto an output layer of a neurons but not vice
versa. So this type is feed forward or acyclic type as shown in Figure 2.2.
Figure 2-2 Feed- forward or acyclic network with single layer[1]
b) Multi-layer feed forward network:
8/10/2019 Neuro fuzzy based heart desease diagnosis
15/42
6
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]
.
8/10/2019 Neuro fuzzy based heart desease diagnosis
16/42
7
2.2 Introduction of Fuzzy Inference System
What is Fuzzy System?
Fuzzy Systems include Fuzzy Logic and Fuzzy Set Theory.
Knowledge exists in two distinct forms:
The Objective knowledge that exists in mathematical form is used in engineering
problems.
The Subjective knowledge that exists in linguistic form, usually impossible to
quantify.
Fuzzy Logic can coordinate these two forms of knowledge in a logical way. Fuzzy
Systems can handle simultaneously the numerical data and linguistic knowledge. Fuzzy
Systems provide opportunities for modeling of conditions which are inherently
imprecisely defined. Many real world problems have been modeled, simulated, and
replicated with the help of fuzzy systems.
The applications of Fuzzy Systems are many like:
Information retrieval systems,
Navigation system
Robot vision.
Expert Systems design have become easy because their domains are inherently fuzzy and
can now be handled better.
Examples: Decision-support systems, financial planners, Diagnostic system, and
Meteorological system.
8/10/2019 Neuro fuzzy based heart desease diagnosis
17/42
8
Fuzzy System
A Block Diagram of Fuzzy System Is shown in figure 2-4.
Figure 2-4 Fuzzy System[2]
Fuzzy System Elements:
Input Vector: X = [x1, x2xn] T are crisp values, which are transformed into fuzzy sets
in the fuzzification block.
Output Vector: Y = [y1, y2ym] T comes out from the defuzzification block, which
transforms an output fuzzy set back to a crisp value.
Fuzzification: a process of transforming crisp values into grades of membership for
linguistic terms, "far", "near", "small" of fuzzy sets.
Fuzzy Rule base: a collection of propositions containing linguistic variables; the rules
are expressed in the form: If (x is A) AND (y is B) . . . . . . THEN (z is C)
Where x, y and z represent variables (e.g. distance, size) and A, B and C are linguistic
variables (e.g. `far', `near', `small').
Membership function:provides a measure of the degree of similarity of elements in the
universe of discourse U to fuzzy set.
8/10/2019 Neuro fuzzy based heart desease diagnosis
18/42
9
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.
2.3 Introduction of ANFIS
Current systems have a lacking in handling imprecise and vague information but still
achieving precise and useful results, which is a natural process for a human brain to
perform. Due to this, Soft Computing emerged as a sub-area of Computational
Intelligence, offering techniques and solutions for computationally deal with imprecise
data (Zadeh 1994).
The Soft Computing techniques tend to be suitable for combining with other established
methods, making it possible to create hybrid systems which are more suitable for problem
solving and data analysis. Fuzzy set theory (Zadeh, 1965), has recently attracted more
interest, as computers are today more suitable for handling the somewhat computationally
intensive calculations imminent in the Soft Computing field.
Another technique affiliated with soft computing is neural networks, inspired from the
actual principles of the human brain, creating an artificial network of interconnected
neurons (Jang et al., 1997). Due to its complex implementation, a neural network is
sometimes regarded as a black-box model. This means that one is only able to see themodels inputs and outputs, not what is going on inside the process.
The advantage is the Learning abilities, which is why it is often used together with other
methods. By including fuzzy sets into the mixture it creates a hybrid approach, called
neuro-fuzzy models, which integrates the strengths of both methods. Jang (1993) and
Jang et al. (1997) introduced a class of adaptive networks that perform in the same
manners as fuzzy inference systems, called ANFIS. The architecture combines the
properties of neural networks and fuzzy logic, creating a dynamic fuzzy inference system
similar to the Sugeno fuzzy model (Sugeno and Kang, 1988), built as a network based on
the same manner as in neural networks.
Adaptive-Network-based Fuzzy Inference System (ANFIS) were firstly introduced by
Jang. It is composed of five layers as shown in Figure 2-5. Layer 1 is called the
fuzzification layer. Crisp inputs are transformed into the membership degrees of the
8/10/2019 Neuro fuzzy based heart desease diagnosis
19/42
10
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.
Figure 2-5 Architecture of ANFIS[5]
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 least-
square 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.
2.4 Parameter of Heart Diseases Diagnosis
The datasets chosen for project are taken Heart diseases database. It concern
classification of person into normal and abnormal person. All attributes and the values are
given.
Number of attributes: 13 + class attributes
8/10/2019 Neuro fuzzy based heart desease diagnosis
20/42
11
Classes:
Class0: Normal person
Class1: First stroke
Class2: Second stroke
Class3: End of life
Table 2-1 Attributes description
Sr.no Attribute Description Range
1 Age Age in year Continuous
2 Gender (1=male, 0=female) 0,1
3 cp Value 1:typical angina
Value 2:atypical angina
Value 3: non-angina pain
Value 4 : asymptomatic
1,2,3,4
4 Trestbps Resting blood pressure(in mm
Hg)
Continuous
5 Chol Serum cholesterol in mg/dl Continuous
6 Fbs (Fasting blood sugar > 120
mg/dl)
(1=true , 0= false)
0,1
7 Restecg Resting electrocardiographic
result
0, 1, 2
http://g/What%20Is%20Angina_%20-%20NHLBI,%20NIH.pdfhttp://g/What%20Is%20Angina_%20-%20NHLBI,%20NIH.pdfhttp://g/What%20Is%20Angina_%20-%20NHLBI,%20NIH.pdf8/10/2019 Neuro fuzzy based heart desease diagnosis
21/42
12
-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 Maximum heart rate achieved Continuous
9 Exang Exercise induced angina (1=yes,
0=no)
0, 1
10 Old peak ST depression induced by
exercise relative to rest
Continuous
11 Slope The slope of the peak exerciseST
segment
-value 1: up sloping
-value 2: flat
-value 3: down sloping
1, 2, 3
12 Ca Number of major vessels (0-3)
coloured by fluoroscopy
Continuous
13 Thal Normal, fixed defect, reversible
defect
3, 6, 7
http://g/The%20ST%20segment%20-%20Life%20in%20the%20Fast%20Lane%20ECG%20Library.pdfhttp://g/The%20ST%20segment%20-%20Life%20in%20the%20Fast%20Lane%20ECG%20Library.pdfhttp://g/The%20ST%20segment%20-%20Life%20in%20the%20Fast%20Lane%20ECG%20Library.pdfhttp://g/The%20ST%20segment%20-%20Life%20in%20the%20Fast%20Lane%20ECG%20Library.pdf8/10/2019 Neuro fuzzy based heart desease diagnosis
22/42
13
2.4.1 Detail Of attributes
For the input variable Cholesterol, we use Low Density Lipoprotein (LDL). However, it
is also possible to use High density Lipoprotein (HDL). In case of Blood Pressure,
Systolic Blood Pressure is used.
Membership function is important for each fuzzy variable. Also rules strength is
calculated based on the membership function.
Age: This input consists of four fuzzy sets i.e. Linguistic variable (Young, Mid, Old,
Very old). Each Linguistic variable has membership functions associated with them. The
range of the fuzzy sets for age is shown in Table 1.
Table 2-2 Age
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.
Input Field Range Linguistic
Representation
Age
Young
Mid
Old
Very Old
8/10/2019 Neuro fuzzy based heart desease diagnosis
23/42
14
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
Cholesterol < 197
188-250
217-307
281>
Low
Medium
High
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.
8/10/2019 Neuro fuzzy based heart desease diagnosis
24/42
15
Table 2-4 Blood Pressure
Input field Range Linguistic
Representation
Blood
Pressure
< 134
127- 153
142-172
154>
Low
Medium
High
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 Range Fuzzy sets
Heart rate < 141
111-164
162>
Low
Medium
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.
8/10/2019 Neuro fuzzy based heart desease diagnosis
25/42
16
Table 2-6 Blood Sugar
Input Field Range Linguistic
Representation
Blood
Sugar
>=120
8/10/2019 Neuro fuzzy based heart desease diagnosis
26/42
17
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 Fuzzy sets
Old Peak
Low
Risk
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
Input Field Range Fuzzy sets
3
6
7
Normal
Fixed Defect
Reversible
Defect
8/10/2019 Neuro fuzzy based heart desease diagnosis
27/42
18
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 Range Fuzzy sets
Result
Normal
First Stroke
Second Stroke
End of life
8/10/2019 Neuro fuzzy based heart desease diagnosis
28/42
19
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.
3.1.1 Single input Rule module method (SIRMs)
The single input rule modules connected type fuzzy inference method (SIRMs method)
has been presented by Yubazaki. It provides the same number of rule modules as input
variables. Therefore, it can decrease the number of fuzzy rules in conventional fuzzy
inference method. Thus it has been effectively applied to many problems however, it can
be handled with only simple application.
8/10/2019 Neuro fuzzy based heart desease diagnosis
29/42
20
3.1.2 Functional-type single input rule modules connected fuzzy
inference method (F-SIRMs)
F-SIRMs was proposed by Sekietal to enhance reasoning capabilities of SIRMs method.
It was successfully applied to nonlinear function approximation and classification
problems. In addition, it has been proven to be a subset of TakagiSugeno inference
system. Simple architecture of F-SIRMs composed of two inputs and one output is shown
in Fig.3-1.
Figure 3-1 Architecture of F-SIRMs[3]
In the figure, each input, xi(i=1, 2), has three corresponding membership functions, Ai1,
Ai2,Ai
3, represented by the Gaussian function form. Degrees of the membership function,
hi1, hi
2, hi
3, 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=Ajiyi= fj
i(xi)}j=1
mi (2)
Where fji(xi) is a function of input xi.
8/10/2019 Neuro fuzzy based heart desease diagnosis
30/42
21
Unifying outputs of the associated fuzzy rules, inference result, yiof the ithmodule can be
determined by
(3)
And the final output of F-SIRMs is given by
(4)
Where wiis the weight of the ith
rule module. N is the number of input nodes.
3.1.3 A generalized neural network-type single input rule modules
connected fuzzy inference method (G-NN-SIRMs)
Though F-SIRMs provided better inference results than the traditional SIRMs method,
with linear functions in the consequent part, generated fuzzy rules are still limited and
unable to efficiently handle highly nonlinear data. In this paper, we propose a generalized
neural network-type single input rule modules connected fuzzy inference method (G-NN-
SIRMs). It combines F-SIRMs technique with artificial neural network. Layer 4 of F-
SIRMs is replaced by multilayer perceptron neural network as shown in Figure 3-2.
Inference results from the rule module layer are thus the inputs to the neural network.
Figure 3-2 Architecture of G-NN-SIRMs[3]
8/10/2019 Neuro fuzzy based heart desease diagnosis
31/42
22
In G-NN-SIRMs model layer 4 represents hidden layer of the multilayer perceptron
neural network. Output, Hk , of the kth
hidden node is obtained by
(5)
Where,
(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. Worepresents 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)
3.2 Effective diagnosis of heart disease through neural networks
ensembles.[4]
Parameters from this paper are taken and are described in the previous section 2.4.
3.3 The reevaluate statistical results of quality of life in patients with
cerebrovascular disease using adaptive network-based fuzzy inference
system.[5]
In this paper, the research data about quality of life in persons with cerebrovascular
disease (CVD) is examined by Adaptive-Network- based Fuzzy Inference system
8/10/2019 Neuro fuzzy based heart desease diagnosis
32/42
23
(ANFIS) and these results are compared with statistical results obtained from the same
data.
3.3.1 Adaptive Neuro fuzzy inference system
The ANFIS is a fuzzy Sugeno model put in the framework of adaptive systems to
facilitate learning and adaptation (Jang, 1993; Jang, 1992). For a first-order Sugeno fuzzy
model Sugeno and Kang, 1988; Takagi and Sugeno, 1985, a typical rule set with two
fuzzy if-then rules can be expressed as
Rule 1: if (x is A1) and (y is B1) then (f1= p1x +q1y + r1).
Rule 2: if (x is A2) and (y is B2) then (f2= p2x +q2y + r2).
Where x and yare the inputs, Aiand Biare the fuzzy sets, fi are the outputs within the
fuzzy region specified by the fuzzy rule, pi, qiand r1are the design parameters that are
determined during the training process. Figure 3-3 illustrates the reasoning mechanism
for this Sugeno model. The corresponding equivalent ANFIS architecture is as shown in
Figure 3-3, where nodes of the same layer have similar functions, as described below.
(Here we denote the output node i in layer 1 as O1, i.)
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 thebell shaped membership function is employed Ai(x) is given by:
8/10/2019 Neuro fuzzy based heart desease diagnosis
33/42
24
bacx
i
i
i
Ax
21
1)(
(12)
Ai, bi, ciare 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:
2,1,
21
3
i
www
wo i
ii
(14)
Output of this layer will be called Normalized firing strengths.
Layer 4:
Every node i in this layer is an adaptive node with a node function:
)(4
rqpwfwo iiiiiii yx (15)
Wiis the normalized firing strength from layer 3. {P i, 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:
8/10/2019 Neuro fuzzy based heart desease diagnosis
34/42
25
ww
fwfwo
i ii
iiii
21
2
12
1
5
(16)
Constructed an adaptive network that has exactly the same function as a Sugeno fuzzy
model.
8/10/2019 Neuro fuzzy based heart desease diagnosis
35/42
26
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.
Figure 0-1 Training and testing of proposed NN
8/10/2019 Neuro fuzzy based heart desease diagnosis
36/42
27
4.1.1 Selection of Parameters
a) Selection of transfer function
net = newff(AX,AY,15, {'tansig' 'purelin'},'trainlm') Where newff is the feed-forward neural
network with input AX, target AY and here 15 neurons in hidden layer.
Transig:- Tansig is a transfer function. Transfer functions calculate a layer's output from its
net input. However, it may be more accurate and is recommended for application.
Purelin:- Purelin is a neural transfer function. Transfer functions calculate a layer's output
from its net input.
b) Selection of training function
Trainlm:- Trainlm is a network training function that updates weight and bias values
according to Levenberg-Marquardt optimization. It is often the fastest backpropagation
algorithm in the toolbox, and is highly recommended as a first-choice supervised algorithm,
although it does require more memory than other algorithms.
c) The Normalization of input data:
Normalization of Each ALL input data is required to be brought in the range between [0 -1]
and thus avoiding undue bias to some of the inputs.
The network is simulated and its output plotted against the targets.
Y= sim(net, p)
The sim command causes the specified Simulink model to be executed. The model is
executed with the data passed to the sim command, which may include parameter values
specified in an options structure. The values in the structure override the values shown for
block diagram parameters in the Configuration Parameters dialog box, and the structure may
set additional parameters that are not otherwise available (such as DstWorkSpace). The
parameters in an options structure are useful for setting conditions for a specific simulation
run.
4.1.2 Training Network Algorithm
In the proposed approach, we train the network as follows:
First, let input cardinality (number of sensor inputs) of the neural networks equal to
13 attribute
Generate training pairs based on attribute
8/10/2019 Neuro fuzzy based heart desease diagnosis
37/42
28
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.
4.2 Implementation using fuzzy logic
In the proposed approach, we train the network as follows:
Define inputs from the data.
Define each input membership function.
Define rules in rule base.
Check result.
4.2.1 Simulation Result
1. Rule Editor
Figure 0-2 Rule Editor
8/10/2019 Neuro fuzzy based heart desease diagnosis
38/42
29
2. Rule Viewer
Figure 0-3 Rule Viewer
3. Surface Viewer
Figure 0-4 Surface viewer of blood sugar and cp
8/10/2019 Neuro fuzzy based heart desease diagnosis
39/42
30
Figure 0-5 Surface Viewer Cholesterol and cp
Figure 0-6 Surface Viewer Cp and Bp
8/10/2019 Neuro fuzzy based heart desease diagnosis
40/42
31
Figure 0-7 Surface Viewer Of Bp and Blood sugar
4.3 Future work
Understanding of ANFIS using simple example
Creation of network based on ANFIS(Adaptive Neuro-fuzzy inference system)
and implementation
Comparison of results by NN,FIS and ANFIS
8/10/2019 Neuro fuzzy based heart desease diagnosis
41/42
32
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 isanalyzed.
8/10/2019 Neuro fuzzy based heart desease diagnosis
42/42
References
Books
1 Simon Haykin, Neural Network a comprehensive foundation, Pearson
Education Asia, 2nd Edition, 19992 RC Chakraborty, Soft Computing-Fundamental of neural network, Dec-
2009
Papers
3 Orrawan Kumdee, Hirosato Seki, Hiroaki Ishii, Thongchai Bhongmakapat
and Panrasee Ritthipravat,Prediction of nasopharyngeal carcinoma
recurrence by neuro-fuzzy techniques, fuzzy sets and systems, pp . 95-
111, Elsevier Ltd, 2012.
4 Resul Das, Ibrahim Turkoglu, Abdulkadir Senger,Effective diagnosis of
heart disease through neural networks ensembles, Expert System with
Application,pp. 7675-7680 Elsevier Ltd, 2009
5 Mahmut Tokmakcl,Demet Vnalan, Ferhan Soyuer and Ahmet
Ozturk,The Reevaluate Statistical results of quality of life in patients
with cerebrovascular disease using Adptive network based fuzzy inference
system,Expert System with Application ,pp.958-963 Elsevier Ltd, 2008