About Neural Network..... How to train Neural Network?

2 views (last 30 days)
I am working on Pedestrian classification. I have data set having positive and negative images. I am using cohog as a feature extraction method. After Extracting features from both image sets I need to give them to Neural Network. Now here I have a confusion whether I have to mix the features of both pos and neg image set. Or train the NN individually. Kindly help me

Accepted Answer

Greg Heath
Greg Heath on 27 Feb 2013
The I input features of the N = N0+N1 point class mixture are put in the same input matrix
[ I N ] = size(input)
For c =2 classes it is sufficient to use a binary 0/1 target vector
[ O N ] = size(target) % O = c-1 = 1
For a pattern recognition net with I-H-O node topology, there are
Ntrneq = Ntrn*O % e.g., Ntrn = N - 2*round(0.15*N) ~ 0.7*N
training equations to design
net = patternnet(H);
using
[ net tr ] = train(net,input,target);
The resulting net has
Nw = (I+1)*H+(H+1)*O
unknown weights. Although it is desirable that
H < -1 + ceil((Ntrneq-O)/(I+O+1)
so that Nw does not exceed Ntrneq, it is not necessary if validation set stopping (or regularization using msereg) is used.
The resulting net outputs
y = net(input);
are interpreted as estimates of the class 1 posterior probabilty conditional on the input. The corresponding assigned class indices and error rates are given by
class = round(y);
Nerr1 = sum(class ~= 1)
Nerr0 = sum(class ~= 0)
PCTerr1 = 100*Nerr1/N1
PCTerr0 = 100*Nerr0/N0
PCTerr = 100*(Nerr1+Nerr0)/(N1+N0)
Hope this helps.
Thank you for formally accepting my answer
Greg

More Answers (1)

Mohan
Mohan on 26 Feb 2013
Use the train function after declaring your net as follows :
net=newff(minmax(in'),[20,1],{'tansig','purelin'},'train');
[net,tr]=train(net,trainInput',trainOutput');
where trainInput would be the "input vector" which has the extracted feature values.
trainOuput would be the corresponding output value - say a "1" for a positive image and a "0" for a negative image

Categories

Find more on Image Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!