Thread Subject: BPNN Input Problem

Subject: BPNN Input Problem

From: sunny

Date: 17 Jul, 2011 17:38:48

Message: 1 of 6

Hi,

I am working on a Project of face Recognition using PCA and Neural
Network Toolbox.
I have made a Code for PCA
Here are some details of my Implementation.
I have made two separate Database. 1) Train database and 2) Test
Database

Train Database
Image Size= 180*200
No. of Images = 100
No. of persons= 20
No. of Images for each persons = 5

Test Database
Image Size = 180*200
No. of Images = 20
No. of Persons = 20

I used the PCA and calculate covariance Matrix and than get
EigenVector( Size 100*100)
and than Eigenfaces matrix( 36000*100)
Than I will pick a select a single test Image from Test Database and
recognize within the Train Database.

Here i m confused.. what should be my 'p' for neural ntwrk.?

My target value will be
[ 1 1 1 1 1 0 0 0 0 0 ....0n;
  0 0 0 0 0 1 1 1 1 1.......0n;
.
.
.
0 0 0 0 0 0 0 0 0 ...1 1 1 1 1 ]

am i right ?

Also guide me further.

as i m stuck here.

Thanks

Subject: BPNN Input Problem

From: Greg Heath

Date: 21 Jul, 2011 04:04:19

Message: 2 of 6

On Jul 17, 1:38 pm, sunny <sandeeprac...@gmail.com> wrote:
> Hi,
>
> I am working on a Project of face Recognition using PCA and Neural
> Network Toolbox.

Unfortunately, my other computer crashed and lost a lengthy reply.
So, I'll write another one.

> I have made a Code for PCA

Sometimes PCA is not the best choice for pattern recognition
because it chooses dominant directions to maximize total input
data variance, not to maximize class separability.

A viable alternative is PLS which chooses dominant directions
to maximize the covariance between inputs and targets.

> Here are some details of my Implementation.
> I have made two separate Database. 1) Train database and 2) Test
> Database

In addition to training and test subsets, sometimes you also need
a validation subset to determine ,by trial and error, the best
settings
for learning algorithm parameters, and number of hidden nodes.

> Train Database
> Image Size= 180*200
> No. of Images = 100
> No. of persons= 20
> No. of Images for each persons = 5
>
> Test Database
> Image Size = 180*200
> No. of Images = 20
> No. of Persons = 20

When images are converted to input vectors, the dimensionality
will be 36,000. However, there are only 100 training images.
These span a subspace with dimension no larger than 99.
Even worse, if you use a validation subset (and you should) with
 the same size as the test subset, there will be only 80 training
images which span a subspace with dimension no larger than 79.

Therefore, there needs to be a very dramatic dimensionality
reduction of the original input matrices, assuming

size(ptrn0) = [36000 80]
size(pval0) = [36000 20]
size(ptst0) = [36000 20]

I will assume that the images are scaled, registered and
normalized.

Some dimensionality reduction has to be done before
calculating the training data covariance matrix because
MATLAB does not have enough memory to calculate a
36000 X 36000 covariance matrix,

Since you will be designing with only 5 images per person
(4 for training and 1 for validation), it might be useful, as an
early preprocessing step, to use a larger grid size and
replace the grid values with nearest neighbor averages.
For example, this may result in 18 x 20 2-D images unfolded
into 360 1-D input vectors. Then

size(ptrn1) = [360 80]

and similarly for val and tst.

Maybe another normalization and registering?

> I used the PCA and calculate covariance Matrix

How? Need details of your approach.

Please post relevant, commented, code.

> EigenVector( Size 100*100)
> and than Eigenfaces matrix( 36000*100)

36,000? ... Ugh. That is why you should reduce the size of the
original matrices.

C = cov(ptrn1'); % size(C) = [360 360]
totvar = trace(C) % total data variance

Use EIG to obtain the eigenstructure
Only keep enough eigenvalues/vectors to retain (say )
99% of the total variance % e.g., nkeep = 75 < 79
Obtain the nkeep x n transformation matrix that projects
ptrn1 into the dominant eigenvector space

ptrn2 = T*ptrn1;
size(ptrn2) = [ nkeep Ntrn] = [75 80]

Also use T to transform the val and tst input data.

size(pval2) = [nkeep 20]
size(ptst2) = [nkeep 20]

Now use ptrn2 and the 20 X 80 target matrix ttrn0 to design
candidate target nets. Use pval2 and tval0 to adjust
parameters and choose the best candidate net

Finally use ptst2 and ttst0 to estimate the generazation
mean-squared error and percent classification error..

Hope this is a helpful start.

Greg

Subject: BPNN Input Problem

From: TomH488

Date: 28 Jul, 2011 18:20:00

Message: 3 of 6

On Jul 21, 12:04 am, Greg Heath <he...@alumni.brown.edu> wrote:
> On Jul 17, 1:38 pm, sunny <sandeeprac...@gmail.com> wrote:
>

> A viable alternative is PLS which chooses dominant directions
> to maximize the covariance between inputs and targets.

>
> Greg

Hi Greg,

Is that MatLab Speak for Discriminant Analysis? (Principle Least
Squares)

Do you have any opinions on:

1) Independent Component Analysis (ICA), and
2) Quotient Singular Value Decomposition (QSVD) ?

Thanks
Tom

