Answers.Body: <p>One of the methods which is quite fast and easy to implement.</p>
  
  <p>You can do <a href="https://en.wikipedia.org/wiki/Principal_component_analysis" rel="nofollow noreferrer">Principal Component Analysis (PCA)</a> based face recognition. You can go through this <a href="https://www.mitpressjournals.org/doi/abs/10.1162/jocn.1991.3.1.71" rel="nofollow noreferrer">paper</a> for the theory behind it. For an example implementation you can see <a href="https://jeremykun.com/2011/07/27/eigenfaces/" rel="nofollow noreferrer">this blog</a> post. </p>
  
  <p>The process, roughly, is as following:</p>
  
  <p>If you have a grayscale image of size <span class="math-container">$(20,20)$</span>, then this image can be flattened to a vector of size <span class="math-container">$400$</span>. If you have <span class="math-container">$5$</span> images of size <span class="math-container">$(20,20)$</span> then your data matrix will be of size <span class="math-container">$(5,400)$</span>. 
  We wish to find the principal components of the distribution of faces, or the <a href="https://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix" rel="nofollow noreferrer">eigenvectors</a> of the <a href="https://en.wikipedia.org/wiki/Covariance_matrix" rel="nofollow noreferrer">covariance matrix</a> of the data matrix, which will be of size <span class="math-container">$(5,5)$</span>. Each eigenvector (out of total <span class="math-container">$5$</span>), of size <span class="math-container">$(5,1)$</span>, accounts for some amount of variation among the images, and they are ordered by the amount (the <a href="https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors" rel="nofollow noreferrer">eigenvalues corresponding to the eigenvectors</a>) they account for. These eigenvectors can be thought of as a <strong>set of features</strong> that <strong>characterize the variation between the images</strong>. Recognition is done by <strong>projecting a new image (flattened to size <span class="math-container">$(400,1)$</span>)into the <a href="https://en.wikipedia.org/wiki/Linear_subspace" rel="nofollow noreferrer">subspace</a> <a href="https://en.wikipedia.org/wiki/Linear_span" rel="nofollow noreferrer">spanned</a> by the eigenvectors</strong> of the covariance matrix and then classifying the face by comparing its <strong>coordinates</strong> in the face space with the <strong>coordinates of the known individuals</strong>.</p>
  
  <p>You can see an implementation in <a href="https://github.com/TheHBK/signal-processing/tree/master/eigenfaces" rel="nofollow noreferrer">this git repo</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T10:26:58.407Z
Answers.Text: why are we using grayscale images?
Answers.UserDisplayName: Bivin Vinod
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T10:59:44.473Z
Answers.Text: @BivinVinod Using grayscale image only to make an easy example.
Answers.UserDisplayName: naive
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-17T09:40:50.707Z
Answers.LastActivityDate: 2019-12-18T09:29:22.207Z
Answers.LastEditDate: 2019-12-18T09:29:22.207Z
Answers.UserDisplayName: naive
Body: <p>I want to make a face authentication application. I need to approve the face during the login based on whether the registered face and the login face match. </p>
  
  <p>Which are the possible appropriate AI methods or technologies for this task?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-17T19:42:57.577Z
Comments.Text: you shouldn't do this unless its just for fun. a simple photograph of the person wold suffice to break the login scheme, and hence it is insecure. the iPhone, which has Face ID, also works on the dimension of depth, as in it can recognize the contours of your face. this make it much harder to crack.
Comments.UserDisplayName: k.c. sayz 'k.c sayz'
Tags: <machine-learning><computer-vision><reference-request><facial-recognition>
Title: Which AI methods are most appropriate for login face recognition?
UserDisplayName: Bivin Vinod
ThreadText: # Which AI methods are most appropriate for login face recognition?
  
  (Asked by: username_0 on 2019-12-17)
  
  I want to make a face authentication application. I need to approve the face during the login based on whether the registered face and the login face match.
  
  Which are the possible appropriate AI methods or technologies for this task?
  
  **Tags:** machine-learning, computer-vision, reference-request, facial-recognition
  > **Comments:**
  > **username_1**: you shouldn't do this unless its just for fun. a simple photograph of the person wold suffice to break the login scheme, and hence it is insecure. the iPhone, which has Face ID, also works on the dimension of depth, as in it can recognize the contours of your face. this make it much harder to crack.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-12-17. Score: 3
  
  One of the methods which is quite fast and easy to implement.
  
  You can do [Principal Component Analysis (PCA)](https://en.wikipedia.org/wiki/Principal_component_analysis) based face recognition. You can go through this [paper](https://www.mitpressjournals.org/doi/abs/10.1162/jocn.1991.3.1.71) for the theory behind it. For an example implementation you can see [this blog](https://jeremykun.com/2011/07/27/eigenfaces/) post.
  
  The process, roughly, is as following:
  
  If you have a grayscale image of size $(20,20)$, then this image can be flattened to a vector of size $400$. If you have $5$ images of size $(20,20)$ then your data matrix will be of size $(5,400)$.
  We wish to find the principal components of the distribution of faces, or the [eigenvectors](https://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix) of the [covariance matrix](https://en.wikipedia.org/wiki/Covariance_matrix) of the data matrix, which will be of size $(5,5)$. Each eigenvector (out of total $5$), of size $(5,1)$, accounts for some amount of variation among the images, and they are ordered by the amount (the [eigenvalues corresponding to the eigenvectors](https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors)) they account for. These eigenvectors can be thought of as a **set of features** that **characterize the variation between the images**. Recognition is done by **projecting a new image (flattened to size $(400,1)$)into the [subspace](https://en.wikipedia.org/wiki/Linear_subspace) [spanned](https://en.wikipedia.org/wiki/Linear_span) by the eigenvectors** of the covariance matrix and then classifying the face by comparing its **coordinates** in the face space with the **coordinates of the known individuals**.
  
  You can see an implementation in [this git repo](https://github.com/TheHBK/signal-processing/tree/master/eigenfaces).
  
  > **Comments:**
  > **username_0**: why are we using grayscale images?  
  > **username_2**: @BivinVinod Using grayscale image only to make an easy example.  
  
  ---
  
  