\documentclass[handout]{beamer}
% \documentclass[handout]{beamer}
   % classes "beamer", "xcolor" and "pgf" are in the /home/olegm/ directory
 
\usepackage{beamerthemeDresden}
\def \hilite<#1>{
\temporal<#1>{\color{gray}}{\color{blue}}{\color{black}}
} 

\def \hilites<#1>{
\temporal<#1>{\color{white}}{\color{black}}{\color{black}}
} 
\newtheorem{deft}{Definition}
\newtheorem{ther}{Theorem}
\title{  Eigenfaces and Deformations}
\author{Oleg Makhnin\\ Dept. of Mathematics \\ New Mexico Tech }
\date{February 27, 2009}
\definecolor{mystructure}{rgb}{.5,.5,.5}
\definecolor{mystructure2}{rgb}{1,.99,.92}
% \definecolor{mystructure}{rgb}{.8,.8,1}
% \definecolor{mystructure2}{rgb}{0.1,0.1,1}
\setbeamercolor{structure}{fg=mystructure2, bg=mystructure}


   \newcommand{\red}{\color[rgb]{1,0,0}}
   \newcommand{\brown}{\color[rgb]{0.7,0.3,0}}
   \newcommand{\navy}{\color[rgb]{0.1,0,0.5}}
   \newcommand{\black}{\color[rgb]{0,0,0}}
   
   \newcommand{\Hatsig}{\hat{\Sigma}}
\newcommand{\calN}{\mathcal{N}}
\newcommand{\hnsp}{\hspace*{-0.2in}}

\begin{document}

\input{omcomm}

\frame{\titlepage}

