CN101329724B - An optimized face recognition method and device - Google Patents
An optimized face recognition method and device Download PDFInfo
- Publication number
- CN101329724B CN101329724B CN2008100411056A CN200810041105A CN101329724B CN 101329724 B CN101329724 B CN 101329724B CN 2008100411056 A CN2008100411056 A CN 2008100411056A CN 200810041105 A CN200810041105 A CN 200810041105A CN 101329724 B CN101329724 B CN 101329724B
- Authority
- CN
- China
- Prior art keywords
- matrix
- lda
- principal component
- projection
- pca
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
- Collating Specific Patterns (AREA)
Abstract
本发明公开了优化的人脸识别方法和装置,提高了人脸图像的识别率。其技术方案为:本发明利用将主成分分析和线性判别分析结合起来解决这个问题,即在进行线性判别分析之前先进行主成分分析,得到相对低维的空间,接着再在这个空间上进行线性判别分析,这样就不会导致类内离散度矩阵奇异而线性判别过程有效。本发明首先采用主成分分析来得到最佳描述特征,然后再在此基础上采用线性判别分析来得到最佳鉴别特征,从而大大降低了人脸特征空间的维数,最后采用最小距离法进行分类识别,显著提高了人脸图像的识别率。本发明应用于人脸识别。
The invention discloses an optimized human face recognition method and device, which improves the recognition rate of human face images. Its technical solution is: the present invention solves this problem by combining principal component analysis and linear discriminant analysis, that is, principal component analysis is performed before linear discriminant analysis to obtain a relatively low-dimensional space, and then linear analysis is performed on this space. Discriminant analysis, so that the linear discriminant process is effective without causing the within-class scatter matrix to be singular. The present invention first uses principal component analysis to obtain the best description features, and then uses linear discriminant analysis to obtain the best identification features on this basis, thereby greatly reducing the dimension of the face feature space, and finally uses the minimum distance method to classify Recognition, which significantly improves the recognition rate of face images. The invention is applied to face recognition.
Description
技术领域technical field
本发明涉及一种人脸识别算法的优化,尤其涉及结合人脸识别中的主成分分析(PCA)和线性判别分析(LDA)的人脸识别方法和装置。The invention relates to the optimization of a face recognition algorithm, in particular to a face recognition method and device combining principal component analysis (PCA) and linear discriminant analysis (LDA) in face recognition.
背景技术Background technique
随着社会的发展以及技术的进步,尤其是近年内计算机的软硬件性能的飞速提升,各方面对快速高效的自动身份验证的要求日益迫切。生物识别技术在科研领域取得了极大的重视和发展。由于生物特征是人的内在属性,具有很强的自身稳定性和个体差异性,因此是身份验证的最理想依据。其中,利用人脸特征进行身份验证又是最自然直接的手段,与指纹、虹膜、掌纹等其他人体生物特征识别系统相比,人脸识别系统更加友好,方便,易于为用户所接受,有广阔的应用领域,例如可应用到公安布控监控、监狱监控、司法认证、民航安检、口岸出入控制、海关身份验证、银行密押、智能身份证、智能门禁、智能视频监控、智能出入控制、司机驾照验证、各类银行卡、金融卡、信用卡、储蓄卡持卡人的身份验证,社会保险身份验证等多个方面,还可以应用到医疗和视频会议等方面,表现出其强大的生命力。人脸识别(Face Recognition)是利用计算机分析人脸图像,从中提取有效的识别信息,用来辨别身份的一门技术。即对已知人脸进行标准化处理后,通过某种方法和数据库中的人脸标本进行比对,寻找库中对应人脸及该人脸的相关信息。With the development of society and the advancement of technology, especially the rapid improvement of computer software and hardware performance in recent years, the requirements for fast and efficient automatic identity verification are increasingly urgent. Biometric technology has gained great attention and development in the field of scientific research. Because biological characteristics are the inherent attributes of human beings, they have strong self-stability and individual differences, so they are the most ideal basis for identity verification. Among them, the use of face features for identity verification is the most natural and direct means. Compared with other human biometric identification systems such as fingerprints, iris, and palm prints, face recognition systems are more friendly, convenient, and easy to be accepted by users. Wide range of applications, such as public security monitoring, prison monitoring, judicial certification, civil aviation security inspection, port access control, customs identity verification, bank security, smart ID card, smart access control, smart video surveillance, smart access control, driver Driver's license verification, various bank cards, debit cards, credit cards, savings card holders' identity verification, social insurance identity verification and many other aspects can also be applied to medical care and video conferencing, showing its strong vitality. Face Recognition (Face Recognition) is a technology that uses computers to analyze face images and extract effective identification information from them to identify identities. That is, after the known faces are standardized, they are compared with the face samples in the database by a certain method to find the corresponding face in the database and the relevant information of the face.
人脸识别技术包括人脸检测、人脸预处理、特征提取和人脸识别。如何有效的特征提取和识别是人脸识别重要的解决问题。Face recognition technology includes face detection, face preprocessing, feature extraction and face recognition. How to effectively extract and recognize features is an important problem in face recognition.
传统的人脸识别技术中有主成分分析(PCA)和线性判别分析(LDA)这两种方法。There are two methods of principal component analysis (PCA) and linear discriminant analysis (LDA) in the traditional face recognition technology.
主成分分析(PCA)的思想来源于K-L变换,目的是寻找一组最优的单位正交向量作为子空间的基,然后用它们的线性组合来重建原样本,并使该重建在均方误差最小的意义下是最优的;即将整个人脸的图像区域看作是一种随机向量,通过K-L变换将表征人脸的高维向量映射到由若干个特征向量张成的子空间中,利用这些特征脸的线性组合来描述、表达和逼近人脸图像。The idea of principal component analysis (PCA) comes from the K-L transformation, the purpose is to find a set of optimal unit orthogonal vectors as the basis of the subspace, and then use their linear combination to reconstruct the original sample, and make the reconstruction in the mean square error It is optimal in the smallest sense; that is, the image area of the entire face is regarded as a random vector, and the high-dimensional vector representing the face is mapped to the subspace formed by several feature vectors through K-L transformation. A linear combination of these eigenfaces is used to describe, express and approximate human face images.
在主成分分析中主要涉及的参数如下:已知有c类不同的人,每类人分别有Ni(i=1,2,...,c)幅人脸图像,则总共有幅训练图像,即有c类N个已知样本,每类有Ni(i=1,2,...,c)幅人脸图像,即N1个样本属于X1类,N2个样本属于X2类,Ni个样本属于Xi类,Xi为第i类样本集。设每幅人脸图像为w×h像素,首先将其按行或列展开为n=w×h维的列向量,则N个样本可以简单的表示为:xi(i=1,2,...,N)。The main parameters involved in principal component analysis are as follows: It is known that there are c types of different people, and each type of people has N i (i=1, 2, ..., c) face images respectively, then there are a total of training images, that is, there are N known samples of class c, and each class has N i (i=1, 2, ..., c) face images, that is, N 1 samples belong to X 1 class, and N 2 Samples belong to class X 2 , N i samples belong to class X i , and X i is the i-th class sample set. Assuming that each face image is w×h pixels, first expand it into a column vector of n=w×h dimension by row or column, then N samples can be simply expressed as: x i (i=1, 2, ..., N).
训练样本集的平均脸定义为:(式1)The average face of the training sample set is defined as: (Formula 1)
训练样本中心化后的向量 (式2)The vector after training sample centering (Formula 2)
训练样本的协方差矩阵C:(式3)The covariance matrix C of the training samples: (Formula 3)
主成分分析具体的步骤为:The specific steps of principal component analysis are:
(1)将每一幅图像展开成一行(或一列)向量,构成人脸图像矩阵,然后求得图像的平均脸并中心化,最后得到样本的协方差矩阵,即式3。(1) Expand each image into a row (or column) of vectors to form a face image matrix, then obtain the average face of the image and center it, and finally obtain the covariance matrix of the samples, that is, Equation 3.
(2)计算得到协方差矩阵C的特征值和特征向量,按非零特征值λi从大到小的顺序,将对应的特征向量ui排列,所组成的前k个特征向量矩阵即为特征脸空间(投影矩阵)U,U的每一列为一个特征向量:U=[u1,u2,...,uk]。(2) Calculate the eigenvalues and eigenvectors of the covariance matrix C, and arrange the corresponding eigenvectors u i in the order of the non-zero eigenvalues λ i from large to small, and the first k eigenvector matrices formed are Eigenface space (projection matrix) U, each column of U is an eigenvector: U=[u 1 , u 2 , . . . , u k ].
(3)将每一幅中心化后的训练图像投影到投影空间,得到其相应的投影系数,组成投影系数矩阵 此时原本n维的人脸图像就经投影后变成了k维,达到了降维的效果。(3) Each centered training image Project to the projection space, get its corresponding projection coefficient, and form a projection coefficient matrix At this time, the original n-dimensional face image becomes k-dimensional after projection, achieving the effect of dimensionality reduction.
(4)将每一幅测试样本中心化之后得到也投影到投影空间,得到投影系数矩阵M为测试样本数目,最后用最小欧氏距离进行判别。(4) After centering each test sample, get Also projected to the projection space, the projection coefficient matrix is obtained M is the number of test samples, and finally the minimum Euclidean distance is used for discrimination.
从主成分分析的效果来看,主成分分析是基于最小均方准则,使图像损失的能量最小,重建图像和原始图像之间的误差最小,它有最佳的表示能力,但是没有最佳的鉴别能力。主成分分析方法是统计最优的,它使得压缩前后的均方误差最小,且保留原样本中方差最大的数据分量(即主元),这使得变换后的低维空间有很好的表示能力,但主成分分析的训练是非监督的,即无法利用训练样本的类别信息,没有考虑类内和类间的问题,而是把全部的样本放在一起运用,没有最佳的鉴别能力。From the effect of principal component analysis, principal component analysis is based on the least mean square criterion, which minimizes the energy loss of the image and minimizes the error between the reconstructed image and the original image. It has the best representation ability, but not the best Discrimination ability. The principal component analysis method is statistically optimal, which minimizes the mean square error before and after compression, and retains the data component with the largest variance in the original sample (ie, the principal component), which makes the transformed low-dimensional space have a good representation ability , but the training of principal component analysis is unsupervised, that is, the category information of the training samples cannot be used, and the problems of intra-class and inter-class are not considered, but all samples are used together, and there is no best discrimination ability.
线性判别分析是以样本的可分性最好为目标,试图寻找一组线性变换使每类的类内离散度最小,并且使类间离散度最大,具有最佳的鉴别能力。即样本投影到该线性变化空间后,能使相同类的样本尽量聚拢,不同类的样本尽量分开。Linear discriminant analysis aims at the best separability of samples, trying to find a set of linear transformations to minimize the intra-class scatter of each class and maximize the inter-class scatter, which has the best discrimination ability. That is, after the samples are projected into the linear change space, the samples of the same class can be gathered as much as possible, and the samples of different classes can be separated as much as possible.
线性判别分析主要涉及的参数如下:The main parameters involved in linear discriminant analysis are as follows:
第i类样本均值为:(式4)The mean value of the i-th sample is: (Formula 4)
样本的类内离散度矩阵Sw:(式5)The intra-class dispersion matrix S w of the sample: (Formula 5)
样本的类间离散度矩阵Sb:(式6)The between-class scatter matrix S b of the sample: (Formula 6)
线性判别分析就是寻找一个最优线性变换W使类内离散度最小,类间离散度最大,即满足:W可以通过解广义特征值问题SbW=SwWΛ求得。Linear discriminant analysis is to find an optimal linear transformation W to minimize the intra-class dispersion and maximize the inter-class dispersion, that is, to satisfy: W can be obtained by solving the generalized eigenvalue problem S b W = S w WΛ.
当类内离散度矩阵Sw非奇异时,最优线性变换W的列向量即为Sw -1Sb的特征向量,这组向量也称为最优判别向量集。When the intra-class dispersion matrix S w is non-singular, the column vector of the optimal linear transformation W is the eigenvector of S w -1 S b , and this group of vectors is also called the optimal discriminant vector set.
然而在实际应用时会遇到的问题就是样本类内离散度矩阵通常是奇异的,这是因为训练样本的样本数往往小于每一个样本所包含的样像素个数,例如ORL人脸库中,其人脸图像的像素为112×92,将其转换为向量表示以后就高达10304维,而训练的样本数通常远小于这个数目,所以,在正常情况下人脸识别总是遇到一个“小样本”,导致类内离散度矩阵奇异,这样线性判别分析就不能直接运用。However, the problem encountered in practical application is that the dispersion matrix within the sample class is usually singular, because the number of samples of training samples is often smaller than the number of sample pixels contained in each sample, such as in the ORL face database, The face image has a pixel size of 112×92, which can be as high as 10304 dimensions after being converted into a vector representation, and the number of training samples is usually much smaller than this number. Therefore, under normal circumstances, face recognition always encounters a "small sample", resulting in the singularity of the intra-class scatter matrix, so that linear discriminant analysis cannot be directly used.
发明内容Contents of the invention
本发明的目的在于提供一种优化的人脸识别方法,提高了人脸图像的识别率。The purpose of the present invention is to provide an optimized face recognition method, which improves the recognition rate of face images.
本发明的另一目的在于提供一种优化的人脸识别装置,提高了人脸图像的识别率。Another object of the present invention is to provide an optimized face recognition device, which improves the recognition rate of face images.
本发明的技术方案为:本发明揭示了一种优化的人脸识别方法,将主成分分析和线性判别分析结合起来,该方法包括:The technical solution of the present invention is: the present invention discloses an optimized face recognition method, which combines principal component analysis and linear discriminant analysis, and the method includes:
(1)将人脸图像的训练样本集xi,i=1,2,...N,中心化之后,根据公式计算得到协方差矩阵C,其中N为训练样本的总数,为训练样本中心化后的向量,M为协方差矩阵C的最大特征值的个数;(1) After centering the training sample set x i of face images, i=1, 2, ... N, according to the formula Calculate the covariance matrix C, where N is the total number of training samples, is the vector after the centering of the training samples, and M is the number of the largest eigenvalues of the covariance matrix C;
(2)计算协方差矩阵C的M个最大特征值对应的特征向量,该M个特征向量组成主成分分析投影矩阵:其中M≤N-c,c为该训练样本集中的不同的人的人数;(2) Calculate the eigenvectors corresponding to the M largest eigenvalues of the covariance matrix C, and the M eigenvectors form the principal component analysis projection matrix: Where M≤Nc, c is the number of different people in the training sample set;
(3)利用该主成分分析投影矩阵,将人脸图像空间转化为降维的特征脸空间,获得人脸图像的最佳描述特征: (3) Using the principal component to analyze the projection matrix, transform the face image space into a dimensionally reduced eigenface space, and obtain the best description features of the face image:
(4)计算由yl,..,yi,...yN构成的类内散布矩阵Sw和类间散布矩阵Sb;(4) Calculate the intra-class scatter matrix S w and the inter-class scatter matrix S b composed of y l , .., y i , ... y N;
(5)计算矩阵Sw -1Sb的k个最大特征值对应的特征向量Wl lda,...,Wi lda,...Wk lda,其中k为矩阵Sw -1Sb的最大特征值的个数,由该k个最大特征值对应的特征向量构成线性判别分析投影矩阵 (5) Calculate the eigenvectors W l lda , ..., W i lda , ... W k lda corresponding to the k largest eigenvalues of the matrix S w -1 S b , where k is the matrix S w -1 S b The number of the largest eigenvalues, the eigenvectors corresponding to the k largest eigenvalues constitute a linear discriminant analysis projection matrix
(6)利用线性判别分析投影矩阵将该特征脸空间进一步降维到k维最佳鉴别空间,获得人脸图像的最佳分类特征:其中i=1,2,...N;(6) Use the linear discriminant analysis projection matrix to further reduce the eigenface space to the k-dimensional optimal discriminant space, and obtain the best classification features of the face image: where i = 1, 2, ... N;
(7)计算转换矩阵W=WpcaWlda,以作为最后的投影方向;(7) Calculate the transformation matrix W=W pca W lda as the final projection direction;
(8)将测试样本和训练样本分别投影到转换矩阵W,获得各自的投影系数;(8) Projecting the test sample and the training sample to the transformation matrix W respectively to obtain respective projection coefficients;
(9)根据最小欧氏距离进行判别。(9) Discriminate based on the minimum Euclidean distance.
上述的优化的人脸识别方法,其中,在步骤(1)中,训练样本的中心化进一步包括:The face recognition method of above-mentioned optimization, wherein, in step (1), the centralization of training sample further comprises:
计算训练样本集的平均脸: Calculate the average face of the training sample set:
计算训练样本中心化后的向量 Calculate the centered vector of the training samples
上述的优化的人脸识别方法,其中,步骤(4)进一步包括:The face recognition method of above-mentioned optimization, wherein, step (4) further comprises:
计算第i类样本均值为: Calculate the mean value of the i-th sample as:
计算由yl,..,yi,...yN构成的样本类内散布矩阵Sw: Calculate the sample within-class scatter matrix S w composed of y l , .., y i , ... y N :
计算样本的类间散布矩阵Sb: Calculate the between-class scatter matrix S b of the sample:
本发明还揭示了一种优化的人脸识别装置,将主成分分析和线性判别分析结合起来,该装置包括:The present invention also discloses an optimized face recognition device, which combines principal component analysis and linear discriminant analysis, and the device includes:
协方差矩阵计算模块,将人脸图像的训练样本集xi,i=1,2,...N,中心化之后,根据公式计算得到协方差矩阵C,其中N为训练样本的总数,为训练样本中心化后的向量,M为协方差矩阵C的最大特征值的个数;The covariance matrix calculation module, after centering the training sample set x i of face images, i=1, 2, ... N, according to the formula Calculate the covariance matrix C, where N is the total number of training samples, is the vector after the centering of the training samples, and M is the number of the largest eigenvalues of the covariance matrix C;
主成分分析投影矩阵计算模块,计算协方差矩阵C的M个最大特征值对应的特征向量,该M个特征向量组成主成分分析投影矩阵:其中M≤N-c,c为该训练样本集中的不同的人的人数;The principal component analysis projection matrix calculation module calculates the eigenvectors corresponding to the M largest eigenvalues of the covariance matrix C, and the M eigenvectors form the principal component analysis projection matrix: Where M≤Nc, c is the number of different people in the training sample set;
特征脸空间获得模块,利用该主成分分析投影矩阵计算模块得到的主成分分析投影矩阵,将人脸图像空间转化为降维的特征脸空间,获得人脸图像的最佳描述特征: The eigenface space acquisition module uses the principal component analysis projection matrix obtained by the principal component analysis projection matrix calculation module to convert the face image space into a dimensionally reduced eigenface space, and obtains the best description features of the face image:
散布矩阵计算模块,计算由yl,..,yi,..yN构成的类内散布矩阵Sw和类间散布矩阵Sb;The scatter matrix calculation module calculates the intra-class scatter matrix S w and the inter-class scatter matrix S b composed of y l , .., y i , ..y N ;
线性判别分析投影矩阵计算模块,计算矩阵Sw -1Sb的k个最大特征值对应的特征向量Wl lda,...,Wi lda,...Wk lda,其中k为矩阵Sw -1Sb的最大特征值的个数,由该k个最大特征值对应的特征向量构成线性判别分析投影矩阵 The linear discriminant analysis projection matrix calculation module calculates the eigenvectors W l lda , ..., W i lda , ... W k lda corresponding to the k largest eigenvalues of the matrix S w -1 S b , where k is the matrix S w -1 The number of the largest eigenvalues of S b , and the eigenvectors corresponding to the k largest eigenvalues form a linear discriminant analysis projection matrix
最佳鉴别空间获得模块,利用线性判别分析投影矩阵将该特征脸空间进一步降维到k维最佳鉴别空间,获得人脸图像的最佳分类特征:其中i=1,2,...N;The optimal discriminative space acquisition module uses the linear discriminant analysis projection matrix to further reduce the dimensionality of the eigenface space to the k-dimensional optimal discriminative space, and obtains the best classification features of the face image: where i = 1, 2, ... N;
转换矩阵计算模块,计算转换矩阵W=WpcaWlda,以作为最后的投影方向;The conversion matrix calculation module calculates the conversion matrix W=W pca W lda as the final projection direction;
投影系数计算模块,将测试样本和训练样本分别投影到转换矩阵W,获得各自的投影系数;The projection coefficient calculation module projects the test sample and the training sample to the transformation matrix W respectively to obtain respective projection coefficients;
判别模块,根据最小欧氏距离进行判别。The discriminant module performs discrimination according to the minimum Euclidean distance.
上述的优化的人脸识别装置,其中,该协方差矩阵计算模块还包括:The above-mentioned optimized face recognition device, wherein the covariance matrix calculation module also includes:
训练样本中心化单元,进一步包括:The training sample centralization unit further includes:
平均脸计算单元,计算训练样本集的平均脸: The average face calculation unit calculates the average face of the training sample set:
中心化向量计算单元,计算训练样本中心化后的向量 上述的优化的人脸识别装置,其中,散布矩阵计算模块进一步包括:Centralized vector calculation unit, which calculates the vector after the training sample is centered The above-mentioned optimized face recognition device, wherein the scatter matrix calculation module further includes:
样本均值计算单元,计算第i类样本均值为: The sample mean calculation unit calculates the i-th sample mean as:
类内散布矩阵计算单元,计算由yl,..,yi,...yN构成的样本类内散布矩阵Sw:
类间散布矩阵计算单元,计算样本的类间散布矩阵Sb:
本发明对比现有技术有如下的有益效果:由于线性判别分析是由于类内离散度矩阵奇异问题造成的,本发明利用将主成分分析和线性判别分析结合起来解决这个问题,即在进行线性判别分析之前先进行主成分分析,得到相对低维的空间,接着再在这个空间上进行线性判别分析,这样就不会导致类内离散度矩阵奇异而线性判别过程有效。传统的线性判别分析使投影后的样本的类间离散度最大而类内离散度最小,也就是说投影后样本在新的空间上相同类的样本聚拢在一起,而不同类的样本则分开,具有很好的分离性。而传统的主成分分析是保留原样本中方差最大的数据分量,所以主成分分析能最好的表示原样本,有最好的表示能力,但是没有鉴别能力。本发明首先采用主成分分析来得到最佳描述特征,然后再在此基础上采用线性判别分析来得到最佳鉴别特征,从而大大降低了人脸特征空间的维数,最后采用最小距离法进行分类识别,显著提高了人脸图像的识别率。Compared with the prior art, the present invention has the following beneficial effects: since the linear discriminant analysis is caused by the singular problem of the intra-class scatter matrix, the present invention solves this problem by combining principal component analysis and linear discriminant analysis, that is, when performing linear discriminant analysis Principal component analysis is performed before the analysis to obtain a relatively low-dimensional space, and then linear discriminant analysis is performed on this space, so that the linear discriminant process is effective without causing the intra-class dispersion matrix to be singular. The traditional linear discriminant analysis makes the inter-class dispersion of the projected samples the largest and the intra-class dispersion the smallest, that is to say, the samples of the same class are gathered together in the new space after projection, and the samples of different classes are separated. Has very good separability. The traditional principal component analysis is to retain the data component with the largest variance in the original sample, so the principal component analysis can best represent the original sample and has the best representation ability, but it has no discrimination ability. The present invention first uses principal component analysis to obtain the best description features, and then uses linear discriminant analysis to obtain the best identification features on this basis, thereby greatly reducing the dimension of the face feature space, and finally uses the minimum distance method to classify Recognition, which significantly improves the recognition rate of face images.
附图说明Description of drawings
图1是本发明的优化的人脸识别方法的较佳实施例的流程图。Fig. 1 is a flowchart of a preferred embodiment of the optimized face recognition method of the present invention.
图2是本发明的优化的人脸识别装置的较佳实施例的框图。Fig. 2 is a block diagram of a preferred embodiment of the optimized face recognition device of the present invention.
图3是本发明的散布矩阵计算模块的较佳实施例的框图。Fig. 3 is a block diagram of a preferred embodiment of the scatter matrix calculation module of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例对本发明作进一步的描述。The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
本发明的主要思想是将主成分分析和线性判别分析结合起来,图1示出了本发明的优化的人脸识别方法的较佳实施例的流程,请参见图1,下面是对方法中各步骤的详细描述。The main idea of the present invention is to combine principal component analysis and linear discriminant analysis, and Fig. 1 has shown the flow process of the preferred embodiment of the face recognition method of optimization of the present invention, please see Fig. 1, below is to each in the method A detailed description of the steps.
步骤S100:计算训练样本集xi,i=1,2,...N的平均脸m:其中N为训练样本集中的样本数量。Step S100: Calculate the average face m of the training sample set x i , i=1, 2, ... N: where N is the number of samples in the training sample set.
步骤S101:计算训练样本中心化后的向量 Step S101: Calculate the centered vector of the training samples
步骤S102:计算协方差矩阵: Step S102: Calculate the covariance matrix:
步骤S103:计算协方差矩阵C的M个最大特征值对应的特征向量,由这M个特征向量组成主成分分析(PCA)投影矩阵:其中M≤N-c,由不同的人的人脸图像组成这个训练样本集,c是人脸图像的类别数。Step S103: Calculate the eigenvectors corresponding to the M largest eigenvalues of the covariance matrix C, and form the principal component analysis (PCA) projection matrix by these M eigenvectors: Among them, M≤Nc, the training sample set is composed of face images of different people, and c is the number of categories of face images.
步骤S104:利用该主成分分析投影矩阵,将人脸图像空间转化为降维的特征脸空间,获得每一幅人脸图像的最佳描述特征:i=1,2,...N。Step S104: Utilize the principal component analysis projection matrix to transform the face image space into a reduced-dimensional eigenface space, and obtain the best description features of each face image: i=1, 2, . . . N.
步骤S105:计算由yl,..,yi,...yN构成的类内散布矩阵Sw和类间散布矩阵Sb。Step S105: Calculate the intra-class scatter matrix S w and the inter-class scatter matrix S b composed of y l , .., y i , ... y N .
计算类内散布矩阵Sw和类间散布矩阵Sb的具体过程为:The specific process of calculating the intra-class scatter matrix S w and the inter-class scatter matrix S b is:
第一步:计算第i类样本均值为: The first step: Calculate the mean value of the i-th class sample as:
第二步:计算由yl,..,yi,...yN构成的样本类内散布矩阵Sw:
第三步:计算样本的类间散布矩阵Sb: Step 3: Calculate the inter-class scatter matrix S b of the sample:
步骤S106:计算矩阵Sw -1Sb的k个最大特征值对应的特征向量Wl lda,...,Wi lda,...Wk lda,其中k为矩阵Sw -1Sb的最大特征值的个数,由该k个最大特征值对应的特征向量构成线性判别分析投影矩阵 Step S106: Calculate the eigenvectors W l lda , ..., W i lda , ... W k lda corresponding to the k largest eigenvalues of the matrix S w -1 S b , where k is the matrix S w -1 S b The number of the largest eigenvalues, the eigenvectors corresponding to the k largest eigenvalues constitute a linear discriminant analysis projection matrix
步骤S107:利用线性判别分析投影矩阵将该特征脸空间进一步降维到k维最佳鉴别空间,获得人脸图像的最佳分类特征:其中i=1,2,...N。Step S107: Using the linear discriminant analysis projection matrix to further reduce the dimensionality of the eigenface space to the k-dimensional optimal discriminant space, and obtain the best classification features of the face image: where i=1, 2, . . . N.
步骤S108:计算转换矩阵W=WpcaWlda,以作为最后的投影方向。Step S108: Calculate the conversion matrix W=W pca W lda as the final projection direction.
步骤S109:将测试样本和训练样本分别投影到转换矩阵W,获得各自的投影系数。Step S109: respectively project the test sample and the training sample to the transformation matrix W to obtain respective projection coefficients.
步骤S110:根据最小欧氏距离进行判别。Step S110: Discriminate according to the minimum Euclidean distance.
本实施例中的训练样本和测试样本可以来源于ORL库,该ORL库是剑桥大学贝尔实验室在1994年制作的用于测试人脸识别算法的人脸图像数据库。该数据库包括40个人在不同时间拍摄的每人10幅图像,共400幅256灰度级的图像,大小为112×92。ORL数据库中的人脸图像为正视图像,倾斜变化和旋转变化在20%左右,尺度变化在10%左右。另外人脸图像的背景光线有一定变化,人脸的表情也不一样(包括睁眼和闭眼,微笑和不笑,有戴眼镜和不戴眼镜时的图像)。The training samples and test samples in this embodiment may be derived from the ORL library, which is a face image database produced by the Bell Labs of the University of Cambridge in 1994 for testing face recognition algorithms. The database includes 10 images of each of 40 people taken at different times, a total of 400 images of 256 gray levels, with a size of 112×92. The face images in the ORL database are front-view images, the tilt and rotation changes are about 20%, and the scale changes are about 10%. In addition, the background light of the face image changes to a certain extent, and the facial expressions are also different (including eyes open and closed, smiling and not smiling, and images with and without glasses).
相应于上述的方法实施例,本发明还提供了一种优化的人脸识别装置,同样的该装置也是结合了主成分分析和线性判别分析,图2示出了人脸识别装置的较佳实施例。请参见图2,装置的实施例包括协方差矩阵计算模块10、主成分分析投影矩阵计算模块11、特征脸空间获得模块12、散布矩阵计算模块13、线性判别分析投影矩阵计算模块14、最佳鉴别空间获得模块15、转换矩阵计算模块16、投影系数计算模块17、判别模块18。Corresponding to the method embodiment described above, the present invention also provides an optimized face recognition device, which also combines principal component analysis and linear discriminant analysis. Figure 2 shows a preferred implementation of the face recognition device example. 2, the embodiment of the device includes a covariance
协方差矩阵计算模块10将人脸图像的训练样本集xi,i=1,2,...N,中心化之后,计算得到协方差矩阵:其中N为训练样本的总数,为训练样本中心化后的向量。协方差矩阵计算模块10中还包括训练样本中心化单元100,在训练样本中心化单元100中进一步包括平均脸计算单元1000和中心化向量计算单元1001。平均脸计算单元1000计算训练样本集的平均脸:中心化向量计算单元1001计算训练样本中心化后的向量 The covariance
主成分分析投影矩阵计算模块11计算协方差矩阵C的M个最大特征值对应的特征向量,该M个特征向量组成主成分分析投影矩阵:其中M≤N-c,c为该训练样本集中的不同的人的人数。特征脸空间获得模块12利用该主成分分析投影矩阵计算模块得到的主成分分析投影矩阵,将人脸图像空间转化为降维的特征脸空间,获得每一幅人脸图像的投影坐标向量:
散布矩阵计算模块13计算由yl,..,yi,...yN构成的类内散布矩阵Sw和类间散布矩阵Sb。散布矩阵计算模块13如图3所示的可分为样本均值计算单元130、类内散布矩阵计算单元131、类间散布矩阵计算单元132。其中样本均值计算单元130计算第i类样本均值为:类内散布矩阵计算单元131计算由yl,..,yi,...yN构成的样本类内散布矩阵Sw:类间散布矩阵计算单元132计算样本的类间散布矩阵Sb: The scatter
线性判别分析投影矩阵计算模块14计算矩阵Sw -1Sb的k个最大特征值对应的特征向量Wl lda,...,Wi lda,...Wk lda,其中k为矩阵Sw -1Sb的最大特征值的个数;由该k个最大特征值对应的特征向量构成线性判别分析投影矩阵最佳鉴别空间获得模块15利用线性判别分析投影矩阵将该特征脸空间进一步降维到k维最佳鉴别空间,获得其中i=1,2,...N。转换矩阵计算模块16计算转换矩阵W=WpcaWlda,以作为最后的投影方向。投影系数计算模块17将测试样本和训练样本分别投影到转换矩阵W,获得各自的投影系数。最后由判别模块18根据最小欧氏距离进行判别。The linear discriminant analysis projection
主成分分析是一种简单、实用的基于变换域系数的算法,从压缩能量的角度来看它是最优的,它不仅使得降维前后的均方误差最小,而且变换后的低维空间有很好的人脸表示能力,但没有很好的人脸鉴别能力。线性判别分析是从样本的可分离性出发,目的就是要找到一个空间使样本投影到这个空间上之后有最佳的可分离性,但在实际应用中常常会遇到“小样本”问题。本发明就是把主成分分析和线性判别分析结合起来,解决小样本问题的同时,也提高了人脸的识别率,是一种非常好的人脸识别方法。Principal component analysis is a simple and practical algorithm based on transform domain coefficients. It is optimal from the perspective of compressing energy. It not only minimizes the mean square error before and after dimension reduction, but also has a low-dimensional space after transformation. Very good face representation ability, but not very good face discrimination ability. Linear discriminant analysis starts from the separability of the samples, and the purpose is to find a space where the samples are projected onto this space to have the best separability, but in practical applications, the "small sample" problem is often encountered. The present invention combines principal component analysis and linear discriminant analysis, solves the small sample problem, and improves the face recognition rate, which is a very good face recognition method.
上述实施例是提供给本领域普通技术人员来实现或使用本发明的,本领域普通技术人员可在不脱离本发明的发明思想的情况下,对上述实施例做出种种修改或变化,因而本发明的保护范围并不被上述实施例所限,而应该是符合权利要求书提到的创新性特征的最大范围。The above-mentioned embodiments are provided for those of ordinary skill in the art to implement or use the present invention. Those of ordinary skill in the art can make various modifications or changes to the above-mentioned embodiments without departing from the inventive idea of the present invention. Therefore, the present invention The scope of protection of the invention is not limited by the above-mentioned embodiments, but should be the maximum scope consistent with the innovative features mentioned in the claims.
Claims (2)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2008100411056A CN101329724B (en) | 2008-07-29 | 2008-07-29 | An optimized face recognition method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2008100411056A CN101329724B (en) | 2008-07-29 | 2008-07-29 | An optimized face recognition method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN101329724A CN101329724A (en) | 2008-12-24 |
| CN101329724B true CN101329724B (en) | 2010-06-09 |
Family
ID=40205526
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2008100411056A Expired - Fee Related CN101329724B (en) | 2008-07-29 | 2008-07-29 | An optimized face recognition method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101329724B (en) |
Families Citing this family (31)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101681321B1 (en) * | 2009-11-17 | 2016-11-30 | 엘지전자 주식회사 | Method for user authentication, video communication apparatus and display apparatus thereof |
| CN101739555B (en) * | 2009-12-01 | 2014-11-26 | 北京中星微电子有限公司 | Method and system for detecting false face, and method and system for training false face model |
| CN102103691A (en) * | 2011-03-14 | 2011-06-22 | 南京邮电大学 | Identification method for analyzing face based on principal component |
| CN102254166A (en) * | 2011-08-15 | 2011-11-23 | 无锡中星微电子有限公司 | Face recognition method |
| CN102609733B (en) * | 2012-02-09 | 2014-04-02 | 北京航空航天大学 | Fast face recognition method in application environment of massive face database |
| CN102609693A (en) * | 2012-02-14 | 2012-07-25 | 南昌航空大学 | Human face recognition method based on fuzzy two-dimensional kernel principal component analysis |
| CN102622616A (en) * | 2012-02-14 | 2012-08-01 | 南昌航空大学 | Human face recognition method based on two-dimensional kernel principal component analysis and fuzzy maximum scatter difference |
| CN102902984B (en) * | 2012-09-27 | 2015-05-27 | 西安电子科技大学 | Remote-sensing image semi-supervised projection dimension reducing method based on local consistency |
| CN102982322A (en) * | 2012-12-07 | 2013-03-20 | 大连大学 | Face recognition method based on PCA (principal component analysis) image reconstruction and LDA (linear discriminant analysis) |
| CN103440292B (en) * | 2013-08-16 | 2016-12-28 | 新浪网技术(中国)有限公司 | Multimedia information retrieval method and system based on bit vectors |
| CN103530988B (en) * | 2013-10-11 | 2017-01-04 | 吉林大学 | A kind of lawn is trampleed on and the method for early warning of the extent of injury |
| CN104915684B (en) * | 2015-06-30 | 2018-03-27 | 苏州大学 | A kind of image-recognizing method and device based on the more plane SVMs of robust |
| CN105138993B (en) * | 2015-08-31 | 2018-07-27 | 小米科技有限责任公司 | Establish the method and device of human face recognition model |
| CN105426815A (en) * | 2015-10-29 | 2016-03-23 | 北京汉王智远科技有限公司 | Living body detection method and device |
| CN105395192A (en) * | 2015-12-09 | 2016-03-16 | 恒爱高科(北京)科技有限公司 | Wearable emotion recognition method and system based on electroencephalogram |
| CN107018118A (en) * | 2016-01-28 | 2017-08-04 | 深圳市云软信息技术有限公司 | A kind of identity verification method |
| CN105678345B (en) * | 2016-03-07 | 2019-07-16 | 昆明理工大学 | A method for improving the detection and recognition rate of edible oil doping spectrum |
| CN105868713B (en) * | 2016-03-29 | 2019-06-25 | 杭州农鑫科技有限公司 | A kind of Concurrent Feature fusion facial expression recognizing method based on core LDA |
| CN105975965A (en) * | 2016-07-18 | 2016-09-28 | 江苏大学 | Bidirectional identification feature extraction method for facial image recognition |
| CN106650370A (en) * | 2016-11-22 | 2017-05-10 | 西北工业大学 | Non-contact encryption method and system for computer |
| CN106845445A (en) * | 2017-02-16 | 2017-06-13 | 东华大学 | A kind of personal identification method based on wireless network and iris recognition |
| CN107239749A (en) * | 2017-05-17 | 2017-10-10 | 广西科技大学鹿山学院 | A kind of face spatial pattern recognition method |
| CN107341505B (en) * | 2017-06-07 | 2020-07-28 | 同济大学 | A Scene Classification Method Based on Image Saliency and Object Bank |
| CN108932468B (en) * | 2018-04-27 | 2021-10-12 | 衡阳师范学院 | Face recognition method suitable for psychology |
| CN108645495A (en) * | 2018-05-03 | 2018-10-12 | 温州三特食品科技有限公司 | A kind of intelligence can trace electronic scale |
| CN108734206B (en) * | 2018-05-10 | 2020-04-14 | 北京工业大学 | A Maximum Correlation Principal Component Analysis Method Based on Deep Parameter Learning |
| CN111062230B (en) * | 2018-10-16 | 2023-08-08 | 首都师范大学 | Gender identification model training method and device and gender identification method and device |
| CN109815990B (en) * | 2018-12-28 | 2023-06-30 | 天津大学 | Principal Component Analysis System Based on Centralized Weights |
| CN111464459A (en) * | 2020-03-20 | 2020-07-28 | 西安交通大学 | Network flow characteristic extraction method based on principal component analysis and linear discriminant analysis |
| CN113177466A (en) * | 2021-04-27 | 2021-07-27 | 北京百度网讯科技有限公司 | Identity recognition method and device based on face image, electronic equipment and medium |
| CN115188053A (en) * | 2022-07-21 | 2022-10-14 | 浪潮卓数大数据产业发展有限公司 | Automatic alarm method and system for detecting intrusion of stranger in residential building |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1932846A (en) * | 2006-10-12 | 2007-03-21 | 上海交通大学 | Visual frequency humary face tracking identification method based on appearance model |
| CN1987890A (en) * | 2005-12-23 | 2007-06-27 | 北京海鑫科金高科技股份有限公司 | Humanface image matching method for general active snape changing mode |
| CN101021897A (en) * | 2006-12-27 | 2007-08-22 | 中山大学 | Two-dimensional linear discrimination human face analysis identificating method based on interblock correlation |
-
2008
- 2008-07-29 CN CN2008100411056A patent/CN101329724B/en not_active Expired - Fee Related
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1987890A (en) * | 2005-12-23 | 2007-06-27 | 北京海鑫科金高科技股份有限公司 | Humanface image matching method for general active snape changing mode |
| CN1932846A (en) * | 2006-10-12 | 2007-03-21 | 上海交通大学 | Visual frequency humary face tracking identification method based on appearance model |
| CN101021897A (en) * | 2006-12-27 | 2007-08-22 | 中山大学 | Two-dimensional linear discrimination human face analysis identificating method based on interblock correlation |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101329724A (en) | 2008-12-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101329724B (en) | An optimized face recognition method and device | |
| US6826300B2 (en) | Feature based classification | |
| US8218880B2 (en) | Linear laplacian discrimination for feature extraction | |
| CN100426314C (en) | Feature classification based multiple classifiers combined people face recognition method | |
| CN100410963C (en) | A Two-Dimensional Linear Discriminant Analysis Face Recognition Method Based on Intra-Block Correlation | |
| Jain et al. | Gender identification using frontal facial images | |
| CN105335732B (en) | Based on piecemeal and differentiate that Non-negative Matrix Factorization blocks face identification method | |
| Zhou et al. | Improved-LDA based face recognition using both facial global and local information | |
| Guzel Turhan et al. | Class‐wise two‐dimensional PCA method for face recognition | |
| CN111325275A (en) | Robust image classification method and device based on low-rank two-dimensional local discriminative graph embedding | |
| CN110287973B (en) | Image feature extraction method based on low-rank robust linear discriminant analysis | |
| CN101216878A (en) | Face Recognition Method Based on Generalized Nonlinear Discriminant Analysis | |
| CN111259780A (en) | Single-sample face recognition method based on block linear reconstruction discriminant analysis | |
| CN105975965A (en) | Bidirectional identification feature extraction method for facial image recognition | |
| Kusuma et al. | Gabor-based face recognition with illumination variation using subspace-linear discriminant analysis | |
| Shen et al. | Gabor wavelets and kernel direct discriminant analysis for face recognition | |
| Song et al. | A highly scalable incremental facial feature extraction method | |
| CN112069948A (en) | A face recognition method based on improved two-dimensional dimension reduction | |
| Thanh Do et al. | Facial feature extraction using geometric feature and independent component analysis | |
| Park et al. | New MCT-based face recognition under varying lighting conditions | |
| Sun et al. | Face recognition based on NMF and SVM | |
| Sang et al. | Local Gabor Fisher classifier for face recognition | |
| Tistarelli et al. | Identity management in face recognition systems | |
| Boodoo-Jahangeer et al. | Fusion of local and global features for face recognition | |
| Savitha et al. | Active appearance model and PCA based face recognition system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20100609 Termination date: 20170729 |
|
| CF01 | Termination of patent right due to non-payment of annual fee |