image classifier using neural network

7 views (last 30 days)
I've implemented a neural network for the pattern recognition. From the two classes of images(I've 70 samples for each class) I've used SIFT feature + BOvW to make the image descriptor (number of clusters is 10). After training and validation I've got confusion matrix with accuracy 80% overall. here I am having two doubts (I've done it in MATLAB GUI)
1)When ever I am training the network it gives different values (confusion matrix) in that case how can I validate the network? (MATLAB documentation says its due to different initial conditions how can I fix it for the good result?).Different values like when ever I've finished training+validation (MATLAB) confusion matrix gives overall accuracy in the range 50%-80%(several times). But mostly more than 70%.
2)How can I use this network to tell the category of the image if I input one, after training and validation?

Accepted Answer

Greg Heath
Greg Heath on 9 Apr 2015
I assume you are using patternnet.
Initial weights and data division depend on the current state of the RNG which changes each time it is used. Therefore, intitialize the RNG before the outside loop over hidden nodes and store the state everytime a new net is created.
For example
rng(4151941)
j=0
for h = Hmin:dH:Hmax
j=j+1
.. define net and parameters
for i=1:Ntrials
state(i,j) = rng;
net = configure(net,x,t);
...
end
end
I have posted zillions of examples. Search in NEWSGROUP and ANSWERS using
greg Hmin:dH:Hmax Ntrials
Hope this helps.
Thank you for formally accepting my answer
Greg

More Answers (0)

Community Treasure Hunt

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

Start Hunting!