0% found this document useful (0 votes)
30 views24 pages

Artificial: Neural

This document presents a study on the application of Artificial Neural Networks (ANN) for the classification of heart disease using the Cleveland dataset. It details the architecture of the neural network, including input, hidden, and output layers, and discusses the design, implementation, and testing phases which achieved an accuracy of 93.61%. The study emphasizes the effectiveness of ANNs in medical diagnostics, particularly for complex problems where traditional methods may fall short.

Uploaded by

malavchavda162
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views24 pages

Artificial: Neural

This document presents a study on the application of Artificial Neural Networks (ANN) for the classification of heart disease using the Cleveland dataset. It details the architecture of the neural network, including input, hidden, and output layers, and discusses the design, implementation, and testing phases which achieved an accuracy of 93.61%. The study emphasizes the effectiveness of ANNs in medical diagnostics, particularly for complex problems where traditional methods may fall short.

Uploaded by

malavchavda162
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Sheffield Hallam University 29004109

ARTIFICIAL NEURAL NETWORK

VISWA SATHISH SANAKARAPANDIAN RAMESH BABU

MASTER OF SCIENCE IN AUTOMATION ,CONTROL AND


ROBOTICS

29004109

i
Sheffield Hallam University 29004109

TABLE OF CONTENTS
1.INTRODUCTION……………………………………………………………………. iii
2. REQUIREMENTS ANALYSIS ………………………………………………………. iv

2.1. INPUT LAYER………………………………………………………………………… iv


2.2. HIDDEN LAYER ……………………………………………………………………. v
2.3. OUTPUT LAYER……………………………………………………………………. v
2.4. MULTI-LAYER PERCEPTRON…………………………………………………… v
3. DESIGN CONSIDERATION…………………………………………………………. vi
4. IMPLEMENTATION AND TESTING……………………………………………… viii
5. RESULTS…………………………………………………………………………………… xiv
6. CONCLUSIONS…………………………………………………………………………. xx
REFERENECES…………………………………………………………………………. xx
APPENDIX……………………………………………………………………………….. xxi

ii
Sheffield Hallam University 29004109

1.Introduction

Classification is one of the most important data set in data analytics. The
various fields such as business, medicine, industry has been solving their
real-life problems using classification approach. One of the important
tools which emerged for the classification approach is artificial neural
network. The data has been classified in an effective manner using this
method. Using neural network approach, the data set for the heart is
analyzed in this task. Using MATLAB, this task is proceeding to design
and automatic diagnosis of heart diseases. In order to do testing and
running the system, the main data base for heart diseases which is used
here is Cleveland data base.
In the medical diagnose, an ANN is used for the purpose of enhancing
the precision, accuracy and objectivity. By training and testing of a
dataset in the ANN, the purpose of diagnosing a disease is achieved in a
high rate of accuracy and tangibility of medical diagnose. It is a
technique that attempts to simulate the behaviour of the human brain's
neurons. It is been used for several years in order to obtain a detection,
estimation and prediction capabilities in ANN (Behnam Zebrardast,Ali
Ghaffari and Mohammad Masdasri, 2013).
The most important advantage of using ANNs is that they are used for
solving the problems that are too complex for conventional technologies
that there is no algorithmic solution or solutions are highly complex.
These attributes are widely used in medical fields. ANNs have been
successfully used in various areas of medicine like diagnosing systems,
the analysis of medicine, medical images analysis. Diagnosis of the
illness in patients is the most important feature for medical treatment in
which ANNs are suitable system for the operation. How to obtain
information on individual patients is of crucial importance. The more
patients are used in implementing an ANN, the better performance of
the ANN will appear. Another advantage of ANNs regarding the
diagnosis of diseases is that feature like fatigue, exhaustion, emotional
state has no influence on them. Its reason is the implementation of
ANNs on computer systems; these cases are vacuous for computer
systems. ANNs are able to learn and an ANN can be trained before
performing major operation, and use it after training and
testing. Learning in ANNs can be done by adjusting the input weights
and the act of learning can be done, if weight in the input changes in the