\section{Intro}
\frame{
\frametitle{}

Part I.   Eigenfaces 

Part II.  Deformations

Part III. Eigenfaces and deformations

}

 \section{Eigenfaces}
 
 
  \frame{
\frametitle{Eigenfaces}

  L. Sirovich and M. Kirby (1987) \vsp
  
    A popular technique to identify main features of a face; 
    also serves as an illustration to Principal Components Analysis (PCA)/ Karhunen-Loeve decomposition/ 
        Empirical Orthogonal functions etc. \vsp
	% see also 
	%  http://www.mathworks.com/matlabcentral/fileexchange/6995
	
	
   Data: n observations of a d-dim vector
    $\bx$. Represent as a matrix 
   $$\bX = [\bx_1 .... \bx_n]$$

   In our context:  d = dimension of the image ($d = n_{row} \times n_{col}$), taken as a vector. 
   (Ignore spatial information!)
 }
 
 \frame{
 \frametitle{Data}
 
  Data: from FERET database \vsp
    
   Facial REcognition Technology (see http://www.itl.nist.gov/iad/humanid/feret/feret\_master.html) 
     (about 1000 subjects and 4000 frontal images) \vsp
     
   Frontal images, 96*64, so that d = 6144,  n = 200 so far. \\
  Two images per person (100 persons) to give an idea about variability.
  
  %\includegraphics[scale=0.5]{
  %} 
 } 
  
  
  
 \frame{
  \frametitle{Eigenvalue decomposition}
  
  Eigenvalue decomposition
  of Covariance matrix: 
  %
   $$  \bC =  \frac{1}{n-1} (\bX - mean)^\prime (\bX-mean) $$
   \hsp $\bullet$ symmetric, positive-definite  
   
   \hsp $\bullet$ mean = columnwise mean (mean of $\bx_1$ in the 1st column, mean of $\bx_2$ in the 2nd etc.) \vsp

  thus 
   $$ \bC = \bV \bLam \bV^\prime $$ 
  $\bLam$ is diagonal with eigenvalues, $\bV$ is unitary, columns are eigenvectors  \vsp

 However, $\bC$ is a $d\times d$ matrix, of rank only $n$: 
 
  problems when $d > n$.
}
  
    
 \frame{
  \frametitle{SVD}
  
 Another way: SVD (singular value decomposition)
 
  $$ \bX - mean = \bX_o = \bU \bD \bV^\prime $$ 
  $\bU, \bV$ are unitary, $\bD$ is diagonal \vsp 
  
  $\bX$ is not necessarily symmetric now \vsp
  
   note
 $$ \bC = \bX_o^\prime \bX_o = \bV \bD \bU^\prime \bU \bD \bV^\prime =  \bV \bD \bD \bV^\prime $$
  so that 
  $$\bLam = \frac{1}{n-1} \bD \bD $$ 

 Columns of $\bV$ form an orthonormal {\em adaptive} basis.
   
  % \includegraphics[scale=0.45]{./images/map.pdf}\\
  
  
 }
  
   \frame{
  \frametitle{Illustration} 
     The columns of $\bV$, or ``principal components'' are known as {\em eigenfaces}.  

   \includegraphics[scale=0.4]{./DEFtalk/avg.jpg}
   
 }
   
     \frame{
  \frametitle{} \hspace*{-0.5in}
  \includegraphics[scale=0.45]{./DEFtalk/ef1-2.jpg}
  }
  
  \frame{
   \hspace*{-0.5in}
  \includegraphics[scale=0.45]{./DEFtalk/ef3-4.jpg}
  }
  
  \frame{
   \hspace*{-0.5in}
  \includegraphics[scale=0.45]{./DEFtalk/ef5-6.jpg}
  }
  
  
    \frame{
   \hspace*{-0.5in}
  \includegraphics[scale=0.45]{./DEFtalk/ef60-61.jpg}
  }
  
    \frame{
   \hspace*{-0.5in}
  \includegraphics[scale=0.45]{./DEFtalk/ef160-161.jpg}
  }
  
  
  \frame{
  \frametitle{Image ``Compression''} 
  
    If we only keep $k$ most important eigenfaces, we can reduce the image dimensionality/ database size
       
  }
  
  \frame{
   \hspace*{-0.5in}
  \includegraphics[scale=0.45]{./DEFtalk/lossy-im101a.jpg}
  }
  
    \frame{
   \hspace*{-0.5in}
  \includegraphics[scale=0.45]{./DEFtalk/lossy-im101b.jpg}
  }
    
  
 %     \frame{
  
 %  images in the ``eigenspace''
   
  %  \hspace*{-0.5in}
  % \includegraphics[scale=0.45]{./DEFtalk/lossy-im101b.jpg}
  
 %   skip for now ... 
 % }
    
    \frame{
     \frametitle{Difficulties}
     
      \begin{itemize}[<+->]  
  \item The vector approach ignores the spatial structure of the face image. 

   \item  Different centering/scale and lighting conditions. Different expressions.
   
   \item Eigenfaces are mostly blurry features (i.e. ``low-frequency'' information)

   \item \hnsp Variations of the technique: Fisherfaces (uses discriminant analysis to separate images of one person
    from images of another; e.g. answers the question which regions are important) 
   
    \item \hnsp LaplacianFaces (uses manifold techniques)

          \end{itemize} 
  }
    
  
  \section{Deformations}
     \frame{
     \frametitle{Deformations}
     
  $\bullet$  
     Deformation is defined on a coarse grid (e.g. iris paper) \vsp 

 J. Thornton, M. Savvides and V. Kumar (2007), {\em A Bayesian Approach to Deformed Pattern Matching of Iris Images.}
   IEEE Transactions on Pattern Analysis and Machine Intelligence, Volume 29(4), 596-606 \vsp

  (however they only applied deformation to matching a given image to the database, 
     not in the database construction itself) \vsp

$\bullet$ then is smoothly extended pixel-wise
}

\frame{
\hspace*{-0.3in}
    \includegraphics[scale=1.4]{./DEFtalk/iris-deform.jpg}
}


   \frame{
   \frametitle{Deformations}
  Unexpected link: particle image velocimetry (PIV)
  
     F Scarano (2002) Iterative image deformation methods in PIV    
              Meas. Sci. Technol. 13 R1-R19 PII: S0957-0233(02)20239-8 \vsp 
	      
  \hspace*{-0.2in}
    \includegraphics[scale=1.25]{./DEFtalk/piv-deform.jpg}
  }
    
   \frame{
  \frametitle{Primitive idea}
  
    1) estimate optimal shifts by maximizing correlation between square fragments of the coarse grid \vsp

    2) smooth out to define the deformation vector field for every pixel \vsp
           
  \hsp        (primitive: extrapolate from the corners of a square formed by points of coarse grid) 
	
   \hsp       (more sophisticated: splines) \vsp
   
    3) move the pixels according to the deformation field 
 }
 \frame{  
    \hspace*{0.5in}
   \includegraphics[scale=0.45]{./DEFtalk/def15-16fine.pdf}
 
  }
  
  
     \frame{
  \frametitle{}
   {\bf Primitive idea (cont'd): Moving the pixels } \vsp

   A problem: non-integer shifts \vsp 
   
   Primitive solution: weigh the intensity according to fractional value of the shift \vsp
 
     \hsp  {\verb"    <  pic here  >} \vsp 
   
  More sophisticated: apply Fourier transform (FT) to the image; then shifting the image will mean applying
  a phase shift to the FT, then inverse FT. However, deformation is not constant.   \vsp
  
   {\huge $\Rightarrow$} Digital filtering 
  
  }
  
     \frame{
  \frametitle{Fitting a coarse deformation}
  
    Primitive idea: move blocks of pixels around to reach highest
       correlation between deformed image and reference image  \vsp 
       
       
    More advanced approach:
         \begin{itemize}[<+->]  
  \item
     minimize square discrepancy between the deformed image and the reference image.   
      (likely Monte-Carlo methods)

  \item Bayesian twist: add a prior that regularizes the deformation field.
     Then we can find the MAP (Maximum a Posteriori Estimate) which is generalization of the Maximum Likelihood/ Least square approaches 
 \end{itemize}
  
  }
  
     \frame{
  \frametitle{Experiments}
     \hspace*{-0.5in}
   \includegraphics[scale=0.4]{./DEFtalk/im5152.jpg}
  }
  
   \frame{
     \hspace*{-0.5in}
   \includegraphics[scale=0.4]{./DEFtalk/deform-51_52.jpg}
        \includegraphics[scale=0.35]{./DEFtalk/def51-52.pdf}
  }
  
     \frame{
 
     \hspace*{-0.5in}
   \includegraphics[scale=0.45]{./DEFtalk/deform-57_58.jpg}
     }
    
          \frame{
 
     \hspace*{-0.5in}
   \includegraphics[scale=0.4]{./DEFtalk/actual-58_30.jpg}
     }
      
     
     
     \frame{
  
     \hspace*{-0.5in}
   \includegraphics[scale=0.37]{./DEFtalk/deform-58_30.jpg}
        \includegraphics[scale=0.32]{./DEFtalk/def58-30.pdf}
  }
  
     
     
       \frame{
  \frametitle{}
     {\huge Much work to be done!!!}
  }
  
       \frame{
  \frametitle{}
  }
  
  \section{ Eigenfaces and deformations}
  
    \frame{
    
      \frametitle{Deformations and eigenfaces}
      
      Deform all other images to one arbitrarily chosen reference. 
      
      What happens to eigenfaces?
      
  }
  
  \frame{
  
  
 %   
    \begin{minipage}{2in}
    Reference image
    
       \includegraphics[scale=0.45]{./DEFtalk/im26.jpg}\\
  
  \end{minipage}
  \begin{minipage}{2in}
 
    New mean image 
        
  \includegraphics[scale=0.4]{./DEFtalk/avg26.jpg}
   \end{minipage}
  
  }
    
  
   \frame{
        
    \includegraphics[scale=0.4]{./DEFtalk/ef-def1-2.jpg}
  
  }
      
     \frame{
        
    \includegraphics[scale=0.4]{./DEFtalk/ef-def3-4.jpg}
  
  }
  
          
     \frame{
        
    \includegraphics[scale=0.4]{./DEFtalk/ef-def45-46.jpg}
  
  }
  
       \frame{
  \frametitle{ Eigenfaces and deformations}
  
  So far, just deformed all images to an arbitrarily chosen reference, see how the eigenfaces change. \vsp

 Potentially: should be an iterative process, for example  \vsp
 
    1) define a single ``canonical image'' for each person 
    
    2) define eigenfaces based on the canonical images
    
    3) recalculate canonical images (deformation) based on the few important eigenfaces \vsp

  If the task is e.g. pattern-matching, then match the (suitably deformed) query image to a canonical image.



  }
    
  
  
  
  
  
  
  
  
  
  
  % ==================================================================================================
  
   \frame{
  
   
  }
  
 
\frame{
\begin{center} \vspace{.25in} \LARGE{QUESTIONS?} \end{center}
}

\frame[containsverbatim]{
\begin{center} \vspace{.25in} \LARGE{THANK YOU!} \vsp \\

\verb"www.nmt.edu/~olegm/talks/DEF.pdf" for pdf file
\end{center}
}


\end{document}


 




