<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="None">

	<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Obtaining the Eigenface Basis</name>
	<metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">1.2</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2004/12/15 15:21:52 US/Central</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2004/12/17 22:49:58.007 US/Central</md:revised>
  <md:authorlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="jkrueger">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Jon</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Krueger</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">jkrue@rice.edu</md:email>
    </md:author>
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="mbr">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Marshall</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Robinson</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mbr@rice.edu</md:email>
    </md:author>
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="kochelek">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Doug</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Kochelek</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">kochelek@rice.edu</md:email>
    </md:author>
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="matte">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Matthew</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">D.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Escarra</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">matte@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="jkrueger">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Jon</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Krueger</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">jkrue@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="mbr">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Marshall</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Robinson</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mbr@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="kochelek">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Doug</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Kochelek</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">kochelek@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="matte">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Matthew</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">D.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Escarra</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">matte@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">basis</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">eigenfaces</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">face recognition</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">face space</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">linear algebra</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">principal component analysis</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">reconstruction</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">This page explains how to set up our face recognition system for detection. It is centered around the creation of the "eigenface" basis for "face space." It also discusses simplifying the eigenface basis to a level that is both managable and accurate.</md:abstract>
</metadata>

<content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="intro"><name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Introduction to Eigenface System</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="intro1">
The eigenface face recognition system can be divided into two main segments: creation of the eigenface basis and recognition, or detection, of a new face. The system follows the following general flow:
</para>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="flowfig">	
<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="fig2">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Summary of Overall Face Recognition Process</name>
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="workflow.jpg"/>
<caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">A robust detection system can yield correct matches when the person is feeling happy or sad.</caption>
</figure>
</para>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec1"><name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Deriving the Eigenface Basis</name>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para1">The eigenface technique is a powerful yet simple solution to the face recognition dilemma. In fact, it is really the most intuitive way to classify a face. As we have shown, old techniques focused on particular features of the face. The eigenface technique uses much more information by classifying faces based on general facial patterns. These patterns include, but are not limited to, the specific features of the face. By using more information, eigenface analysis is naturally more effective than feature-based face recognition.</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para2">Eigenfaces are fundamentally nothing more than basis vectors for real faces. This can be related directly to one of the most fundamental concepts in electrical engineering: Fourier analysis. Fourier analysis reveals that a sum of weighted sinusoids at differing frequencies can recompose a signal perfectly! In the same way, a sum of weighted eigenfaces can seamlessly reconstruct a specific person’s face. </para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para3">Determining what these eigenfaces are is the crux of this technique. </para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para4">Before finding the eigenfaces, we first need to collect a set of face images. These face images become our database of known faces. We will later determine whether or not an unknown face matches any of these known faces. All face images must be the same size (in pixels), and for our purposes, they must be grayscale, with values ranging from 0 to 255. Each face image is converted into a vector <m:math display="inline"><m:semantics><m:mrow><m:msub>    <m:mi>Γ</m:mi><m:mi>n</m:mi></m:msub></m:mrow><m:annotation encoding="MathType-MTEF"/></m:semantics></m:math> of length N (N=imagewidth*imageheight). The most useful face sets have multiple images per person. This sharply increases accuracy, due to the increased information available on each known individual. We will call our collection of faces “face space.” This space is of dimension N.</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="faces">
<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="figfaces">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Example Images from the Rice Database</name>
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="25rice.jpg"/>
</figure>

</para>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para6">Next we need to calculate the average face in face space. Here M is the number of faces in our set:</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para7">
<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq1">
<m:math display="block">
 <m:semantics>
  <m:mrow>
   <m:mi>Ψ</m:mi><m:mo>=</m:mo><m:mfrac>
    <m:mn>1</m:mn>
    <m:mi>M</m:mi>
   </m:mfrac>
   <m:mstyle displaystyle="true">
    <m:munderover>
     <m:mo>∑</m:mo>
     <m:mrow>
      <m:mi>n</m:mi><m:mo>=</m:mo><m:mn>1</m:mn>
     </m:mrow>
     <m:mi>M</m:mi>
    </m:munderover>
    <m:mrow>
     <m:msub>
      <m:mi>Γ</m:mi>
      <m:mi>n</m:mi>
     </m:msub>
    </m:mrow>
   </m:mstyle>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 </m:annotation>
 </m:semantics>
