Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RBF neural network

15 views
Skip to first unread message

Bita

unread,
Oct 21, 2010, 1:31:25 PM10/21/10
to
Hi

I'm working on a face recognition project and I have problems with its
classification part,I want to use RBF neural network as classifier.I
have N training images in which I have extracted their features and
now the inputs for the classifier is a matrix [M N] that each column
is a feature vector , I am using Gaussian function :
h(x) = exp( -||x-mi||^2 / standarddeviation_i ^ 2 )

My question is about implementing this function,I used kmeans
algorithm for clustering,does it mean that I have done this part of
the function : -||x-mi||^2 , because I've searched it through the
internet but I'm not completely sure,and I have problem with finding
the standard deviation of each cluster,I don't know how can I
understand which image belongs to which cluster to find its standard
deviation.
any help will be really appreciated.
thanks

by the way I'm using MATLAB software

Bita

Greg Heath

unread,
Oct 29, 2010, 3:25:12 AM10/29/10
to
On Oct 21, 1:31 pm, Bita <b.mirshafie...@gmail.com> wrote:
> Hi
>
> I'm working on a face recognition project and I have problems with its
> classification part,I want to use RBF neural network as classifier.I
> have N training images in which I have extracted their features and
> now the inputs for the classifier is a matrix [M N] that each column
> is a feature vector ,

How many faces (classes)?
For each face how many images?
How is the data normalized?

> I am using Gaussian function :
> h(x) = exp( -||x-mi||^2 / standarddeviation_i ^ 2 )

Missing a factor of 1/2 in the exponent?
How many total clusters?
How many clusters for each face?

> My question is about implementing this function,I used kmeans
> algorithm for clustering,

Squared Euclidean Distance?

Supervised Clustering where images for each face are clustered
separately from clusters of other faces?

> does it mean that I have done this part of
> the function : -||x-mi||^2 ,

Yes. Your clustering algorithm must keep track of which in-class
cluster is closest to each image. The means of those images
give you the cluster center.

> internet but I'm not completely sure,and I have problem with finding
> the standard deviation of each cluster,I don't know how can I
> understand which image belongs to which cluster to find its standard
> deviation.

The images of each face are clustered separately. The
cluster membership is recorded. See the kmeans documentation.

help kmeans
doc kmeans

Let's use the term "spread":

You can use the cluster members to calculate
a) a different spread.for each cluster
or combine them to
b) use the same spread for all clusters corresponding
to each face
or
b) use the same spread for all clusters regardless of
the corresponding face

However, sometimes is better to use, si, the minimum distance
from the cluster center to the nearest center of a cluster of
another class. Then use

h(x) = exp(-ln8*||x-mi||^2/si^2) % ln8 = ln(8)

Then h = 0.5 when x is halfway between the two centers.

Also used is the average distance to the c closest
clusters of another class.

> any help will be really appreciated.
> thanks
>
> by the way I'm using MATLAB software

If you have the Neural Network Tool Box,
just use the function NEWRB.

Hope this helps.

Greg

Bita

unread,
Nov 1, 2010, 8:35:54 AM11/1/10
to
On Oct 29, 10:25 am, Greg Heath <he...@alumni.brown.edu> wrote:
> On Oct 21, 1:31 pm, Bita <b.mirshafie...@gmail.com> wrote:
>

First thanks a lot Greg for giving me your time

> > Hi
>
> > I'm working on a face recognition project and I have problems with its
> > classification part,I want to use RBF neural network as classifier.I
> > have N training images in which I have extracted their features and
> > now the inputs for the classifier is a matrix [M N] that each column
> > is a feature vector ,
>
> How many faces (classes)?
> For each face how many images?

There are 40 faces in the database and 10 images for each individual

> How is the data normalized?
>

I just used PCA+LDA for decreasing the resolution of face images
Actually I don't know that I should normalize it or not,when
normalization is required to data?


> > I am using Gaussian function :
> > h(x) = exp( -||x-mi||^2 / standarddeviation_i ^ 2 )
>
> Missing a factor of 1/2 in the exponent?

Actually I have read a paper that wrote Gaussian function like
above,but I have seen a factor of 1/2 in the exponent in other papers
too,but I don't know whats the difference,I just chose one of
them,whould you plz help me about it?

> How many total clusters?

I think I should use arbitrary numbers for total number of clusters
till the kmeans algorithm gives me the best result,but I'm not sure
about it,do you have any idea about it?

> How many clusters for each face?

I don't understand.what's the difference between total number of
clusters and number of clusters for each face?

Again thanks alot for helping

Bita

Greg Heath

unread,
Nov 1, 2010, 6:38:14 PM11/1/10
to
On Nov 1, 8:35 am, Bita <b.mirshafie...@gmail.com> wrote:
> On Oct 29, 10:25 am, Greg Heath <he...@alumni.brown.edu> wrote:
>
> > On Oct 21, 1:31 pm, Bita <b.mirshafie...@gmail.com> wrote:
>
> First thanks a lot Greg for giving me your time
>
> > > Hi
>
> > > I'm working on a face recognition project and I have problems with its
> > > classification part,I want to use RBF neural network as classifier.I
> > > have N training images in which I have extracted their features and
> > > now the inputs for the classifier is a matrix [M N] that each column
> > > is a feature vector ,
>
> > How many faces (classes)?
> > For each face how many images?
>
> There are 40 faces in the database and 10 images for each > individual
>
> > How is the data normalized?
>
> I just used PCA+LDA for decreasing the resolution of face images