iii
Sheffield Hallam University 29004109

case that the desired results happen (Mohammed A.M. Abushariah,


Assal A.M. Alqudah ,Omar Y.Adwan, Rana M.M. Yousef , 2014).

2.Requirements Analysis

In this task, a Cleveland data set is provided and been asked to design,
implement and evaluate the neural network for data classification.
The given dataset has 75 in it which cleaned subset of 14. In the target
set it has been classifying as 0 for the patients who doesn’t have heart
diseases. 1 for the patients who have mild-heart diseases. 2 for the
patients who severe heart diseases. The main focus of the task is to
obtain the number of patients who been classified according to the set
provided. The current state of the task is 90% accuracy in it. By
designing the neural network and cross validation classification is done
in order to obtain or more than the actual accuracy

Figure 1:- Artificial Neural Network

From the above figure we come to know that the three layers are there
such as Input, Hidden and Output .
.

iv
Sheffield Hallam University 29004109

2.1 Input layer: Number of neurons in this layer corresponds to the


number of inputs to the neuronal network. This layer consists of
passive nodes, i.e., which do not take part in the actual signal
modification, but only transmits the signal to the following layer
(Yasushi Sakurai, Yasuko Matsubara, Christos Faloutsos, 2017).

2.2 Hidden layer: This layer has arbitrary number of layers with
arbitrary number of neurons. The nodes in this layer take part in the
signal modification, hence, they are active (Yasushi Sakurai, Yasuko
Matsubara, Christos Faloutsos, 2017).

2.3 Output layer: The number of neurons in the output layer


corresponds to the number of the output values of the
neural network. The nodes in this layer are active ones (Yasushi
Sakurai, Yasuko Matsubara, Christos Faloutsos, 2017).

Now the given data set will be given to each layer of the neural network
and be detected. The input layer consists of patient’s information in the
heart diagnosis system (i.e.,) raw materials. The weights are obtained on
the hidden layers. This will be generated on the output layer. This the
Perceptron System

The summation function for the output layer, Summation function


=x1wi1+x2wi2+…...xnwin.

2.3 Multi-layer Perceptron: The neural network with an input layer,


one or more intermediate layers of neurons and an output layer is
called Multi-Layer Perceptron or MLP. It calculates the weights between
layers starting from random values and making small gradual and
progressive changes after the network’s output errors until the learning
algorithm converges to an acceptable error approximation (Khosrowpour,
2005).

v
Sheffield Hallam University 29004109

Figure 2 :- MLP which has two hidden layers

Back propagation works as a training algorithm in MLP. The input


data is presented to the neural network using this algorithm. During
each iteration, the desired one is compared with the output data, error is
computed and it is fed back to the network. This modify the neurons
weight. Now based on the iteration the desired output is generated.

3.DESIGN CONSIDERATION

After getting the requirements, based on the input data the neural
network is designed.Feedforward.net command is given to design a
neural network and it is the simplest network type.

Figure 3. Feed-Forward Neural Network (view)


vi
Sheffield Hallam University 29004109

Here the data is been given to the input layer and then passes in to the
hidden layer where the weights of neurons have been calculated. Then it
reaches the output layer where the iteration has been done again and
again and finally, we get the output. This is the view of the network
where we give the data and finally, we get it.

In consideration we follow the network which we obtain in it. First the


Cleveland data set is taken and followed by we take a sample data.
According to the task, we need to classify the patients depends upon the
heart diseases they face. Now the 50 data is taken in the sample
workspace and it’s been loaded with the given dataset and been
compared with target .By using in the given network ,the classification
approach will be obtained .

Now we go in to task of classification in order to separate the patients


according to the disease they obtain .All the data set is taken to sub-set
v. v0 is for the patients who doesn’t have heart diseases .v1 is for the
patients who have mild heart diseases and v2 is for the patients who
have severe heart diseases .Each data set is been taken into subset for the
training and testing .