</m:math>
</equation>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="pic">
<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="fig0">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Average Face from Rice Database</name>
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="average.jpg"/>
</figure>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para8">We then compute each face’s difference from the average:</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para9">
<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq2">
<m:math display="block">
 <m:semantics>
  <m:mrow>
   <m:msub>
    <m:mi>Φ</m:mi>
    <m:mi>i</m:mi>
   </m:msub>
   <m:mo>=</m:mo><m:msub>
    <m:mi>Γ</m:mi>
    <m:mi>i</m:mi>
   </m:msub>
   <m:mo>−</m:mo><m:mi>Ψ</m:mi>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 </m:annotation>
 </m:semantics>
</m:math>
</equation>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para10">We use these differences to compute a covariance matrix (C) for our dataset. The covariance between two sets of data reveals how much the sets correlate.</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para11">
<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq3">
<m:math display="block">
 <m:semantics>
  <m:mrow>
   <m:mi>C</m:mi><m:mo>=</m:mo><m:mfrac>
    <m:mn>1</m:mn>
    <m:mi>M</m:mi>
   </m:mfrac>
   <m:mstyle displaystyle="true">
    <m:munderover>
     <m:mo>∑</m:mo>
     <m:mrow>
      <m:mi>n</m:mi><m:mo>=</m:mo><m:mn>1</m:mn>
     </m:mrow>
     <m:mi>M</m:mi>
    </m:munderover>
    <m:mrow>
     <m:msub>
      <m:mi>Φ</m:mi>
      <m:mi>n</m:mi>
     </m:msub>
     <m:msubsup>
      <m:mi>Φ</m:mi>
      <m:mi>n</m:mi>
      <m:mi>T</m:mi>
     </m:msubsup>
    </m:mrow>
   </m:mstyle><m:mo>=</m:mo><m:mfrac>
    <m:mn>1</m:mn>
    <m:mi>M</m:mi>
   </m:mfrac>
   <m:mstyle displaystyle="true">
    <m:munderover>
     <m:mo>∑</m:mo>
     <m:mrow>
      <m:mi>n</m:mi><m:mo>=</m:mo><m:mn>1</m:mn>
     </m:mrow>
     <m:mi>M</m:mi>
    </m:munderover>
    <m:mrow>
     <m:msub>
      <m:mrow>
       <m:mrow><m:mo>(</m:mo>
        <m:mrow>
         <m:mtable>
          <m:mtr>
           <m:mtd>
            <m:mrow>
             <m:mi>var</m:mi><m:mo>⁡</m:mo><m:mo stretchy="false">(</m:mo><m:msub>
              <m:mi>p</m:mi>
              <m:mn>1</m:mn>
             </m:msub>
             <m:mo stretchy="false">)</m:mo>
            </m:mrow>
           </m:mtd>
           <m:mtd>
            <m:mo>…</m:mo>
           </m:mtd>
           <m:mtd>
            <m:mrow>
             <m:mi>cov</m:mi><m:mo>⁡</m:mo><m:mo stretchy="false">(</m:mo><m:msub>
              <m:mi>p</m:mi>
              <m:mn>1</m:mn>
             </m:msub>
             <m:mo>,</m:mo><m:msub>
              <m:mi>p</m:mi>
              <m:mi>N</m:mi>
             </m:msub>
             <m:mo stretchy="false">)</m:mo>
            </m:mrow>
           </m:mtd>
          </m:mtr>
          <m:mtr>
           <m:mtd>
            <m:mo>⋮</m:mo>
           </m:mtd>
           <m:mtd>
            <m:mo>⋱</m:mo>
           </m:mtd>
           <m:mtd>
            <m:mo>⋮</m:mo>
           </m:mtd>
          </m:mtr>
          <m:mtr>
           <m:mtd>
            <m:mrow>
             <m:mi>cov</m:mi><m:mo>⁡</m:mo><m:mo stretchy="false">(</m:mo><m:msub>
              <m:mi>p</m:mi>
              <m:mi>N</m:mi>
             </m:msub>
             <m:mo>,</m:mo><m:msub>
              <m:mi>p</m:mi>
              <m:mn>1</m:mn>
             </m:msub>
             <m:mo stretchy="false">)</m:mo>
            </m:mrow>
           </m:mtd>
           <m:mtd>
            <m:mo>⋯</m:mo>
           </m:mtd>
           <m:mtd>
            <m:mrow>
             <m:mi>var</m:mi><m:mo>⁡</m:mo><m:mo stretchy="false">(</m:mo><m:msub>
              <m:mi>p</m:mi>
              <m:mi>N</m:mi>
             </m:msub>
             <m:mo stretchy="false">)</m:mo>
            </m:mrow>
           </m:mtd>
          </m:mtr>
         </m:mtable>
        </m:mrow>
       <m:mo>)</m:mo></m:mrow>
      </m:mrow>
      <m:mi>n</m:mi>
     </m:msub>
     <m:mo>=</m:mo><m:mi>A</m:mi>
    </m:mrow>
   </m:mstyle><m:msup>
    <m:mi>A</m:mi>
    <m:mi>T</m:mi>
   </m:msup>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 </m:annotation>
 </m:semantics>