What are the original image sizes (i pixels x n pixels)

What are the original max and min pixel values?
e.g., [0 1] binary?, [0 255] color?

How are faces aligned and rescaled?

Are facial features extracted or do you just
convert the image to a column vector??

A clear description of the preprocessing involved from
comverting the original i X n image to the vector x
is really necessary.

> Actually I don't know that I should normalize it or not,when
> normalization is required to data?

I advise normalization.

> > > I am using Gaussian function :
> > > h(x) = exp( -||x-mi||^2 / standarddeviation_i ^ 2 )
>
> > Missing a factor of 1/2 in the exponent?
>
> Actually I have read a paper that wrote Gaussian function like
> above,but I have seen a factor of 1/2 in the exponent in other papers
> too,but I don't know whats the difference,I just chose one of
> them,whould you plz help me about it?

The standard multi-dimensional Gaussian function with equal
variances has the 1/2 . For the use of the multi-dimensional
Gaussian in clustering and classification, the 1/2 is not needed
and the standard deviation is not the optimal parameter to use
in the denominator..

> > How many total clusters?
>
> I think I should use arbitrary numbers for total number of clusters
> till the kmeans algorithm gives me the best result,but I'm not sure
> about it,do you have any idea about it?

> > How many clusters for each face?
>
> I don't understand.what's the difference between
> total number of
> clusters and number of clusters for each face?

You should cluster the 10 images for each of the
40 classes (individuals,faces) separately. This
will result in 1 or more clusters per class.
Therefore the total number of clusters will be
more than 40.

> Again thanks al ot for helping

Do you have the NNTB?
What version of MATLAB do you have?

You will get a lot more advice on all facets of this problem
if you simultaneously post to comp.soft-sys.matlab as
well as comp.ai.neural-nets.

Hope this helps.

Greg

P.S. Although I have crossposted this reply. My Google
Group reader does not allow me to change the title so that
potentially interested readers will know that the thread
involves face image recognition.

Greg Heath

unread,
Nov 5, 2010, 4:40:20 PM11/5/10
to
On Nov 1, 6:38 pm, Greg Heath <he...@alumni.brown.edu> wrote:

> On Nov 1, 8:35 am,Bita<b.mirshafie...@gmail.com> wrote:
> > On Oct 29, 10:25 am, Greg Heath <he...@alumni.brown.edu> wrote:

EMAIL REPLY:

Hi Greg and thanks for helping.

> What are the original image sizes (i pixels x n pixels)
>
> What are the original max and min pixel values?
> e.g., [0 1] binary?, [0 255] color?
>
> How are faces aligned and rescaled?
>
> Are facial features extracted or do you just
> convert the image to a column vector??

I 've used ORL face database(here are the samples
http://www.cl.cam.ac.uk/research/dtg/attarchive/facesataglance.html)
with size 112 x 92 , I have extracted the features and yes I've
converted it to a column vector.

and the original max and min pixel values are between 0 and 255


>
> > clusters and number of clusters for each face?
>
> You should cluster the 10 images for each of the
> 40 classes (individuals,faces) separately. This
> will result in 1 or more clusters per class.
> Therefore the total number of clusters will be
> more than 40.

If
Idx = kmeans(X,K) % X : a column vector features that have been
extracted from each image
%K : number of clusters
Then I should have K = 40+40 x n , clusters? ( n is the number of
clusters for each class)

> Do you have the NNTB?
> What version of MATLAB do you have?

My MATLAB version is 7.9.0(R2009b) and it has the Neural Network Tool
Box (nnet) and in your previous post you told me to use function
NEWRB , but isn't it better that I write it myself because I think in
this way I will have more insight about it¬,¬but I don't know maybe
it's better just to use the function NEWRB would you please give me
some advice about it.

thanks Greg for helping

Bita

Greg Heath

unread,
Nov 5, 2010, 4:49:09 PM11/5/10
to
> I 've used ORL face database(here are the sampleshttp://www.cl.cam.ac.uk/research/dtg/attarchive/facesataglance.html)

> with size 112 x 92 , I have extracted the features and yes I've
> converted it to a column vector.

And the original 10304 dimensional vectors were reduced to what
length?

> and the original max and min pixel values are between 0 and 255
>
> > > clusters and number of clusters for each face?
>
> > You should cluster the 10 images for each of the
> > 40 classes (individuals,faces) separately. This
> > will result in 1 or more clusters per class.
> > Therefore the total number of clusters will be
> > more than 40.
>
> If
> Idx = kmeans(X,K) % X : a column vector features that have been
> extracted from each image
> %K : number of clusters
> Then I should have K = 40+40 x n , clusters? ( n is the number of
> clusters for each class)

Each class is clustered separately. Therefore there will be a
different number of clusters per class. Those numbers will have to
be determined separately for each class.

> > Do you have the NNTB?
> > What version of MATLAB do you have?
>
> My MATLAB version is 7.9.0(R2009b) and it has the Neural Network Tool
> Box (nnet) and in your previous post you told me to use function
> NEWRB , but isn't it better that I write it myself because I think in
> this way I will have more insight about it¬,¬but I don't know maybe
> it's better just to use the function NEWRB would you please give me
> some advice about it.

Search the Google Groups archives in comp.ai.neural-nets and
comp.soft-sys.matlab using

greg heath newrb

Hope this helps.

Greg

0 new messages