How to improve the performance of my neural network

조회 수: 2 (최근 30일)
afef
afef 2017년 6월 28일
댓글: Kaan Simsek 2021년 4월 22일
Hi,i'm trying to create neural network for binary classification of epileptic seizure so i have 2 classes either normal or abnormal and 9 features using an input matrix with a size of [9 981] and target matrix [1 981] . This is my code :
rng(0);
inputs = patientInputs;
targets = patientTargets;
[x,ps] = mapminmax(inputs);
t=targets;
trainFcn = 'trainbr';
% Create a Pattern Recognition Network
hiddenLayerSize =8;
net = patternnet(hiddenLayerSize,trainFcn);
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
net.performFcn = 'mse';
net.trainParam.max_fail=6;
% Choose Plot Functions
% For a list of all plot functions type: help nnplot
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
'plotconfusion', 'plotroc'};
% Train the Network
net= configure(net,x,t);
[net,tr] = train(net,x,t);
y = net(x);
e = gsubtract(t,y);
performance = perform(net,t,y)
tind = vec2ind(t);
yind = vec2ind(y);
percentErrors = sum(tind ~= yind)/numel(tind);
% Recalculate Training, Validation and Test Performance
trainTargets = t .* tr.trainMask{1};
valTargets = t .* tr.valMask{1};
testTargets = t .* tr.testMask{1};
trainPerformance = perform(net,trainTargets,y)
valPerformance = perform(net,valTargets,y)
testPerformance = perform(net,testTargets,y)
% View the Network
view(net)
Unti now i reach only this accuracy with the confusion matrix and i hope to improve it more than this so can anyone help me please ?
  댓글 수: 1
Kaan Simsek
Kaan Simsek 2021년 4월 22일
Hello there. I am a senior student in biomedical engineering. I chose "The detection of the epileptic seizures using CHB-MIT Scalp EEG Database with Deep Learning and CNN" for my graduation thesis. My consultant asked me to use the data on this link "https://www.physionet.org/content/chbmit/1.0.0/". Please help me for the matlap code.Kaansimsek94@gmail.com

댓글을 달려면 로그인하십시오.

답변 (2개)

Marco Giuliani
Marco Giuliani 2017년 9월 8일
The first thing I'd suggest is to try a different number of neurons in the hidden layer. Try spacing from 4 to 20 and check the accuracy result. Then you could also try using another learning algorithm, for example the Levenberg-Marquardt.

Greg Heath
Greg Heath 2017년 9월 13일
You violated one of the first design rules:
ALWAYS BEGIN WITH AS MANY DEFAULTS AS POSSIBLE.
The rest usually follows from those results.
See the help and doc code for patternnet.
You can also check some of my patternnet post in the NEWSGROUP and ANSWERS.
Hope his helps.
Greg

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by