Current location - Education and Training Encyclopedia - Graduation thesis - Face recognition punched paper
Face recognition punched paper
Eigenface method

Step 1: obtain a set s containing m face images. In our example, there are 25 face images (although there are 25 face images of different people, why don't they look alike? Do I have face blindness? ), as shown in the figure below. You can convert each image into an n-dimensional vector (yes, just arrange one pixel at a time, and it's up to you whether to take the pixels of the original image horizontally or vertically, as long as they are unified before and after), and then put these m vectors into a set S, as shown in the following formula.

Step 2: After obtaining the face vector set S, calculate the average image ψ? As for how to calculate the average image, the formula is as follows. Is to traverse the vectors in the set s and accumulate them, and then take the average. You got it? It's actually quite interesting, isn't it It's actually an n-dimensional vector. If you restore it to the form of an image, you can get the following "average face". Yes, it is, and it's fucking handsome. So if you want to see what a computer college boy looks like on average, you can use the above method.

Step 3: Calculate the difference φ between each image and the average image, that is, subtract the average value in step 2 from each element in the S set.

Step 4: Find M orthogonal unit vectors un? These unit vectors are actually used to describe the distribution of φ (the difference in the third step). United Nations? K(k= 1, 2,3 ... m) vector Britain? Calculated by the following formula,

When this λk (named as eigenvalue in the original text) takes the minimum value, uk is basically determined. By the way, I just said that these M vectors are orthogonal to each other and have a unit length, so uk also needs to satisfy the following formula:

The above equation makes uk? Is the unit orthogonal vector. Does it count as Britain? In fact, the eigenvector of covariance matrix is calculated as follows:

In ...

For an NxN (for example, 100x 100) dimensional image, the calculation amount of directly calculating its feature vector is too large (covariance matrix can reach 10000x 10000), so the following simple calculation is made.

Step 4 Another solution: If the number of training images is less than the dimension of images, for example, (m

Once we find the m eigenvectors vl of the L matrix, the eigenvector ul of the covariance matrix can be expressed as:

If these feature vectors are simplified to pixel arrangement, they are actually quite similar to human faces, so they are called feature faces (as shown below). There are twenty-five characteristic faces in the picture, and it is just a coincidence that the number is equal to the training image. Some papers show that 40 characteristic faces are generally enough. In order to illustrate the experiment, only seven feature faces are used in feature face recognition.

Step 5: Recognize your face. Well, finally. Don't faint. The above steps are to reduce the dimension of the face and find a suitable vector to represent the face. First, consider a new face. We can mark it with a feature face:

Where k= 1, 2...m, for the kth feature face uk, the above formula can calculate its corresponding weight, and m weights can form a vector:

Perfect, this is the representation of the obtained characteristic face to face!

So how to recognize faces, look at the following formula:

Where ω represents the face to be identified and ωk represents the face in the training set, both of which are represented by the weight of the feature face. The formula is to find the Euclidean distance between them. When the distance is less than the threshold, it means that the face to be discriminated and the k-th face in the training set belong to the same person. When all the traversed training sets are greater than the threshold, it can be divided into two situations: new face or non-face according to the distance value. The threshold setting is not fixed according to different training sets.

There will be a supplement of PCA theory in the future. Complementary theory: the theoretical basis of characteristic face -PCA (principal component analysis).

References:

1, feature face recognition:. Extension of portable document format file (abbreviation of portable document format)

2. Feature Face Wikipedia: http://zh.wikipedia.org/wiki/%E7% 89% B9% E5% Be% 81%E8% 84% B8.

3. Eigenface _ Tutorial: http://www.pages.drexel.edu/~ sis26/Eigenface% 20Tutorial.htm.