</m:math>
</equation>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para12">Where <m:math display="inline"><m:semantics><m:mrow><m:mi>A</m:mi><m:mo>=</m:mo><m:mo stretchy="false">[</m:mo><m:msub><m:mi>Φ</m:mi><m:mn>1</m:mn></m:msub><m:msub>    <m:mi>Φ</m:mi><m:mn>2</m:mn></m:msub><m:mn>...</m:mn><m:msub><m:mi>Φ</m:mi>    <m:mi>M</m:mi></m:msub><m:mo stretchy="false">]</m:mo></m:mrow><m:annotation encoding="MathType-MTEF"/></m:semantics></m:math> and <m:math display="inline"><m:semantics><m:mrow><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:mrow><m:annotation encoding="MathType-MTEF"/></m:semantics></m:math> = pixel i of face n.</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para13">The eigenfaces that we are looking for are simply the eigenvectors of C.  However, since C is of dimension N (the number of pixels in our images), solving for the eigenfaces gets ugly very quickly. Eigenface face recognition would not be possible if we had to do this. This is where the magic behind the eigenface system happens. </para>

</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sec2"><name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Simplifying the Initial Eigenface Basis</name>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para14">Based on a statistical technique known as Principal Component Analysis (PCA), we can reduce the number of eigenvectors for our covariance matrix from N (the number of pixels in our image) to M (the number of images in our dataset). This is huge! In general, PCA is used to describe a large dimensional space with a relative small set of vectors. It is a popular technique for finding patterns in data of high dimension, and is used commonly in both face recognition and image compression.* PCA is applicable to face recognition because face images usually are very similar to each other (relative to images of non-faces) and clearly share the same general pattern and structure.</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para15">PCA tells us that since we have only M images, we have only M non-trivial eigenvectors. We can solve for these eigenvectors by taking the eigenvectors of a new M x M matrix:</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para16">
<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq4">
<m:math display="block">
 <m:semantics>
  <m:mrow>
   <m:mi>L</m:mi><m:mo>=</m:mo><m:msup>
    <m:mi>A</m:mi>
    <m:mi>T</m:mi>
   </m:msup>
   <m:mi>A</m:mi>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 </m:annotation>
 </m:semantics>