Subject: BPNN Input Problem

From: Greg Heath

Date: 29 Jul, 2011 14:10:31

Message: 4 of 6

On Jul 28, 2:20 pm, TomH488 <tom...@gmail.com> wrote:
> On Jul 21, 12:04 am, Greg Heath <he...@alumni.brown.edu> wrote:
>
> > On Jul 17, 1:38 pm, sunny <sandeeprac...@gmail.com> wrote:
>
> > A viable alternative is PLS which chooses dominant directions
> > to maximize the covariance between inputs and targets.
>
> > Greg
>
> Hi Greg,
>
> Is that MatLab Speak for Discriminant Analysis?  (Principle Least
> Squares)

No.

 http://en.wikipedia.org/wiki/Partial_least_squares_regression

> Do you have any opinions on:
>
> 1) Independent Component Analysis (ICA), and

Never had cause to use it. Looks interesting.

http://en.wikipedia.org/wiki/Independent_components_analysis

> 2) Quotient Singular Value Decomposition (QSVD) ?

Never heard of it

Your search - wikipdia QSVD - did not match any documents.

However, the Google search was successful. There is also a RSVD

The demos in

http://massiveanalytics.com/blog/tag/qsvd/

are very inpressive.

Greg

Subject: BPNN Input Problem

From: Greg Heath

Date: 30 Jul, 2011 17:21:30

Message: 5 of 6

On Jul 28, 2:20 pm, TomH488 <tom...@gmail.com> wrote:
> On Jul 21, 12:04 am, Greg Heath <he...@alumni.brown.edu> wrote:
> > On Jul 17, 1:38 pm, sunny <sandeeprac...@gmail.com> wrote:
>
> > A viable alternative is PLS which chooses dominant directions
> > to maximize the covariance between inputs and targets.
>
> > Greg
>
> Hi Greg,
>
> Is that MatLab Speak for Discriminant Analysis? (Principle Least
> Squares)

No.

http://en.wikipedia.org/wiki/Partial_least_squares_regression

> Do you have any opinions on:
>
> 1) Independent Component Analysis (ICA),

Aware of it but never used it. Looks interesting.

http://en.wikipedia.org/wiki/Independent_component_analysis

> and
> 2) Quotient Singular Value Decomposition (QSVD) ?

Never heard of it. Neither has wikipedia.

http://en.wikipedia.org/wiki/Singular_value_decomposition

However, a Google search of "QSVD" has not only
uncovered three different QSVDs

1. QSVD (Quotient)
2. QSVD (Quick)
3. qSVD (quaternion)

 but several other variants:

4. RSVD (Restricted)
5. PSVD (Product)
6. TSVD (Truncated)

I have been using TSVD for decades. However, the ads
for QSVD (Quick) are VERY,VERY, impressive:

http://massivedynamics.com/

In fact, using this, one-step input dimensionality
restriction for size [36000 80] doesn't look as formidable.

When I get time I would like to understand the important
differences between the different SVD flavors.

Do you have any comments on them?

Hope this helps.

Greg

Subject: BPNN Input Problem

From: Firestrand

Date: 26 Aug, 2011 03:07:11

Message: 6 of 6

On Jul 30, 1:21 pm, Greg Heath <he...@alumni.brown.edu> wrote:
> On Jul 28, 2:20 pm, TomH488 <tom...@gmail.com> wrote:
>
> > On Jul 21, 12:04 am, Greg Heath <he...@alumni.brown.edu> wrote:
> > > On Jul 17, 1:38 pm, sunny <sandeeprac...@gmail.com> wrote:
>
> > > A viable alternative is PLS which chooses dominant directions
> > > to maximize the covariance between inputs and targets.
>
> > > Greg
>
> > Hi Greg,
>
> > Is that MatLab Speak for Discriminant Analysis?  (Principle Least
> > Squares)
>
> No.
>
> http://en.wikipedia.org/wiki/Partial_least_squares_regression
>
> > Do you have any opinions on:
>
> > 1) Independent Component Analysis (ICA),
>
> Aware of it but never used it. Looks interesting.
>
> http://en.wikipedia.org/wiki/Independent_component_analysis
>
> > and
> > 2) Quotient Singular Value Decomposition (QSVD) ?
>
> Never heard of it. Neither has wikipedia.
>
> http://en.wikipedia.org/wiki/Singular_value_decomposition
>
> However, a Google search of "QSVD" has not only
> uncovered three different QSVDs
>
> 1. QSVD (Quotient)
> 2. QSVD (Quick)
> 3. qSVD (quaternion)
>
>  but several other variants:
>
> 4. RSVD (Restricted)
> 5. PSVD (Product)
> 6. TSVD (Truncated)
>
> I have been using TSVD for decades. However, the ads
> for QSVD (Quick) are VERY,VERY, impressive:
>
> http://massivedynamics.com/
>
> In fact, using this, one-step input dimensionality
> restriction for size [36000 80] doesn't look as formidable.
>
> When I get time I would like  to understand the important
> differences between the different SVD flavors.
>
> Do you have any comments on them?
>
> Hope this helps.
>
> Greg

You both may want to take a look at Non-negative matrix factorization
which seems to provide better performance for facial recognition when
compared with other methods. At least according to the literature.
http://en.wikipedia.org/wiki/Non-negative_matrix_factorization

-Travis

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com