Skip to content
Surf Wiki
Save to docs
general/statistical-classification

From Surf Wiki (app.surf) — the open knowledge base

Kernel Fisher discriminant analysis


In statistics, kernel Fisher discriminant analysis (KFD), also known as generalized discriminant analysis and kernel discriminant analysis, 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, \mathbf{C}_1 and \mathbf{C}_2, we can calculate the mean value of each class, \mathbf{m}_1 and \mathbf{m}_2, as

: \mathbf{m}i = \frac{1}{l_i}\sum{n=1}^{l_i}\mathbf{x}_n^i,

where l_i is the number of examples of class \mathbf{C}_i. The goal of linear discriminant analysis is to give a large separation of the class means while also keeping the in-class variance small. This is formulated as maximizing, with respect to \mathbf{w}, the following ratio:

: J(\mathbf{w}) = \frac{\mathbf{w}^{\text{T}}\mathbf{S}_B\mathbf{w}}{\mathbf{w}^{\text{T}}\mathbf{S}_W\mathbf{w}},

where \mathbf{S}_B is the between-class covariance matrix and \mathbf{S}_W is the total within-class covariance matrix:

: \begin{align} \mathbf{S}_B & = (\mathbf{m}_2-\mathbf{m}_1)(\mathbf{m}_2-\mathbf{m}1)^{\text{T}} \ \mathbf{S}W & = \sum{i=1,2}\sum{n=1}^{l_i}(\mathbf{x}_n^i-\mathbf{m}_i)(\mathbf{x}_n^i-\mathbf{m}_i)^{\text{T}}. \end{align}

The maximum of the above ratio is attained at

: \mathbf{w} \propto \mathbf{S}^{-1}_W(\mathbf{m}_2-\mathbf{m}_1).

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

Maximizing J(\mathbf{w}) = \frac{\mathbf{w}^{\text{T}}\mathbf{S}_B\mathbf{w}}{\mathbf{w}^{\text{T}}\mathbf{S}_W\mathbf{w}} is equivalent to maximizing

: \mathbf{w}^{\text{T}}\mathbf{S}_B\mathbf{w}

subject to

: \mathbf{w}^{\text{T}}\mathbf{S}_W\mathbf{w} = 1 .

This, in turn, is equivalent to maximizing I(\mathbf{w}, \lambda) = \mathbf{w}^{\text{T}}\mathbf{S}_B\mathbf{w} - \lambda (\mathbf{w}^{\text{T}}\mathbf{S}_W\mathbf{w} - 1) , where \lambda is the Lagrange multiplier.

At the maximum, the derivatives of I(\mathbf{w}, \lambda) with respect to \mathbf{w} and \lambda must be zero. Taking \frac{dI}{d\mathbf{w}} = \mathbf{0} yields

: \mathbf{S}_B\mathbf{w} - \lambda \mathbf{S}_W \mathbf{w} = \mathbf{0},

which is trivially satisfied by \mathbf{w} = c \mathbf{S}^{-1}_W(\mathbf{m}_2-\mathbf{m}_1) and \lambda = (\mathbf{m}_2-\mathbf{m}_1)^{\text{T}} \mathbf{S}^{-1}_W(\mathbf{m}_2-\mathbf{m}_1).

Extending LDA

To extend LDA to non-linear mappings, the data, given as the \ell points \mathbf{x}_i, 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(\mathbf{w}) = \frac{\mathbf{w}^{\text{T}}\mathbf{S}_B^{\phi}\mathbf{w}}{\mathbf{w}^{\text{T}}\mathbf{S}_W^{\phi}\mathbf{w}},

where

: \begin{align} \mathbf{S}_B^{\phi} & = \left (\mathbf{m}_2^{\phi}-\mathbf{m}_1^{\phi} \right ) \left (\mathbf{m}_2^{\phi}-\mathbf{m}1^{\phi} \right )^{\text{T}} \ \mathbf{S}W^{\phi} & = \sum{i=1,2} \sum{n=1}^{l_i} \left (\phi(\mathbf{x}_n^i)-\mathbf{m}_i^{\phi} \right ) \left (\phi(\mathbf{x}_n^i)-\mathbf{m}_i^{\phi} \right)^{\text{T}}, \end{align}

and

: \mathbf{m}i^{\phi} = \frac{1}{l_i}\sum{j=1}^{l_i}\phi(\mathbf{x}_j^i).

