I'm currently woking on pedestrian classification. I have a IEEE paper that I need to implement. I have a data set "INRIA", which consists of positive images(1126) and negative images(1218). I'm using coHOG as a feature extractor. On extracting the features from negative folder(1218 image), i got .mat file which consists of two variables "x" which contains 1218*1344 features and "y" which consists of 1*1218 elements. When I am presenting this .mat file to the pattern net (toolbox) with x as input and y as target, NN doesn't show any progress, neither it performs any epoch. I don't know what should be input and target to a NN. What should be the no. of classes( i think classes are two as pedestrian and non pedestrian). Kindly help me from last 10 days I am working on it but I have done nothing....
No products are associated with this question.
xn=x'; %size of x is: 1344 x 1218
yn=y; %size of y is: 1 x 1218
clear x y
x=xp'; %size of xp is 1344 x 1126
y=yp; %size of yp is 1 x 1126
1. Your code, notation, and reuse of variable names are confusing.
2. You never use the commands size and whos to double check variable size.
3. Use variable names that indicate the function of the variable
4. Use xn,tn for input and target negatives, xp,tp for positives, x,t for the combination and y for the nnet output.
5. Use the command whos at any time to check the sizes of all variables
sizexn0 = size(xn0) %[ 1344 1218 ] sizetn = size(tn) %[ 1 1218 ] from [ zeros(1,1218) ] sizexp0 = size(xp0) %[ 1344 1126 ] sizetp = size(yp) %[ 1 1126 ] from [ ones(1,1126) ] whos % doublecheck
% Use feature extraction function to reduce input dimensionality to 60 ( for example)
sizexn = size(xn) % [ 60 1218 ] sizexp = size(xp) % [ 60 1126 ]
x = [ xn , xp ]; % [ 60 2344] t = [ tn , tp ]; % [ 1 2344] from [ zeros(1,1218) , ones(1,1126) ];
Hope this helps
Thank you for formally accepting my answer!
Hi, first of all you should clearly set the num of classes, say 'c'. Then the num of examples you have of each class, say 'n'. Each example should be a vector NOT matrix. Ip matrix is ((n*c)*k), where k is num of features in each example. The target matrix size is c*(n*c).
K must be as small as possible. Roughly talk, if n =70, then k should be around 7.
Hope this helps.
It looks like you have an I-H-O patternnet classifier with
[ I N ] = size(input) = [ 1134 2344] % 2344=1218+1126
[ O N ] = size(target) = [ 1 2344] % zeros and ones
(N*O-O)/(I+O+1) ~ N/(I+2) >> H for O=1 and N >> 1.
Both classes must have the same number of extracted features, I.
The target matrix contains only zeros and ones.
help/doc patternnet % 'tansig', 'logsig' and 'trainscg'
Your biggest challenge is the feature reduction of an image to a vector with a reasonably small dimension, I. With only 2 classes, it is hard for me to believe that more than several tens of features are necessary.
While you are in the debugging mode I suggest only using a subsample ( e.g., several hundreds?) of the data vectors.
Then, for prime-time you can either design one classifier using all of the data or design several classifiers designed on separate subsets of the data and outputting a vote for either class. Then, with an odd number of classifiers, assign the input to the class that has the most votes.
Search "committee" and "ensemble" in the Newsgroup and comp.ai.neural-nets for more details on combining nets.
Hope this helps.
Thank you for formally accepting my answer
Play games and win prizes!Learn more