error in printed character recognition using neural network

3 views (last 30 days)
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');

Accepted Answer

Greg Heath
Greg Heath on 29 Sep 2013
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);

More Answers (0)

Community Treasure Hunt

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

Start Hunting!