Further, note that \mathbf{w}\in F. Explicitly computing the mappings \phi(\mathbf{x}_i) and then performing LDA can be computationally expensive, and in many cases intractable. For example, F may be infinite 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(\mathbf{x},\mathbf{y}) =\phi( \mathbf{x}) \cdot\phi(\mathbf{y}).

LDA can be reformulated in terms of dot products by first noting that \mathbf{w} will have an expansion of the form

: \mathbf{w} = \sum_{i=1}^l\alpha_i\phi(\mathbf{x}_i).

Then note that

: \mathbf{w}^{\text{T}}\mathbf{m}i^{\phi} = \frac{1}{l_i}\sum{j=1}^{l}\sum_{k=1}^{l_i}\alpha_jk \left (\mathbf{x}_j,\mathbf{x}_k^i \right ) = \mathbf{\alpha}^{\text{T}}\mathbf{M}_i,

where

: (\mathbf{M}_i)j = \frac{1}{l_i}\sum{k=1}^{l_i}k(\mathbf{x}_j,\mathbf{x}_k^i).

The numerator of J(\mathbf{w}) can then be written as:

: \mathbf{w}^{\text{T}}\mathbf{S}_B^{\phi}\mathbf{w} = \mathbf{w}^{\text{T}} \left (\mathbf{m}_2^{\phi}-\mathbf{m}_1^{\phi} \right ) \left (\mathbf{m}_2^{\phi}-\mathbf{m}_1^{\phi} \right )^{\text{T}}\mathbf{w} = \mathbf{\alpha}^{\text{T}}\mathbf{M}\mathbf{\alpha}, \qquad \text{where} \qquad \mathbf{M} = (\mathbf{M}_2-\mathbf{M}_1)(\mathbf{M}_2-\mathbf{M}_1)^{\text{T}}.

Similarly, the denominator can be written as

: \mathbf{w}^{\text{T}}\mathbf{S}W^{\phi}\mathbf{w}=\mathbf{\alpha}^{\text{T}}\mathbf{N}\mathbf{\alpha},\qquad \text{where} \qquad \mathbf{N} = \sum{j=1,2}\mathbf{K}j(\mathbf{I}-\mathbf{1}{l_j})\mathbf{K}_j^{\text{T}},

with the n^{\text{th}}, m^{\text{th}} component of \mathbf{K}_j defined as k(\mathbf{x}_n,\mathbf{x}m^j), \mathbf{I} is the identity matrix, and \mathbf{1}{l_j} the matrix with all entries equal to 1/l_j. This identity can be derived by starting out with the expression for \mathbf{w}^{\text{T}} \mathbf{S}_W^{\phi}\mathbf{w} and using the expansion of \mathbf{w} and the definitions of \mathbf{S}_W^{\phi} and \mathbf{m}_i^{\phi}

