Kernel Fisher discriminant analysis explained

In statistics, kernel Fisher discriminant analysis (KFD),[1] also known as generalized discriminant analysis[2] and kernel discriminant analysis,[3] is a kernelized version of linear discriminant analysis (LDA). It is named after Ronald Fisher.

Linear discriminant analysis

Intuitively, the idea of LDA is to find a projection where class separation is maximized. Given two sets of labeled data,

C1

and

C2

, we can calculate the mean value of each class,

m1

and

m2

, as

mi=

1
li
li
\sum
n=1
i,
x
n

where

li

is the number of examples of class

Ci

. The goal of linear discriminant analysis is to give a large separation of the class means while also keeping the in-class variance small.[4] This is formulated as maximizing, with respect to

w

, the following ratio:

J(w)=

wTSBw
wTSWw

,

where

SB

is the between-class covariance matrix and

SW

is the total within-class covariance matrix:

\begin{align} SB&=(m2-m1)(m2-m

T
1)

\\ SW&=\sumi=1,2

li
\sum
n=1
i-m
(x
i)(x
T
i)

. \end{align}

The maximum of the above ratio is attained at

w\propto

-1
S
W(m

2-m1).

as can be shown by the Lagrange multiplier method (sketch of proof): Maximizing

J(w)=

wTSBw
wTSWw

is equivalent to maximizing

wTSBw

subject to

wTSWw=1.

This, in turn, is equivalent to maximizing

I(w,λ)=wTSBw-λ(wTSWw-1)

, where

λ

is the Lagrange multiplier.

At the maximum, the derivatives of

I(w,λ)

with respect to

w

and

λ

must be zero. Taking
dI
dw

=0

yields

SBw-λSWw=0,

which is trivially satisfied by

w=c

-1
S
W(m

2-m1)

and

λ=(m2-m

T
1)
-1
S
W(m

2-m1).

Extending LDA

To extend LDA to non-linear mappings, the data, given as the

\ell

points

xi,

can be mapped to a new feature space,

F,

via some function

\phi.

In this new feature space, the function that needs to be maximized is

J(w)=

T
w
\phi
S
B
w
T
w
\phi
S
W
w

,

where

\phi
\begin{align} S
B

&=\left

\phi
(m
2
\phi
-m
1

\right)\left

\phi
(m
2
\phi
-m
1

\right)T

\phi
\\ S
W

&=\sumi=1,2

li
\sum
n=1

\left