Now for the each subset are taken to the indices values and since it has
repeated values ,50 data are taken in to it .We limited to 50 because it
has same values for each heart diseases .The 10 hidden layers are used
for communication purposes and it transfers the data from input and
output .Each data in the subset is taken the training in the network and
each time few weights have been taken and trained again and again .So
that we can get a good accuracy in it .From the indices its then taken to
the subset and been as classified. When the peak value is reached when
we do test and train, we take the samples with subset and obtained in it.

vii
Sheffield Hallam University 29004109

Figure 4. Neural network training

Here the data has been taken with samples in the input and been
communicated in the hidden layers .The hidden layers calculates each
weight obtained in the system and neurons had been weighed .The data
has been evaluated in the system and been proceed to the output layer
and finally we reach the output of the system .This is been discussed in
the system

Fully recurrent network architecture is the simplest sort of


architecture in which every neuron is connected to each other. Simple
recurrent network is to somehow like fully recurrent network, except
that neurons are not fully connected. Competitive network is the same as
single layer feed forward architecture. In addition of all attributes related
to single layer feed forward architecture, in competitive network there is
connection between outputs. Among aforementioned architecture, feed-
forward architecture is the most suitable one in terms of time
for a large amount of data (Mohammed A.M. Abushariah, Assal A.M.
Alqudah ,Omar Y.Adwan, Rana M.M. Yousef , 2014).

4.IMPLEMANTATION AND TESTING

The neural network is not programmed directly but it is explicitly trained


through a learning algorithm for solving a given task, a process that leads
to “learning through experience”. The learning algorithm helps to define
the specific configuration of a neural network and, therefore, conditions
and determines the ability of the network itself to provide correct
answers to specific problems. The dataset used for network learning
constitutes the so-called learning or training set (Khosrowpour, 2005).

Now the subset which carries classification will get into the process of
training and testing. Each subset has been designated for the following
heart diseases and the values are taken in the work space. Each test and
train is done according to the indices values is given in the design. After
the test of the subsets, all of them taken in to the workspace which is
denoted as p. In that the samples taken for testing with the number of
inputs taken from the data set is obtained. Now the transpose of the p
workstation is taken and been created to the new workspace called p1.
Same as the sample workspace has called to the new work space
sample1.

viii
Sheffield Hallam University 29004109

Now the training part starts, feed-forward net command is given. Now
the trains function is carried with sigmoid process where it trains each
subset to evaluate with the classification in order to obtain the accuracy.
In each layer, the subset of each classification is taken and trained. Now
mynet command is given and here the data receive workspace p1 and
sample 1 is taken. This will be trained to seek for the accuracy. Now the
output of the train value is taken as y and called the given data set in
order to start the simulation. After the simulation, the output
transpose of y stored in the workspace complete. Now in order to
obtain the accuracy which is been trained is taken to the variable valid
which has function of mynet, t and complete. After several number of
training finally I got the accuracy of 93.61% in the artificial neural
network.

Figure 5. the workspace of the neural network

ix
Sheffield Hallam University 29004109

In this figure, the list of workspaces for the given data set, variables and
its transposes are given. Also, we can see the trained accuracy is obtained
in the valid

In the below figure we can see the neural network training tool by using
the command nntraintool in which can see the gradient level
,performance ,validation check in it .As we can see it obtained a minmum
gradient level in it .

x
Sheffield Hallam University 29004109

Figure 6. Neural network training tool

xi
Sheffield Hallam University 29004109

Figure 7. the ploted graph of given data

Figure 8. Plot results of the output of the trained data

The output of the training and the matrix results of the test and train
data is shown after the plot result of the heart disesases .The values of

xii
Sheffield Hallam University 29004109

the validation performance and the mean square error is shown in the
graph . The result of the training data is shown in the train graph

Figure 9.the plot for the performance

The best results which shows the best iterations which has a dirct impact
on accuracy of the model .The result will be good if we obatain good
training with maximum epoch ,which used here is 6epoch

xiii
Sheffield Hallam University 29004109

Figure 10. The plot trainstate of the neural network

It shows the values which is been plotted as graph for gradient ,Mu and
Validation in it .The values are been taken with the epoch 6