: \begin{align} \mathbf{w}^{\text{T}}\mathbf{S}W^{\phi}\mathbf{w} &= \left(\sum{i=1}^l\alpha_i\phi^{\text{T}}(\mathbf{x}i)\right)\left(\sum{j=1,2}\sum_{n =1}^{l_j} \left (\phi(\mathbf{x}n^j)-\mathbf{m}j^{\phi} \right ) \left (\phi(\mathbf{x}n^j)-\mathbf{m}j^{\phi} \right )^{\text{T}}\right) \left(\sum{k=1}^l\alpha_k\phi(\mathbf{x}k)\right)\ &= \sum{j=1,2}\sum{i=1}^l\sum{n =1}^{l_j}\sum{k=1}^l \left (\alpha_i\phi^{\text{T}} (\mathbf{x}_i) \left (\phi(\mathbf{x}_n^j)-\mathbf{m}j^{\phi} \right ) \left (\phi(\mathbf{x}n^j)-\mathbf{m}j^{\phi} \right )^{\text{T}} \alpha_k\phi(\mathbf{x}k) \right ) \ & = \sum{j=1,2}\sum{i=1}^l\sum{n =1}^{l_j}\sum{k=1}^l \left(\alpha_ik(\mathbf{x}_i,\mathbf{x}n^j)-\frac{1}{l_j}\sum{p=1}^{l_j}\alpha_ik(\mathbf{x}_i,\mathbf{x}p^j)\right) \left(\alpha_kk(\mathbf{x}k,\mathbf{x}n^j)-\frac{1}{l_j}\sum{q=1}^{l_j}\alpha_kk(\mathbf{x}k,\mathbf{x}q^j)\right) \ & = \sum{j=1,2}\left( \sum{i=1}^l\sum{n =1}^{l_j}\sum{k=1}^l \left ( \alpha_i\alpha_kk(\mathbf{x}_i,\mathbf{x}_n^j)k(\mathbf{x}_k,\mathbf{x}n^j) - \frac{2\alpha_i\alpha_k}{l_j}\sum{p=1}^{l_j}k(\mathbf{x}_i,\mathbf{x}_n^j)k(\mathbf{x}k,\mathbf{x}p^j) + \frac{\alpha_i\alpha_k}{l_j^2}\sum{p=1}^{l_j}\sum{q=1}^{l_j} k(\mathbf{x}i,\mathbf{x}p^j)k(\mathbf{x}k,\mathbf{x}q^j) \right) \right )\ & = \sum{j=1,2}\left( \sum{i=1}^l\sum{n =1}^{l_j}\sum{k=1}^l\left( \alpha_i\alpha_kk(\mathbf{x}_i,\mathbf{x}_n^j)k(\mathbf{x}_k,\mathbf{x}n^j) - \frac{\alpha_i\alpha_k}{l_j}\sum{p=1}^{l_j}k(\mathbf{x}_i,\mathbf{x}_n^j)k(\mathbf{x}_k,\mathbf{x}p^j) \right)\right) \[6pt] & = \sum{j=1,2} \mathbf{\alpha}^{\text{T}} \mathbf{K}_j\mathbf{K}_j^{\text{T}}\mathbf{\alpha} - \mathbf{\alpha}^{\text{T}} \mathbf{K}j\mathbf{1}{l_j}\mathbf{K}_j^{\text{T}}\mathbf{\alpha} \[4pt] & = \mathbf{\alpha}^{\text{T}}\mathbf{N}\mathbf{\alpha}. \end{align}

With these equations for the numerator and denominator of J(\mathbf{w}), the equation for J can be rewritten as

: J(\mathbf{\alpha}) = \frac{\mathbf{\alpha}^{\text{T}}\mathbf{M}\mathbf{\alpha}}{\mathbf{\alpha}^{\text{T}}\mathbf{N}\mathbf{\alpha}}.

Then, differentiating and setting equal to zero gives

: (\mathbf{\alpha}^{\text{T}}\mathbf{M}\mathbf{\alpha})\mathbf{N}\mathbf{\alpha} = (\mathbf{\alpha}^{\text{T}}\mathbf{N}\mathbf{\alpha})\mathbf{M}\mathbf{\alpha}.

Since only the direction of \mathbf{w}, and hence the direction of \mathbf{\alpha}, matters, the above can be solved for \mathbf{\alpha} as

: \mathbf{\alpha} = \mathbf{N}^{-1}(\mathbf{M}_2- \mathbf{M}_1).

Note that in practice, \mathbf{N} is usually singular and so a multiple of the identity is added to it

: \mathbf{N}_{\epsilon} = \mathbf{N}+\epsilon\mathbf{I}.

Given the solution for \mathbf{\alpha}, the projection of a new data point is given by

: y(\mathbf{x}) = (\mathbf{w}\cdot\phi(\mathbf{x})) = \sum_{i=1}^l\alpha_ik(\mathbf{x}_i,\mathbf{x}).

Multi-class KFD

The extension to cases where there are more than two classes is relatively straightforward. 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

: y_i = \mathbf{w}_i^{\text{T}}\phi(\mathbf{x}) \qquad i= 1,\ldots,c-1.

This can be written in matrix notation

: \mathbf{y} = \mathbf{W}^{\text{T}}\phi(\mathbf{x}),

where the \mathbf{w}_i are the columns of \mathbf{W}. Further, the between-class covariance matrix is now

: \mathbf{S}B^{\phi} = \sum{i=1}^c l_i(\mathbf{m}_i^{\phi}-\mathbf{m}^{\phi})(\mathbf{m}_i^{\phi}-\mathbf{m}^{\phi})^{\text{T}},

where \mathbf{m}^\phi is the mean of all the data in the new feature space. The within-class covariance matrix is

: \mathbf{S}W^{\phi} = \sum{i=1}^c \sum_{n=1}^{l_i}(\phi(\mathbf{x}_n^i)-\mathbf{m}_i^{\phi})(\phi(\mathbf{x}_n^i)-\mathbf{m}_i^{\phi})^{\text{T}},

