Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

error in printed character recognition using neural network

Asked by Sarah Mahmood

Sarah Mahmood (view profile)

on 19 Sep 2013
Latest activity Commented on by Sarah Mahmood

Sarah Mahmood (view profile)

on 15 Nov 2013

hi all, I'm an Ms.c. student and I'm working on my thesis project , part of it consisted of printed character recognition using neural network, i have implement the input data, target data and the NN structure yet its only works well on the trained data !! neither disabling training and test using testing samples and trained data nor online acquisition of character and train the network is working, I checked the feature acquired during online acquisition they are almost the same to the one NN trained on, but the character not RECOGNIZED !! I have changed the font and repeat the entire work and changed the camera and the position but this was in vain the tested characters is L,R and 0 to 9 if there is any expert can figure this out, it will help me a lot and i really appreciated the code of the net is shown bellow

load y;

load x11;

InData=y';

TarData=(0.01*x11');

net1 = newff(minmax(InData),[10,10,1],{'logsig','logsig','purelin'},'trainlm')

net1.trainParam.epochs=1000;

net1.trainParam.goal=1e-10;

net1.trainParam.min_grad=1e-10;

net1.trainParam.mu=0.001;

[net1 tr] = train(net1,InData,TarData);
save tr tr;
axes(handles.axes5);
loglog(tr.perf);

yt=100*sim(net1,ft');

Sarah Mahmood

Sarah Mahmood (view profile)

Products

No products are associated with this question.

1 Answer

Answer by Greg Heath

Greg Heath (view profile)

on 29 Sep 2013
Accepted answer
 load y;
 load x11;

% size(y), size(x11) ?

 InData = y';
 TarData = (0.01*x11');

% If this is a pattern recognizer, why isn't the target binary??

% MSE00 = mean(var(TarData',1)) % Reference MSE

 net1 = newff(minmax(InData),[10,10,1],{'logsig','logsig','purelin'},'trainlm')
 net1.trainParam.epochs=1000;
 net1.trainParam.goal=1e-10;
 net1.trainParam.min_grad=1e-10;
 net1.trainParam.mu=0.001;
 [net1 tr] = train(net1,InData,TarData);

% Only use one hidden layer and as many defaults as possible. Replace above 6 statements with

%

% net1 = newff(minmax(InData),[10,1]);

% [net1 tr Y E ] = train(net1,InData,TarData); % E = TarData - Y

% MSE = mse(E)

% NMSE = MSE/MSE00 % Normalized

% If this is a pattern recognizer you should compare round(Y) and binary TarData to calculate the classification error rate

% Nerr = sum(round(Y)~=TarData) % Assuming binary TarData

 save tr tr;
 axes(handles.axes5);
 loglog(tr.perf);

1 Comment

Sarah Mahmood

Sarah Mahmood (view profile)

on 15 Nov 2013

what I suppose to conclude form NMSE ??

Greg Heath

Greg Heath (view profile)

Contact us