Figure 11. The Neural Network Training Error Histogram

xiv
Sheffield Hallam University 29004109

Figure 12 .The regression plot

Here the output of each data has been plotted for the training
,valiadation ,test and training

5.RESULTS

assignment

v2 =

[]

xv
Sheffield Hallam University 29004109

y=

Columns 1 through 12

0.3067 0.2340 0.6448 -0.1976 0.5523 -0.9144 2.1546


0.5777 0.4195 0.1148 -0.7830 0.9811

Columns 13 through 24

1.1431 1.0575 1.3459 0.0383 0.9644 0.8763 0.5676 -0.9879


0.0782 0.6140 0.1176 0.4781

Columns 25 through 36

0.5575 0.7327 0.3900 -0.8181 1.4556 0.8390 0.3122 1.8187


0.0174 0.2875 0.3144 2.2529

Columns 37 through 48

1.4255 0.6244 -0.5831 1.0135 -0.0872 0.3733 0.5351 0.4524


-1.1619 0.0395 0.2627 0.3842

Columns 49 through 60

0.4707 0.4579 1.1408 0.3267 0.3690 0.5919 -0.0598


0.3485 2.4987 0.1789 0.3211 0.5168

Columns 61 through 72

xvi
Sheffield Hallam University 29004109

0.5483 0.2658 0.2318 0.4123 0.3430 0.3508 0.4148 0.1153


1.1684 0.6606 0.3971 -0.5870

Columns 73 through 84

0.0229 -0.3724 0.2760 0.3170 -0.0416 0.3721 1.2862


0.4176 0.4572 0.0826 -0.0470 0.2742

Columns 85 through 96

0.4951 0.2214 -0.1204 1.0813 0.0744 0.3167 0.0308 0.3318


0.6267 0.1243 -1.2256 0.7190

Columns 97 through 108

1.6529 0.4181 0.5338 1.5169 0.7479 0.5003 0.3327 0.8367


0.7623 1.4248 0.2858 0.1644

Columns 109 through 120

0.5280 0.3630 -0.8110 1.8532 1.3215 -0.5607 -0.2491 -


0.2127 1.5571 0.8245 0.3354 0.5442

Columns 121 through 132

1.3941 0.5457 -0.0495 0.6613 -0.5869 0.6680 1.8626 -


0.0590 1.8422 1.4474 2.2899 0.2707

Columns 133 through 144


xvii
Sheffield Hallam University 29004109

0.7045 0.6759 0.6118 0.4539 -0.1045 1.5436 0.1065 -0.2945


0.2124 -0.3962 0.4798 2.0240

Columns 145 through 156

0.7645 0.7125 0.5416 2.0949 0.2781 0.4348 -0.0469


0.0607 1.2012 0.3867 0.3975 0.9782

Columns 157 through 168

0.3520 1.8112 -0.9211 0.5765 1.8784 0.5253 0.1667 0.4261


0.1906 0.4819 0.4183 0.3533

Columns 169 through 180

0.0628 0.0300 0.7449 0.4306 0.8045 0.2201 0.6791 -


0.2231 -0.0241 0.1008 0.1713 0.5840

Columns 181 through 192

0.4796 0.1021 2.1249 0.2125 1.1792 0.3936 0.4686 0.3037


0.8812 1.8793 0.6470 1.7901

Columns 193 through 204

0.3530 0.0209 0.4324 0.7758 0.2099 -0.5357 0.1108


0.4058 -0.1249 1.4133 0.9104 0.5901

Columns 205 through 216


xviii
Sheffield Hallam University 29004109

0.2504 0.1916 -0.0811 -0.1496 1.4375 0.4344 0.0945 0.1285


-0.0143 1.4472 0.5767 1.0791

Columns 217 through 228

1.3795 1.2472 1.0198 0.5348 -0.1565 1.0255 0.6386 0.4690


0.2771 0.5198 1.7530 0.5917

Columns 229 through 240

1.7347 -0.2931 0.6310 0.6190 0.1645 -0.2183 0.2705 0.2328