The solution is now obtained by maximizing

: J(\mathbf{W}) = \frac{\left|\mathbf{W}^{\text{T}}\mathbf{S}_B^{\phi}\mathbf{W}\right|}{\left|\mathbf{W}^{\text{T}}\mathbf{S}_W^{\phi}\mathbf{W}\right|}.

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

: \mathbf{A}^* = \underset{\mathbf{A}}{\operatorname{argmax}} = \frac{\left|\mathbf{A}^{\text{T}}\mathbf{M}\mathbf{A}\right|}{\left|\mathbf{A}^{\text{T}}\mathbf{N}\mathbf{A}\right|},

where A = [\mathbf{\alpha}1,\ldots,\mathbf{\alpha}{c-1}] and

: \begin{align} M & = \sum_{j=1}^cl_j(\mathbf{M}j-\mathbf{M}{})(\mathbf{M}j-\mathbf{M}{})^{\text{T}} \ N & = \sum_{j=1}^c\mathbf{K}j(\mathbf{I}-\mathbf{1}{l_j})\mathbf{K}_j^{\text{T}}. \end{align}

The \mathbf{M}i are defined as in the above section and \mathbf{M}{*} is defined as

: (\mathbf{M}_{*})j = \frac{1}{l}\sum{k=1}^{l}k(\mathbf{x}_j,\mathbf{x}_k).

\mathbf{A}^{*} can then be computed by finding the (c-1) leading eigenvectors of \mathbf{N}^{-1}\mathbf{M}. Furthermore, the projection of a new input, \mathbf{x}_t, is given by

: \mathbf{y}(\mathbf{x}_t) = \left(\mathbf{A}^{*}\right)^{\text{T}}\mathbf{K}_t,

where the i^{th} component of \mathbf{K}_t is given by k(\mathbf{x}_i,\mathbf{x}_t).

Classification using KFD

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

: f(\mathbf{x}) = arg\min_j D(\mathbf{y}(\mathbf{x}),\bar{\mathbf{y}}_j),

where \bar{\mathbf{y}}_j is the projected mean for class j and D(\cdot,\cdot) is a distance function.

Applications

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

  • Face recognition and detection
  • Hand-written digit recognition
  • Palmprint recognition
  • Classification of malignant and benign cluster microcalcifications
  • Seed classification
  • Search for the Higgs Boson at CERN

References

References

  1. Mika, S. (1999). "Neural Networks for Signal Processing IX: Proceedings of the 1999 IEEE Signal Processing Society Workshop (Cat. No.98TH8468)".
  2. Baudat, G.. (2000). "Generalized discriminant analysis using a kernel approach". Neural Computation.
  3. Li, Y.. (2003). "Recognising trajectories of facial identities using kernel discriminant analysis". Image and Vision Computing.
  4. Bishop, CM. (2006). "Pattern Recognition and Machine Learning". Springer.
  5. Scholkopf, B. (2001). "Computational Learning Theory".
  6. Duda, R.. (2001). "Pattern Classification". Wiley.
  7. Zhang, J.. (2004). "Kernel fisher discriminant for texture classification".
  8. Liu, Q.. (2004). "Improving kernel Fisher discriminant analysis for face recognition". IEEE Transactions on Circuits and Systems for Video Technology.
  9. Liu, Q.. (2002). "Face recognition using kernel-based Fisher discriminant analysis". IEEE International Conference on Automatic Face and Gesture Recognition.
  10. Kurita, T.. (2002). "Proceedings of Fifth IEEE International Conference on Automatic Face Gesture Recognition".
  11. Feng, Y.. (2004). "Face detection based on kernel fisher discriminant analysis". IEEE International Conference on Automatic Face and Gesture Recognition.
  12. Yang, J.. (2005). "KPCA plus LDA: a complete kernel Fisher discriminant framework for feature extraction and recognition". IEEE Transactions on Pattern Analysis and Machine Intelligence.
  13. Wang, Y.. (2006). "Kernel fisher discriminant analysis for palmprint recognition". International Conference on Pattern Recognition.
  14. Wei, L.. (2005). "A study on several machine-learning methods for classification of malignant and benign clustered microcalcifications". IEEE Transactions on Medical Imaging.
  15. Malmgren, T.. (1997). "An iterative nonlinear discriminant analysis program: IDA 1.0". Computer Physics Communications.
Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Kernel Fisher discriminant analysis — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report