</m:math>
</equation>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para17">Because of the following math trick:</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para18">
<m:math display="block">
 <m:semantics>
  <m:mtable columnalign="left">
   <m:mtr>
    <m:mtd>
     <m:msup>
      <m:mi>A</m:mi>
      <m:mi>T</m:mi>
     </m:msup>
     <m:mi>A</m:mi><m:msub>
      <m:mi>v</m:mi>
      <m:mi>i</m:mi>
     </m:msub>
     <m:mo>=</m:mo><m:msub>
      <m:mi>μ</m:mi>
      <m:mi>i</m:mi>
     </m:msub>
     <m:msub>
      <m:mi>v</m:mi>
      <m:mi>i</m:mi>
     </m:msub>
    </m:mtd>
   </m:mtr>
   <m:mtr>
    <m:mtd>
     <m:mi>A</m:mi><m:msup>
      <m:mi>A</m:mi>
      <m:mi>T</m:mi>
     </m:msup>
     <m:mi>A</m:mi><m:msub>
      <m:mi>v</m:mi>
      <m:mi>i</m:mi>
     </m:msub>
     <m:mo>=</m:mo><m:msub>
      <m:mi>μ</m:mi>
      <m:mi>i</m:mi>
     </m:msub>
     <m:mi>A</m:mi><m:msub>
      <m:mi>v</m:mi>
      <m:mi>i</m:mi>
     </m:msub>
    </m:mtd>
   </m:mtr>
  </m:mtable>
 <m:annotation encoding="MathType-MTEF">
 </m:annotation>
 </m:semantics>
</m:math>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para19">Where <m:math display="inline"><m:semantics><m:msub><m:mi>v</m:mi><m:mi>i</m:mi></m:msub><m:annotation encoding="MathType-MTEF"/></m:semantics></m:math> is an eigenvector of L. From this simple proof we can see that 
<m:math display="inline">
 <m:semantics>
  <m:mrow>
   <m:mi>A</m:mi><m:msub>
    <m:mi>v</m:mi>
    <m:mi>i</m:mi>
   </m:msub>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 </m:annotation>
 </m:semantics>
</m:math>
 is an eigenvector of C.</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para20">The M eigenvectors of L are finally used to form the M eigenvectors <m:math display="inline"><m:semantics><m:mrow><m:msub><m:mi>u</m:mi><m:mi>l</m:mi></m:msub> </m:mrow><m:annotation encoding="MathType-MTEF"/></m:semantics></m:math> of C that form our eigenface basis:</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para21">
<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="eq5">
<m:math display="block">
 <m:semantics>
  <m:mrow>
   <m:msub>
    <m:mi>u</m:mi>
    <m:mi>l</m:mi>
   </m:msub>
   <m:mo>=</m:mo><m:mstyle displaystyle="true">
    <m:munderover>
     <m:mo>∑</m:mo>
     <m:mrow>
      <m:mi>k</m:mi><m:mo>=</m:mo><m:mn>1</m:mn>
     </m:mrow>
     <m:mi>M</m:mi>
    </m:munderover>
    <m:mrow>
     <m:msub>
      <m:mi>v</m:mi>
      <m:mrow>
       <m:mi>l</m:mi><m:mi>k</m:mi>
      </m:mrow>
     </m:msub>
    </m:mrow>
   </m:mstyle><m:msub>
    <m:mi>Φ</m:mi>
    <m:mi>k</m:mi>
   </m:msub>
  </m:mrow>
 <m:annotation encoding="MathType-MTEF">
 </m:annotation>
 </m:semantics>
</m:math>
</equation>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para22">It turns out that only M-k eigenfaces are actually needed to produce a complete basis for the face space, where k is the number of unique individuals in the set of known faces.  </para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para23">In the end, one can get a decent reconstruction of the image using only a few eigenfaces (M’), where M’ usually ranges anywhere from .1M to .2M. These correspond to the vectors with the highest eigenvalues and represent the most variance within face space. </para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="riceeig">
<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="riceeigfig">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Top Ten Eigenfaces from Rice Database</name>
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="10rice-eig.jpg"/>
</figure>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para24">These eigenfaces provide a small yet powerful basis for face space. Using only a weighted sum of these eigenfaces, it is possible to reconstruct each face in the dataset. Yet the main application of eigenfaces, face recognition, takes this one step further.</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para25">*For more information on Principal Component Analysis, check out this easy to follow <link xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" src="http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf">tutorial</link>.</para>

</section>


</content>
</document>