-1.4351 0.3504 0.4475 -0.1235

Columns 241 through 252

2.1786 0.9555 0.2990 0.4279 0.0395 0.4503 1.4856 -0.1061


0.4031 0.7517 0.3241 2.1297

Columns 253 through 264

0.3673 0.4190 0.3908 0.2205 -0.2412 0.5016 0.3733


0.5532 1.5298 0.1811 0.4723 2.1849

Columns 265 through 276

0.0268 0.5021 -0.3156 0.1098 -0.1770 0.0355 1.8785 -


0.0828 1.1279 -0.0930 0.3306 0.4587

Columns 277 through 288


xix
Sheffield Hallam University 29004109

0.6350 1.3309 0.4714 1.8332 0.2032 1.4806 -1.1097 0.2383


1.4111 0.6182 -0.0267 0.5159
Columns 289 through 297

1.2254 0.0955 -0.2523 0.3122 0.8480 1.0738 1.8615 0.3984


2.2533

>>
The ouput has been implemented in a table and chart .

Complete t
0.306691 0
0.234036 1
0.644775 0
-0.1976 0
0.552281 0
-0.91442 2
2.154604 0
0.577663 1
0.419453 1

1.5

0.5

0
1
12
23
34
45
56
67
78
89
100
111
122
133
144
155
166
177
188
199
210
221
232

Series1
243
254
265
276
287

Chart Title

xx
Sheffield Hallam University 29004109

6.Conclusions

Using the Artificial Neural Network with the given data set, the
classification has been approached in the system. This gives us a way of
classify a complex across all industries .This approach creates a new
gateway for the field of analytics

xxi
Sheffield Hallam University 29004109

References
Behnam Zebrardast,Ali Ghaffari and Mohammad Masdasri. (2013). Mr. A New Generalised
Regression Artificial Networks Approach for diagnostic Heart Disease, 11.

Khosrowpour, M. (2005). Encyclopedia of information science and technology . USA: International


Resource and Management Association.

Mohammed A.M. Abushariah, Assal A.M. Alqudah ,Omar Y.Adwan, Rana M.M. Yousef . (2014). Mr.
Automatic Heart Disease Diagnosis System Based on Artificial Neural Network (ANN) and
Adaptive Neuro-Fuzzy Inference Systems (ANFIS, 12.

Yasushi Sakurai, Yasuko Matsubara, Christos Faloutsos. (2017). Mr. Smart Analytics for Big Time-
series Data, 30.

xxii
Sheffield Hallam University 29004109

APPENDIX

% cleveland_heart_disease_dataset

clear
close all
load cleveland_heart_disease_dataset_labelled

load sample

Target = t';
data_set= x';
figure(2),plot(x')
hold on

v0=[];v1=[]; v2=[]
for i=1:length(t)
if t(i)==0 v0=[v0; x(i,:)]; end
if t(i)==1 v1=[v1; x(i,:)];end
if t(i)==2 v2=[v2; x(i,:)];
end
end

figure(1)
subplot(3,1,1),plot(v0,'b');
subplot(3,1,2),plot(v1,'r');
subplot(3,1,3),plot(v2,'g');

v0test=[];
indices0 = 3:6:size(v0,1);
v0test = v0(indices0,:);
v0train = v0;
v0train(indices0,:)=[];

v1test=[];
indices1 = 3:6:size(v1,1);
v1test = v1(indices1,:);
v1train = v1;
v1train(indices1,:)=[];

v2test=[];
indices2 = 3:6:size(v2,1);
v2test = v2(indices2,:);

xxiii
Sheffield Hallam University 29004109

v2train = v2;
v2train(indices2,:)=[];

p = [v0test ;v1test ;v2test];

p1=p';
sample1=sample';

mynet=feedforwardnet;
%design;
%mynet.trainFcn='traingd';
%mynet.layers{1}.transferFcn='tansig';
view(mynet);
mynet=train(mynet,p1,sample1);
y =sim(mynet,data_set)
complete= y';
valid = perform(mynet,t,complete);

xxiv

You might also like