Artificial: Neural
Artificial: Neural
29004109
i
Sheffield Hallam University 29004109
TABLE OF CONTENTS
1.INTRODUCTION……………………………………………………………………. iii
2. REQUIREMENTS ANALYSIS ………………………………………………………. iv
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
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
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.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).
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
v
Sheffield Hallam University 29004109
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.
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.
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
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
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.
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
xi
Sheffield Hallam University 29004109
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
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
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
xiv
Sheffield Hallam University 29004109
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
Columns 13 through 24
Columns 25 through 36
Columns 37 through 48
Columns 49 through 60
Columns 61 through 72
xvi
Sheffield Hallam University 29004109
Columns 73 through 84
Columns 85 through 96
>>
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.
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,:)=[];
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