\phi
(\phi(x
i

\right)\left

\phi
(\phi(x
i

\right)T, \end{align}

and

\phi
m
i

=

1
li
li
\sum
j=1
i).
\phi(x
j

Further, note that

w\inF

. Explicitly computing the mappings

\phi(xi)

and then performing LDA can be computationally expensive, and in many cases intractable. For example,

F

may be infinitely dimensional. Thus, rather than explicitly mapping the data to

F

, the data can be implicitly embedded by rewriting the algorithm in terms of dot products and using kernel functions in which the dot product in the new feature space is replaced by a kernel function,

k(x,y)=\phi(x)\phi(y)

.

LDA can be reformulated in terms of dot products by first noting that

w

will have an expansion ofthe form[5]

w=

l\alpha
\sum
i\phi(x

i).

Then note that

wT

\phi
m
i

=

1
li
l
\sum
j=1
li
\sum
k=1

\alphajk\left(xj,x

i
k

\right)=\alphaTMi,

where

(Mi)j=

1
li
li
\sum
k=1

k(xj,x

i).
k

The numerator of

J(w)

can then be written as:

wT

\phi
S
B

w=wT\left

\phi
(m
2
\phi
-m
1

\right)\left

\phi
(m
2
\phi
-m
1

\right)Tw=\alphaTM\alpha,    where    M=(M2-M1)(M2-M

T
1)

.

Similarly, the denominator can be written as

wT

\phi
S
W

w=\alphaTN\alpha,    where    N=\sumj=1,2Kj(I-1

lj
T
)K
j

,

with the

nth,mth

component of

Kj

defined as

k(xn,x

j),
m

I

is the identity matrix, and
1
lj
the matrix with all entries equal to

1/lj

. This identity can be derived by starting out with the expression for

wT

\phi
S
W

w

and using the expansion of

w

and the definitions of
\phi
S
W
and
\phi
m
i

\begin{align} wT

\phi
S
W

w&=

T
\left(\sum
i\phi

(xi)\right)\left(\sumj=1,2

lj
\sum
n=1

\left

\phi
(\phi(x
j

\right)\left

\phi
(\phi(x
j

\right)T\right)

l\alpha
\left(\sum
k\phi(x

k)\right)\\ &=\sumj=1,2

lj
\sum
n=1
l
\sum
k=1

\left

T
(\alpha
i\phi

(xi)\left

\phi
(\phi(x
j

\right)\left

\phi
(\phi(x
j

\right)T\alphak\phi(xk)\right)\\ &=\sumj=1,2

lj
\sum
n=1
l
\sum
k=1

\left(\alphaik(xi,x

j)-1
lj
n
lj
\sum
p=1

\alphaik(xi,x

j)\right) \left(\alpha
kk(x

k,x

j)-1
lj
n
lj
\sum
q=1

\alphakk(xk,x

j)\right)
q

\ &=\sumj=1,2\left(

lj
\sum
n=1
l
\sum
k=1

\left(\alphai\alphakk(xi,x

j)k(x
k,x
j)
n

-

2\alphai\alphak
lj
lj
\sum
p=1

k(xi,x

j)k(x
k,x
j)
p

+

\alphai\alphak
2
l
j
lj
\sum
p=1
lj
\sum
q=1

k(xi,x

j)k(x
k,x
j)
q

\right)\right)\\ &=\sumj=1,2\left(

lj
\sum
n=1
l\left(
\sum
k=1

\alphai\alphakk(xi,x

j)k(x
k,x
j)
n

-

\alphai\alphak
lj
lj
\sum
p=1

k(xi,x

j)k(x
k,x
j)
p

\right)\right)\\[6pt] &=\sumj=1,2\alphaTKjK

T
j

\alpha-\alphaTKj1

lj
T
K
j

\alpha\\[4pt] &=\alphaTN\alpha. \end{align}

With these equations for the numerator and denominator of

J(w)

, the equation for

J

can be rewritten as

J(\alpha)=

\alphaTM\alpha
\alphaTN\alpha

.

Then, differentiating and setting equal to zero gives

(\alphaTM\alpha)N\alpha=(\alphaTN\alpha)M\alpha.

Since only the direction of

w

, and hence the direction of

\alpha,

matters, the above can be solved for

\alpha

as

\alpha=N-1(M2-M1).

Note that in practice,

N

is usually singular and so a multiple of the identity is added to it

N\epsilon=N+\epsilonI.

Given the solution for

\alpha

, the projection of a new data point is given by

y(x)=(w\phi(x))=

l\alpha
\sum
ik(x

i,x).

Multi-class KFD

The extension to cases where there are more than two classes is relatively straightforward.[6] [7] Let

c

be the number of classes. Then multi-class KFD involves projecting the data into a

(c-1)

-dimensional space using

(c-1)

discriminant functions

yi=

T
w
i

\phi(x)    i=1,\ldots,c-1.

This can be written in matrix notation

y=WT\phi(x),

where the

wi

are the columns of

W

. Further, the between-class covariance matrix is now
\phi
S
B

=

c
\sum
i=1

li(m

\phi
i

-m\phi

\phi
)(m
i

-m\phi)T,

where

m\phi

is the mean of all the data in the new feature space. The within-class covariance matrix is
\phi
S
W

=

c
\sum
i=1
li
\sum
n=1
\phi
(\phi(x
i
\phi
)(\phi(x
i

)T,

The solution is now obtained by maximizing

J(W)=

T
\left|W
\phi
S
B
W\right|
T
\left|W
\phi
S
W
W\right|

.

The kernel trick can again be used and the goal of multi-class KFD becomes

A*=\underset{A

} = \frac, where

A=[\alpha1,\ldots,\alphac-1]

and

\begin{align} M&=

cl
\sum
j(M

j-M*)(Mj-M*)T\\ N&=

cK
\sum
j(I-1
lj
T
)K
j

. \end{align}

The

Mi

are defined as in the above section and

M*

is defined as

(M*)j=

1
l
l
\sum
k=1

k(xj,xk).

A*

can then be computed by finding the

(c-1)

leading eigenvectors of

N-1M

. Furthermore, the projection of a new input,

xt

, is given by

y(xt)=\left(A*\right)TKt,

where the

ith

component of

Kt

is given by

k(xi,xt)

.

Classification using KFD

In both two-class and multi-class KFD, the class label of a new input can be assigned as

f(x)=argminjD(y(x),\bar{y

}_j),

where

\bar{y

}_j is the projected mean for class

j

and

D(,)

is a distance function.

Applications

Kernel discriminant analysis has been used in a variety of applications. These include:

See also

External links

Notes and References

  1. Book: Mika, S . Rätsch, G. . Weston, J. . Schölkopf, B. . Müller, KR . 1999 . Neural Networks for Signal Processing IX: Proceedings of the 1999 IEEE Signal Processing Society Workshop (Cat. No.98TH8468) . Fisher discriminant analysis with kernels . Klaus-Robert Müller . IX. 41–48. 10.1109/NNSP.1999.788121. 978-0-7803-5673-3 . 10.1.1.35.9904 . 8473401 .
  2. Baudat. G.. Anouar, F. . Generalized discriminant analysis using a kernel approach. Neural Computation. 2000. 12. 10. 2385–2404. 10.1162/089976600300014980. 10.1.1.412.760. 11032039. 7036341 .
  3. Li. Y.. Gong, S. . Liddell, H. . Recognising trajectories of facial identities using kernel discriminant analysis. Image and Vision Computing. 2003. 21. 13–14. 1077–1086. 10.1016/j.imavis.2003.08.010. 10.1.1.2.6315.
  4. Book: Bishop, CM. Pattern Recognition and Machine Learning. 2006. Springer. New York, NY.
  5. Book: Scholkopf, B. Herbrich, R. . Smola, A. . Computational Learning Theory. A Generalized Representer Theorem. 2111. 416–426. 2001. 10.1007/3-540-44581-1_27. 10.1.1.42.8617. Lecture Notes in Computer Science. 978-3-540-42343-0.
  6. Book: Duda, R. . Hart, P. . Stork, D.. Pattern Classification. 2001. Wiley. New York, NY.
  7. Zhang. J.. Ma, K.K.. Kernel fisher discriminant for texture classification. 2004.
  8. Liu. Q.. Lu, H. . Ma, S. . Improving kernel Fisher discriminant analysis for face recognition. IEEE Transactions on Circuits and Systems for Video Technology. 2004. 14. 1. 42–49. 10.1109/tcsvt.2003.818352. 39657721 .
  9. Liu. Q.. Huang, R. . Lu, H. . Ma, S. . Face recognition using kernel-based Fisher discriminant analysis. IEEE International Conference on Automatic Face and Gesture Recognition. 2002.
  10. Book: Kurita, T.. Taguchi, T. . Proceedings of Fifth IEEE International Conference on Automatic Face Gesture Recognition . A modification of kernel-based Fisher discriminant analysis for face detection . 300–305. 2002. 10.1109/AFGR.2002.1004170. 10.1.1.100.3568. 978-0-7695-1602-8. 7581426 .
  11. Feng. Y.. Shi, P. . Face detection based on kernel fisher discriminant analysis. IEEE International Conference on Automatic Face and Gesture Recognition. 2004.
  12. Yang. J.. Frangi, AF . Yang, JY . Zang, D., Jin, Z. . KPCA plus LDA: a complete kernel Fisher discriminant framework for feature extraction and recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence. 2005. 27. 2. 230–244. 10.1109/tpami.2005.33 . 15688560. 10.1.1.330.1179. 9771368 .
  13. Wang. Y.. Ruan, Q. . Kernel fisher discriminant analysis for palmprint recognition. International Conference on Pattern Recognition. 2006.
  14. Wei. L.. Yang, Y. . Nishikawa, R.M. . Jiang, Y. . A study on several machine-learning methods for classification of malignant and benign clustered microcalcifications. IEEE Transactions on Medical Imaging. 2005. 24. 3. 371–380. 10.1109/tmi.2004.842457. 15754987 . 36691320 .
  15. Malmgren. T.. An iterative nonlinear discriminant analysis program: IDA 1.0. Computer Physics Communications. 1997. 106. 3. 230–236. 10.1016/S0010-4655(97)00100-8. 1997CoPhC.106..230M .